filter-object
Advanced tools
Comparing version 0.1.3 to 0.2.0
@@ -5,5 +5,5 @@ 'use strict'; | ||
var sortObject = require('sort-object'); | ||
var extend = require('extend-shallow'); | ||
module.exports = function filterObject(o, patterns) { | ||
module.exports = function filterObject(o, patterns, options) { | ||
if (o == null) { | ||
@@ -17,3 +17,4 @@ throw new Error('filter-object expects an object'); | ||
return sortObject(o, filterKeys(o, patterns)); | ||
var keys = filterKeys(o, patterns); | ||
return sortObject(o, extend({keys: keys}, options)); | ||
}; |
{ | ||
"name": "filter-object", | ||
"description": "Return a copy of an object, filtered to have only keys that match the given glob patterns.", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/jonschlinkert/filter-object", | ||
@@ -30,6 +30,10 @@ "author": { | ||
}, | ||
"dependencies": { | ||
"extend-shallow": "^0.1.1", | ||
"filter-keys": "^0.1.1", | ||
"sort-object": "^0.3.1" | ||
}, | ||
"devDependencies": { | ||
"verb-tag-jscomments": ">= 0.2.0", | ||
"verb": ">= 0.2.6", | ||
"mocha": "*" | ||
"mocha": "*", | ||
"should": "^4.3.0" | ||
}, | ||
@@ -61,7 +65,3 @@ "keywords": [ | ||
"wildcard" | ||
], | ||
"dependencies": { | ||
"filter-keys": "^0.1.1", | ||
"sort-object": "^0.3.1" | ||
} | ||
} | ||
] | ||
} |
@@ -6,3 +6,3 @@ # 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): | ||
@@ -44,4 +44,14 @@ ```bash | ||
### options | ||
Pass options to [sort-object] | ||
```js | ||
filter({foo: 'a', bar: 'b', baz: 'c'}, ['*', '!b*'], options); | ||
``` | ||
See [sort-object] for the full range of options and features. | ||
## Contributing | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue][issues]. | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/filter-object/issues). | ||
@@ -56,3 +66,3 @@ ## Author | ||
## License | ||
Copyright (c) 2014 Jon Schlinkert, contributors. | ||
Copyright (c) 2014 Jon Schlinkert | ||
Released under the MIT license | ||
@@ -62,4 +72,4 @@ | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 24, 2014._ | ||
_This file was generated by [verb](https://github.com/assemble/verb) on November 24, 2014._ | ||
[issues]: https://github.com/jonschlinkert/filter-keys/issues | ||
[sort-object]: https://github.com/helpers/sort-object |
@@ -10,3 +10,2 @@ /*! | ||
var assert = require('assert'); | ||
var should = require('should'); | ||
@@ -13,0 +12,0 @@ var filter = require('./'); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7710
2
45
71
3
+ Addedextend-shallow@^0.1.1
+ Addedarray-slice@0.2.3(transitive)
+ Addedextend-shallow@0.1.1(transitive)