Linux v69820.1blu.de 4.15.0 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
Apache/2.4.58
Server IP : 195.90.215.149 & Your IP : 216.73.217.80
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
share /
nodejs /
@babel /
types /
lib /
clone /
Delete
Unzip
Name
Size
Permission
Date
Action
clone.js
253
B
-rw-r--r--
2024-02-26 08:46
cloneDeep.js
258
B
-rw-r--r--
2024-02-26 08:46
cloneDeepWithoutLoc.js
300
B
-rw-r--r--
2024-02-26 08:46
cloneNode.js
3.03
KB
-rw-r--r--
2024-02-26 08:46
cloneWithoutLoc.js
289
B
-rw-r--r--
2024-02-26 08:46
Save
Rename
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = cloneNode; var _definitions = require("../definitions"); var _generated = require("../validators/generated"); const has = Function.call.bind(Object.prototype.hasOwnProperty); function cloneIfNode(obj, deep, withoutLoc, commentsCache) { if (obj && typeof obj.type === "string") { return cloneNodeInternal(obj, deep, withoutLoc, commentsCache); } return obj; } function cloneIfNodeOrArray(obj, deep, withoutLoc, commentsCache) { if (Array.isArray(obj)) { return obj.map(node => cloneIfNode(node, deep, withoutLoc, commentsCache)); } return cloneIfNode(obj, deep, withoutLoc, commentsCache); } function cloneNode(node, deep = true, withoutLoc = false) { return cloneNodeInternal(node, deep, withoutLoc, new Map()); } function cloneNodeInternal(node, deep = true, withoutLoc = false, commentsCache) { if (!node) return node; const { type } = node; const newNode = { type: node.type }; if ((0, _generated.isIdentifier)(node)) { newNode.name = node.name; if (has(node, "optional") && typeof node.optional === "boolean") { newNode.optional = node.optional; } if (has(node, "typeAnnotation")) { newNode.typeAnnotation = deep ? cloneIfNodeOrArray(node.typeAnnotation, true, withoutLoc, commentsCache) : node.typeAnnotation; } } else if (!has(_definitions.NODE_FIELDS, type)) { throw new Error(`Unknown node type: "${type}"`); } else { for (const field of Object.keys(_definitions.NODE_FIELDS[type])) { if (has(node, field)) { if (deep) { newNode[field] = (0, _generated.isFile)(node) && field === "comments" ? maybeCloneComments(node.comments, deep, withoutLoc, commentsCache) : cloneIfNodeOrArray(node[field], true, withoutLoc, commentsCache); } else { newNode[field] = node[field]; } } } } if (has(node, "loc")) { if (withoutLoc) { newNode.loc = null; } else { newNode.loc = node.loc; } } if (has(node, "leadingComments")) { newNode.leadingComments = maybeCloneComments(node.leadingComments, deep, withoutLoc, commentsCache); } if (has(node, "innerComments")) { newNode.innerComments = maybeCloneComments(node.innerComments, deep, withoutLoc, commentsCache); } if (has(node, "trailingComments")) { newNode.trailingComments = maybeCloneComments(node.trailingComments, deep, withoutLoc, commentsCache); } if (has(node, "extra")) { newNode.extra = Object.assign({}, node.extra); } return newNode; } function maybeCloneComments(comments, deep, withoutLoc, commentsCache) { if (!comments || !deep) { return comments; } return comments.map(comment => { const cache = commentsCache.get(comment); if (cache) return cache; const { type, value, loc } = comment; const ret = { type, value, loc }; if (withoutLoc) { ret.loc = null; } commentsCache.set(comment, ret); return ret; }); } //# sourceMappingURL=cloneNode.js.map