Skip to content

eGavr/depsjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'
}