Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 1.06 KB

README.md

File metadata and controls

34 lines (25 loc) · 1.06 KB

depsjs Build Status Dependency Status devDependency Status

Utility for operations with deps.js entities.

Install

$ npm install depsjs

Usage

var depsjs = require('depsjs');

var first = {mustDeps: {block: 'b1', elem: 'e1'}},
    second = {mustDeps: {block: 'b1', elems: 'e1'}};

depsjs.difference(first, second); // [{mustDeps: {block: 'b1'}}]
depsjs.intersection(first, second); // [{mustDeps: {block: 'b1', elem: 'e1'}}]
depsjs.subtraction(first, second); // []
depsjs.subtraction(second, first); // [{mustDeps: {block: 'b1'}}]

Note! Each method can accept the third argument – a BEM-entity for which given deps.js contents are written:

{
    block: 'b1',
    elem: 'e1',
    modName: 'm1',
    modVal: 'v1'
}