flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
19
VISUALIZACION/node_modules/ngraph.forcelayout/lib/codeGenerators/createPatternBuilder.js
generated
vendored
Executable file
19
VISUALIZACION/node_modules/ngraph.forcelayout/lib/codeGenerators/createPatternBuilder.js
generated
vendored
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
const getVariableName = require('./getVariableName');
|
||||
|
||||
module.exports = function createPatternBuilder(dimension) {
|
||||
|
||||
return pattern;
|
||||
|
||||
function pattern(template, config) {
|
||||
let indent = (config && config.indent) || 0;
|
||||
let join = (config && config.join !== undefined) ? config.join : '\n';
|
||||
let indentString = Array(indent + 1).join(' ');
|
||||
let buffer = [];
|
||||
for (let i = 0; i < dimension; ++i) {
|
||||
let variableName = getVariableName(i);
|
||||
let prefix = (i === 0) ? '' : indentString;
|
||||
buffer.push(prefix + template.replace(/{var}/g, variableName));
|
||||
}
|
||||
return buffer.join(join);
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue