Socket
Socket
Sign inDemoInstall

like-ar

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

like-ar - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

2

package.json
{
"name": "like-ar",
"description": "Using objects like arrays with map, filter, forEach and others coming soon.",
"version": "0.2.0",
"version": "0.2.1",
"author": "Codenautas <codenautas@googlegroups.com>",

@@ -6,0 +6,0 @@ "repository": "codenautas/like-ar",

@@ -26,2 +26,8 @@ # like-ar

# Usage
The function `likeAr` wraps an object. The wraped object can be used like an array
with some array functions: `forEach`, `map`, `filter` y `join`.
These functions receive a callback in the same way that the array version does.
```sh

@@ -40,2 +46,29 @@ var likeAr = require('like-ar');

# API
The callback functions receive these parameters: `value`, `key` and the original object.
The functions that in the Array case returns Arrays returns a chainable object.
function | returned value
--------------------|--------------------
`forEach(cb, this)` | `undefined`
`map(cb, this)` | chainable object with the same keys and the value mapeds
`filter(db, this)` | chainable object with the same keys and values for only that key/value that returns true in the callback function
`join(separator)` | string with the join of the values
`array()` | array of values
`keys()` | array of keys
# Usage
```sh
var likeAr = require('like-ar');
var object={
lastName:'Perez',
firstName:'Diego'
}
likeAr(object).forEach(function(value, attrName, object){
console.log(attrName,':',value);
});
```
## License

@@ -42,0 +75,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc