0.1.2 • Published 9 years ago

ensure-keys v0.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

ensure-keys

build status NPM version

ensure a json has specific keys

Installation

This module is installed via npm:

$ npm install ensure-keys --save

Example Usage

var ensureKeys = require('ensure-keys');

var json = {
  name: 'bigruan',
  age: 12,
  child: {
    name: 'yulong',
    age: 1
  }
}
// return the keys that not exists or has value: undefined, null and ''
ensureKeys(json, ['name', 'job', 'child.name']); // -> ['job']
0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.1

9 years ago