open-index/open-npm huggingface dataset:
npm package: @salsita/prune-values
Description: [![NPM version](https://img.shields.io/npm/v/@salsita/prune-values.svg)](https://www.npmjs.com/package/@salsita/prune-values) ![Downloads](https://img.shields.io/npm/dm/@salsita/prune-values.svg?style=flat) ![Licence](https://img.shields.io/npm/l/@salsita
Author: Jan Dolezel
Latest version: 1.0.1

# @salsita/prune-values

[![NPM version](https://img.shields.io/npm/v/@salsita/prune-values.svg)](https://www.npmjs.com/package/@salsita/prune-values)
![Downloads](https://img.shields.io/npm/dm/@salsita/prune-values.svg?style=flat)
![Licence](https://img.shields.io/npm/l/@salsita/prune-values.svg?style=flat)
[![Dependency Status](https://img.shields.io/david/salsita/nodejs-modules.svg?path=packages/prune-values)](https://david-dm.org/salsita/nodejs-modules?path=packages/prune-values)
[![devDependency Status](https://img.shields.io/david/dev/salsita/nodejs-modules.svg?path=packages/prune-values)](https://david-dm.org/salsita/nodejs-modules?type=dev&path=packages/prune-values)

Removes keys with undefined values from object.
npm package: @salsita/psql
Description: [![NPM version](https://img.shields.io/npm/v/@salsita/psql.svg)](https://www.npmjs.com/package/@salsita/psql) ![Downloads](https://img.shields.io/npm/dm/@salsita/psql.svg?style=flat) ![Licence](https://img.shields.io/npm/l/@salsita/psql.svg?style=flat) [!
Author: Jan Dolezel
Latest version: 1.0.3

# @salsita/psql

[![NPM version](https://img.shields.io/npm/v/@salsita/psql.svg)](https://www.npmjs.com/package/@salsita/psql)
![Downloads](https://img.shields.io/npm/dm/@salsita/psql.svg?style=flat)
![Licence](https://img.shields.io/npm/l/@salsita/psql.svg?style=flat)
[![Dependency Status](https://img.shields.io/david/salsita/nodejs-modules.svg?path=packages/psql)](https://david-dm.org/salsita/nodejs-modules?path=packages/psql)
[![devDependency Status](https://img.shields.io/david/dev/salsita/nodejs-modules.svg?path=packages/psql)](https://david-dm.org/salsita/nodejs-modules?type=dev&path=packages/psql)

Functions and utilities for wrapping postgres DB connection.

- `connect` - accepts function and executes it passing DB connection as parameter.
- `transaction` - wraps function call to DB transaction
- `withDb` - ensures first parameter of function is DB connection

Example:

```js
const _ = require("lodash");
const squel = require("squel");
const psql = require("@salsita/psql");
const onlyFirstRow = require("@salsita/sql/utils/onlyFirstRow");
const quote = require("@salsita/sql/utils/quote");

//
// CONFIGURATION
//

const connect = psql.connect({ options: { connectionString: process.env.DATABASE_URL } });
const withDb = psql.withDb(connect);
const { transaction } = psql;

const usersModel = _.mapValues(
  {
    findById: onlyFirstRow((dbClient, id) =>
      dbClient.query(
        squel
          .select()
          .from('"Users"')
          .where('"userId" = ?', id)
          .toParam()
      )
    ),
    updateById: onlyFirstRow((dbClient, id, data) =>
      dbClient.query(
        squel
          .update()
          .table('"Users"')
          .setFields(quote(data))
          .where('"userId" = ?', id)
          .returning("*")
          .toParam()
      )
    )
  },
  withDb
);

//
// USAGE
//

// random connection from pool
const user = await usersModel.findById(1);

// using one connection for all queries in transaction
const user = await connect(
  transaction(async dbClient => {
    const oldUser = await usersModel.findById(dbClient, 1);
    const newUser = await usersModel.updateById(dbClient, 1, { name: `${oldUser.name}son` });
  })
);
```
npm package: @salsita/react-entities
Description: ## Install
Latest version: 1.0.0

# react-entities

## Install

Install this package with `npm`
```
npm i @salsita/react-entities
```

or `yarn`
```
yarn add @salsita/react-entities
```

## API
### Modules

<dl>
<dt><a href="#module_EntitiesActions">EntitiesActions</a></dt>
<dd></dd>
</dl>

### Functions

<dl>
<dt><a href="#entitiesReducer">entitiesReducer(state, action)</a> ⇒ <code>EntitiesState</code></dt>
<dd><p>The reducer of the entities module</p>
</dd>
<dt><a href="#normalizeAndStore">normalizeAndStore(data, schema)</a> ⇒ <code>String</code> | <code>Number</code> | <code>Array</code></dt>
<dd><p>Normalize and store data into the entity repository</p>
<p>Normalizes data according to the schema and stores the result into the entity repository.</p>
</dd>
</dl>

<a name="module_EntitiesActions"></a>

### EntitiesActions
<a name="module_EntitiesActions.repositoryHasChanged"></a>

#### EntitiesActions.repositoryHasChanged(repository) ⇒ <code>Action</code>
Modifies entity repository

**Kind**: static method of [<code>EntitiesActions</code>](#module_EntitiesActions)  

| Param | Type | Description |
| --- | --- | --- |
| repository | <code>Partial.&lt;EntitiesState&gt;</code> | Entities that will be merged into the entity repository |

<a name="entitiesReducer"></a>

### entitiesReducer(state, action) ⇒ <code>EntitiesState</code>
The reducer of the entities module

**Kind**: global function  

| Param | Type | Description |
| --- | --- | --- |
| state | <code>EntitiesState</code> | The state of the entities module |
| action | <code>Action</code> | A redux action |

<a name="normalizeAndStore"></a>

### normalizeAndStore(data, schema) ⇒ <code>String</code> \| <code>Number</code> \| <code>Array</code>
Normalize and store data into the entity repository

Normalizes data according to the schema and stores the result into the entity repository.

**Kind**: global function  
**Returns**: <code>String</code> \| <code>Number</code> \| <code>Array</code> - Returns either ID or list of IDs of normalized data  

| Param | Type | Description |
| --- | --- | --- |
| data | <code>Object</code> \| <code>Array</code> | Entity or list of entities |
| schema | <code>Object</code> \| <code>Array</code> | Normalizr schema |
npm package: @salsita/react-helpers
Description: ## Install
Latest version: 1.0.0

# react-helpers

## Install

Install this package with `npm`
```
npm i @salsita/react-helpers
```

or `yarn`
```
yarn add @salsita/react-helpers
```

## API
### Functions

<dl>
<dt><a href="#composeSaga">composeSaga(...sagas)</a> ⇒ <code>Generator</code></dt>
<dd><p>A helper function to compose multiple sagas</p>
<p>Given two Sagas as arguments, eg. compose(f, g) function composition f∘g is performed.
Please note that functions are executed in backward order.</p>
</dd>
<dt><a href="#empty">empty()</a></dt>
<dd><p>An empty function that performs nothing</p>
</dd>
<dt><a href="#identity">identity(value)</a></dt>
<dd><p>An identity function that return its input</p>
</dd>
</dl>

<a name="composeSaga"></a>

### composeSaga(...sagas) ⇒ <code>Generator</code>
A helper function to compose multiple sagas

Given two Sagas as arguments, eg. compose(f, g) function composition f∘g is performed.
Please note that functions are executed in backward order.

**Kind**: global function  
**Returns**: <code>Generator</code> - Composed Saga  

| Param | Type | Description |
| --- | --- | --- |
| ...sagas | <code>Generator</code> | Sagas to be composed |

<a name="empty"></a>

### empty()
An empty function that performs nothing

**Kind**: global function  
<a name="identity"></a>

### identity(value)
An identity function that return its input

**Kind**: global function  

| Param | Type | Description |
| --- | --- | --- |
| value | <code>any</code> | A value that will be returned |