mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Replace assign/clone helpers with object spread syntax.
This commit is contained in:
parent
684416a902
commit
1b8b15693f
6 changed files with 51 additions and 55 deletions
|
@ -24,20 +24,6 @@ module.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/;
|
|||
// readFile options for reading with the UTF-8 encoding
|
||||
module.exports.utf8Encoding = { "encoding": "utf8" };
|
||||
|
||||
// Applies key/value pairs from src to dst, returning dst
|
||||
function assign(dst, src) {
|
||||
Object.keys(src).forEach(function forKey(key) {
|
||||
dst[key] = src[key];
|
||||
});
|
||||
return dst;
|
||||
}
|
||||
module.exports.assign = assign;
|
||||
|
||||
// Clones the key/value pairs of obj, returning the clone
|
||||
module.exports.clone = function clone(obj) {
|
||||
return assign({}, obj);
|
||||
};
|
||||
|
||||
// Returns true iff the input is a number
|
||||
module.exports.isNumber = function isNumber(obj) {
|
||||
return typeof obj === "number";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue