ubdate
This commit is contained in:
22
node_modules/sort-keys-length/index.js
generated
vendored
Normal file
22
node_modules/sort-keys-length/index.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
var sortKeys = require('sort-keys');
|
||||
|
||||
/**
|
||||
* Sort object keys by length
|
||||
*
|
||||
* @param obj
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports.desc = function (obj) {
|
||||
return sortKeys(obj, function (a, b) {
|
||||
return b.length - a.length;
|
||||
});
|
||||
}
|
||||
|
||||
module.exports.asc = function (obj) {
|
||||
return sortKeys(obj, function (a, b) {
|
||||
return a.length - b.length;
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user