sort-object-keys
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -10,6 +10,10 @@ module.exports = function sortObjectByKeyNameList(object, sortWith) { | ||
} | ||
return (keys || []).concat(Object.keys(object).sort(sortFn)).reduce(function(total, key) { | ||
total[key] = object[key]; | ||
var objectKeys = Object.keys(object); | ||
return (keys || []).concat(objectKeys.sort(sortFn)).reduce(function(total, key) { | ||
if (objectKeys.indexOf(key) !== -1) { | ||
total[key] = object[key]; | ||
} | ||
return total; | ||
}, Object.create(null)); | ||
} |
{ | ||
"name": "sort-object-keys", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Sort an object's keys, including an optional key list", | ||
@@ -28,6 +28,14 @@ "keywords": [ | ||
}, | ||
"config": { | ||
"ghooks": { | ||
"pre-commit": "npm t", | ||
"commit-msg": "validate-commit-msg" | ||
} | ||
}, | ||
"devDependencies": { | ||
"ghooks": "^1.0.1", | ||
"semantic-release": "^4.3.5", | ||
"travis-after-all": "^1.4.4" | ||
"travis-after-all": "^1.4.4", | ||
"validate-commit-msg": "^2.4.1" | ||
} | ||
} | ||
} |
# Sort Object | ||
[![Build Status](https://travis-ci.org/keithamus/sort-object-keys.svg)](https://travis-ci.org/keithamus/sort-object-keys) | ||
@@ -4,0 +6,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2694
16
57
4