foreach-prop
Advanced tools
Comparing version
139
CHANGELOG.md
# foreach-prop changelog | ||
## 2.0.7 | ||
## Version History | ||
***14-SEP-2019*** | ||
### [2.0.8](https://github.com/manferlo81/foreach-prop/compare/v2.0.7...v2.0.8) (2020-05-11) | ||
* dependencies updated | ||
## 2.0.6 | ||
### Bug Fixes | ||
***29-AUG-2019*** | ||
* Update vulnerable dependencies ([782b3ff](https://github.com/manferlo81/foreach-prop/commit/782b3ff0bf3cca2c638d78c5ded5d76005cc43e1)) | ||
### [2.0.7](https://github.com/manferlo81/foreach-prop/compare/v2.0.6...v2.0.7) (2019-SEP-14) | ||
* dependencies updated | ||
### [2.0.6](https://github.com/manferlo81/foreach-prop/compare/v2.0.5...v2.0.6) (2019-AUG-29) | ||
* dependencies updated | ||
* `ts-jest` for typescript test | ||
* added `husky` | ||
## 2.0.5 | ||
### [2.0.5](https://github.com/manferlo81/foreach-prop/compare/v2.0.4...v2.0.5) (2019-JUN-22) | ||
***22-JUN-2019*** | ||
* dependencies updated | ||
## 2.0.4 | ||
### [2.0.4](https://github.com/manferlo81/foreach-prop/compare/v2.0.3...v2.0.4) (2019-JUN-19) | ||
***19-JUN-2019*** | ||
* improved documentation | ||
@@ -31,6 +32,4 @@ * fix: throw on null object | ||
## 2.0.3 | ||
### [2.0.3](https://github.com/manferlo81/foreach-prop/compare/v2.0.2...v2.0.3) (2019-JUN-18) | ||
***18-JUN-2019*** | ||
* dependencies updated | ||
@@ -40,19 +39,13 @@ * refactoring | ||
## 2.0.2 | ||
### [2.0.2](https://github.com/manferlo81/foreach-prop/compare/v2.0.1...v2.0.2) (2019-JUN-18) | ||
***18-JUN-2019*** | ||
* dependencies updated | ||
* minor improvements | ||
## 2.0.1 | ||
### [2.0.1](https://github.com/manferlo81/foreach-prop/compare/v2.0.0...v2.0.1) (2019-JUN-07) | ||
***07-JUN-2019*** | ||
* dependencies updated | ||
## 2.0.0 | ||
## [2.0.0](https://github.com/manferlo81/foreach-prop/compare/v1.1.13...v2.0.0) (2019-JUN-05) | ||
***05-JUN-2019*** | ||
* improved documentation | ||
@@ -65,19 +58,13 @@ * performance improvements for none & 1 extra arguments | ||
## 1.1.13 | ||
### [1.1.13](https://github.com/manferlo81/foreach-prop/compare/v1.1.12...v1.1.13) (2019-JUN-01) | ||
***01-JUN-2019*** | ||
* dependencies updated | ||
* improved documentation | ||
## 1.1.12 | ||
### [1.1.12](https://github.com/manferlo81/foreach-prop/compare/v1.1.11...v1.1.12) (2019-JUN-01) | ||
***01-JUN-2019*** | ||
* dependencies updated | ||
## 1.1.11 | ||
### [1.1.11](https://github.com/manferlo81/foreach-prop/compare/v1.1.10...v1.1.11) (2019-MAY-31) | ||
***31-MAY-2019*** | ||
* dependencies updated | ||
@@ -88,19 +75,13 @@ * fixed cdn links for latest version | ||
## 1.1.10 | ||
### [1.1.10](https://github.com/manferlo81/foreach-prop/compare/v1.1.9...v1.1.10) (2019-MAY-30) | ||
***30-MAY-2019*** | ||
* dependencies updated | ||
## 1.1.9 | ||
### [1.1.9](https://github.com/manferlo81/foreach-prop/compare/v1.1.8...v1.1.9) (2019-MAY-29) | ||
***29-MAY-2019*** | ||
* installed `typescript` locally | ||
* minor improvements | ||
## 1.1.8 | ||
### [1.1.8](https://github.com/manferlo81/foreach-prop/compare/v1.1.7...v1.1.8) (2019-MAY-28) | ||
***28-MAY-2019*** | ||
* improved documentation | ||
@@ -110,6 +91,4 @@ * dependencies updated | ||
## 1.1.7 | ||
### [1.1.7](https://github.com/manferlo81/foreach-prop/compare/v1.1.6...v1.1.7) (2019-MAY-28) | ||
***28-MAY-2019*** | ||
* improved jest config | ||
@@ -119,6 +98,4 @@ * dependencies updated | ||
## 1.1.6 | ||
### [1.1.6](https://github.com/manferlo81/foreach-prop/compare/v1.1.5...v1.1.6) (2019-MAY-25) | ||
***25-MAY-2019*** | ||
* dependencies updated | ||
@@ -129,38 +106,26 @@ * improved documentation | ||
## 1.1.5 | ||
### [1.1.5](https://github.com/manferlo81/foreach-prop/compare/v1.1.4...v1.1.5) (2019-MAY-24) | ||
***24-MAY-2019*** | ||
* dependencies updated | ||
* improved documentation | ||
## 1.1.4 | ||
### [1.1.4](https://github.com/manferlo81/foreach-prop/compare/v1.1.3...v1.1.4) (2019-MAY-17) | ||
***17-MAY-2019*** | ||
* switched to `bundlib` | ||
## 1.1.3 | ||
### [1.1.3](https://github.com/manferlo81/foreach-prop/compare/v1.1.2...v1.1.3) (2019-MAY-17) | ||
***17-MAY-2019*** | ||
* fixed: broken sourcemap | ||
## 1.1.2 | ||
### [1.1.2](https://github.com/manferlo81/foreach-prop/compare/v1.1.1...v1.1.2) (2019-MAY-17) | ||
***17-MAY-2019*** | ||
* minor source code refactoring | ||
## 1.1.1 | ||
### [1.1.1](https://github.com/manferlo81/foreach-prop/compare/v1.1.0...v1.1.1) (2019-MAY-16) | ||
***16-MAY-2019*** | ||
* dependencies updated | ||
* test refactoring | ||
## 1.1.0 | ||
### [1.1.0](https://github.com/manferlo81/foreach-prop/compare/v1.0.3...v1.1.0) (2019-MAY-09) | ||
***09-MAY-2019*** | ||
* switched to `typescript` | ||
@@ -172,73 +137,51 @@ * use `tslint` | ||
## 1.0.3 | ||
### [1.0.3](https://github.com/manferlo81/foreach-prop/compare/v1.0.2...v1.0.3) (2019-MAY-06) | ||
***06-MAY-2019*** | ||
* dependencies updated | ||
## 1.0.2 | ||
### [1.0.2](https://github.com/manferlo81/foreach-prop/compare/v1.0.1...v1.0.2) (2019-MAY-05) | ||
***05-MAY-2019*** | ||
* test improvements | ||
* improved documentation | ||
## 1.0.1 | ||
### [1.0.1](https://github.com/manferlo81/foreach-prop/compare/v1.0.0...v1.0.1) (2019-MAY-05) | ||
***05-MAY-2019*** | ||
* test refactoring | ||
* improved documentation | ||
## 1.0.0 | ||
## [1.0.0](https://github.com/manferlo81/foreach-prop/compare/v0.2.3...v1.0.0) (2019-MAY-04) | ||
***04-MAY-2019*** | ||
* first official release | ||
* improved documentation | ||
## 0.2.3 | ||
### [0.2.3](https://github.com/manferlo81/foreach-prop/compare/v0.2.2...v0.2.3) (2019-MAY-04) | ||
***04-MAY-2019*** | ||
* improved documentation | ||
* minor source code improvements | ||
## 0.2.2 | ||
### [0.2.2](https://github.com/manferlo81/foreach-prop/compare/v0.2.1...v0.2.2) (2019-MAY-04) | ||
***04-MAY-2019*** | ||
* added browser support | ||
## 0.2.1 | ||
### [0.2.1](https://github.com/manferlo81/foreach-prop/compare/v0.2.0...v0.2.1) (2019-MAY-04) | ||
***04-MAY-2019*** | ||
* source code refactoring | ||
## 0.2.0 | ||
### [0.2.0](https://github.com/manferlo81/foreach-prop/compare/v0.1.1...v0.2.0) (2019-MAY-04) | ||
***04-MAY-2019*** | ||
* changelog documented | ||
* added `some`, `every` & `includes` methods | ||
## 0.1.1 | ||
### [0.1.1](https://github.com/manferlo81/foreach-prop/compare/v0.1.0...v0.1.1) (2019-MAY-04) | ||
***04-MAY-2019*** | ||
* added keywords | ||
## 0.1.0 | ||
### [0.1.0](https://github.com/manferlo81/foreach-prop/compare/v0.0.1...v0.1.0) (2019-MAY-04) | ||
***04-MAY-2019*** | ||
* added `find` method | ||
* test refactoring | ||
## 0.0.1 | ||
### 0.0.1 (2019-MAY-01) | ||
***01-MAY-2019*** | ||
* first release | ||
* added `forEach`, `map`, `keyOf`, `lasKeyOf`, `findKey`, `filter` & `reduce` methods |
@@ -5,21 +5,23 @@ (function (global, factory) { | ||
(global = global || self, factory(global.eachProp = {})); | ||
}(this, function (exports) { 'use strict'; | ||
}(this, (function (exports) { 'use strict'; | ||
function error(msg) { | ||
return new TypeError(msg); | ||
function createErrorFactory(template) { | ||
return function () { | ||
// eslint-disable-next-line prefer-rest-params | ||
var args = arguments; | ||
return new TypeError(template.replace(/\$(\d+)/g, function (_, i) { | ||
return "" + args[i]; | ||
})); | ||
}; | ||
} | ||
function notEnoughArgs(count, expected) { | ||
return error("expected " + expected + " arguments, got " + count + "."); | ||
} | ||
function invalidObject(object) { | ||
return error(object + " is not an object."); | ||
} | ||
function invalidCallback(callback) { | ||
return error(callback + " is not a function."); | ||
} | ||
var notEnoughArgs = createErrorFactory('expected $1 arguments, got $0.'); | ||
var invalidObject = createErrorFactory('$0 is not an object.'); | ||
var invalidCallback = createErrorFactory('$0 is not a function.'); | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
var hasOwn = {}.hasOwnProperty; | ||
function isObject(param) { | ||
return !!param && typeof param === "object"; | ||
return !!param && typeof param === 'object'; | ||
} | ||
@@ -76,2 +78,5 @@ | ||
function isFunction (fn) { | ||
if (!fn) { | ||
return false | ||
} | ||
var string = toString.call(fn); | ||
@@ -115,3 +120,3 @@ return string === '[object Function]' || | ||
function toArray(args, start) { | ||
if (!isArrayLike(args) && args !== "") { | ||
if (!isArrayLike(args) && args !== '') { | ||
throw new TypeError(args + " can't be converted to array."); | ||
@@ -124,3 +129,3 @@ } | ||
if (typeof start !== "number" || !isFinite(start)) { | ||
if (typeof start !== 'number' || !isFinite(start)) { | ||
throw new TypeError(start + " is not a valid start point."); | ||
@@ -175,2 +180,3 @@ } | ||
function forEach(object, callback) { | ||
// eslint-disable-next-line prefer-rest-params | ||
var args = arguments; | ||
@@ -197,2 +203,3 @@ var argsLen = args.length; | ||
function map(object, callback) { | ||
// eslint-disable-next-line prefer-rest-params | ||
var args = arguments; | ||
@@ -268,2 +275,3 @@ var argsLen = args.length; | ||
function findKey(object, callback) { | ||
// eslint-disable-next-line prefer-rest-params | ||
var args = arguments; | ||
@@ -292,2 +300,3 @@ var argsLen = args.length; | ||
function find(object, callback) { | ||
// eslint-disable-next-line prefer-rest-params | ||
var args = arguments; | ||
@@ -314,2 +323,3 @@ var argsLen = args.length; | ||
function filter(object, callback) { | ||
// eslint-disable-next-line prefer-rest-params | ||
var args = arguments; | ||
@@ -339,2 +349,3 @@ var argsLen = args.length; | ||
function reduce(object, callback, initial) { | ||
// eslint-disable-next-line prefer-rest-params | ||
var args = arguments; | ||
@@ -364,2 +375,3 @@ var argsLen = args.length; | ||
function some(object, callback) { | ||
// eslint-disable-next-line prefer-rest-params | ||
var args = arguments; | ||
@@ -388,2 +400,3 @@ var argsLen = args.length; | ||
function every(object, callback) { | ||
// eslint-disable-next-line prefer-rest-params | ||
var args = arguments; | ||
@@ -423,3 +436,3 @@ var argsLen = args.length; | ||
})); | ||
}))); | ||
//# sourceMappingURL=each-prop.umd.js.map |
@@ -1,2 +0,2 @@ | ||
var r,n;r=this,n=function(r){"use strict";function n(r){return new TypeError(r)}function t(r,t){return n("expected "+t+" arguments, got "+r+".")}function e(r){return n(r+" is not an object.")}function o(r){return n(r+" is not a function.")}var i={}.hasOwnProperty;function f(r){return!!r&&"object"==typeof r}var u=Array.isArray,a=Object.prototype.toString,c=u||function(r){return!!r&&"[object Array]"==a.call(r)},l=function(r){var n=h.call(r);return"[object Function]"===n||"function"==typeof r&&"[object RegExp]"!==n||"undefined"!=typeof window&&(r===window.setTimeout||r===window.alert||r===window.confirm||r===window.prompt)},h=Object.prototype.toString,w=function(r){if(!r)return!1;if(c(r))return!0;if(l(r)||function(r){if(null==r)return!1;var n=Object(r);return n===n.window}(r))return!1;var n="length"in(r=Object(r))&&r.length;return!(1!==r.nodeType||!n)||0===n||"number"==typeof n&&n>0&&n-1 in r};function v(r,n){if(!w(r)&&""!==r)throw new TypeError(r+" can't be converted to array.");if(null==n&&(n=0),"number"!=typeof n||!isFinite(n))throw new TypeError(n+" is not a valid start point.");var t=r.length;n<0&&(n+=t);for(var e=Object(r),o=new Array(t-n),i=n;i<t;i++)i in e&&(o[i-n]=e[i]);return o}function p(r,n,t,e,i){if(!l(r))throw o(r);return 2===i?function(e){return r.call(n,t[e],e)}:3===i?function(o){return r.call(n,t[o],o,e[2])}:function(o){return r.call.apply(r,[n,t[o],o].concat(v(e,2)))}}function s(r,n){var o=arguments.length;if(o<2)throw t(o,2);if(!f(r))throw e(r);for(var u in r)if(i.call(r,u)&&r[u]===n)return u;return null}r.every=function(r,n){var o=arguments,u=o.length;if(u<2)throw t(u,2);if(!f(r))throw e(r);var a=p(n,this,r,o,u);for(var c in r)if(i.call(r,c)&&!a(c))return!1;return!0},r.filter=function(r,n){var o=arguments,u=o.length;if(u<2)throw t(u,2);if(!f(r))throw e(r);var a=p(n,this,r,o,u),c={};for(var l in r)i.call(r,l)&&a(l)&&(c[l]=r[l]);return c},r.find=function(r,n){var o=arguments,u=o.length;if(u<2)throw t(u,2);if(!f(r))throw e(r);var a=p(n,this,r,o,u);for(var c in r)if(i.call(r,c)&&a(c))return r[c]},r.findKey=function(r,n){var o=arguments,u=o.length;if(u<2)throw t(u,2);if(!f(r))throw e(r);var a=p(n,this,r,o,u);for(var c in r)if(i.call(r,c)&&a(c))return c;return null},r.forEach=function(r,n){var o=arguments,u=o.length;if(u<2)throw t(u,2);if(!f(r))throw e(r);var a=p(n,this,r,o,u);for(var c in r)i.call(r,c)&&a(c)},r.includes=function(r,n){return null!==s(r,n)},r.keyOf=s,r.lastKeyOf=function(r,n){var o=arguments.length;if(o<2)throw t(o,2);if(!f(r))throw e(r);var u=null;for(var a in r)i.call(r,a)&&r[a]===n&&(u=a);return u},r.map=function(r,n){var o=arguments,u=o.length;if(u<2)throw t(u,2);if(!f(r))throw e(r);var a=p(n,this,r,o,u),c={};for(var l in r)i.call(r,l)&&(c[l]=a(l));return c},r.reduce=function(r,n,u){var a=arguments,c=a.length;if(c<2)throw t(c,2);if(!f(r))throw e(r);var h=function(r,n,t,e,i){if(!l(r))throw o(r);return 3===i?function(e,o){return r.call(n,o,t[e],e)}:4===i?function(o,i){return r.call(n,i,t[o],o,e[3])}:function(o,i){return r.call.apply(r,[n,i,t[o],o].concat(v(e,3)))}}(n,this,r,a,c),w=u;for(var p in r)i.call(r,p)&&(w=h(p,w));return w},r.some=function(r,n){var o=arguments,u=o.length;if(u<2)throw t(u,2);if(!f(r))throw e(r);var a=p(n,this,r,o,u);for(var c in r)if(i.call(r,c)&&a(c))return!0;return!1}},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((r=r||self).eachProp={}); | ||
var r,n;r=this,n=function(r){function n(r){return function(){var n=arguments;return new TypeError(r.replace(/\$(\d+)/g,(function(r,t){return""+n[t]})))}}var t=n("expected $1 arguments, got $0."),e=n("$0 is not an object."),o=n("$0 is not a function."),i={}.hasOwnProperty;function f(r){return!!r&&"object"==typeof r}var u=Array.isArray,a=Object.prototype.toString,c=u||function(r){return!!r&&"[object Array]"==a.call(r)},l=function(r){if(!r)return!1;var n=h.call(r);return"[object Function]"===n||"function"==typeof r&&"[object RegExp]"!==n||"undefined"!=typeof window&&(r===window.setTimeout||r===window.alert||r===window.confirm||r===window.prompt)},h=Object.prototype.toString;function v(r,n){if(!function(r){if(!r)return!1;if(c(r))return!0;if(l(r)||function(r){if(null==r)return!1;var n=Object(r);return n===n.window}(r))return!1;var n="length"in(r=Object(r))&&r.length;return!(1!==r.nodeType||!n)||0===n||"number"==typeof n&&n>0&&n-1 in r}(r)&&""!==r)throw new TypeError(r+" can't be converted to array.");if(null==n&&(n=0),"number"!=typeof n||!isFinite(n))throw new TypeError(n+" is not a valid start point.");var t=r.length;n<0&&(n+=t);for(var e=Object(r),o=new Array(t-n),i=n;i<t;i++)i in e&&(o[i-n]=e[i]);return o}function w(r,n,t,e,i){if(!l(r))throw o(r);return 2===i?function(e){return r.call(n,t[e],e)}:3===i?function(o){return r.call(n,t[o],o,e[2])}:function(o){return r.call.apply(r,[n,t[o],o].concat(v(e,2)))}}function p(r,n,t,e,i){if(!l(r))throw o(r);return 3===i?function(e,o){return r.call(n,o,t[e],e)}:4===i?function(o,i){return r.call(n,i,t[o],o,e[3])}:function(o,i){return r.call.apply(r,[n,i,t[o],o].concat(v(e,3)))}}function y(r,n){var o=arguments.length;if(o<2)throw t(o,2);if(!f(r))throw e(r);for(var u in r)if(i.call(r,u)&&r[u]===n)return u;return null}r.every=function(r,n){var o=arguments,u=o.length;if(u<2)throw t(u,2);if(!f(r))throw e(r);var a=w(n,this,r,o,u);for(var c in r)if(i.call(r,c)&&!a(c))return!1;return!0},r.filter=function(r,n){var o=arguments,u=o.length;if(u<2)throw t(u,2);if(!f(r))throw e(r);var a=w(n,this,r,o,u),c={};for(var l in r)i.call(r,l)&&a(l)&&(c[l]=r[l]);return c},r.find=function(r,n){var o=arguments,u=o.length;if(u<2)throw t(u,2);if(!f(r))throw e(r);var a=w(n,this,r,o,u);for(var c in r)if(i.call(r,c)&&a(c))return r[c]},r.findKey=function(r,n){var o=arguments,u=o.length;if(u<2)throw t(u,2);if(!f(r))throw e(r);var a=w(n,this,r,o,u);for(var c in r)if(i.call(r,c)&&a(c))return c;return null},r.forEach=function(r,n){var o=arguments,u=o.length;if(u<2)throw t(u,2);if(!f(r))throw e(r);var a=w(n,this,r,o,u);for(var c in r)i.call(r,c)&&a(c)},r.includes=function(r,n){return null!==y(r,n)},r.keyOf=y,r.lastKeyOf=function(r,n){var o=arguments.length;if(o<2)throw t(o,2);if(!f(r))throw e(r);var u=null;for(var a in r)i.call(r,a)&&r[a]===n&&(u=a);return u},r.map=function(r,n){var o=arguments,u=o.length;if(u<2)throw t(u,2);if(!f(r))throw e(r);var a=w(n,this,r,o,u),c={};for(var l in r)i.call(r,l)&&(c[l]=a(l));return c},r.reduce=function(r,n,o){var u=arguments,a=u.length;if(a<2)throw t(a,2);if(!f(r))throw e(r);var c=p(n,this,r,u,a),l=o;for(var h in r)i.call(r,h)&&(l=c(h,l));return l},r.some=function(r,n){var o=arguments,u=o.length;if(u<2)throw t(u,2);if(!f(r))throw e(r);var a=w(n,this,r,o,u);for(var c in r)if(i.call(r,c)&&a(c))return!0;return!1}},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((r=r||self).eachProp={}); | ||
//# sourceMappingURL=each-prop.umd.min.js.map |
{ | ||
"name": "foreach-prop", | ||
"version": "2.0.7", | ||
"version": "2.0.8", | ||
"description": "Array-like methods for objects", | ||
@@ -13,44 +13,61 @@ "keywords": [ | ||
"keys", | ||
"forEach", | ||
"map", | ||
"filter", | ||
"keyOf", | ||
"lastKeyOf", | ||
"find", | ||
"findKey", | ||
"reduce", | ||
"map" | ||
"includes", | ||
"some", | ||
"every" | ||
], | ||
"main": "dist/each-prop.cjs.js", | ||
"module": "dist/each-prop.es.js", | ||
"main": "dist/each-prop.js", | ||
"module": "dist/each-prop.mjs", | ||
"browser": "dist/each-prop.umd.js", | ||
"types": "types/index.d.ts", | ||
"typings": "types/index.d.ts", | ||
"bundlib": { | ||
"name": "eachProp", | ||
"min": "browser" | ||
}, | ||
"files": [ | ||
"dist", | ||
"types" | ||
], | ||
"scripts": { | ||
"clean": "rm -rf node_modules/.cache/bundlib node_modules/.cache/jest dist types coverage", | ||
"lint": "tslint src/**/*.ts", | ||
"dev": "bundlib -dw", | ||
"build": "bundlib -d", | ||
"test": "jest --color -w 3", | ||
"preversion": "npm run clean && npm test && npm run lint && npm run build" | ||
"clean": "rimraf node_modules/.cache/bundlib node_modules/.cache/jest dist types coverage", | ||
"lint": "eslint src/**/*.ts __test__/**/*.ts", | ||
"prerelease": "npm run clean && npm run lint && npm test && npm run build", | ||
"release": "standard-version" | ||
}, | ||
"dependencies": { | ||
"args-to-arr": "^1.4.7", | ||
"is-function": "^1.0.1" | ||
"args-to-arr": "^1.4.8", | ||
"is-function": "^1.0.2" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.9.6", | ||
"@babel/preset-env": "^7.9.6", | ||
"@rollup/plugin-commonjs": "^11.1.0", | ||
"@rollup/plugin-node-resolve": "^7.1.3", | ||
"@types/is-function": "^1.0.0", | ||
"@types/jest": "^24.0.18", | ||
"@types/node": "^12.7.5", | ||
"bundlib": "^0.12.5", | ||
"chokidar": "^3.0.2", | ||
"eslint": "^6.4.0", | ||
"husky": "^3.0.5", | ||
"jest": "^24.9.0", | ||
"ts-jest": "^24.1.0", | ||
"tslint": "^5.20.0", | ||
"typescript": "^3.6.3" | ||
"@types/jest": "^25.2.1", | ||
"@types/node": "^13.13.5", | ||
"@typescript-eslint/eslint-plugin": "^2.31.0", | ||
"@typescript-eslint/parser": "^2.31.0", | ||
"bundlib": "^0.16.3", | ||
"chokidar": "^3.4.0", | ||
"eslint": "^7.0.0", | ||
"husky": "^4.2.5", | ||
"jest": "^26.0.1", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.9.1", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-eslint": "^7.0.0", | ||
"rollup-plugin-terser": "^5.3.0", | ||
"rollup-plugin-typescript2": "^0.27.0", | ||
"standard-version": "^8.0.0", | ||
"ts-jest": "^25.5.1", | ||
"typescript": "^3.8.3" | ||
}, | ||
"files": [ | ||
"dist", | ||
"types" | ||
], | ||
"author": { | ||
@@ -57,0 +74,0 @@ "name": "Manuel Fernández", |
# foreach-prop | ||
[](https://circleci.com/gh/manferlo81/foreach-prop) [](https://dependabot.com) [](https://www.npmjs.com/package/foreach-prop) [](https://codecov.io/gh/manferlo81/foreach-prop) [](https://www.jsdelivr.com/package/npm/foreach-prop) [](https://david-dm.org/manferlo81/foreach-prop) [](https://david-dm.org/manferlo81/foreach-prop?type=dev) [](https://packagephobia.now.sh/result?p=foreach-prop) [](https://bundlephobia.com/result?p=foreach-prop) [](https://github.com/microsoft/typescript) [](https://snyk.io/test/github/manferlo81/foreach-prop?targetFile=package.json) [](LICENSE) | ||
[](https://circleci.com/gh/manferlo81/foreach-prop) [](https://dependabot.com) [](https://www.npmjs.com/package/foreach-prop) [](https://codecov.io/gh/manferlo81/foreach-prop) [](https://www.jsdelivr.com/package/npm/foreach-prop) [](https://david-dm.org/manferlo81/foreach-prop) [](https://david-dm.org/manferlo81/foreach-prop?type=dev) [](https://packagephobia.now.sh/result?p=foreach-prop) [](https://bundlephobia.com/result?p=foreach-prop) [](https://github.com/microsoft/typescript) [](https://snyk.io/test/github/manferlo81/foreach-prop?targetFile=package.json) [](LICENSE) | ||
@@ -5,0 +5,0 @@ Array-like methods for objects |
@@ -1,4 +0,3 @@ | ||
export declare function error(msg: string): TypeError; | ||
export declare function notEnoughArgs(count: number, expected: number): TypeError; | ||
export declare function invalidObject(object: unknown): TypeError; | ||
export declare function invalidCallback(callback: unknown): TypeError; | ||
export declare const notEnoughArgs: (count: number, expected: number) => TypeError; | ||
export declare const invalidObject: (object: unknown) => TypeError; | ||
export declare const invalidCallback: (callback: unknown) => TypeError; |
@@ -1,4 +0,4 @@ | ||
import { Extra, FilterCallback, Key } from "./types"; | ||
import { Extra, FilterCallback, Key } from './types'; | ||
declare function every<V, K extends Key, E extends Extra, TH = any>(this: TH, object: Record<K, V>, callback: FilterCallback<V, K, E, TH>, ...extra: E): boolean; | ||
declare function every<V, K extends Key, TH = any>(this: TH, object: Record<K, V>, callback: FilterCallback<V, K, Extra, TH>, ...extra: Extra): boolean; | ||
export default every; |
@@ -1,4 +0,4 @@ | ||
import { Extra, FilterCallback, Key } from "./types"; | ||
import { Extra, FilterCallback, Key } from './types'; | ||
declare function filter<V, K extends Key, E extends Extra, TH = any>(this: TH, object: Record<K, V>, callback: FilterCallback<V, K, E, TH>, ...extra: E): Record<K, V>; | ||
declare function filter<V, K extends Key, TH = any>(this: TH, object: Record<K, V>, callback: FilterCallback<V, K, Extra, TH>, ...extra: Extra): Record<K, V>; | ||
export default filter; |
@@ -1,4 +0,4 @@ | ||
import { Extra, FilterCallback, Key } from "./types"; | ||
import { Extra, FilterCallback, Key } from './types'; | ||
declare function findKey<V, K extends Key, E extends Extra, TH = any>(this: TH, object: Record<K, V>, callback: FilterCallback<V, K, E, TH>, ...extra: E): K | null; | ||
declare function findKey<V, K extends Key, TH = any>(this: TH, object: Record<K, V>, callback: FilterCallback<V, K, Extra, TH>, ...extra: Extra): K | null; | ||
export default findKey; |
@@ -1,4 +0,4 @@ | ||
import { Extra, FilterCallback, Key } from "./types"; | ||
import { Extra, FilterCallback, Key } from './types'; | ||
declare function find<V, K extends Key, E extends Extra, TH = any>(this: TH, object: Record<K, V>, callback: FilterCallback<V, K, E, TH>, ...extra: E): V | void; | ||
declare function find<V, K extends Key, TH = any>(this: TH, object: Record<K, V>, callback: FilterCallback<V, K, Extra, TH>, ...extra: Extra): V | void; | ||
export default find; |
@@ -1,4 +0,4 @@ | ||
import { Extra, ForEachCallback, Key } from "./types"; | ||
import { Extra, ForEachCallback, Key } from './types'; | ||
declare function forEach<V, K extends Key, E extends Extra, TH = any>(this: TH, object: Record<K, V>, callback: ForEachCallback<V, K, E, TH>, ...extra: E): void; | ||
declare function forEach<V, K extends Key, TH = any>(this: TH, object: Record<K, V>, callback: ForEachCallback<V, K, Extra, TH>, ...extra: Extra): void; | ||
export default forEach; |
@@ -1,4 +0,4 @@ | ||
import { Key } from "./types"; | ||
import { Key } from './types'; | ||
declare function includes(object: {}, value: any): false; | ||
declare function includes(object: Record<Key, any>, value: any): boolean; | ||
export default includes; |
@@ -1,12 +0,12 @@ | ||
export { default as forEach } from "./for-each"; | ||
export { default as map } from "./map"; | ||
export { default as keyOf } from "./key-of"; | ||
export { default as lastKeyOf } from "./last-key-of"; | ||
export { default as includes } from "./includes"; | ||
export { default as findKey } from "./find-key"; | ||
export { default as find } from "./find"; | ||
export { default as filter } from "./filter"; | ||
export { default as reduce } from "./reduce"; | ||
export { default as some } from "./some"; | ||
export { default as every } from "./every"; | ||
export { FilterCallback, ForEachCallback, MapCallback, ReduceCallback } from "./types"; | ||
export { default as forEach } from './for-each'; | ||
export { default as map } from './map'; | ||
export { default as keyOf } from './key-of'; | ||
export { default as lastKeyOf } from './last-key-of'; | ||
export { default as includes } from './includes'; | ||
export { default as findKey } from './find-key'; | ||
export { default as find } from './find'; | ||
export { default as filter } from './filter'; | ||
export { default as reduce } from './reduce'; | ||
export { default as some } from './some'; | ||
export { default as every } from './every'; | ||
export { FilterCallback, ForEachCallback, MapCallback, ReduceCallback } from './types'; |
@@ -1,3 +0,3 @@ | ||
import { Key } from "./types"; | ||
import { Key } from './types'; | ||
declare function isObject<K extends Key = Key, V = any>(param: unknown): param is Record<K, V>; | ||
export default isObject; |
@@ -1,4 +0,4 @@ | ||
import { Key } from "./types"; | ||
import { Key } from './types'; | ||
declare function keyOf(object: {}, value: any): null; | ||
declare function keyOf<K extends Key>(object: Record<K, any>, value: any): K | null; | ||
export default keyOf; |
@@ -1,4 +0,4 @@ | ||
import { Key } from "./types"; | ||
import { Key } from './types'; | ||
declare function lastKeyOf(object: {}, value: any): null; | ||
declare function lastKeyOf<K extends Key>(object: Record<K, any>, value: any): K | null; | ||
export default lastKeyOf; |
@@ -1,4 +0,4 @@ | ||
import { Extra, Key, MapCallback } from "./types"; | ||
import { Extra, Key, MapCallback } from './types'; | ||
declare function map<V, K extends Key, E extends Extra, RV = any, TH = any>(this: TH, object: Record<K, V>, callback: MapCallback<V, K, E, TH, RV>, ...extra: E): Record<K, RV>; | ||
declare function map<V, K extends Key, RV = any, TH = any>(this: TH, object: Record<K, V>, callback: MapCallback<V, K, Extra, TH, RV>, ...extra: Extra): Record<K, RV>; | ||
export default map; |
@@ -1,2 +0,2 @@ | ||
import { Extra, Key, ReduceCallback } from "./types"; | ||
import { Extra, Key, ReduceCallback } from './types'; | ||
declare function reduce<V, K extends Key, E extends Extra, R = any, TH = any>(this: TH, object: Record<K, V>, callback: ReduceCallback<V, K, E, TH, R>, initial: R, ...extra: E): R; | ||
@@ -3,0 +3,0 @@ declare function reduce<V, K extends Key, R = any, TH = any>(this: TH, object: Record<K, V>, callback: ReduceCallback<V, K, Extra, TH, R>, initial: R, ...extra: Extra): R; |
@@ -1,4 +0,4 @@ | ||
import { Extra, FilterCallback, Key } from "./types"; | ||
import { Extra, FilterCallback, Key } from './types'; | ||
declare function some<V, K extends Key, E extends Extra, TH = any>(this: TH, object: Record<K, V>, callback: FilterCallback<V, K, E, TH>, ...extra: E): boolean; | ||
declare function some<V, K extends Key, TH = any>(this: TH, object: Record<K, V>, callback: FilterCallback<V, K, Extra, TH>, ...extra: Extra): boolean; | ||
export default some; |
@@ -1,3 +0,3 @@ | ||
import { Extra, FilterCallback, Key, ReduceCallback, WrappedFilterCallback, WrappedReduceCallback } from "./types"; | ||
import { Extra, FilterCallback, Key, ReduceCallback, WrappedFilterCallback, WrappedReduceCallback } from './types'; | ||
export declare function wrapFilterCallback<V, K extends Key, E extends Extra, TH = any, R = any>(callback: FilterCallback<V, K, E, TH>, thisArg: TH, object: Record<K, V>, args: IArguments, argsLen: number): WrappedFilterCallback<K, R>; | ||
export declare function wrapReduceCallback<V, K extends Key, E extends Extra, R = any, TH = any>(callback: ReduceCallback<V, K, E, TH, R>, thisArg: TH, object: Record<K, V>, args: IArguments, argsLen: number): WrappedReduceCallback<K, R>; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
157632
10.97%879
3.41%23
109.09%1
Infinity%Updated
Updated