@mavogel/cdk-vscode-server 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +4351 -0
- package/API.md +367 -0
- package/CONTRIBUTING.md +59 -0
- package/LICENSE +202 -0
- package/README.md +183 -0
- package/assets/installer/installer.lambda/index.js +112 -0
- package/assets/secret-retriever/secret-retriever.lambda/index.js +57 -0
- package/docs/img/vscode-server-ui-login-min.png +0 -0
- package/docs/img/vscode-server-ui-min.png +0 -0
- package/docs/img/vscode-server.drawio +108 -0
- package/docs/img/vscode-server.drawio-min.png +0 -0
- package/integ-tests/code-server login.html +48 -0
- package/integ-tests/functions/login-handler.ts +63 -0
- package/integ-tests/integ.al2023.ts +69 -0
- package/integ-tests/integ.al2023.ts.snapshot/IntegSetupVSCodeOnAl2023DefaultTestDeployAssert74D8F645.assets.json +32 -0
- package/integ-tests/integ.al2023.ts.snapshot/IntegSetupVSCodeOnAl2023DefaultTestDeployAssert74D8F645.template.json +337 -0
- package/integ-tests/integ.al2023.ts.snapshot/IntegTestStackAl2023.assets.json +110 -0
- package/integ-tests/integ.al2023.ts.snapshot/IntegTestStackAl2023.template.json +2459 -0
- package/integ-tests/integ.al2023.ts.snapshot/asset.23732f3d1982f7fb0da3bd6638a8107337bb767fea165b45eae12000a1dd67ce/index.js +6169 -0
- package/integ-tests/integ.al2023.ts.snapshot/asset.2819175352ad1ce0dae768e83fc328fb70fb5f10b4a8ff0ccbcb791f02b0716d/index.js +1 -0
- package/integ-tests/integ.al2023.ts.snapshot/asset.4dc48ffba382f93077a1e6824599bbd4ceb6f91eb3d9442eca3b85bdb1a20b1e/cfn-response.js +1 -0
- package/integ-tests/integ.al2023.ts.snapshot/asset.4dc48ffba382f93077a1e6824599bbd4ceb6f91eb3d9442eca3b85bdb1a20b1e/consts.js +1 -0
- package/integ-tests/integ.al2023.ts.snapshot/asset.4dc48ffba382f93077a1e6824599bbd4ceb6f91eb3d9442eca3b85bdb1a20b1e/framework.js +3 -0
- package/integ-tests/integ.al2023.ts.snapshot/asset.4dc48ffba382f93077a1e6824599bbd4ceb6f91eb3d9442eca3b85bdb1a20b1e/outbound.js +1 -0
- package/integ-tests/integ.al2023.ts.snapshot/asset.4dc48ffba382f93077a1e6824599bbd4ceb6f91eb3d9442eca3b85bdb1a20b1e/util.js +1 -0
- package/integ-tests/integ.al2023.ts.snapshot/asset.512cf155ada4793b37a885c1aa6d9bb8f534e88bac6f63c69672d4d73df2decf.lambda/index.js +112 -0
- package/integ-tests/integ.al2023.ts.snapshot/asset.781ab0ab74634cdaf61539ab208ab777829ef07097ac21f95b9e15a3b1eedc1b.lambda/index.js +57 -0
- package/integ-tests/integ.al2023.ts.snapshot/asset.c504585dae89ce8e394d7744ccae054318e7d1aff14afb545438d173d51dc97d.bundle/index.js +30572 -0
- package/integ-tests/integ.al2023.ts.snapshot/asset.ce2f3595a340d6c519a65888ef97e3b9b64f053f83608e32cc28162e22d7d99a/index.js +1 -0
- package/integ-tests/integ.al2023.ts.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/__entrypoint__.js +1 -0
- package/integ-tests/integ.al2023.ts.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/index.js +1 -0
- package/integ-tests/integ.al2023.ts.snapshot/cdk.out +1 -0
- package/integ-tests/integ.al2023.ts.snapshot/integ.json +22 -0
- package/integ-tests/integ.al2023.ts.snapshot/manifest.json +510 -0
- package/integ-tests/integ.al2023.ts.snapshot/tree.json +2944 -0
- package/integ-tests/integ.ubuntu.ts +66 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/IntegSetupVSCodeOnUbuntuDefaultTestDeployAssertFF8DF2C5.assets.json +32 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/IntegSetupVSCodeOnUbuntuDefaultTestDeployAssertFF8DF2C5.template.json +337 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/IntegTestStackUbuntu22.assets.json +110 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/IntegTestStackUbuntu22.template.json +2477 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/asset.23732f3d1982f7fb0da3bd6638a8107337bb767fea165b45eae12000a1dd67ce/index.js +6169 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/asset.2819175352ad1ce0dae768e83fc328fb70fb5f10b4a8ff0ccbcb791f02b0716d/index.js +1 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/asset.4dc48ffba382f93077a1e6824599bbd4ceb6f91eb3d9442eca3b85bdb1a20b1e/cfn-response.js +1 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/asset.4dc48ffba382f93077a1e6824599bbd4ceb6f91eb3d9442eca3b85bdb1a20b1e/consts.js +1 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/asset.4dc48ffba382f93077a1e6824599bbd4ceb6f91eb3d9442eca3b85bdb1a20b1e/framework.js +3 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/asset.4dc48ffba382f93077a1e6824599bbd4ceb6f91eb3d9442eca3b85bdb1a20b1e/outbound.js +1 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/asset.4dc48ffba382f93077a1e6824599bbd4ceb6f91eb3d9442eca3b85bdb1a20b1e/util.js +1 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/asset.512cf155ada4793b37a885c1aa6d9bb8f534e88bac6f63c69672d4d73df2decf.lambda/index.js +112 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/asset.781ab0ab74634cdaf61539ab208ab777829ef07097ac21f95b9e15a3b1eedc1b.lambda/index.js +57 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/asset.c504585dae89ce8e394d7744ccae054318e7d1aff14afb545438d173d51dc97d.bundle/index.js +30572 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/asset.ce2f3595a340d6c519a65888ef97e3b9b64f053f83608e32cc28162e22d7d99a/index.js +1 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/__entrypoint__.js +1 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/asset.ee7de53d64cc9d6248fa6aa550f92358f6c907b5efd6f3298aeab1b5e7ea358a/index.js +1 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/cdk.out +1 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/integ.json +22 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/manifest.json +510 -0
- package/integ-tests/integ.ubuntu.ts.snapshot/tree.json +2962 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +18 -0
- package/lib/installer/installer-function.d.ts +13 -0
- package/lib/installer/installer-function.js +23 -0
- package/lib/installer/installer.d.ts +64 -0
- package/lib/installer/installer.js +707 -0
- package/lib/installer/installer.lambda.d.ts +3 -0
- package/lib/installer/installer.lambda.js +94 -0
- package/lib/mappings.d.ts +2 -0
- package/lib/mappings.js +25 -0
- package/lib/prefixlist-retriever/prefixlist-retriever.d.ts +16 -0
- package/lib/prefixlist-retriever/prefixlist-retriever.js +56 -0
- package/lib/secret-retriever/secret-retriever-function.d.ts +13 -0
- package/lib/secret-retriever/secret-retriever-function.js +23 -0
- package/lib/secret-retriever/secret-retriever.d.ts +33 -0
- package/lib/secret-retriever/secret-retriever.js +72 -0
- package/lib/secret-retriever/secret-retriever.lambda.d.ts +2 -0
- package/lib/secret-retriever/secret-retriever.lambda.js +36 -0
- package/lib/vscode-server.d.ts +97 -0
- package/lib/vscode-server.js +417 -0
- package/node_modules/boolbase/README.md +10 -0
- package/node_modules/boolbase/index.js +8 -0
- package/node_modules/boolbase/package.json +23 -0
- package/node_modules/css-select/LICENSE +11 -0
- package/node_modules/css-select/README.md +264 -0
- package/node_modules/css-select/lib/attributes.d.ts +7 -0
- package/node_modules/css-select/lib/attributes.d.ts.map +1 -0
- package/node_modules/css-select/lib/attributes.js +236 -0
- package/node_modules/css-select/lib/attributes.js.map +1 -0
- package/node_modules/css-select/lib/compile.d.ts +13 -0
- package/node_modules/css-select/lib/compile.d.ts.map +1 -0
- package/node_modules/css-select/lib/compile.js +151 -0
- package/node_modules/css-select/lib/compile.js.map +1 -0
- package/node_modules/css-select/lib/esm/attributes.d.ts +7 -0
- package/node_modules/css-select/lib/esm/attributes.d.ts.map +1 -0
- package/node_modules/css-select/lib/esm/attributes.js +222 -0
- package/node_modules/css-select/lib/esm/attributes.js.map +1 -0
- package/node_modules/css-select/lib/esm/compile.d.ts +13 -0
- package/node_modules/css-select/lib/esm/compile.d.ts.map +1 -0
- package/node_modules/css-select/lib/esm/compile.js +115 -0
- package/node_modules/css-select/lib/esm/compile.js.map +1 -0
- package/node_modules/css-select/lib/esm/general.d.ts +3 -0
- package/node_modules/css-select/lib/esm/general.d.ts.map +1 -0
- package/node_modules/css-select/lib/esm/general.js +144 -0
- package/node_modules/css-select/lib/esm/general.js.map +1 -0
- package/node_modules/css-select/lib/esm/index.d.ts +50 -0
- package/node_modules/css-select/lib/esm/index.d.ts.map +1 -0
- package/node_modules/css-select/lib/esm/index.js +115 -0
- package/node_modules/css-select/lib/esm/index.js.map +1 -0
- package/node_modules/css-select/lib/esm/package.json +1 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/aliases.d.ts +5 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/aliases.d.ts.map +1 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/aliases.js +35 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/aliases.js.map +1 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/filters.d.ts +4 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/filters.d.ts.map +1 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/filters.js +143 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/filters.js.map +1 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/index.d.ts +8 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/index.d.ts.map +1 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/index.js +40 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/index.js.map +1 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.d.ts +6 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.d.ts.map +1 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.js +79 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.js.map +1 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/subselects.d.ts +9 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/subselects.d.ts.map +1 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/subselects.js +94 -0
- package/node_modules/css-select/lib/esm/pseudo-selectors/subselects.js.map +1 -0
- package/node_modules/css-select/lib/esm/sort.d.ts +12 -0
- package/node_modules/css-select/lib/esm/sort.d.ts.map +1 -0
- package/node_modules/css-select/lib/esm/sort.js +79 -0
- package/node_modules/css-select/lib/esm/sort.js.map +1 -0
- package/node_modules/css-select/lib/esm/types.d.ts +167 -0
- package/node_modules/css-select/lib/esm/types.d.ts.map +1 -0
- package/node_modules/css-select/lib/esm/types.js +2 -0
- package/node_modules/css-select/lib/esm/types.js.map +1 -0
- package/node_modules/css-select/lib/general.d.ts +3 -0
- package/node_modules/css-select/lib/general.d.ts.map +1 -0
- package/node_modules/css-select/lib/general.js +148 -0
- package/node_modules/css-select/lib/general.js.map +1 -0
- package/node_modules/css-select/lib/index.d.ts +50 -0
- package/node_modules/css-select/lib/index.d.ts.map +1 -0
- package/node_modules/css-select/lib/index.js +154 -0
- package/node_modules/css-select/lib/index.js.map +1 -0
- package/node_modules/css-select/lib/pseudo-selectors/aliases.d.ts +5 -0
- package/node_modules/css-select/lib/pseudo-selectors/aliases.d.ts.map +1 -0
- package/node_modules/css-select/lib/pseudo-selectors/aliases.js +34 -0
- package/node_modules/css-select/lib/pseudo-selectors/aliases.js.map +1 -0
- package/node_modules/css-select/lib/pseudo-selectors/filters.d.ts +4 -0
- package/node_modules/css-select/lib/pseudo-selectors/filters.d.ts.map +1 -0
- package/node_modules/css-select/lib/pseudo-selectors/filters.js +157 -0
- package/node_modules/css-select/lib/pseudo-selectors/filters.js.map +1 -0
- package/node_modules/css-select/lib/pseudo-selectors/index.d.ts +8 -0
- package/node_modules/css-select/lib/pseudo-selectors/index.d.ts.map +1 -0
- package/node_modules/css-select/lib/pseudo-selectors/index.js +46 -0
- package/node_modules/css-select/lib/pseudo-selectors/index.js.map +1 -0
- package/node_modules/css-select/lib/pseudo-selectors/pseudos.d.ts +6 -0
- package/node_modules/css-select/lib/pseudo-selectors/pseudos.d.ts.map +1 -0
- package/node_modules/css-select/lib/pseudo-selectors/pseudos.js +93 -0
- package/node_modules/css-select/lib/pseudo-selectors/pseudos.js.map +1 -0
- package/node_modules/css-select/lib/pseudo-selectors/subselects.d.ts +9 -0
- package/node_modules/css-select/lib/pseudo-selectors/subselects.d.ts.map +1 -0
- package/node_modules/css-select/lib/pseudo-selectors/subselects.js +112 -0
- package/node_modules/css-select/lib/pseudo-selectors/subselects.js.map +1 -0
- package/node_modules/css-select/lib/sort.d.ts +12 -0
- package/node_modules/css-select/lib/sort.d.ts.map +1 -0
- package/node_modules/css-select/lib/sort.js +84 -0
- package/node_modules/css-select/lib/sort.js.map +1 -0
- package/node_modules/css-select/lib/types.d.ts +167 -0
- package/node_modules/css-select/lib/types.d.ts.map +1 -0
- package/node_modules/css-select/lib/types.js +3 -0
- package/node_modules/css-select/lib/types.js.map +1 -0
- package/node_modules/css-select/package.json +81 -0
- package/node_modules/css-what/LICENSE +11 -0
- package/node_modules/css-what/lib/commonjs/index.d.ts +4 -0
- package/node_modules/css-what/lib/commonjs/index.d.ts.map +1 -0
- package/node_modules/css-what/lib/commonjs/index.js +23 -0
- package/node_modules/css-what/lib/commonjs/parse.d.ts +20 -0
- package/node_modules/css-what/lib/commonjs/parse.d.ts.map +1 -0
- package/node_modules/css-what/lib/commonjs/parse.js +425 -0
- package/node_modules/css-what/lib/commonjs/stringify.d.ts +8 -0
- package/node_modules/css-what/lib/commonjs/stringify.d.ts.map +1 -0
- package/node_modules/css-what/lib/commonjs/stringify.js +138 -0
- package/node_modules/css-what/lib/commonjs/types.d.ts +70 -0
- package/node_modules/css-what/lib/commonjs/types.d.ts.map +1 -0
- package/node_modules/css-what/lib/commonjs/types.js +42 -0
- package/node_modules/css-what/lib/es/index.d.ts +4 -0
- package/node_modules/css-what/lib/es/index.d.ts.map +1 -0
- package/node_modules/css-what/lib/es/index.js +3 -0
- package/node_modules/css-what/lib/es/parse.d.ts +20 -0
- package/node_modules/css-what/lib/es/parse.d.ts.map +1 -0
- package/node_modules/css-what/lib/es/parse.js +420 -0
- package/node_modules/css-what/lib/es/stringify.d.ts +8 -0
- package/node_modules/css-what/lib/es/stringify.d.ts.map +1 -0
- package/node_modules/css-what/lib/es/stringify.js +126 -0
- package/node_modules/css-what/lib/es/types.d.ts +70 -0
- package/node_modules/css-what/lib/es/types.d.ts.map +1 -0
- package/node_modules/css-what/lib/es/types.js +39 -0
- package/node_modules/css-what/package.json +59 -0
- package/node_modules/css-what/readme.md +69 -0
- package/node_modules/dom-serializer/LICENSE +11 -0
- package/node_modules/dom-serializer/README.md +109 -0
- package/node_modules/dom-serializer/lib/esm/foreignNames.d.ts +3 -0
- package/node_modules/dom-serializer/lib/esm/foreignNames.d.ts.map +1 -0
- package/node_modules/dom-serializer/lib/esm/foreignNames.js +100 -0
- package/node_modules/dom-serializer/lib/esm/index.d.ts +52 -0
- package/node_modules/dom-serializer/lib/esm/index.d.ts.map +1 -0
- package/node_modules/dom-serializer/lib/esm/index.js +190 -0
- package/node_modules/dom-serializer/lib/esm/package.json +1 -0
- package/node_modules/dom-serializer/lib/foreignNames.d.ts +3 -0
- package/node_modules/dom-serializer/lib/foreignNames.d.ts.map +1 -0
- package/node_modules/dom-serializer/lib/foreignNames.js +103 -0
- package/node_modules/dom-serializer/lib/index.d.ts +52 -0
- package/node_modules/dom-serializer/lib/index.d.ts.map +1 -0
- package/node_modules/dom-serializer/lib/index.js +229 -0
- package/node_modules/dom-serializer/package.json +69 -0
- package/node_modules/domelementtype/LICENSE +11 -0
- package/node_modules/domelementtype/lib/esm/index.d.ts +48 -0
- package/node_modules/domelementtype/lib/esm/index.d.ts.map +1 -0
- package/node_modules/domelementtype/lib/esm/index.js +51 -0
- package/node_modules/domelementtype/lib/esm/package.json +1 -0
- package/node_modules/domelementtype/lib/index.d.ts +48 -0
- package/node_modules/domelementtype/lib/index.d.ts.map +1 -0
- package/node_modules/domelementtype/lib/index.js +55 -0
- package/node_modules/domelementtype/package.json +54 -0
- package/node_modules/domelementtype/readme.md +1 -0
- package/node_modules/domhandler/LICENSE +11 -0
- package/node_modules/domhandler/lib/esm/index.d.ts +76 -0
- package/node_modules/domhandler/lib/esm/index.d.ts.map +1 -0
- package/node_modules/domhandler/lib/esm/index.js +146 -0
- package/node_modules/domhandler/lib/esm/node.d.ts +245 -0
- package/node_modules/domhandler/lib/esm/node.d.ts.map +1 -0
- package/node_modules/domhandler/lib/esm/node.js +338 -0
- package/node_modules/domhandler/lib/esm/package.json +1 -0
- package/node_modules/domhandler/lib/index.d.ts +76 -0
- package/node_modules/domhandler/lib/index.d.ts.map +1 -0
- package/node_modules/domhandler/lib/index.js +165 -0
- package/node_modules/domhandler/lib/node.d.ts +245 -0
- package/node_modules/domhandler/lib/node.d.ts.map +1 -0
- package/node_modules/domhandler/lib/node.js +474 -0
- package/node_modules/domhandler/package.json +73 -0
- package/node_modules/domhandler/readme.md +92 -0
- package/node_modules/domutils/LICENSE +11 -0
- package/node_modules/domutils/lib/esm/feeds.d.ts +71 -0
- package/node_modules/domutils/lib/esm/feeds.d.ts.map +1 -0
- package/node_modules/domutils/lib/esm/feeds.js +183 -0
- package/node_modules/domutils/lib/esm/feeds.js.map +1 -0
- package/node_modules/domutils/lib/esm/helpers.d.ts +59 -0
- package/node_modules/domutils/lib/esm/helpers.d.ts.map +1 -0
- package/node_modules/domutils/lib/esm/helpers.js +136 -0
- package/node_modules/domutils/lib/esm/helpers.js.map +1 -0
- package/node_modules/domutils/lib/esm/index.d.ts +10 -0
- package/node_modules/domutils/lib/esm/index.d.ts.map +1 -0
- package/node_modules/domutils/lib/esm/index.js +10 -0
- package/node_modules/domutils/lib/esm/index.js.map +1 -0
- package/node_modules/domutils/lib/esm/legacy.d.ts +79 -0
- package/node_modules/domutils/lib/esm/legacy.d.ts.map +1 -0
- package/node_modules/domutils/lib/esm/legacy.js +152 -0
- package/node_modules/domutils/lib/esm/legacy.js.map +1 -0
- package/node_modules/domutils/lib/esm/manipulation.d.ts +49 -0
- package/node_modules/domutils/lib/esm/manipulation.d.ts.map +1 -0
- package/node_modules/domutils/lib/esm/manipulation.js +134 -0
- package/node_modules/domutils/lib/esm/manipulation.js.map +1 -0
- package/node_modules/domutils/lib/esm/package.json +1 -0
- package/node_modules/domutils/lib/esm/querying.d.ts +64 -0
- package/node_modules/domutils/lib/esm/querying.d.ts.map +1 -0
- package/node_modules/domutils/lib/esm/querying.js +142 -0
- package/node_modules/domutils/lib/esm/querying.js.map +1 -0
- package/node_modules/domutils/lib/esm/stringify.d.ts +46 -0
- package/node_modules/domutils/lib/esm/stringify.d.ts.map +1 -0
- package/node_modules/domutils/lib/esm/stringify.js +81 -0
- package/node_modules/domutils/lib/esm/stringify.js.map +1 -0
- package/node_modules/domutils/lib/esm/traversal.d.ts +67 -0
- package/node_modules/domutils/lib/esm/traversal.d.ts.map +1 -0
- package/node_modules/domutils/lib/esm/traversal.js +112 -0
- package/node_modules/domutils/lib/esm/traversal.js.map +1 -0
- package/node_modules/domutils/lib/feeds.d.ts +71 -0
- package/node_modules/domutils/lib/feeds.d.ts.map +1 -0
- package/node_modules/domutils/lib/feeds.js +190 -0
- package/node_modules/domutils/lib/feeds.js.map +1 -0
- package/node_modules/domutils/lib/helpers.d.ts +59 -0
- package/node_modules/domutils/lib/helpers.d.ts.map +1 -0
- package/node_modules/domutils/lib/helpers.js +142 -0
- package/node_modules/domutils/lib/helpers.js.map +1 -0
- package/node_modules/domutils/lib/index.d.ts +10 -0
- package/node_modules/domutils/lib/index.d.ts.map +1 -0
- package/node_modules/domutils/lib/index.js +33 -0
- package/node_modules/domutils/lib/index.js.map +1 -0
- package/node_modules/domutils/lib/legacy.d.ts +79 -0
- package/node_modules/domutils/lib/legacy.d.ts.map +1 -0
- package/node_modules/domutils/lib/legacy.js +168 -0
- package/node_modules/domutils/lib/legacy.js.map +1 -0
- package/node_modules/domutils/lib/manipulation.d.ts +49 -0
- package/node_modules/domutils/lib/manipulation.d.ts.map +1 -0
- package/node_modules/domutils/lib/manipulation.js +142 -0
- package/node_modules/domutils/lib/manipulation.js.map +1 -0
- package/node_modules/domutils/lib/querying.d.ts +64 -0
- package/node_modules/domutils/lib/querying.d.ts.map +1 -0
- package/node_modules/domutils/lib/querying.js +155 -0
- package/node_modules/domutils/lib/querying.js.map +1 -0
- package/node_modules/domutils/lib/stringify.d.ts +46 -0
- package/node_modules/domutils/lib/stringify.d.ts.map +1 -0
- package/node_modules/domutils/lib/stringify.js +91 -0
- package/node_modules/domutils/lib/stringify.js.map +1 -0
- package/node_modules/domutils/lib/traversal.d.ts +67 -0
- package/node_modules/domutils/lib/traversal.d.ts.map +1 -0
- package/node_modules/domutils/lib/traversal.js +125 -0
- package/node_modules/domutils/lib/traversal.js.map +1 -0
- package/node_modules/domutils/package.json +79 -0
- package/node_modules/domutils/readme.md +31 -0
- package/node_modules/entities/LICENSE +11 -0
- package/node_modules/entities/lib/decode.d.ts +211 -0
- package/node_modules/entities/lib/decode.d.ts.map +1 -0
- package/node_modules/entities/lib/decode.js +536 -0
- package/node_modules/entities/lib/decode.js.map +1 -0
- package/node_modules/entities/lib/decode_codepoint.d.ts +19 -0
- package/node_modules/entities/lib/decode_codepoint.d.ts.map +1 -0
- package/node_modules/entities/lib/decode_codepoint.js +76 -0
- package/node_modules/entities/lib/decode_codepoint.js.map +1 -0
- package/node_modules/entities/lib/encode.d.ts +22 -0
- package/node_modules/entities/lib/encode.d.ts.map +1 -0
- package/node_modules/entities/lib/encode.js +77 -0
- package/node_modules/entities/lib/encode.js.map +1 -0
- package/node_modules/entities/lib/escape.d.ts +43 -0
- package/node_modules/entities/lib/escape.d.ts.map +1 -0
- package/node_modules/entities/lib/escape.js +122 -0
- package/node_modules/entities/lib/escape.js.map +1 -0
- package/node_modules/entities/lib/esm/decode.d.ts +211 -0
- package/node_modules/entities/lib/esm/decode.d.ts.map +1 -0
- package/node_modules/entities/lib/esm/decode.js +496 -0
- package/node_modules/entities/lib/esm/decode.js.map +1 -0
- package/node_modules/entities/lib/esm/decode_codepoint.d.ts +19 -0
- package/node_modules/entities/lib/esm/decode_codepoint.d.ts.map +1 -0
- package/node_modules/entities/lib/esm/decode_codepoint.js +71 -0
- package/node_modules/entities/lib/esm/decode_codepoint.js.map +1 -0
- package/node_modules/entities/lib/esm/encode.d.ts +22 -0
- package/node_modules/entities/lib/esm/encode.d.ts.map +1 -0
- package/node_modules/entities/lib/esm/encode.js +69 -0
- package/node_modules/entities/lib/esm/encode.js.map +1 -0
- package/node_modules/entities/lib/esm/escape.d.ts +43 -0
- package/node_modules/entities/lib/esm/escape.d.ts.map +1 -0
- package/node_modules/entities/lib/esm/escape.js +116 -0
- package/node_modules/entities/lib/esm/escape.js.map +1 -0
- package/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +3 -0
- package/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map +1 -0
- package/node_modules/entities/lib/esm/generated/decode-data-html.js +7 -0
- package/node_modules/entities/lib/esm/generated/decode-data-html.js.map +1 -0
- package/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +3 -0
- package/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map +1 -0
- package/node_modules/entities/lib/esm/generated/decode-data-xml.js +7 -0
- package/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +1 -0
- package/node_modules/entities/lib/esm/generated/encode-html.d.ts +8 -0
- package/node_modules/entities/lib/esm/generated/encode-html.d.ts.map +1 -0
- package/node_modules/entities/lib/esm/generated/encode-html.js +10 -0
- package/node_modules/entities/lib/esm/generated/encode-html.js.map +1 -0
- package/node_modules/entities/lib/esm/index.d.ts +96 -0
- package/node_modules/entities/lib/esm/index.d.ts.map +1 -0
- package/node_modules/entities/lib/esm/index.js +99 -0
- package/node_modules/entities/lib/esm/index.js.map +1 -0
- package/node_modules/entities/lib/esm/package.json +1 -0
- package/node_modules/entities/lib/generated/decode-data-html.d.ts +3 -0
- package/node_modules/entities/lib/generated/decode-data-html.d.ts.map +1 -0
- package/node_modules/entities/lib/generated/decode-data-html.js +9 -0
- package/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
- package/node_modules/entities/lib/generated/decode-data-xml.d.ts +3 -0
- package/node_modules/entities/lib/generated/decode-data-xml.d.ts.map +1 -0
- package/node_modules/entities/lib/generated/decode-data-xml.js +9 -0
- package/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
- package/node_modules/entities/lib/generated/encode-html.d.ts +8 -0
- package/node_modules/entities/lib/generated/encode-html.d.ts.map +1 -0
- package/node_modules/entities/lib/generated/encode-html.js +12 -0
- package/node_modules/entities/lib/generated/encode-html.js.map +1 -0
- package/node_modules/entities/lib/index.d.ts +96 -0
- package/node_modules/entities/lib/index.d.ts.map +1 -0
- package/node_modules/entities/lib/index.js +126 -0
- package/node_modules/entities/lib/index.js.map +1 -0
- package/node_modules/entities/package.json +90 -0
- package/node_modules/entities/readme.md +122 -0
- package/node_modules/he/LICENSE-MIT.txt +20 -0
- package/node_modules/he/README.md +379 -0
- package/node_modules/he/bin/he +148 -0
- package/node_modules/he/he.js +345 -0
- package/node_modules/he/man/he.1 +78 -0
- package/node_modules/he/package.json +58 -0
- package/node_modules/node-html-parser/CHANGELOG.md +137 -0
- package/node_modules/node-html-parser/LICENSE +7 -0
- package/node_modules/node-html-parser/README.md +365 -0
- package/node_modules/node-html-parser/dist/back.d.ts +1 -0
- package/node_modules/node-html-parser/dist/back.js +6 -0
- package/node_modules/node-html-parser/dist/index.d.ts +20 -0
- package/node_modules/node-html-parser/dist/index.js +32 -0
- package/node_modules/node-html-parser/dist/main.js +1646 -0
- package/node_modules/node-html-parser/dist/matcher.d.ts +6 -0
- package/node_modules/node-html-parser/dist/matcher.js +106 -0
- package/node_modules/node-html-parser/dist/nodes/comment.d.ts +20 -0
- package/node_modules/node-html-parser/dist/nodes/comment.js +57 -0
- package/node_modules/node-html-parser/dist/nodes/html.d.ts +240 -0
- package/node_modules/node-html-parser/dist/nodes/html.js +1218 -0
- package/node_modules/node-html-parser/dist/nodes/node.d.ts +24 -0
- package/node_modules/node-html-parser/dist/nodes/node.js +52 -0
- package/node_modules/node-html-parser/dist/nodes/text.d.ts +44 -0
- package/node_modules/node-html-parser/dist/nodes/text.js +144 -0
- package/node_modules/node-html-parser/dist/nodes/type.d.ts +6 -0
- package/node_modules/node-html-parser/dist/nodes/type.js +9 -0
- package/node_modules/node-html-parser/dist/parse.d.ts +1 -0
- package/node_modules/node-html-parser/dist/parse.js +5 -0
- package/node_modules/node-html-parser/dist/valid.d.ts +6 -0
- package/node_modules/node-html-parser/dist/valid.js +13 -0
- package/node_modules/node-html-parser/dist/void-tag.d.ts +7 -0
- package/node_modules/node-html-parser/dist/void-tag.js +29 -0
- package/node_modules/node-html-parser/package.json +114 -0
- package/node_modules/nth-check/LICENSE +11 -0
- package/node_modules/nth-check/README.md +136 -0
- package/node_modules/nth-check/lib/compile.d.ts +55 -0
- package/node_modules/nth-check/lib/compile.d.ts.map +1 -0
- package/node_modules/nth-check/lib/compile.js +121 -0
- package/node_modules/nth-check/lib/compile.js.map +1 -0
- package/node_modules/nth-check/lib/esm/compile.d.ts +55 -0
- package/node_modules/nth-check/lib/esm/compile.d.ts.map +1 -0
- package/node_modules/nth-check/lib/esm/compile.js +113 -0
- package/node_modules/nth-check/lib/esm/compile.js.map +1 -0
- package/node_modules/nth-check/lib/esm/index.d.ts +59 -0
- package/node_modules/nth-check/lib/esm/index.d.ts.map +1 -0
- package/node_modules/nth-check/lib/esm/index.js +63 -0
- package/node_modules/nth-check/lib/esm/index.js.map +1 -0
- package/node_modules/nth-check/lib/esm/package.json +1 -0
- package/node_modules/nth-check/lib/esm/parse.d.ts +9 -0
- package/node_modules/nth-check/lib/esm/parse.d.ts.map +1 -0
- package/node_modules/nth-check/lib/esm/parse.js +73 -0
- package/node_modules/nth-check/lib/esm/parse.js.map +1 -0
- package/node_modules/nth-check/lib/index.d.ts +59 -0
- package/node_modules/nth-check/lib/index.d.ts.map +1 -0
- package/node_modules/nth-check/lib/index.js +70 -0
- package/node_modules/nth-check/lib/index.js.map +1 -0
- package/node_modules/nth-check/lib/parse.d.ts +9 -0
- package/node_modules/nth-check/lib/parse.d.ts.map +1 -0
- package/node_modules/nth-check/lib/parse.js +77 -0
- package/node_modules/nth-check/lib/parse.js.map +1 -0
- package/node_modules/nth-check/package.json +78 -0
- package/package.json +154 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
.Dd April 5, 2016
|
|
2
|
+
.Dt he 1
|
|
3
|
+
.Sh NAME
|
|
4
|
+
.Nm he
|
|
5
|
+
.Nd encode/decode HTML entities just like a browser would
|
|
6
|
+
.Sh SYNOPSIS
|
|
7
|
+
.Nm
|
|
8
|
+
.Op Fl -escape Ar string
|
|
9
|
+
.br
|
|
10
|
+
.Op Fl -encode Ar string
|
|
11
|
+
.br
|
|
12
|
+
.Op Fl -encode Fl -use-named-refs Fl -everything Fl -allow-unsafe Ar string
|
|
13
|
+
.br
|
|
14
|
+
.Op Fl -decode Ar string
|
|
15
|
+
.br
|
|
16
|
+
.Op Fl -decode Fl -attribute Ar string
|
|
17
|
+
.br
|
|
18
|
+
.Op Fl -decode Fl -strict Ar string
|
|
19
|
+
.br
|
|
20
|
+
.Op Fl v | -version
|
|
21
|
+
.br
|
|
22
|
+
.Op Fl h | -help
|
|
23
|
+
.Sh DESCRIPTION
|
|
24
|
+
.Nm
|
|
25
|
+
encodes/decodes HTML entities in strings just like a browser would.
|
|
26
|
+
.Sh OPTIONS
|
|
27
|
+
.Bl -ohang -offset
|
|
28
|
+
.It Sy "--escape"
|
|
29
|
+
Take a string of text and escape it for use in text contexts in XML or HTML documents. Only the following characters are escaped: `&`, `<`, `>`, `"`, and `'`.
|
|
30
|
+
.It Sy "--encode"
|
|
31
|
+
Take a string of text and encode any symbols that aren't printable ASCII symbols and that can be replaced with character references. For example, it would turn `©` into `©`, but it wouldn't turn `+` into `+` since there is no point in doing so. Additionally, it replaces any remaining non-ASCII symbols with a hexadecimal escape sequence (e.g. `𝌆`). The return value of this function is always valid HTML.
|
|
32
|
+
.It Sy "--encode --use-named-refs"
|
|
33
|
+
Enable the use of named character references (like `©`) in the output. If compatibility with older browsers is a concern, don't use this option.
|
|
34
|
+
.It Sy "--encode --everything"
|
|
35
|
+
Encode every symbol in the input string, even safe printable ASCII symbols.
|
|
36
|
+
.It Sy "--encode --allow-unsafe"
|
|
37
|
+
Encode non-ASCII characters only. This leaves unsafe HTML/XML symbols like `&`, `<`, `>`, `"`, and `'` intact.
|
|
38
|
+
.It Sy "--encode --decimal"
|
|
39
|
+
Use decimal digits rather than hexadecimal digits for encoded character references, e.g. output `©` instead of `©`.
|
|
40
|
+
.It Sy "--decode"
|
|
41
|
+
Takes a string of HTML and decode any named and numerical character references in it using the algorithm described in the HTML spec.
|
|
42
|
+
.It Sy "--decode --attribute"
|
|
43
|
+
Parse the input as if it was an HTML attribute value rather than a string in an HTML text content.
|
|
44
|
+
.It Sy "--decode --strict"
|
|
45
|
+
Throw an error if an invalid character reference is encountered.
|
|
46
|
+
.It Sy "-v, --version"
|
|
47
|
+
Print he's version.
|
|
48
|
+
.It Sy "-h, --help"
|
|
49
|
+
Show the help screen.
|
|
50
|
+
.El
|
|
51
|
+
.Sh EXIT STATUS
|
|
52
|
+
The
|
|
53
|
+
.Nm he
|
|
54
|
+
utility exits with one of the following values:
|
|
55
|
+
.Pp
|
|
56
|
+
.Bl -tag -width flag -compact
|
|
57
|
+
.It Li 0
|
|
58
|
+
.Nm
|
|
59
|
+
did what it was instructed to do successfully; either it encoded/decoded the input and printed the result, or it printed the version or usage message.
|
|
60
|
+
.It Li 1
|
|
61
|
+
.Nm
|
|
62
|
+
encountered an error.
|
|
63
|
+
.El
|
|
64
|
+
.Sh EXAMPLES
|
|
65
|
+
.Bl -ohang -offset
|
|
66
|
+
.It Sy "he --escape '<script>alert(1)</script>'"
|
|
67
|
+
Print an escaped version of the given string that is safe for use in HTML text contexts, escaping only `&`, `<`, `>`, `"`, and `'`.
|
|
68
|
+
.It Sy "he --decode '©𝌆'"
|
|
69
|
+
Print the decoded version of the given HTML string.
|
|
70
|
+
.It Sy "echo\ '©𝌆'\ |\ he --decode"
|
|
71
|
+
Print the decoded version of the HTML string that gets piped in.
|
|
72
|
+
.El
|
|
73
|
+
.Sh BUGS
|
|
74
|
+
he's bug tracker is located at <https://github.com/mathiasbynens/he/issues>.
|
|
75
|
+
.Sh AUTHOR
|
|
76
|
+
Mathias Bynens <https://mathiasbynens.be/>
|
|
77
|
+
.Sh WWW
|
|
78
|
+
<https://mths.be/he>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "he",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "A robust HTML entities encoder/decoder with full Unicode support.",
|
|
5
|
+
"homepage": "https://mths.be/he",
|
|
6
|
+
"main": "he.js",
|
|
7
|
+
"bin": "bin/he",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"string",
|
|
10
|
+
"entities",
|
|
11
|
+
"entity",
|
|
12
|
+
"html",
|
|
13
|
+
"encode",
|
|
14
|
+
"decode",
|
|
15
|
+
"unicode"
|
|
16
|
+
],
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": {
|
|
19
|
+
"name": "Mathias Bynens",
|
|
20
|
+
"url": "https://mathiasbynens.be/"
|
|
21
|
+
},
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://github.com/mathiasbynens/he.git"
|
|
25
|
+
},
|
|
26
|
+
"bugs": "https://github.com/mathiasbynens/he/issues",
|
|
27
|
+
"files": [
|
|
28
|
+
"LICENSE-MIT.txt",
|
|
29
|
+
"he.js",
|
|
30
|
+
"bin/",
|
|
31
|
+
"man/"
|
|
32
|
+
],
|
|
33
|
+
"directories": {
|
|
34
|
+
"bin": "bin",
|
|
35
|
+
"man": "man",
|
|
36
|
+
"test": "tests"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"test": "node tests/tests.js",
|
|
40
|
+
"build": "grunt build"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"codecov.io": "^0.1.6",
|
|
44
|
+
"grunt": "^0.4.5",
|
|
45
|
+
"grunt-cli": "^1.3.1",
|
|
46
|
+
"grunt-shell": "^1.1.1",
|
|
47
|
+
"grunt-template": "^0.2.3",
|
|
48
|
+
"istanbul": "^0.4.2",
|
|
49
|
+
"jsesc": "^1.0.0",
|
|
50
|
+
"lodash": "^4.8.2",
|
|
51
|
+
"qunit-extras": "^1.4.5",
|
|
52
|
+
"qunitjs": "~1.11.0",
|
|
53
|
+
"regenerate": "^1.2.1",
|
|
54
|
+
"regexgen": "^1.3.0",
|
|
55
|
+
"requirejs": "^2.1.22",
|
|
56
|
+
"sort-object": "^3.0.2"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
+
|
|
5
|
+
### [6.1.13](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.12...v6.1.13) (2024-03-29)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* add rawTagName [#269](https://github.com/taoqf/node-fast-html-parser/issues/269) [#270](https://github.com/taoqf/node-fast-html-parser/issues/270) ([9ac642d](https://github.com/taoqf/node-fast-html-parser/commit/9ac642d7b6a97c84fd4471b8eaa0bd9debf5e325))
|
|
11
|
+
|
|
12
|
+
### [6.1.12](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.11...v6.1.12) (2023-12-25)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* [#258](https://github.com/taoqf/node-fast-html-parser/issues/258) ([5a6a614](https://github.com/taoqf/node-fast-html-parser/commit/5a6a61489a62264221dde5e8f76a5d35b18d17bd))
|
|
18
|
+
* nullable return types of HTMLElement ([fe83c3e](https://github.com/taoqf/node-fast-html-parser/commit/fe83c3ee405b2fd973a9d46e4b2ff40f68a5471f))
|
|
19
|
+
|
|
20
|
+
### [6.1.11](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.10...v6.1.11) (2023-10-25)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* [#254](https://github.com/taoqf/node-fast-html-parser/issues/254) ([8e4e9e0](https://github.com/taoqf/node-fast-html-parser/commit/8e4e9e0a13796ed9a39ebb930b0ee5e55b578b82))
|
|
26
|
+
* Fixed typo in JSDoc for HTMLElement `structure` method ([3a52ee9](https://github.com/taoqf/node-fast-html-parser/commit/3a52ee97463d8ab1f35ef7c0f08d3696bc38e5c4))
|
|
27
|
+
|
|
28
|
+
### [6.1.10](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.9...v6.1.10) (2023-09-15)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* [#242](https://github.com/taoqf/node-fast-html-parser/issues/242) ([36670f4](https://github.com/taoqf/node-fast-html-parser/commit/36670f4bb15f18b3cdfec0484f67c4cb891f1e79))
|
|
34
|
+
* [#251](https://github.com/taoqf/node-fast-html-parser/issues/251) ([42365de](https://github.com/taoqf/node-fast-html-parser/commit/42365dee6b28da5ab4017508b1ba15be503f001e))
|
|
35
|
+
|
|
36
|
+
### [6.1.9](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.8...v6.1.9) (2023-09-11)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Bug Fixes
|
|
40
|
+
|
|
41
|
+
* [#249](https://github.com/taoqf/node-fast-html-parser/issues/249) ([5a0a795](https://github.com/taoqf/node-fast-html-parser/commit/5a0a79573d51da9eccf6d13647413447eba413b1))
|
|
42
|
+
* test code for issue 249 ([799ee31](https://github.com/taoqf/node-fast-html-parser/commit/799ee31155a0635955b0a85e3d21ec4967223a25))
|
|
43
|
+
|
|
44
|
+
### [6.1.8](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.7...v6.1.8) (2023-09-08)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
* [#248](https://github.com/taoqf/node-fast-html-parser/issues/248) void tag ([01ff9f4](https://github.com/taoqf/node-fast-html-parser/commit/01ff9f41e416d0ef0c47bc40c282d6aeb405e100))
|
|
50
|
+
|
|
51
|
+
### [6.1.7](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.6...v6.1.7) (2023-09-08)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
### Bug Fixes
|
|
55
|
+
|
|
56
|
+
* block text elements [#242](https://github.com/taoqf/node-fast-html-parser/issues/242) ([97e593c](https://github.com/taoqf/node-fast-html-parser/commit/97e593c2bdefbfefd35c2c9ccaef914517d60fe7))
|
|
57
|
+
* docs [#245](https://github.com/taoqf/node-fast-html-parser/issues/245) ([f656c7b](https://github.com/taoqf/node-fast-html-parser/commit/f656c7b2de2a62a9a363f797c6f03a2477e7312e))
|
|
58
|
+
* remove test code ([d3980c5](https://github.com/taoqf/node-fast-html-parser/commit/d3980c5fb7744d6fda4b270619bb581a19a4cb18))
|
|
59
|
+
|
|
60
|
+
### [6.1.6](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.5...v6.1.6) (2023-08-17)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
### Bug Fixes
|
|
64
|
+
|
|
65
|
+
* [#203](https://github.com/taoqf/node-fast-html-parser/issues/203) ([6006c52](https://github.com/taoqf/node-fast-html-parser/commit/6006c52c20e6c3c07405c808c8d81fa78425e794))
|
|
66
|
+
* [#218](https://github.com/taoqf/node-fast-html-parser/issues/218) ([6f6c824](https://github.com/taoqf/node-fast-html-parser/commit/6f6c824df54fa53af47956048b42ea47cd3b53bf))
|
|
67
|
+
* add tests for issue [#242](https://github.com/taoqf/node-fast-html-parser/issues/242) ([7615e27](https://github.com/taoqf/node-fast-html-parser/commit/7615e27e3eea47142beff11101d293c4f93cb6ce))
|
|
68
|
+
* do not decode special chractors [#240](https://github.com/taoqf/node-fast-html-parser/issues/240) ([cdadb13](https://github.com/taoqf/node-fast-html-parser/commit/cdadb132f681ca587d17df991d09ff8d22997f4e))
|
|
69
|
+
* improve constructor types [#230](https://github.com/taoqf/node-fast-html-parser/issues/230) ([24fd055](https://github.com/taoqf/node-fast-html-parser/commit/24fd055913125a964cb5aa61330376274c938035))
|
|
70
|
+
* more change about types [#230](https://github.com/taoqf/node-fast-html-parser/issues/230) ([2852d20](https://github.com/taoqf/node-fast-html-parser/commit/2852d20f865dc18a8dc6727d5b5e586282e7d50d))
|
|
71
|
+
* remove test code ([f0b176e](https://github.com/taoqf/node-fast-html-parser/commit/f0b176eb1ba5b5bc162744a37adcd18d3d64a515))
|
|
72
|
+
|
|
73
|
+
### [6.1.5](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.4...v6.1.5) (2023-02-21)
|
|
74
|
+
|
|
75
|
+
### [6.1.4](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.3...v6.1.4) (2022-11-15)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### Bug Fixes
|
|
79
|
+
|
|
80
|
+
* [#224](https://github.com/taoqf/node-fast-html-parser/issues/224) ([0719bf0](https://github.com/taoqf/node-fast-html-parser/commit/0719bf031c3fec51611f9dff922f46bfe4acb060))
|
|
81
|
+
|
|
82
|
+
### [6.1.3](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.2...v6.1.3) (2022-11-14)
|
|
83
|
+
|
|
84
|
+
### [6.1.2](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.1...v6.1.2) (2022-11-14)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
### Bug Fixes
|
|
88
|
+
|
|
89
|
+
* [#224](https://github.com/taoqf/node-fast-html-parser/issues/224) ([fc367fa](https://github.com/taoqf/node-fast-html-parser/commit/fc367fa294d72794a0dea49edbd986d527a6314b))
|
|
90
|
+
|
|
91
|
+
### [6.1.1](https://github.com/taoqf/node-fast-html-parser/compare/v6.1.0...v6.1.1) (2022-09-24)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
### Bug Fixes
|
|
95
|
+
|
|
96
|
+
* parse comments ([82b68ff](https://github.com/taoqf/node-fast-html-parser/commit/82b68ff9eb944e0c55ca2e0ea13fb714e2004803))
|
|
97
|
+
|
|
98
|
+
## [6.1.0](https://github.com/taoqf/node-fast-html-parser/compare/v6.0.0...v6.1.0) (2022-09-19)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Features
|
|
102
|
+
|
|
103
|
+
* Add docs ([8a38eed](https://github.com/taoqf/node-fast-html-parser/commit/8a38eedab6b20906ee89dea86c4271960afbad2d))
|
|
104
|
+
|
|
105
|
+
## [6.0.0](https://github.com/taoqf/node-fast-html-parser/compare/v5.4.2-0...v6.0.0) (2022-09-08)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
### Bug Fixes
|
|
109
|
+
|
|
110
|
+
* Preserve invalid nested A tags in AST (see [#215](https://github.com/taoqf/node-fast-html-parser/issues/215) for detail) ([374188f](https://github.com/taoqf/node-fast-html-parser/commit/374188f1c6d6c6d0567348b8e8d20957f5a93fb8))
|
|
111
|
+
|
|
112
|
+
### [5.4.2](https://github.com/taoqf/node-fast-html-parser/compare/v5.4.2-0...v5.4.2) (2022-08-30)
|
|
113
|
+
|
|
114
|
+
## [5.1.0](https://github.com/taoqf/node-fast-html-parser/compare/v4.1.5...v5.1.0) (2021-10-28)
|
|
115
|
+
|
|
116
|
+
### Features
|
|
117
|
+
|
|
118
|
+
* Exposed `HTMLElement#rawAttrs` (made public) ([34f1595](https://github.com/taoqf/node-fast-html-parser/commit/34f1595756c0974b6ae7ef5755a615f09e421f32))
|
|
119
|
+
|
|
120
|
+
## [5.0.0](https://github.com/taoqf/node-fast-html-parser/compare/v4.1.5...v5.0.0) (2021-10-10)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
### ⚠ BREAKING CHANGES
|
|
124
|
+
|
|
125
|
+
* Added esm named export support ([0d4b922](https://github.com/taoqf/node-fast-html-parser/commit/0d4b922eefd6210fe802991e464b21b0c69d5f63))
|
|
126
|
+
|
|
127
|
+
### Features
|
|
128
|
+
|
|
129
|
+
* Added esm named export support (closes [#160](https://github.com/taoqf/node-fast-html-parser/issues/160) closes [#139](https://github.com/taoqf/node-fast-html-parser/issues/139)) ([0d4b922](https://github.com/taoqf/node-fast-html-parser/commit/0d4b922eefd6210fe802991e464b21b0c69d5f63))
|
|
130
|
+
* Added HTMLElement#getElementsByTagName ([d462e44](https://github.com/taoqf/node-fast-html-parser/commit/d462e449e7ebb00a5a43fb574133681ad5a62475))
|
|
131
|
+
* Improved parsing performance + matching (closes [#164](https://github.com/taoqf/node-fast-html-parser/issues/164)) ([3c5b8e2](https://github.com/taoqf/node-fast-html-parser/commit/3c5b8e2a9104b01a8ca899a7970507463e42adaf))
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
### Bug Fixes
|
|
135
|
+
|
|
136
|
+
* Add null to return type for HTMLElement#querySelector (closes [#157](https://github.com/taoqf/node-fast-html-parser/issues/157)) ([2b65583](https://github.com/taoqf/node-fast-html-parser/commit/2b655839bd3868c41fb19cae5786ca097565bc7f))
|
|
137
|
+
* blockTextElements incorrectly matching partial tag (detail) (fixes [#156](https://github.com/taoqf/node-fast-html-parser/issues/156) fixes [#124](https://github.com/taoqf/node-fast-html-parser/issues/124)) ([6823349](https://github.com/taoqf/node-fast-html-parser/commit/6823349fdf1809c7484c70d948aa24930ef4983f))
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2019 Tao Qiufeng
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
# Fast HTML Parser [](http://badge.fury.io/js/node-html-parser) [](https://actions-badge.atrox.dev/taoqf/node-html-parser/goto?ref=main)
|
|
2
|
+
|
|
3
|
+
Fast HTML Parser is a _very fast_ HTML parser. Which will generate a simplified
|
|
4
|
+
DOM tree, with element query support.
|
|
5
|
+
|
|
6
|
+
Per the design, it intends to parse massive HTML files in lowest price, thus the
|
|
7
|
+
performance is the top priority. For this reason, some malformatted HTML may not
|
|
8
|
+
be able to parse correctly, but most usual errors are covered (eg. HTML4 style
|
|
9
|
+
no closing `<li>`, `<td>` etc).
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```shell
|
|
14
|
+
npm install --save node-html-parser
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
> Note: when using Fast HTML Parser in a Typescript project the minimum Typescript version supported is `^4.1.2`.
|
|
18
|
+
|
|
19
|
+
## Performance
|
|
20
|
+
|
|
21
|
+
-- 2022-08-10
|
|
22
|
+
|
|
23
|
+
```shell
|
|
24
|
+
html-parser :24.1595 ms/file ± 18.7667
|
|
25
|
+
htmljs-parser :4.72064 ms/file ± 5.67689
|
|
26
|
+
html-dom-parser :2.18055 ms/file ± 2.96136
|
|
27
|
+
html5parser :1.69639 ms/file ± 2.17111
|
|
28
|
+
cheerio :12.2122 ms/file ± 8.10916
|
|
29
|
+
parse5 :6.50626 ms/file ± 4.02352
|
|
30
|
+
htmlparser2 :2.38179 ms/file ± 3.42389
|
|
31
|
+
htmlparser :17.4820 ms/file ± 128.041
|
|
32
|
+
high5 :3.95188 ms/file ± 2.52313
|
|
33
|
+
node-html-parser:2.04288 ms/file ± 1.25203
|
|
34
|
+
node-html-parser (last release):2.00527 ms/file ± 1.21317
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Tested with [htmlparser-benchmark](https://github.com/AndreasMadsen/htmlparser-benchmark).
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
import { parse } from 'node-html-parser';
|
|
43
|
+
|
|
44
|
+
const root = parse('<ul id="list"><li>Hello World</li></ul>');
|
|
45
|
+
|
|
46
|
+
console.log(root.firstChild.structure);
|
|
47
|
+
// ul#list
|
|
48
|
+
// li
|
|
49
|
+
// #text
|
|
50
|
+
|
|
51
|
+
console.log(root.querySelector('#list'));
|
|
52
|
+
// { tagName: 'ul',
|
|
53
|
+
// rawAttrs: 'id="list"',
|
|
54
|
+
// childNodes:
|
|
55
|
+
// [ { tagName: 'li',
|
|
56
|
+
// rawAttrs: '',
|
|
57
|
+
// childNodes: [Object],
|
|
58
|
+
// classNames: [] } ],
|
|
59
|
+
// id: 'list',
|
|
60
|
+
// classNames: [] }
|
|
61
|
+
console.log(root.toString());
|
|
62
|
+
// <ul id="list"><li>Hello World</li></ul>
|
|
63
|
+
root.set_content('<li>Hello World</li>');
|
|
64
|
+
root.toString(); // <li>Hello World</li>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
var HTMLParser = require('node-html-parser');
|
|
69
|
+
|
|
70
|
+
var root = HTMLParser.parse('<ul id="list"><li>Hello World</li></ul>');
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Global Methods
|
|
74
|
+
|
|
75
|
+
### parse(data[, options])
|
|
76
|
+
|
|
77
|
+
Parse the data provided, and return the root of the generated DOM.
|
|
78
|
+
|
|
79
|
+
- **data**, data to parse
|
|
80
|
+
- **options**, parse options
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
{
|
|
84
|
+
lowerCaseTagName: false, // convert tag name to lower case (hurts performance heavily)
|
|
85
|
+
comment: false, // retrieve comments (hurts performance slightly)
|
|
86
|
+
voidTag:{
|
|
87
|
+
tags: ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr'], // optional and case insensitive, default value is ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr']
|
|
88
|
+
closingSlash: true // optional, default false. void tag serialisation, add a final slash <br/>
|
|
89
|
+
},
|
|
90
|
+
blockTextElements: {
|
|
91
|
+
script: true, // keep text content when parsing
|
|
92
|
+
noscript: true, // keep text content when parsing
|
|
93
|
+
style: true, // keep text content when parsing
|
|
94
|
+
pre: true // keep text content when parsing
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### valid(data[, options])
|
|
100
|
+
|
|
101
|
+
Parse the data provided, return true if the given data is valid, and return false if not.
|
|
102
|
+
|
|
103
|
+
## Class
|
|
104
|
+
|
|
105
|
+
```mermaid
|
|
106
|
+
classDiagram
|
|
107
|
+
direction TB
|
|
108
|
+
class HTMLElement{
|
|
109
|
+
this trimRight()
|
|
110
|
+
this removeWhitespace()
|
|
111
|
+
Node[] querySelectorAll(string selector)
|
|
112
|
+
Node querySelector(string selector)
|
|
113
|
+
HTMLElement[] getElementsByTagName(string tagName)
|
|
114
|
+
Node closest(string selector)
|
|
115
|
+
Node appendChild(Node node)
|
|
116
|
+
this insertAdjacentHTML('beforebegin' | 'afterbegin' | 'beforeend' | 'afterend' where, string html)
|
|
117
|
+
this setAttribute(string key, string value)
|
|
118
|
+
this setAttributes(Record string, string attrs)
|
|
119
|
+
this removeAttribute(string key)
|
|
120
|
+
string getAttribute(string key)
|
|
121
|
+
this exchangeChild(Node oldNode, Node newNode)
|
|
122
|
+
this removeChild(Node node)
|
|
123
|
+
string toString()
|
|
124
|
+
this set_content(string content)
|
|
125
|
+
this set_content(Node content)
|
|
126
|
+
this set_content(Node[] content)
|
|
127
|
+
this remove()
|
|
128
|
+
this replaceWith((string | Node)[] ...nodes)
|
|
129
|
+
ClassList classList
|
|
130
|
+
HTMLElement clone()
|
|
131
|
+
HTMLElement getElementById(string id)
|
|
132
|
+
string text
|
|
133
|
+
string rawText
|
|
134
|
+
string tagName
|
|
135
|
+
string structuredText
|
|
136
|
+
string structure
|
|
137
|
+
Node firstChild
|
|
138
|
+
Node lastChild
|
|
139
|
+
Node nextSibling
|
|
140
|
+
HTMLElement nextElementSibling
|
|
141
|
+
Node previousSibling
|
|
142
|
+
HTMLElement previousElementSibling
|
|
143
|
+
string innerHTML
|
|
144
|
+
string outerHTML
|
|
145
|
+
string textContent
|
|
146
|
+
Record<string, string> attributes
|
|
147
|
+
[number, number] range
|
|
148
|
+
}
|
|
149
|
+
class Node{
|
|
150
|
+
<<abstract>>
|
|
151
|
+
string toString()
|
|
152
|
+
Node clone()
|
|
153
|
+
this remove()
|
|
154
|
+
number nodeType
|
|
155
|
+
string innerText
|
|
156
|
+
string textContent
|
|
157
|
+
}
|
|
158
|
+
class ClassList{
|
|
159
|
+
add(string c)
|
|
160
|
+
replace(string c1, string c2)
|
|
161
|
+
remove(string c)
|
|
162
|
+
toggle(string c)
|
|
163
|
+
boolean contains(string c)
|
|
164
|
+
number length
|
|
165
|
+
string[] value
|
|
166
|
+
string toString()
|
|
167
|
+
}
|
|
168
|
+
class CommentNode{
|
|
169
|
+
CommentNode clone()
|
|
170
|
+
string toString()
|
|
171
|
+
}
|
|
172
|
+
class TextNode{
|
|
173
|
+
TextNode clone()
|
|
174
|
+
string toString()
|
|
175
|
+
string rawText
|
|
176
|
+
string trimmedRawText
|
|
177
|
+
string trimmedText
|
|
178
|
+
string text
|
|
179
|
+
boolean isWhitespace
|
|
180
|
+
}
|
|
181
|
+
Node --|> HTMLElement
|
|
182
|
+
Node --|> CommentNode
|
|
183
|
+
Node --|> TextNode
|
|
184
|
+
Node ..> ClassList
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## HTMLElement Methods
|
|
188
|
+
|
|
189
|
+
### trimRight()
|
|
190
|
+
|
|
191
|
+
Trim element from right (in block) after seeing pattern in a TextNode.
|
|
192
|
+
|
|
193
|
+
### removeWhitespace()
|
|
194
|
+
|
|
195
|
+
Remove whitespaces in this sub tree.
|
|
196
|
+
|
|
197
|
+
### querySelectorAll(selector)
|
|
198
|
+
|
|
199
|
+
Query CSS selector to find matching nodes.
|
|
200
|
+
|
|
201
|
+
Note: Full range of CSS3 selectors supported since v3.0.0.
|
|
202
|
+
|
|
203
|
+
### querySelector(selector)
|
|
204
|
+
|
|
205
|
+
Query CSS Selector to find matching node. `null` if not found.
|
|
206
|
+
|
|
207
|
+
### getElementsByTagName(tagName)
|
|
208
|
+
|
|
209
|
+
Get all elements with the specified tagName.
|
|
210
|
+
|
|
211
|
+
Note: Use * for all elements.
|
|
212
|
+
|
|
213
|
+
### closest(selector)
|
|
214
|
+
|
|
215
|
+
Query closest element by css selector. `null` if not found.
|
|
216
|
+
|
|
217
|
+
### appendChild(node)
|
|
218
|
+
|
|
219
|
+
Append a child node to childNodes
|
|
220
|
+
|
|
221
|
+
### insertAdjacentHTML(where, html)
|
|
222
|
+
|
|
223
|
+
Parses the specified text as HTML and inserts the resulting nodes into the DOM tree at a specified position.
|
|
224
|
+
|
|
225
|
+
### setAttribute(key: string, value: string)
|
|
226
|
+
|
|
227
|
+
Set `value` to `key` attribute.
|
|
228
|
+
|
|
229
|
+
### setAttributes(attrs: Record<string, string>)
|
|
230
|
+
|
|
231
|
+
Set attributes of the element.
|
|
232
|
+
|
|
233
|
+
### removeAttribute(key: string)
|
|
234
|
+
|
|
235
|
+
Remove `key` attribute.
|
|
236
|
+
|
|
237
|
+
### getAttribute(key: string)
|
|
238
|
+
|
|
239
|
+
Get `key` attribute. `undefined` if not set.
|
|
240
|
+
|
|
241
|
+
### exchangeChild(oldNode: Node, newNode: Node)
|
|
242
|
+
|
|
243
|
+
Exchanges given child with new child.
|
|
244
|
+
|
|
245
|
+
### removeChild(node: Node)
|
|
246
|
+
|
|
247
|
+
Remove child node.
|
|
248
|
+
|
|
249
|
+
### toString()
|
|
250
|
+
|
|
251
|
+
Same as [outerHTML](#htmlelementouterhtml)
|
|
252
|
+
|
|
253
|
+
### set_content(content: string | Node | Node[])
|
|
254
|
+
|
|
255
|
+
Set content. **Notice**: Do not set content of the **root** node.
|
|
256
|
+
|
|
257
|
+
### remove()
|
|
258
|
+
|
|
259
|
+
Remove current element.
|
|
260
|
+
|
|
261
|
+
### replaceWith(...nodes: (string | Node)[])
|
|
262
|
+
|
|
263
|
+
Replace current element with other node(s).
|
|
264
|
+
|
|
265
|
+
### classList
|
|
266
|
+
|
|
267
|
+
#### classList.add
|
|
268
|
+
|
|
269
|
+
Add class name.
|
|
270
|
+
|
|
271
|
+
#### classList.replace(old: string, new: string)
|
|
272
|
+
|
|
273
|
+
Replace class name with another one.
|
|
274
|
+
|
|
275
|
+
#### classList.remove()
|
|
276
|
+
|
|
277
|
+
Remove class name.
|
|
278
|
+
|
|
279
|
+
#### classList.toggle(className: string):void
|
|
280
|
+
|
|
281
|
+
Toggle class. Remove it if it is already included, otherwise add.
|
|
282
|
+
|
|
283
|
+
#### classList.contains(className: string): boolean
|
|
284
|
+
|
|
285
|
+
Returns true if the classname is already in the classList.
|
|
286
|
+
|
|
287
|
+
#### classList.value
|
|
288
|
+
|
|
289
|
+
Get class names.
|
|
290
|
+
|
|
291
|
+
#### clone()
|
|
292
|
+
|
|
293
|
+
Clone a node.
|
|
294
|
+
|
|
295
|
+
#### getElementById(id: string): HTMLElement | null
|
|
296
|
+
|
|
297
|
+
Get element by it's ID.
|
|
298
|
+
|
|
299
|
+
## HTMLElement Properties
|
|
300
|
+
|
|
301
|
+
### text
|
|
302
|
+
|
|
303
|
+
Get unescaped text value of current node and its children. Like `innerText`.
|
|
304
|
+
(slow for the first time)
|
|
305
|
+
|
|
306
|
+
### rawText
|
|
307
|
+
|
|
308
|
+
Get escaped (as-is) text value of current node and its children. May have
|
|
309
|
+
`&` in it. (fast)
|
|
310
|
+
|
|
311
|
+
### tagName
|
|
312
|
+
|
|
313
|
+
Get or Set tag name of HTMLElement. Notice: the returned value would be an uppercase string.
|
|
314
|
+
|
|
315
|
+
### structuredText
|
|
316
|
+
|
|
317
|
+
Get structured Text.
|
|
318
|
+
|
|
319
|
+
### structure
|
|
320
|
+
|
|
321
|
+
Get DOM structure.
|
|
322
|
+
|
|
323
|
+
### firstChild
|
|
324
|
+
|
|
325
|
+
Get first child node. `undefined` if no child.
|
|
326
|
+
|
|
327
|
+
### lastChild
|
|
328
|
+
|
|
329
|
+
Get last child node. `undefined` if no child
|
|
330
|
+
|
|
331
|
+
### innerHTML
|
|
332
|
+
|
|
333
|
+
Set or Get innerHTML.
|
|
334
|
+
|
|
335
|
+
### outerHTML
|
|
336
|
+
|
|
337
|
+
Get outerHTML.
|
|
338
|
+
|
|
339
|
+
### nextSibling
|
|
340
|
+
|
|
341
|
+
Returns a reference to the next child node of the current element's parent. `null` if not found.
|
|
342
|
+
|
|
343
|
+
### nextElementSibling
|
|
344
|
+
|
|
345
|
+
Returns a reference to the next child element of the current element's parent. `null` if not found.
|
|
346
|
+
|
|
347
|
+
### previousSibling
|
|
348
|
+
|
|
349
|
+
Returns a reference to the previous child node of the current element's parent. `null` if not found.
|
|
350
|
+
|
|
351
|
+
### previousElementSibling
|
|
352
|
+
|
|
353
|
+
Returns a reference to the previous child element of the current element's parent. `null` if not found.
|
|
354
|
+
|
|
355
|
+
### textContent
|
|
356
|
+
|
|
357
|
+
Get or Set textContent of current element, more efficient than [set_content](#htmlelementset_contentcontent-string--node--node).
|
|
358
|
+
|
|
359
|
+
### attributes
|
|
360
|
+
|
|
361
|
+
Get all attributes of current element. **Notice: do not try to change the returned value.**
|
|
362
|
+
|
|
363
|
+
### range
|
|
364
|
+
|
|
365
|
+
Corresponding source code start and end indexes (ie [ 0, 40 ])
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function arr_back<T>(arr: T[]): T;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import CommentNode from './nodes/comment';
|
|
2
|
+
import HTMLElement, { Options } from './nodes/html';
|
|
3
|
+
import Node from './nodes/node';
|
|
4
|
+
import TextNode from './nodes/text';
|
|
5
|
+
import NodeType from './nodes/type';
|
|
6
|
+
import baseParse from './parse';
|
|
7
|
+
import valid from './valid';
|
|
8
|
+
export { Options } from './nodes/html';
|
|
9
|
+
export { parse, HTMLElement, CommentNode, valid, Node, TextNode, NodeType };
|
|
10
|
+
declare function parse(data: string, options?: Partial<Options>): HTMLElement;
|
|
11
|
+
declare namespace parse {
|
|
12
|
+
var parse: typeof baseParse;
|
|
13
|
+
var HTMLElement: typeof import("./nodes/html").default;
|
|
14
|
+
var CommentNode: typeof import("./nodes/comment").default;
|
|
15
|
+
var valid: typeof import("./valid").default;
|
|
16
|
+
var Node: typeof import("./nodes/node").default;
|
|
17
|
+
var TextNode: typeof import("./nodes/text").default;
|
|
18
|
+
var NodeType: typeof import("./nodes/type").default;
|
|
19
|
+
}
|
|
20
|
+
export default parse;
|