Для сравнения была поставлена задача преобразовать входные данные вида:
var data = {
caption: "Cap",
people: [ 'John', 'Malkovich', 'Doe' ]
}
в строку Cap: John, Malkovich, Doe
// Узел содержит значение с маской и связи. Формат узла: | |
{ | |
scope: {block: ?String, elem: ?String}, | |
block: ?String, | |
elems: ?Array<{ | |
scope: {block: ?String, elem: ?String}, | |
elem: ?String, | |
mods: ?Object<String, String[]>, | |
shouldDeps: ?Array, | |
mustDeps: ?Array |
/* $ for i in common.blocks/button2/_theme/button2_theme_*.css; echo $i:; head $i; echo '---'; end */ | |
/* common.blocks/button2/_theme/button2_theme_action.css: */ | |
.button2_theme_action { | |
position: relative; | |
z-index: 0; | |
color: #000; | |
border: none; | |
outline: none; | |
} |
module.exports = { | |
root: true, | |
levels: [ | |
// Ordered array of levels if you need a specific order between levels in library or project | |
{ | |
layer: 'common', // Должен быть уникальным | |
path: 'very-uncommon.blocks', // если сильно хочется (?) | |
fs: { scheme: 'flat', naming: 'secondary' }, | |
naming: 'primary' |
/node_modules | |
/.gitignore |
const path = require('path'); | |
const gulp = require('gulp'); | |
const debug = require('gulp-debug'); | |
const Builder = require('gulp-bem-bundle-builder'); | |
const bundler = require('gulp-bem-bundler-fs'); | |
const postcss = require('gulp-postcss'); | |
const postcssUrl = require('postcss-url'); | |
const autoprefixer = require('autoprefixer'); | |
const csso = require('gulp-csso'); |
parserOptions: | |
ecmaVersion: 6 | |
sourceType: module | |
env: | |
node: true | |
es6: true | |
extends: pedant |
module.exports = function comb(matrix) { | |
return Object.keys(matrix).reduce((res, k) => _fillIn(res, k, matrix[k]), [{}]); | |
/** | |
* Adds all combinations of existing array and incoming variants | |
* @param {Array<Object>} combinations - existing combinations | |
* @param {String} key - new key for items in combinations | |
* @param {Array} values - values for new key | |
* @returns {Array<Object>} - modified | |
*/ |
nodeConfig.addTechs([ | |
[require('enb-define'), { | |
target: '?.fullofconsoles.js', | |
sources: ['?.js'], | |
variables: { | |
ISLDEBUG: '*/!/*' | |
}, | |
sourcemap: true | |
}] | |
]); |
({ | |
block : 'page', | |
title : 'elem-inst-test', | |
styles : [{ elem : 'css', url : 'elem-inst-test.min.css' }], | |
scripts : [{ elem : 'js', url : 'elem-inst-test.min.js' }], | |
content : [ | |
{ | |
block : 'elem-inst-test', | |
js : true, | |
mods : { mod : true }, |