UNPKG

html-dom-parser

Version:
1 lines 723 B
{"version":3,"file":"utilities.mjs","names":[],"sources":["../../src/server/utilities.ts"],"sourcesContent":["import type { ChildNode } from 'domhandler';\n\nimport type { DOMNode } from '../types';\n\n/**\n * Sets root parent to null.\n *\n * @param nodes - Nodes.\n * @returns - Nodes.\n */\nexport function unsetRootParent(nodes: ChildNode[]): DOMNode[] {\n let index = 0;\n const nodesLength = nodes.length;\n\n for (; index < nodesLength; index++) {\n const node = nodes[index];\n node.parent = null;\n }\n\n return nodes as DOMNode[];\n}\n"],"mappings":";;;;;;;AAUA,SAAgB,gBAAgB,OAA+B;CAC7D,IAAI,QAAQ;CACZ,MAAM,cAAc,MAAM;CAE1B,OAAO,QAAQ,aAAa,SAAS;EACnC,MAAM,OAAO,MAAM;EACnB,KAAK,SAAS;CAChB;CAEA,OAAO;AACT"}