foreach-prop
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -30,3 +30,2 @@ 'use strict'; | ||
var extra = toArray(arguments, 2); | ||
var result = {}; | ||
@@ -77,14 +76,3 @@ | ||
function includes(object, value) { | ||
for (var key in object) { | ||
if ( | ||
hasOwn.call(object, key) && | ||
object[key] === value | ||
) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
return keyOf(object, value) !== null; | ||
} | ||
@@ -115,5 +103,4 @@ | ||
if (hasOwn.call(object, key)) { | ||
var value = object[key]; | ||
if (callItBack(callback, this, object, key, extra)) { | ||
return value; | ||
return object[key]; | ||
} | ||
@@ -174,3 +161,3 @@ } | ||
function some$1(object, callback) { | ||
function every(object, callback) { | ||
@@ -192,3 +179,3 @@ var extra = toArray(arguments, 2); | ||
exports.every = some$1; | ||
exports.every = every; | ||
exports.filter = filter; | ||
@@ -195,0 +182,0 @@ exports.find = find; |
@@ -28,3 +28,2 @@ import toArray from 'args-to-arr'; | ||
var extra = toArray(arguments, 2); | ||
var result = {}; | ||
@@ -75,14 +74,3 @@ | ||
function includes(object, value) { | ||
for (var key in object) { | ||
if ( | ||
hasOwn.call(object, key) && | ||
object[key] === value | ||
) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
return keyOf(object, value) !== null; | ||
} | ||
@@ -113,5 +101,4 @@ | ||
if (hasOwn.call(object, key)) { | ||
var value = object[key]; | ||
if (callItBack(callback, this, object, key, extra)) { | ||
return value; | ||
return object[key]; | ||
} | ||
@@ -172,3 +159,3 @@ } | ||
function some$1(object, callback) { | ||
function every(object, callback) { | ||
@@ -190,3 +177,3 @@ var extra = toArray(arguments, 2); | ||
export { some$1 as every, filter, find, findKey, forEach, includes, keyOf, lastKeyOf, map, reduce, some }; | ||
export { every, filter, find, findKey, forEach, includes, keyOf, lastKeyOf, map, reduce, some }; | ||
//# sourceMappingURL=each-prop.es.js.map |
@@ -120,3 +120,2 @@ (function (global, factory) { | ||
var extra = toArray(arguments, 2); | ||
var result = {}; | ||
@@ -167,14 +166,3 @@ | ||
function includes(object, value) { | ||
for (var key in object) { | ||
if ( | ||
hasOwn.call(object, key) && | ||
object[key] === value | ||
) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
return keyOf(object, value) !== null; | ||
} | ||
@@ -205,5 +193,4 @@ | ||
if (hasOwn.call(object, key)) { | ||
var value = object[key]; | ||
if (callItBack(callback, this, object, key, extra)) { | ||
return value; | ||
return object[key]; | ||
} | ||
@@ -264,3 +251,3 @@ } | ||
function some$1(object, callback) { | ||
function every(object, callback) { | ||
@@ -282,3 +269,3 @@ var extra = toArray(arguments, 2); | ||
exports.every = some$1; | ||
exports.every = every; | ||
exports.filter = filter; | ||
@@ -285,0 +272,0 @@ exports.find = find; |
{ | ||
"name": "foreach-prop", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Array-like methods for objects", | ||
@@ -5,0 +5,0 @@ "main": "dist/each-prop.cjs.js", |
# foreach-prop | ||
[![CircleCI](https://circleci.com/gh/manferlo81/foreach-prop.svg?style=svg)](https://circleci.com/gh/manferlo81/foreach-prop) [![Greenkeeper badge](https://badges.greenkeeper.io/manferlo81/foreach-prop.svg)](https://greenkeeper.io/) [![npm](https://img.shields.io/npm/v/foreach-prop.svg)](https://www.npmjs.com/package/foreach-prop) [![codecov](https://codecov.io/gh/manferlo81/foreach-prop/branch/master/graph/badge.svg)](https://codecov.io/gh/manferlo81/foreach-prop) [![Known Vulnerabilities](https://snyk.io/test/github/manferlo81/foreach-prop/badge.svg?targetFile=package.json)](https://snyk.io/test/github/manferlo81/foreach-prop?targetFile=package.json) [![GitHub](https://img.shields.io/github/license/manferlo81/foreach-prop.svg)](LICENSE) | ||
[![CircleCI](https://circleci.com/gh/manferlo81/foreach-prop.svg?style=svg)](https://circleci.com/gh/manferlo81/foreach-prop) [![Greenkeeper badge](https://badges.greenkeeper.io/manferlo81/foreach-prop.svg)](https://greenkeeper.io/) [![npm](https://img.shields.io/npm/v/foreach-prop.svg)](https://www.npmjs.com/package/foreach-prop) [![dependencies Status](https://david-dm.org/manferlo81/foreach-prop/status.svg)](https://david-dm.org/manferlo81/foreach-prop) [![devDependencies Status](https://david-dm.org/manferlo81/foreach-prop/dev-status.svg)](https://david-dm.org/manferlo81/foreach-prop?type=dev) [![install size](https://packagephobia.now.sh/badge?p=foreach-prop)](https://packagephobia.now.sh/result?p=foreach-prop) [![npm bundle size](https://img.shields.io/bundlephobia/min/foreach-prop.svg)](https://bundlephobia.com/result?p=foreach-prop) [![codecov](https://codecov.io/gh/manferlo81/foreach-prop/branch/master/graph/badge.svg)](https://codecov.io/gh/manferlo81/foreach-prop) [![Known Vulnerabilities](https://snyk.io/test/github/manferlo81/foreach-prop/badge.svg?targetFile=package.json)](https://snyk.io/test/github/manferlo81/foreach-prop?targetFile=package.json) [![GitHub](https://img.shields.io/github/license/manferlo81/foreach-prop.svg)](LICENSE) | ||
@@ -9,2 +9,4 @@ Array-like methods for objects | ||
#### npm | ||
```sh | ||
@@ -14,3 +16,4 @@ npm install foreach-prop | ||
*... or use it from [jsDelivr](https://www.jsdelivr.com/) cdn...* | ||
#### jsDelivr | ||
*[www.jsdelivr.com](https://www.jsdelivr.com/)* | ||
@@ -21,4 +24,11 @@ ```html | ||
*... see [this link](https://www.jsdelivr.com/package/npm/foreach-prop) for more cdn options (specific/minified version, etc...)* | ||
*[more options on jsDelivr website...](https://www.jsdelivr.com/package/npm/foreach-prop)* | ||
#### UNPKG | ||
*[unpkg.com](https://unpkg.com)* | ||
```html | ||
<script src="https://unpkg.com/foreach-prop"></script> | ||
``` | ||
## Methods | ||
@@ -25,0 +35,0 @@ |
@@ -5,3 +5,3 @@ import toArray from "args-to-arr"; | ||
function some(object, callback) { | ||
function every(object, callback) { | ||
@@ -23,2 +23,2 @@ const extra = toArray(arguments, 2); | ||
export default some; | ||
export default every; |
@@ -11,5 +11,4 @@ import toArray from "args-to-arr"; | ||
if (hasOwn.call(object, key)) { | ||
const value = object[key]; | ||
if (callItBack(callback, this, object, key, extra)) { | ||
return value; | ||
return object[key]; | ||
} | ||
@@ -16,0 +15,0 @@ } |
@@ -1,18 +0,7 @@ | ||
import hasOwn from "./has-own"; | ||
import keyOf from "./key-of"; | ||
function includes(object, value) { | ||
for (const key in object) { | ||
if ( | ||
hasOwn.call(object, key) && | ||
object[key] === value | ||
) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
return keyOf(object, value) !== null; | ||
} | ||
export default includes; |
@@ -8,3 +8,2 @@ import toArray from "args-to-arr"; | ||
const extra = toArray(arguments, 2); | ||
const result = {}; | ||
@@ -11,0 +10,0 @@ |
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
144
55453
647