flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
21
VISUALIZACION/node_modules/css-tree/lib/utils/clone.js
generated
vendored
Executable file
21
VISUALIZACION/node_modules/css-tree/lib/utils/clone.js
generated
vendored
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
var List = require('../common/List');
|
||||
|
||||
module.exports = function clone(node) {
|
||||
var result = {};
|
||||
|
||||
for (var key in node) {
|
||||
var value = node[key];
|
||||
|
||||
if (value) {
|
||||
if (Array.isArray(value) || value instanceof List) {
|
||||
value = value.map(clone);
|
||||
} else if (value.constructor === Object) {
|
||||
value = clone(value);
|
||||
}
|
||||
}
|
||||
|
||||
result[key] = value;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue