object-glob
Object key filtering
Last updated 8 months ago by cygnusroboticus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install object-glob 
SYNC missed versions from official npm registry.

object-glob

Basic utility for searching an object for all keys matching a glob pattern.

Installation

  • yarn add object-glob
  • npm install --save object-glob

Usage

import { objectGlob } from "object-glob";

const obj = {
  root: {
    nested: {
      leaf: "leaf"
    },
    alsoNested: {
      branch: "branch"
    },
    leaf: "keys"
  },
  leaf: "only"
};

const filter = objectGlob(obj);

filter("**/leaf");
// {
//   root: {
//     nested: {
//       leaf: "leaf"
//     },
//     leaf: "keys"
//   },
//   leaf: "only"
// }

Current Tags

  • 0.1.1                                ...           latest (8 months ago)

2 Versions

  • 0.1.1                                ...           8 months ago
  • 0.1.0                                ...           8 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (3)
Dev Dependencies (13)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |