New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

filter-object

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filter-object - npm Package Compare versions

Comparing version 0.2.0 to 1.0.0

LICENSE

17

.verb.md

@@ -6,10 +6,4 @@ # {%= name %} {%= badge("fury") %}

## Install
{%= include("install") %}
{%= include("install-npm", {save: true}) %}
## Run tests
```bash
npm test
```
## Usage

@@ -50,2 +44,11 @@

## Run tests
Install dev dependencies:
```bash
npm i -d && mocha
```
## Contributing

@@ -52,0 +55,0 @@ Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue]({%= bugs.url %}).

{
"name": "filter-object",
"description": "Return a copy of an object, filtered to have only keys that match the given glob patterns.",
"version": "0.2.0",
"version": "1.0.0",
"homepage": "https://github.com/jonschlinkert/filter-object",

@@ -17,8 +17,6 @@ "author": {

},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/jonschlinkert/filter-object/blob/master/LICENSE-MIT"
}
],
"license": {
"type": "MIT",
"url": "https://github.com/jonschlinkert/filter-object/blob/master/LICENSE-MIT"
},
"main": "index.js",

@@ -29,13 +27,12 @@ "engines": {

"scripts": {
"test": "mocha -R spec"
"test": "mocha -R spec",
"lint": "jshint **.js",
"docs": "update && license && verb && deps",
"all": "npm run test && npm run lint && npm run docs"
},
"dependencies": {
"extend-shallow": "^0.1.1",
"filter-keys": "^0.1.1",
"sort-object": "^0.3.1"
"extend-shallow": "^0.2.0",
"filter-keys": "^1.0.0",
"sort-object": "^0.3.2"
},
"devDependencies": {
"mocha": "*",
"should": "^4.3.0"
},
"keywords": [

@@ -63,6 +60,4 @@ "arr",

"sort",
"util",
"utility",
"wildcard"
]
}
}

@@ -6,14 +6,8 @@ # filter-object [![NPM version](https://badge.fury.io/js/filter-object.svg)](http://badge.fury.io/js/filter-object)

## Install
### Install with [npm](npmjs.org):
## Install with [npm](npmjs.org)
```bash
npm i filter-object --save-dev
npm i filter-object --save
```
## Run tests
```bash
npm test
```
## Usage

@@ -54,2 +48,11 @@

## Run tests
Install dev dependencies:
```bash
npm i -d && mocha
```
## Contributing

@@ -71,4 +74,4 @@ Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/filter-object/issues).

_This file was generated by [verb](https://github.com/assemble/verb) on November 24, 2014._
_This file was generated by [verb](https://github.com/assemble/verb) on December 30, 2014._
[sort-object]: https://github.com/helpers/sort-object
/*!
* filter-object <https://github.com/jonschlinkert/filter-object>
*
* Copyright (c) 2014 Jon Schlinkert, contributors.
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License

@@ -10,3 +10,3 @@ */

var should = require('should');
var assert = require('assert');
var filter = require('./');

@@ -16,25 +16,19 @@

it('should filter keys using the given glob patterns', function () {
filter({a: 'a', b: 'b', c: 'c'}, '*').should.eql({a: 'a', b: 'b', c: 'c'});
filter({a: 'a', b: 'b', c: 'c'}, 'b').should.eql({b: 'b'});
filter({foo: 'a', bar: 'b', baz: 'c'}, 'b*').should.eql({bar: 'b', baz: 'c'});
assert.deepEqual(filter({a: 'a', b: 'b', c: 'c'}, '*'), {a: 'a', b: 'b', c: 'c'});
assert.deepEqual(filter({a: 'a', b: 'b', c: 'c'}, 'b'), {b: 'b'});
assert.deepEqual(filter({foo: 'a', bar: 'b', baz: 'c'}, 'b*'), {bar: 'b', baz: 'c'});
});
it('should exclude keys that match negation patterns:', function () {
filter({a: 'a', b: 'b', c: 'c'}, ['*', '!a']).should.eql({b: 'b', c: 'c'});
filter({foo: 'a', bar: 'b', baz: 'c'}, ['*', '!b*']).should.eql({foo: 'a'});
assert.deepEqual(filter({a: 'a', b: 'b', c: 'c'}, ['*', '!a']), {b: 'b', c: 'c'});
assert.deepEqual(filter({foo: 'a', bar: 'b', baz: 'c'}, ['*', '!b*']), {foo: 'a'});
});
it('should filter keys using brace expansion', function () {
filter({a: 'a', b: 'b', c: 'c'}, '{b,c}').should.eql({b: 'b', c: 'c'});
assert.deepEqual(filter({a: 'a', b: 'b', c: 'c'}, '{b,c}'), {b: 'b', c: 'c'});
});
it('should return the entire object if no pattern is given:', function () {
filter({a: 'a', b: 'b', c: 'c'}).should.eql({a: 'a', b: 'b', c: 'c'});
assert.deepEqual(filter({a: 'a', b: 'b', c: 'c'}), {a: 'a', b: 'b', c: 'c'});
});
it('should throw an error if an object is not passed:', function () {
(function () {
filter()
}).should.throw('filter-object expects an object');
});
});
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