# normalize-prefix

> Normalize an object based on one or more prefixes

Latest version **1.0.0** (published 2016-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install normalize-prefix
pnpm add normalize-prefix
yarn add normalize-prefix
bun add normalize-prefix
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-10-27 |
| First published | 2016-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ben Drucker |
| Maintainers | bendrucker |
| Keywords | object, normalize, prefix, data |

## Links

- npm: https://www.npmjs.com/package/normalize-prefix
- Repository: https://github.com/bendrucker/normalize-prefix
- Homepage: https://github.com/bendrucker/normalize-prefix#readme
- Issues: https://github.com/bendrucker/normalize-prefix/issues
- npm.io page: https://npm.io/package/normalize-prefix

## Dependencies (3)

- [ap](https://npm.io/package/ap.md) ~0.2.0
- [is-obj](https://npm.io/package/is-obj.md) ~1.0.1
- [cast-array](https://npm.io/package/cast-array.md) ~1.0.1

## Alternatives

- [@libsql/sqlite3](https://npm.io/package/@libsql/sqlite3.md) — 39.8K weekly downloads
- [@fortemi/core](https://npm.io/package/@fortemi/core.md) — 461 weekly downloads
- [cdb-converter](https://npm.io/package/cdb-converter.md) — 341 weekly downloads
- [@uplo/adapter-prisma](https://npm.io/package/@uplo/adapter-prisma.md) — 75 weekly downloads
- [typeorm-aios](https://npm.io/package/typeorm-aios.md) — 30 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-10-27

## README

# normalize-prefix [![Build Status](https://travis-ci.org/bendrucker/normalize-prefix.svg?branch=master)](https://travis-ci.org/bendrucker/normalize-prefix)

> Normalize an object based on a specified prefix


## Install

```
$ npm install --save normalize-prefix
```


## Usage

```js
var normalize = require('normalize-prefix')

normalize(['foo_', 'baz_'], {
  foo_id: 1,
  baz_id: 2,
  foo: {},
  baz: 3
})
//=> {foo: {id: 1}, baz_id: 2, baz: 3}
```

## API

#### `normalize(prefixes, data)` -> `object`

If only `prefixes` are supplied, a partially applied function will be returned instead.

##### prefixes

*Required*  
Type: `string / array[string]`

A punctuated prefix (e.g. `foo_`) or array of prefixes to use for normalization.

##### data

*Required*  
Type: `object`

The data to normalize.


## License

MIT © [Ben Drucker](http://bendrucker.me)

---
_Source: https://npm.io/package/normalize-prefix · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
