Comparing version 0.4.1 to 0.4.2
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.pick = exports.curry = exports.compose = undefined; | ||
exports.throttle = exports.debounce = exports.pick = exports.curry = exports.compose = undefined; | ||
@@ -21,2 +21,10 @@ var _compose2 = require('./compose'); | ||
var _debounce2 = require('./debounce'); | ||
var _debounce3 = _interopRequireDefault(_debounce2); | ||
var _throttle2 = require('./throttle'); | ||
var _throttle3 = _interopRequireDefault(_throttle2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -26,2 +34,5 @@ | ||
exports.curry = _curry3.default; | ||
exports.pick = _pick3.default; | ||
exports.pick = _pick3.default; | ||
exports.debounce = _debounce3.default; | ||
exports.throttle = _throttle3.default; | ||
// export |
@@ -7,2 +7,11 @@ "use strict"; | ||
exports.default = pick; | ||
// 从对象中获取符合条件的值 | ||
// | ||
// ``` | ||
// var obj = { | ||
// a: 1, b: 2, c: 3 | ||
// } | ||
// pick(obj, val => val < 2) // { a: 1 } | ||
// ``` | ||
// | ||
function pick(obj, predicate) { | ||
@@ -9,0 +18,0 @@ return Object.keys(obj).reduce(function (result, key) { |
{ | ||
"name": "lgutil", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "util function", | ||
@@ -8,3 +8,4 @@ "main": "lib/index.js", | ||
"build": "babel src --out-dir lib", | ||
"prepublish": "npm run build" | ||
"prepublish": "npm run build", | ||
"test": "mocha --compilers js:babel-register" | ||
}, | ||
@@ -33,4 +34,5 @@ "repository": { | ||
"babel-preset-stage-0": "^6.1.2", | ||
"babel-register": "^6.3.13", | ||
"eslint": "^1.1.0" | ||
} | ||
} |
# lgutil | ||
some util function |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
30817
29
1181
6