Utilies for parser-cache and compatible parsers.
npm install parser-utils
> Utilies for parser-cache and compatible parsers.
``bash`
npm i parser-utils --save-dev
`js`
var utils = require('parser-utils');
* returns {Array}: Array of keys.
Get the array of keys expected on normalized file objects.
Get an array of keys that should not be on the root of a normalized file object.
* obj {Object}: The object to inspect. props
* {Array}: Array of properties to concat to the output. returns
* {Array}: Array of keys
Example:
`js`
var utils = require('parser-utils');
var file = {a: 'a', b: 'b', path: 'a/b/c.md'};
console.log(utils.diffKeys(file));
//=> ['a', 'b']
* obj {Object}: The object to normalize. props
* {Array}: Any additional properties to include. returns
* {Object}: Normalized object.
Normalize the properties on the given obj.
* obj {Object}: Object with data objects to merge. locals
* {Object}: Optional object of data that should "win" over other data. merge
* {Function}: Function to use for merging data. returns
* {Object}: Object with a single data property.
Return an object composed only of data properties. If a locals objectdata
is supplied, properties in that object will override any properties on the object. If a locals object is defined, and/or if the locals objectlocals
has a nested property, both will be merged with the data property
on the returned object.
Merge nested properties into the root of the given object. Nested properties occur when, for instance, and options object - intended as locals, is also passed with an actual locals property.
* obj {Object}: The object to flatten. key
* {String}: The property to merge onto the root of the object. merge
* {Function}: Function to use for merging data. returns
* {Object}: Object with locals` merged into the root.
Note that this will only merge properties one level deep.
Jon Schlinkert
+ github/jonschlinkert
+ twitter/jonschlinkert
*
_This file was generated by verb-cli on September 01, 2014._