# fuzzy-path

> Drill down an object in a fuzzy fashion

Latest version **1.0.1** (published 2015-08-05) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install fuzzy-path
pnpm add fuzzy-path
yarn add fuzzy-path
bun add fuzzy-path
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2015-08-05 |
| First published | 2015-08-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Trevor Senior |
| Maintainers | trevorsenior |
| Keywords | fuzzy, path, object |

## Links

- npm: https://www.npmjs.com/package/fuzzy-path
- Repository: https://github.com/trevorsenior/fuzzy-path
- Homepage: https://github.com/trevorsenior/fuzzy-path#readme
- Issues: https://github.com/trevorsenior/fuzzy-path/issues
- npm.io page: https://npm.io/package/fuzzy-path

## Dependencies (2)

- [fuzzy](https://npm.io/package/fuzzy.md) ^0.1.0
- [auto-curry](https://npm.io/package/auto-curry.md) ^0.2.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2015-08-05
- 1.0.0 — 2015-08-05

## README

# fuzzy-path

```
String -> { k: v } -> v | undefined
```

Drill down an object in a fuzzy fashion.

[![Build Status](https://travis-ci.org/trevorsenior/fuzzy-path.svg?branch=master)](https://travis-ci.org/trevorsenior/fuzzy-path)

## Example

```javascript
import fpath from 'fuzzy-path';

const info = {
    firstName: 'Trevor',
    lastName: 'Senior',
    address: {
        city: 'Seattle',
        state: 'VA',
        zip: 12345,
        address1: '55 W St.',
        address2: '#4',
        phoneNumbers: {
            home: 9993334444,
            mobile: 1112223333
        }
    }
};

fpath('firstName', info); // 'Trevor'
fpath('first', info); // 'Trevor'
fpath('add.city', info); // 'Seattle'
fpath('add.phone.mob', info); // 111222333

fpath('foo', info); // undefined
fpath('address.foo', info); // undefined

// throws error! too many options to choose from
fpath('name', info);

// throws error! invalid path (firstName is a string)
fpath('first.foo', info);
```

## Currying

```javascript
var getMobileNumber = fpath('add.phone.mob');

getMobileNumber(info); // 111222333
```

## Install

```sh
npm install --save fuzzy-path
```

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