filter-obj

WebJar for filter-obj

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

filter-obj
Последняя версия

Последняя версия

1.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

filter-obj
WebJar for filter-obj
Ссылка на сайт

Ссылка на сайт

https://www.webjars.org
Система контроля версий

Система контроля версий

https://github.com/sindresorhus/filter-obj

Скачать filter-obj

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/filter-obj/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>filter-obj</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/filter-obj/
implementation 'org.webjars.npm:filter-obj:1.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/filter-obj/
implementation ("org.webjars.npm:filter-obj:1.1.0")
'org.webjars.npm:filter-obj:jar:1.1.0'
<dependency org="org.webjars.npm" name="filter-obj" rev="1.1.0">
  <artifact name="filter-obj" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='filter-obj', version='1.1.0')
)
libraryDependencies += "org.webjars.npm" % "filter-obj" % "1.1.0"
[org.webjars.npm/filter-obj "1.1.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

filter-obj

Filter object keys and values into a new object

Install

$ npm install filter-obj

Usage

const filterObject = require('filter-obj');

const object = {
	foo: true,
	bar: false
};

const newObject = filterObject(object, (key, value) => value === true);
//=> {foo: true}

const newObject2 = filterObject(object, ['bar']);
//=> {bar: false}

API

filterObject(source, filter)

filterObject(source, includeKeys)

source

Type: object

Source object to filter properties from.

filter

Type: (sourceKey, sourceValue, source) => boolean

A predicate function that detemines whether a property should be assigned to the new object.

includeKeys

Type: string[]

Array of property names that should be assigned to the new object.

Related

  • map-obj - Map object keys and values into a new object

Версии библиотеки

Версия
1.1.0