depsjs
v0.2.0
Published
Operations with deps.js entities
Downloads
5
Readme
depsjs
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'
}