Skip to content

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

filter-properties

Filter object properties using a whitelist

Installation

npminstallfilter-properties--save

API

filter(Array whitelist, Object object) -> Object

The whitelist is an Array of strings.

varwhitelist=["username"]

The object is the input data.

varobject={username: "acro",gender: "male"}

Applying the filter function onto these two inputs will return a filtered object.

varfilter=require("filter-properties")varfiltered=filter(whitelist,object)// { username: "acro" }

Dependencies

This library has no dependencies.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages