0.0.3 • Published 8 months ago

obj-finder v0.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

obj-finder

A simple helper, highly type, to find a value in an object by string. using the best of typescript.

Sample

import { findByString } from 'obj-finder';

const obj = {
  a: {
    b: 'notebook',
    c: {
      d: 'mouse',
    }
  }
};

const value = findByString('a.c.d', obj); 
// value has type 'string' 
// 'a.b.d' is validated in type-check

console.log(value);
// Outputs:
// 'mouse'
0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago