@zowe/cli 8.36.0 → 8.37.0
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/lib/daemon/DaemonClient.d.ts.map +1 -1
- package/lib/daemon/DaemonClient.js +3 -0
- package/lib/daemon/DaemonClient.js.map +1 -1
- package/lib/zosfiles/-strings-/en.d.ts +2 -0
- package/lib/zosfiles/-strings-/en.d.ts.map +1 -1
- package/lib/zosfiles/-strings-/en.js +5 -1
- package/lib/zosfiles/-strings-/en.js.map +1 -1
- package/lib/zosfiles/ZosFiles.options.d.ts.map +1 -1
- package/lib/zosfiles/ZosFiles.options.js +3 -1
- package/lib/zosfiles/ZosFiles.options.js.map +1 -1
- package/lib/zosfiles/create/Create.utils.d.ts.map +1 -1
- package/lib/zosfiles/create/Create.utils.js +3 -1
- package/lib/zosfiles/create/Create.utils.js.map +1 -1
- package/lib/zosfiles/create/ussDir/ussDir.handler.d.ts.map +1 -1
- package/lib/zosfiles/create/ussDir/ussDir.handler.js +5 -1
- package/lib/zosfiles/create/ussDir/ussDir.handler.js.map +1 -1
- package/lib/zosfiles/create/ussFile/ussFile.handler.d.ts.map +1 -1
- package/lib/zosfiles/create/ussFile/ussFile.handler.js +5 -1
- package/lib/zosfiles/create/ussFile/ussFile.handler.js.map +1 -1
- package/lib/zosfiles/create/vsam/vsam.handler.d.ts.map +1 -1
- package/lib/zosfiles/create/vsam/vsam.handler.js +3 -1
- package/lib/zosfiles/create/vsam/vsam.handler.js.map +1 -1
- package/lib/zosfiles/create/zfs/zfs.handler.d.ts.map +1 -1
- package/lib/zosfiles/create/zfs/zfs.handler.js +3 -1
- package/lib/zosfiles/create/zfs/zfs.handler.js.map +1 -1
- package/lib/zosfiles/delete/ds/Ds.handler.d.ts.map +1 -1
- package/lib/zosfiles/delete/ds/Ds.handler.js +4 -1
- package/lib/zosfiles/delete/ds/Ds.handler.js.map +1 -1
- package/lib/zosfiles/delete/uss/Uss.handler.d.ts.map +1 -1
- package/lib/zosfiles/delete/uss/Uss.handler.js +5 -1
- package/lib/zosfiles/delete/uss/Uss.handler.js.map +1 -1
- package/lib/zosfiles/delete/vsam/Vsam.handler.d.ts.map +1 -1
- package/lib/zosfiles/delete/vsam/Vsam.handler.js +3 -1
- package/lib/zosfiles/delete/vsam/Vsam.handler.js.map +1 -1
- package/lib/zosfiles/delete/zfs/zfs.handler.d.ts.map +1 -1
- package/lib/zosfiles/delete/zfs/zfs.handler.js +3 -1
- package/lib/zosfiles/delete/zfs/zfs.handler.js.map +1 -1
- package/lib/zosfiles/download/am/AllMembers.handler.d.ts.map +1 -1
- package/lib/zosfiles/download/am/AllMembers.handler.js +3 -1
- package/lib/zosfiles/download/am/AllMembers.handler.js.map +1 -1
- package/lib/zosfiles/download/amm/AllMembersMatching.handler.d.ts.map +1 -1
- package/lib/zosfiles/download/amm/AllMembersMatching.handler.js +2 -0
- package/lib/zosfiles/download/amm/AllMembersMatching.handler.js.map +1 -1
- package/lib/zosfiles/download/ds/Dataset.handler.d.ts.map +1 -1
- package/lib/zosfiles/download/ds/Dataset.handler.js +3 -1
- package/lib/zosfiles/download/ds/Dataset.handler.js.map +1 -1
- package/lib/zosfiles/download/dsm/DataSetMatching.handler.d.ts.map +1 -1
- package/lib/zosfiles/download/dsm/DataSetMatching.handler.js +6 -2
- package/lib/zosfiles/download/dsm/DataSetMatching.handler.js.map +1 -1
- package/lib/zosfiles/download/uss/UssFile.handler.d.ts.map +1 -1
- package/lib/zosfiles/download/uss/UssFile.handler.js +2 -0
- package/lib/zosfiles/download/uss/UssFile.handler.js.map +1 -1
- package/lib/zosfiles/download/ussdir/UssDir.handler.d.ts.map +1 -1
- package/lib/zosfiles/download/ussdir/UssDir.handler.js +6 -2
- package/lib/zosfiles/download/ussdir/UssDir.handler.js.map +1 -1
- package/lib/zosfiles/edit/Edit.utils.d.ts +2 -2
- package/lib/zosfiles/edit/Edit.utils.d.ts.map +1 -1
- package/lib/zosfiles/edit/Edit.utils.js +10 -10
- package/lib/zosfiles/edit/Edit.utils.js.map +1 -1
- package/lib/zosfiles/invoke/amsFile/AmsFile.handler.d.ts.map +1 -1
- package/lib/zosfiles/invoke/amsFile/AmsFile.handler.js +5 -1
- package/lib/zosfiles/invoke/amsFile/AmsFile.handler.js.map +1 -1
- package/lib/zosfiles/invoke/amsStatements/AmsStatements.handler.d.ts.map +1 -1
- package/lib/zosfiles/invoke/amsStatements/AmsStatements.handler.js +5 -1
- package/lib/zosfiles/invoke/amsStatements/AmsStatements.handler.js.map +1 -1
- package/lib/zosfiles/list/alias/Alias.handler.d.ts.map +1 -1
- package/lib/zosfiles/list/alias/Alias.handler.js +3 -1
- package/lib/zosfiles/list/alias/Alias.handler.js.map +1 -1
- package/lib/zosfiles/list/am/AllMembers.handler.d.ts.map +1 -1
- package/lib/zosfiles/list/am/AllMembers.handler.js +3 -1
- package/lib/zosfiles/list/am/AllMembers.handler.js.map +1 -1
- package/lib/zosfiles/list/ds/DataSet.handler.d.ts.map +1 -1
- package/lib/zosfiles/list/ds/DataSet.handler.js +3 -1
- package/lib/zosfiles/list/ds/DataSet.handler.js.map +1 -1
- package/lib/zosfiles/list/fs/Fs.handler.d.ts.map +1 -1
- package/lib/zosfiles/list/fs/Fs.handler.js +6 -2
- package/lib/zosfiles/list/fs/Fs.handler.js.map +1 -1
- package/lib/zosfiles/list/uss/UssFile.handler.d.ts.map +1 -1
- package/lib/zosfiles/list/uss/UssFile.handler.js +3 -1
- package/lib/zosfiles/list/uss/UssFile.handler.js.map +1 -1
- package/lib/zosfiles/mount/fs/fs.handler.d.ts.map +1 -1
- package/lib/zosfiles/mount/fs/fs.handler.js +3 -1
- package/lib/zosfiles/mount/fs/fs.handler.js.map +1 -1
- package/lib/zosfiles/rename/ds/Ds.handler.d.ts.map +1 -1
- package/lib/zosfiles/rename/ds/Ds.handler.js +4 -1
- package/lib/zosfiles/rename/ds/Ds.handler.js.map +1 -1
- package/lib/zosfiles/rename/dsm/Dsm.handler.d.ts.map +1 -1
- package/lib/zosfiles/rename/dsm/Dsm.handler.js +4 -1
- package/lib/zosfiles/rename/dsm/Dsm.handler.js.map +1 -1
- package/lib/zosfiles/search/ds/DataSets.handler.d.ts.map +1 -1
- package/lib/zosfiles/search/ds/DataSets.handler.js +10 -2
- package/lib/zosfiles/search/ds/DataSets.handler.js.map +1 -1
- package/lib/zosfiles/upload/dtp/DirToPds.handler.d.ts.map +1 -1
- package/lib/zosfiles/upload/dtp/DirToPds.handler.js +3 -1
- package/lib/zosfiles/upload/dtp/DirToPds.handler.js.map +1 -1
- package/lib/zosfiles/upload/dtu/DirToUSSDir.handler.d.ts.map +1 -1
- package/lib/zosfiles/upload/dtu/DirToUSSDir.handler.js +3 -1
- package/lib/zosfiles/upload/dtu/DirToUSSDir.handler.js.map +1 -1
- package/lib/zosfiles/upload/ftds/FileToDataSet.handler.d.ts.map +1 -1
- package/lib/zosfiles/upload/ftds/FileToDataSet.handler.js +3 -1
- package/lib/zosfiles/upload/ftds/FileToDataSet.handler.js.map +1 -1
- package/lib/zosfiles/upload/ftu/FileToUSS.handler.d.ts.map +1 -1
- package/lib/zosfiles/upload/ftu/FileToUSS.handler.js +3 -1
- package/lib/zosfiles/upload/ftu/FileToUSS.handler.js.map +1 -1
- package/lib/zosfiles/upload/stds/StdinToDataSet.handler.d.ts.map +1 -1
- package/lib/zosfiles/upload/stds/StdinToDataSet.handler.js +3 -1
- package/lib/zosfiles/upload/stds/StdinToDataSet.handler.js.map +1 -1
- package/lib/zosfiles/view/ds/Dataset.handler.d.ts.map +1 -1
- package/lib/zosfiles/view/ds/Dataset.handler.js +3 -1
- package/lib/zosfiles/view/ds/Dataset.handler.js.map +1 -1
- package/lib/zosfiles/view/uss/USSFile.handler.d.ts.map +1 -1
- package/lib/zosfiles/view/uss/USSFile.handler.js +3 -1
- package/lib/zosfiles/view/uss/USSFile.handler.js.map +1 -1
- package/node_modules/@zowe/core-for-zowe-sdk/lib/rest/ZosmfHeaders.d.ts +14 -0
- package/node_modules/@zowe/core-for-zowe-sdk/lib/rest/ZosmfHeaders.d.ts.map +1 -1
- package/node_modules/@zowe/core-for-zowe-sdk/lib/rest/ZosmfHeaders.js +14 -0
- package/node_modules/@zowe/core-for-zowe-sdk/lib/rest/ZosmfHeaders.js.map +1 -1
- package/node_modules/@zowe/core-for-zowe-sdk/package.json +3 -3
- package/node_modules/@zowe/imperative/lib/config/src/ConfigSchema.d.ts.map +1 -1
- package/node_modules/@zowe/imperative/lib/config/src/ConfigSchema.js +1 -0
- package/node_modules/@zowe/imperative/lib/config/src/ConfigSchema.js.map +1 -1
- package/node_modules/@zowe/imperative/lib/logger/src/LoggerConfigBuilder.d.ts +1 -0
- package/node_modules/@zowe/imperative/lib/logger/src/LoggerConfigBuilder.d.ts.map +1 -1
- package/node_modules/@zowe/imperative/lib/logger/src/LoggerConfigBuilder.js +2 -0
- package/node_modules/@zowe/imperative/lib/logger/src/LoggerConfigBuilder.js.map +1 -1
- package/node_modules/@zowe/imperative/lib/logger/src/log4jsToWinston.d.ts +1 -0
- package/node_modules/@zowe/imperative/lib/logger/src/log4jsToWinston.d.ts.map +1 -1
- package/node_modules/@zowe/imperative/lib/logger/src/log4jsToWinston.js +11 -3
- package/node_modules/@zowe/imperative/lib/logger/src/log4jsToWinston.js.map +1 -1
- package/node_modules/@zowe/imperative/lib/utilities/src/TextUtils.d.ts.map +1 -1
- package/node_modules/@zowe/imperative/lib/utilities/src/TextUtils.js +25 -0
- package/node_modules/@zowe/imperative/lib/utilities/src/TextUtils.js.map +1 -1
- package/node_modules/@zowe/imperative/package.json +3 -3
- package/node_modules/@zowe/imperative/web-help/package-lock.json +62 -62
- package/node_modules/@zowe/provisioning-for-zowe-sdk/package.json +4 -4
- package/node_modules/@zowe/secrets-for-zowe-sdk/README.md +70 -0
- package/node_modules/@zowe/secrets-for-zowe-sdk/package.json +1 -1
- package/node_modules/@zowe/secrets-for-zowe-sdk/prebuilds/keyring.darwin-arm64.node +0 -0
- package/node_modules/@zowe/secrets-for-zowe-sdk/prebuilds/keyring.darwin-x64.node +0 -0
- package/node_modules/@zowe/secrets-for-zowe-sdk/prebuilds/keyring.linux-arm-gnueabihf.node +0 -0
- package/node_modules/@zowe/secrets-for-zowe-sdk/prebuilds/keyring.linux-arm64-gnu.node +0 -0
- package/node_modules/@zowe/secrets-for-zowe-sdk/prebuilds/keyring.linux-ia32-gnu.node +0 -0
- package/node_modules/@zowe/secrets-for-zowe-sdk/prebuilds/keyring.linux-x64-gnu.node +0 -0
- package/node_modules/@zowe/secrets-for-zowe-sdk/prebuilds/keyring.win32-arm64-msvc.node +0 -0
- package/node_modules/@zowe/secrets-for-zowe-sdk/prebuilds/keyring.win32-ia32-msvc.node +0 -0
- package/node_modules/@zowe/secrets-for-zowe-sdk/prebuilds/keyring.win32-x64-msvc.node +0 -0
- package/node_modules/@zowe/zos-console-for-zowe-sdk/package.json +4 -4
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/doc/IZosFilesOptions.d.ts +12 -0
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/doc/IZosFilesOptions.d.ts.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/copy/Copy.js +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/copy/Copy.js.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/create/Create.d.ts.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/create/Create.js +18 -3
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/create/Create.js.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/delete/Delete.d.ts.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/delete/Delete.js +7 -3
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/delete/Delete.js.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/download/Download.js +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/download/Download.js.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/invoke/Invoke.d.ts.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/invoke/Invoke.js +2 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/invoke/Invoke.js.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/list/List.d.ts.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/list/List.js +6 -5
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/list/List.js.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/mount/Mount.d.ts.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/mount/Mount.js +6 -0
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/mount/Mount.js.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/rename/Rename.d.ts.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/rename/Rename.js +2 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/rename/Rename.js.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/unmount/Unmount.d.ts.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/unmount/Unmount.js +3 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/unmount/Unmount.js.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/upload/Upload.d.ts.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/upload/Upload.js +5 -5
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/upload/Upload.js.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/utilities/Utilities.d.ts +4 -4
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/utilities/Utilities.d.ts.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/utilities/Utilities.js +10 -33
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/methods/utilities/Utilities.js.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/utils/ZosFilesUtils.d.ts +7 -0
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/utils/ZosFilesUtils.d.ts.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/utils/ZosFilesUtils.js +16 -0
- package/node_modules/@zowe/zos-files-for-zowe-sdk/lib/utils/ZosFilesUtils.js.map +1 -1
- package/node_modules/@zowe/zos-files-for-zowe-sdk/package.json +5 -5
- package/node_modules/@zowe/zos-jobs-for-zowe-sdk/package.json +5 -5
- package/node_modules/@zowe/zos-logs-for-zowe-sdk/package.json +4 -4
- package/node_modules/@zowe/zos-tso-for-zowe-sdk/package.json +5 -5
- package/node_modules/@zowe/zos-uss-for-zowe-sdk/package.json +3 -3
- package/node_modules/@zowe/zos-workflows-for-zowe-sdk/package.json +5 -5
- package/node_modules/@zowe/zosmf-for-zowe-sdk/lib/constants/Zosmf.constants.d.ts.map +1 -1
- package/node_modules/@zowe/zosmf-for-zowe-sdk/lib/constants/Zosmf.constants.js +21 -0
- package/node_modules/@zowe/zosmf-for-zowe-sdk/lib/constants/Zosmf.constants.js.map +1 -1
- package/node_modules/@zowe/zosmf-for-zowe-sdk/lib/constants/Zosmf.profile.d.ts.map +1 -1
- package/node_modules/@zowe/zosmf-for-zowe-sdk/lib/constants/Zosmf.profile.js +8 -0
- package/node_modules/@zowe/zosmf-for-zowe-sdk/lib/constants/Zosmf.profile.js.map +1 -1
- package/node_modules/@zowe/zosmf-for-zowe-sdk/package.json +4 -4
- package/node_modules/js-yaml/dist/js-yaml.js +11 -3
- package/node_modules/js-yaml/dist/js-yaml.js.map +1 -1
- package/node_modules/js-yaml/dist/js-yaml.min.js +1 -1
- package/node_modules/js-yaml/dist/js-yaml.min.js.map +1 -1
- package/node_modules/js-yaml/dist/js-yaml.mjs +11 -3
- package/node_modules/js-yaml/dist/js-yaml.mjs.map +1 -1
- package/node_modules/js-yaml/lib/loader.js +16 -3
- package/node_modules/js-yaml/package.json +1 -1
- package/node_modules/sanitize-html/README.md +13 -0
- package/node_modules/sanitize-html/index.js +86 -12
- package/node_modules/sanitize-html/node_modules/dom-serializer/LICENSE +7 -0
- package/node_modules/{dom-serializer → sanitize-html/node_modules/dom-serializer}/README.md +14 -8
- package/node_modules/sanitize-html/node_modules/dom-serializer/dist/foreign-names.d.ts +11 -0
- package/node_modules/sanitize-html/node_modules/dom-serializer/dist/foreign-names.d.ts.map +1 -0
- package/node_modules/sanitize-html/node_modules/dom-serializer/dist/foreign-names.js +15 -0
- package/node_modules/sanitize-html/node_modules/dom-serializer/dist/foreign-names.js.map +1 -0
- package/node_modules/sanitize-html/node_modules/dom-serializer/dist/index.d.ts +72 -0
- package/node_modules/sanitize-html/node_modules/dom-serializer/dist/index.d.ts.map +1 -0
- package/node_modules/sanitize-html/node_modules/dom-serializer/dist/index.js +173 -0
- package/node_modules/sanitize-html/node_modules/dom-serializer/dist/index.js.map +1 -0
- package/node_modules/sanitize-html/node_modules/dom-serializer/package.json +69 -0
- package/node_modules/sanitize-html/node_modules/dom-serializer/src/foreign-names.ts +19 -0
- package/node_modules/sanitize-html/node_modules/dom-serializer/src/index.ts +315 -0
- package/node_modules/{domelementtype/lib → sanitize-html/node_modules/domelementtype/dist}/index.d.ts +12 -12
- package/node_modules/sanitize-html/node_modules/domelementtype/dist/index.d.ts.map +1 -0
- package/node_modules/{domelementtype/lib/esm → sanitize-html/node_modules/domelementtype/dist}/index.js +15 -6
- package/node_modules/sanitize-html/node_modules/domelementtype/package.json +59 -0
- package/node_modules/{domhandler/lib → sanitize-html/node_modules/domhandler/dist}/index.d.ts +9 -6
- package/node_modules/sanitize-html/node_modules/domhandler/dist/index.d.ts.map +1 -0
- package/node_modules/{domhandler/lib/esm → sanitize-html/node_modules/domhandler/dist}/index.js +34 -25
- package/node_modules/{domhandler/lib → sanitize-html/node_modules/domhandler/dist}/node.d.ts +34 -15
- package/node_modules/sanitize-html/node_modules/domhandler/dist/node.d.ts.map +1 -0
- package/node_modules/{domhandler/lib/esm → sanitize-html/node_modules/domhandler/dist}/node.js +81 -60
- package/node_modules/sanitize-html/node_modules/domhandler/package.json +65 -0
- package/node_modules/{domhandler → sanitize-html/node_modules/domhandler}/readme.md +1 -7
- package/node_modules/{domutils/lib → sanitize-html/node_modules/domutils/dist}/feeds.d.ts +2 -2
- package/node_modules/sanitize-html/node_modules/domutils/dist/feeds.d.ts.map +1 -0
- package/node_modules/{domutils/lib/esm → sanitize-html/node_modules/domutils/dist}/feeds.js +22 -25
- package/node_modules/sanitize-html/node_modules/domutils/dist/feeds.js.map +1 -0
- package/node_modules/{domutils/lib → sanitize-html/node_modules/domutils/dist}/helpers.d.ts +1 -1
- package/node_modules/sanitize-html/node_modules/domutils/dist/helpers.d.ts.map +1 -0
- package/node_modules/{domutils/lib/esm → sanitize-html/node_modules/domutils/dist}/helpers.js +16 -16
- package/node_modules/sanitize-html/node_modules/domutils/dist/helpers.js.map +1 -0
- package/node_modules/{domutils/lib/esm → sanitize-html/node_modules/domutils/dist}/index.d.ts +5 -7
- package/node_modules/sanitize-html/node_modules/domutils/dist/index.d.ts.map +1 -0
- package/node_modules/{domutils/lib/esm → sanitize-html/node_modules/domutils/dist}/index.js +5 -7
- package/node_modules/sanitize-html/node_modules/domutils/dist/index.js.map +1 -0
- package/node_modules/{domutils/lib/esm → sanitize-html/node_modules/domutils/dist}/legacy.d.ts +1 -1
- package/node_modules/sanitize-html/node_modules/domutils/dist/legacy.d.ts.map +1 -0
- package/node_modules/{domutils/lib/esm → sanitize-html/node_modules/domutils/dist}/legacy.js +15 -15
- package/node_modules/sanitize-html/node_modules/domutils/dist/legacy.js.map +1 -0
- package/node_modules/{domutils/lib/esm → sanitize-html/node_modules/domutils/dist}/manipulation.d.ts +9 -9
- package/node_modules/sanitize-html/node_modules/domutils/dist/manipulation.d.ts.map +1 -0
- package/node_modules/sanitize-html/node_modules/domutils/dist/manipulation.js +138 -0
- package/node_modules/sanitize-html/node_modules/domutils/dist/manipulation.js.map +1 -0
- package/node_modules/{domutils/lib → sanitize-html/node_modules/domutils/dist}/querying.d.ts +6 -16
- package/node_modules/sanitize-html/node_modules/domutils/dist/querying.d.ts.map +1 -0
- package/node_modules/{domutils/lib/esm → sanitize-html/node_modules/domutils/dist}/querying.js +13 -26
- package/node_modules/sanitize-html/node_modules/domutils/dist/querying.js.map +1 -0
- package/node_modules/{domutils/lib → sanitize-html/node_modules/domutils/dist}/stringify.d.ts +2 -2
- package/node_modules/sanitize-html/node_modules/domutils/dist/stringify.d.ts.map +1 -0
- package/node_modules/{domutils/lib/esm → sanitize-html/node_modules/domutils/dist}/stringify.js +1 -1
- package/node_modules/sanitize-html/node_modules/domutils/dist/stringify.js.map +1 -0
- package/node_modules/sanitize-html/node_modules/domutils/dist/traversal.d.ts +74 -0
- package/node_modules/sanitize-html/node_modules/domutils/dist/traversal.d.ts.map +1 -0
- package/node_modules/sanitize-html/node_modules/domutils/dist/traversal.js +105 -0
- package/node_modules/sanitize-html/node_modules/domutils/dist/traversal.js.map +1 -0
- package/node_modules/sanitize-html/node_modules/domutils/package.json +69 -0
- package/node_modules/{domutils → sanitize-html/node_modules/domutils}/readme.md +0 -6
- package/node_modules/sanitize-html/node_modules/domutils/src/__snapshots__/feeds.spec.ts.snap +103 -0
- package/node_modules/sanitize-html/node_modules/domutils/src/feeds.ts +301 -0
- package/node_modules/{domutils/lib/helpers.js → sanitize-html/node_modules/domutils/src/helpers.ts} +55 -43
- package/node_modules/{domutils/lib/index.d.ts → sanitize-html/node_modules/domutils/src/index.ts} +5 -8
- package/node_modules/sanitize-html/node_modules/domutils/src/legacy.ts +224 -0
- package/node_modules/sanitize-html/node_modules/domutils/src/manipulation.ts +156 -0
- package/node_modules/{domutils/lib/querying.js → sanitize-html/node_modules/domutils/src/querying.ts} +77 -60
- package/node_modules/sanitize-html/node_modules/domutils/src/stringify.ts +90 -0
- package/node_modules/sanitize-html/node_modules/domutils/src/traversal.ts +132 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/decode-codepoint.d.ts +28 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/decode-codepoint.d.ts.map +1 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/decode-codepoint.js +61 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/decode-codepoint.js.map +1 -0
- package/node_modules/{htmlparser2/node_modules/entities/dist/commonjs → sanitize-html/node_modules/entities/dist}/decode.d.ts +66 -44
- package/node_modules/sanitize-html/node_modules/entities/dist/decode.d.ts.map +1 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/decode.js +1132 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/decode.js.map +1 -0
- package/node_modules/{htmlparser2/node_modules/entities/dist/commonjs → sanitize-html/node_modules/entities/dist}/encode.d.ts +4 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/encode.d.ts.map +1 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/encode.js +295 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/encode.js.map +1 -0
- package/node_modules/{htmlparser2/node_modules/entities/dist/commonjs → sanitize-html/node_modules/entities/dist}/escape.d.ts +23 -9
- package/node_modules/sanitize-html/node_modules/entities/dist/escape.d.ts.map +1 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/escape.js +172 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/escape.js.map +1 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/generated/decode-data-html.d.ts +3 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/generated/decode-data-html.d.ts.map +1 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/generated/decode-data-html.js +5 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/generated/decode-data-html.js.map +1 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/generated/decode-data-xml.d.ts +3 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/generated/decode-data-xml.d.ts.map +1 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/generated/decode-data-xml.js +7 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/generated/decode-data-xml.js.map +1 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/generated/encode-html.d.ts +3 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/generated/encode-html.d.ts.map +1 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/generated/encode-html.js +3 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/generated/encode-html.js.map +1 -0
- package/node_modules/{htmlparser2/node_modules/entities/dist/commonjs → sanitize-html/node_modules/entities/dist}/index.d.ts +11 -18
- package/node_modules/sanitize-html/node_modules/entities/dist/index.d.ts.map +1 -0
- package/node_modules/{htmlparser2/node_modules/entities/dist/esm → sanitize-html/node_modules/entities/dist}/index.js +9 -29
- package/node_modules/sanitize-html/node_modules/entities/dist/index.js.map +1 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/internal/bin-trie-flags.d.ts +48 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/internal/bin-trie-flags.d.ts.map +1 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/internal/bin-trie-flags.js +49 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/internal/bin-trie-flags.js.map +1 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/internal/decode-shared.d.ts +38 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/internal/decode-shared.d.ts.map +1 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/internal/decode-shared.js +195 -0
- package/node_modules/sanitize-html/node_modules/entities/dist/internal/decode-shared.js.map +1 -0
- package/node_modules/sanitize-html/node_modules/entities/package.json +83 -0
- package/node_modules/{htmlparser2 → sanitize-html}/node_modules/entities/readme.md +4 -16
- package/node_modules/sanitize-html/node_modules/entities/src/decode-codepoint.ts +69 -0
- package/node_modules/sanitize-html/node_modules/entities/src/decode.ts +1368 -0
- package/node_modules/sanitize-html/node_modules/entities/src/encode.ts +337 -0
- package/node_modules/sanitize-html/node_modules/entities/src/escape.ts +187 -0
- package/node_modules/sanitize-html/node_modules/entities/src/generated/decode-data-html.ts +12 -0
- package/node_modules/sanitize-html/node_modules/entities/src/generated/decode-data-xml.ts +7 -0
- package/node_modules/sanitize-html/node_modules/entities/src/generated/encode-html.ts +3 -0
- package/node_modules/{htmlparser2 → sanitize-html}/node_modules/entities/src/index.ts +14 -41
- package/node_modules/sanitize-html/node_modules/entities/src/internal/bin-trie-flags.ts +47 -0
- package/node_modules/sanitize-html/node_modules/entities/src/internal/decode-shared.ts +209 -0
- package/node_modules/sanitize-html/node_modules/htmlparser2/README.md +257 -0
- package/node_modules/{htmlparser2/dist/esm → sanitize-html/node_modules/htmlparser2/dist}/Parser.d.ts +97 -38
- package/node_modules/sanitize-html/node_modules/htmlparser2/dist/Parser.d.ts.map +1 -0
- package/node_modules/sanitize-html/node_modules/htmlparser2/dist/Parser.js +644 -0
- package/node_modules/sanitize-html/node_modules/htmlparser2/dist/Parser.js.map +1 -0
- package/node_modules/{htmlparser2/dist/commonjs → sanitize-html/node_modules/htmlparser2/dist}/Tokenizer.d.ts +75 -7
- package/node_modules/sanitize-html/node_modules/htmlparser2/dist/Tokenizer.d.ts.map +1 -0
- package/node_modules/{htmlparser2/dist/esm → sanitize-html/node_modules/htmlparser2/dist}/Tokenizer.js +434 -179
- package/node_modules/sanitize-html/node_modules/htmlparser2/dist/Tokenizer.js.map +1 -0
- package/node_modules/sanitize-html/node_modules/htmlparser2/dist/WebWritableStream.d.ts +24 -0
- package/node_modules/sanitize-html/node_modules/htmlparser2/dist/WebWritableStream.d.ts.map +1 -0
- package/node_modules/sanitize-html/node_modules/htmlparser2/dist/WebWritableStream.js +44 -0
- package/node_modules/sanitize-html/node_modules/htmlparser2/dist/WebWritableStream.js.map +1 -0
- package/node_modules/{htmlparser2/dist/commonjs → sanitize-html/node_modules/htmlparser2/dist}/WritableStream.d.ts +1 -2
- package/node_modules/sanitize-html/node_modules/htmlparser2/dist/WritableStream.d.ts.map +1 -0
- package/node_modules/{htmlparser2/dist/esm → sanitize-html/node_modules/htmlparser2/dist}/WritableStream.js +3 -3
- package/node_modules/sanitize-html/node_modules/htmlparser2/dist/WritableStream.js.map +1 -0
- package/node_modules/{htmlparser2/dist/commonjs → sanitize-html/node_modules/htmlparser2/dist}/index.d.ts +6 -26
- package/node_modules/sanitize-html/node_modules/htmlparser2/dist/index.d.ts.map +1 -0
- package/node_modules/{htmlparser2/dist/esm → sanitize-html/node_modules/htmlparser2/dist}/index.js +2 -30
- package/node_modules/sanitize-html/node_modules/htmlparser2/dist/index.js.map +1 -0
- package/node_modules/sanitize-html/node_modules/htmlparser2/package.json +86 -0
- package/node_modules/{htmlparser2 → sanitize-html/node_modules/htmlparser2}/src/Parser.ts +260 -100
- package/node_modules/{htmlparser2 → sanitize-html/node_modules/htmlparser2}/src/Tokenizer.ts +438 -165
- package/node_modules/sanitize-html/node_modules/htmlparser2/src/WebWritableStream.ts +47 -0
- package/node_modules/{htmlparser2 → sanitize-html/node_modules/htmlparser2}/src/WritableStream.ts +1 -2
- package/node_modules/{htmlparser2 → sanitize-html/node_modules/htmlparser2}/src/index.ts +14 -43
- package/node_modules/sanitize-html/package.json +5 -2
- package/package.json +15 -15
- package/scripts/validateSecretsPrebuild.js +231 -0
- package/node_modules/dom-serializer/LICENSE +0 -11
- package/node_modules/dom-serializer/lib/esm/foreignNames.d.ts +0 -3
- package/node_modules/dom-serializer/lib/esm/foreignNames.d.ts.map +0 -1
- package/node_modules/dom-serializer/lib/esm/foreignNames.js +0 -100
- package/node_modules/dom-serializer/lib/esm/index.d.ts +0 -52
- package/node_modules/dom-serializer/lib/esm/index.d.ts.map +0 -1
- package/node_modules/dom-serializer/lib/esm/index.js +0 -190
- package/node_modules/dom-serializer/lib/esm/package.json +0 -1
- package/node_modules/dom-serializer/lib/foreignNames.d.ts +0 -3
- package/node_modules/dom-serializer/lib/foreignNames.d.ts.map +0 -1
- package/node_modules/dom-serializer/lib/foreignNames.js +0 -103
- package/node_modules/dom-serializer/lib/index.d.ts +0 -52
- package/node_modules/dom-serializer/lib/index.d.ts.map +0 -1
- package/node_modules/dom-serializer/lib/index.js +0 -229
- package/node_modules/dom-serializer/package.json +0 -69
- package/node_modules/domelementtype/lib/esm/index.d.ts +0 -48
- package/node_modules/domelementtype/lib/esm/index.d.ts.map +0 -1
- package/node_modules/domelementtype/lib/esm/package.json +0 -1
- package/node_modules/domelementtype/lib/index.d.ts.map +0 -1
- package/node_modules/domelementtype/lib/index.js +0 -55
- package/node_modules/domelementtype/package.json +0 -54
- package/node_modules/domhandler/lib/esm/index.d.ts +0 -76
- package/node_modules/domhandler/lib/esm/index.d.ts.map +0 -1
- package/node_modules/domhandler/lib/esm/node.d.ts +0 -245
- package/node_modules/domhandler/lib/esm/node.d.ts.map +0 -1
- package/node_modules/domhandler/lib/esm/package.json +0 -1
- package/node_modules/domhandler/lib/index.d.ts.map +0 -1
- package/node_modules/domhandler/lib/index.js +0 -165
- package/node_modules/domhandler/lib/node.d.ts.map +0 -1
- package/node_modules/domhandler/lib/node.js +0 -474
- package/node_modules/domhandler/package.json +0 -73
- package/node_modules/domutils/lib/esm/feeds.d.ts +0 -71
- package/node_modules/domutils/lib/esm/feeds.d.ts.map +0 -1
- package/node_modules/domutils/lib/esm/feeds.js.map +0 -1
- package/node_modules/domutils/lib/esm/helpers.d.ts +0 -59
- package/node_modules/domutils/lib/esm/helpers.d.ts.map +0 -1
- package/node_modules/domutils/lib/esm/helpers.js.map +0 -1
- package/node_modules/domutils/lib/esm/index.d.ts.map +0 -1
- package/node_modules/domutils/lib/esm/index.js.map +0 -1
- package/node_modules/domutils/lib/esm/legacy.d.ts.map +0 -1
- package/node_modules/domutils/lib/esm/legacy.js.map +0 -1
- package/node_modules/domutils/lib/esm/manipulation.d.ts.map +0 -1
- package/node_modules/domutils/lib/esm/manipulation.js +0 -134
- package/node_modules/domutils/lib/esm/manipulation.js.map +0 -1
- package/node_modules/domutils/lib/esm/package.json +0 -1
- package/node_modules/domutils/lib/esm/querying.d.ts +0 -64
- package/node_modules/domutils/lib/esm/querying.d.ts.map +0 -1
- package/node_modules/domutils/lib/esm/querying.js.map +0 -1
- package/node_modules/domutils/lib/esm/stringify.d.ts +0 -46
- package/node_modules/domutils/lib/esm/stringify.d.ts.map +0 -1
- package/node_modules/domutils/lib/esm/stringify.js.map +0 -1
- package/node_modules/domutils/lib/esm/traversal.d.ts +0 -67
- package/node_modules/domutils/lib/esm/traversal.d.ts.map +0 -1
- package/node_modules/domutils/lib/esm/traversal.js +0 -112
- package/node_modules/domutils/lib/esm/traversal.js.map +0 -1
- package/node_modules/domutils/lib/feeds.d.ts.map +0 -1
- package/node_modules/domutils/lib/feeds.js +0 -190
- package/node_modules/domutils/lib/feeds.js.map +0 -1
- package/node_modules/domutils/lib/helpers.d.ts.map +0 -1
- package/node_modules/domutils/lib/helpers.js.map +0 -1
- package/node_modules/domutils/lib/index.d.ts.map +0 -1
- package/node_modules/domutils/lib/index.js +0 -33
- package/node_modules/domutils/lib/index.js.map +0 -1
- package/node_modules/domutils/lib/legacy.d.ts +0 -79
- package/node_modules/domutils/lib/legacy.d.ts.map +0 -1
- package/node_modules/domutils/lib/legacy.js +0 -168
- package/node_modules/domutils/lib/legacy.js.map +0 -1
- package/node_modules/domutils/lib/manipulation.d.ts +0 -49
- package/node_modules/domutils/lib/manipulation.d.ts.map +0 -1
- package/node_modules/domutils/lib/manipulation.js +0 -142
- package/node_modules/domutils/lib/manipulation.js.map +0 -1
- package/node_modules/domutils/lib/querying.d.ts.map +0 -1
- package/node_modules/domutils/lib/querying.js.map +0 -1
- package/node_modules/domutils/lib/stringify.d.ts.map +0 -1
- package/node_modules/domutils/lib/stringify.js +0 -91
- package/node_modules/domutils/lib/stringify.js.map +0 -1
- package/node_modules/domutils/lib/traversal.d.ts +0 -67
- package/node_modules/domutils/lib/traversal.d.ts.map +0 -1
- package/node_modules/domutils/lib/traversal.js +0 -125
- package/node_modules/domutils/lib/traversal.js.map +0 -1
- package/node_modules/domutils/package.json +0 -79
- package/node_modules/htmlparser2/README.md +0 -171
- package/node_modules/htmlparser2/WritableStream.js +0 -3
- package/node_modules/htmlparser2/dist/commonjs/Parser.d.ts +0 -198
- package/node_modules/htmlparser2/dist/commonjs/Parser.d.ts.map +0 -1
- package/node_modules/htmlparser2/dist/commonjs/Parser.js +0 -527
- package/node_modules/htmlparser2/dist/commonjs/Parser.js.map +0 -1
- package/node_modules/htmlparser2/dist/commonjs/Tokenizer.d.ts.map +0 -1
- package/node_modules/htmlparser2/dist/commonjs/Tokenizer.js +0 -805
- package/node_modules/htmlparser2/dist/commonjs/Tokenizer.js.map +0 -1
- package/node_modules/htmlparser2/dist/commonjs/WritableStream.d.ts.map +0 -1
- package/node_modules/htmlparser2/dist/commonjs/WritableStream.js +0 -36
- package/node_modules/htmlparser2/dist/commonjs/WritableStream.js.map +0 -1
- package/node_modules/htmlparser2/dist/commonjs/index.d.ts.map +0 -1
- package/node_modules/htmlparser2/dist/commonjs/index.js +0 -123
- package/node_modules/htmlparser2/dist/commonjs/index.js.map +0 -1
- package/node_modules/htmlparser2/dist/commonjs/package.json +0 -3
- package/node_modules/htmlparser2/dist/esm/Parser.d.ts.map +0 -1
- package/node_modules/htmlparser2/dist/esm/Parser.js +0 -490
- package/node_modules/htmlparser2/dist/esm/Parser.js.map +0 -1
- package/node_modules/htmlparser2/dist/esm/Tokenizer.d.ts +0 -126
- package/node_modules/htmlparser2/dist/esm/Tokenizer.d.ts.map +0 -1
- package/node_modules/htmlparser2/dist/esm/Tokenizer.js.map +0 -1
- package/node_modules/htmlparser2/dist/esm/WritableStream.d.ts +0 -15
- package/node_modules/htmlparser2/dist/esm/WritableStream.d.ts.map +0 -1
- package/node_modules/htmlparser2/dist/esm/WritableStream.js.map +0 -1
- package/node_modules/htmlparser2/dist/esm/index.d.ts +0 -54
- package/node_modules/htmlparser2/dist/esm/index.d.ts.map +0 -1
- package/node_modules/htmlparser2/dist/esm/index.js.map +0 -1
- package/node_modules/htmlparser2/dist/esm/package.json +0 -3
- package/node_modules/htmlparser2/node_modules/entities/decode.d.ts +0 -3
- package/node_modules/htmlparser2/node_modules/entities/decode.js +0 -3
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode-codepoint.d.ts +0 -19
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode-codepoint.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode-codepoint.js +0 -77
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode-codepoint.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode.js +0 -568
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/decode.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/encode.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/encode.js +0 -92
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/encode.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/escape.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/escape.js +0 -138
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/escape.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-html.d.ts +0 -2
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-html.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-html.js +0 -7
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-html.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-xml.d.ts +0 -2
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-xml.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +0 -7
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/decode-data-xml.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/encode-html.d.ts +0 -3
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/encode-html.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/encode-html.js +0 -14
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/generated/encode-html.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/index.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/index.js +0 -131
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/index.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/bin-trie-flags.d.ts +0 -17
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/bin-trie-flags.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +0 -21
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/decode-shared.d.ts +0 -2
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/decode-shared.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/decode-shared.js +0 -31
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/decode-shared.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/encode-shared.d.ts +0 -32
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/encode-shared.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/encode-shared.js +0 -94
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/internal/encode-shared.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/commonjs/package.json +0 -3
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode-codepoint.d.ts +0 -19
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode-codepoint.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode-codepoint.js +0 -72
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode-codepoint.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode.d.ts +0 -205
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode.js +0 -554
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/decode.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/encode.d.ts +0 -22
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/encode.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/encode.js +0 -88
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/encode.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/escape.d.ts +0 -46
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/escape.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/escape.js +0 -134
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/escape.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-html.d.ts +0 -2
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-html.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-html.js +0 -4
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-html.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-xml.d.ts +0 -2
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-xml.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-xml.js +0 -4
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/decode-data-xml.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/encode-html.d.ts +0 -3
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/encode-html.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/encode-html.js +0 -11
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/generated/encode-html.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/index.d.ts +0 -96
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/index.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/index.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/bin-trie-flags.d.ts +0 -17
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/bin-trie-flags.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/bin-trie-flags.js +0 -18
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/bin-trie-flags.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/decode-shared.d.ts +0 -2
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/decode-shared.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/decode-shared.js +0 -28
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/decode-shared.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/encode-shared.d.ts +0 -32
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/encode-shared.d.ts.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/encode-shared.js +0 -91
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/internal/encode-shared.js.map +0 -1
- package/node_modules/htmlparser2/node_modules/entities/dist/esm/package.json +0 -3
- package/node_modules/htmlparser2/node_modules/entities/escape.d.ts +0 -3
- package/node_modules/htmlparser2/node_modules/entities/escape.js +0 -3
- package/node_modules/htmlparser2/node_modules/entities/package.json +0 -120
- package/node_modules/htmlparser2/node_modules/entities/src/decode-codepoint.ts +0 -81
- package/node_modules/htmlparser2/node_modules/entities/src/decode.ts +0 -685
- package/node_modules/htmlparser2/node_modules/entities/src/encode.ts +0 -93
- package/node_modules/htmlparser2/node_modules/entities/src/escape.ts +0 -161
- package/node_modules/htmlparser2/node_modules/entities/src/generated/.eslintrc.json +0 -10
- package/node_modules/htmlparser2/node_modules/entities/src/generated/decode-data-html.ts +0 -6
- package/node_modules/htmlparser2/node_modules/entities/src/generated/decode-data-xml.ts +0 -6
- package/node_modules/htmlparser2/node_modules/entities/src/generated/encode-html.ts +0 -17
- package/node_modules/htmlparser2/node_modules/entities/src/internal/bin-trie-flags.ts +0 -16
- package/node_modules/htmlparser2/node_modules/entities/src/internal/decode-shared.ts +0 -30
- package/node_modules/htmlparser2/node_modules/entities/src/internal/encode-shared.ts +0 -121
- package/node_modules/htmlparser2/package.json +0 -113
- /package/node_modules/{domelementtype → sanitize-html/node_modules/domelementtype}/LICENSE +0 -0
- /package/node_modules/{domelementtype → sanitize-html/node_modules/domelementtype}/readme.md +0 -0
- /package/node_modules/{domhandler → sanitize-html/node_modules/domhandler}/LICENSE +0 -0
- /package/node_modules/{domutils → sanitize-html/node_modules/domutils}/LICENSE +0 -0
- /package/node_modules/{htmlparser2 → sanitize-html}/node_modules/entities/LICENSE +0 -0
- /package/node_modules/{htmlparser2 → sanitize-html/node_modules/htmlparser2}/LICENSE +0 -0
package/node_modules/{domutils/lib/esm → sanitize-html/node_modules/domutils/dist}/stringify.js
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isTag, isCDATA, isText, hasChildren, isComment, } from "domhandler";
|
|
2
1
|
import renderHTML from "dom-serializer";
|
|
3
2
|
import { ElementType } from "domelementtype";
|
|
3
|
+
import { hasChildren, isCDATA, isComment, isTag, isText, } from "domhandler";
|
|
4
4
|
/**
|
|
5
5
|
* @category Stringify
|
|
6
6
|
* @deprecated Use the `dom-serializer` module directly.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stringify.js","sourceRoot":"","sources":["../src/stringify.ts"],"names":[],"mappings":"AAAA,OAAO,UAAyC,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAEH,WAAW,EACX,OAAO,EACP,SAAS,EACT,KAAK,EACL,MAAM,GACT,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CACxB,IAAkC,EAClC,OAA8B;IAE9B,OAAO,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CACxB,IAAa,EACb,OAA8B;IAE9B,OAAO,WAAW,CAAC,IAAI,CAAC;QACpB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QACnE,CAAC,CAAC,EAAE,CAAC;AACb,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,IAAyB;IAC7C,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3D,IAAI,KAAK,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3E,IAAI,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,MAAM,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnC,OAAO,EAAE,CAAC;AACd,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,IAAyB;IACjD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/D,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,OAAO,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnC,OAAO,EAAE,CAAC;AACd,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,IAAyB;IAC/C,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7D,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACxE,OAAO,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpC,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC;IACnC,OAAO,EAAE,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type AnyNode, type ChildNode, type Element, type ParentNode } from "domhandler";
|
|
2
|
+
/**
|
|
3
|
+
* Get a node's children.
|
|
4
|
+
*
|
|
5
|
+
* @category Traversal
|
|
6
|
+
* @param element Node to get the children of.
|
|
7
|
+
* @returns `element`'s children, or an empty array.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getChildren(element: AnyNode): ChildNode[];
|
|
10
|
+
/**
|
|
11
|
+
* Get a node's parent.
|
|
12
|
+
*
|
|
13
|
+
* @category Traversal
|
|
14
|
+
* @param element Node to get the parent of.
|
|
15
|
+
* @returns `element`'s parent node, or `null` if `element` is a root node.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getParent(element: AnyNode): ParentNode | null;
|
|
18
|
+
/**
|
|
19
|
+
* Gets an elements siblings, including the element itself.
|
|
20
|
+
*
|
|
21
|
+
* Attempts to get the children through the element's parent first. If we don't
|
|
22
|
+
* have a parent (the element is a root node), we walk the element's `prev` &
|
|
23
|
+
* `next` to get all remaining nodes.
|
|
24
|
+
*
|
|
25
|
+
* @category Traversal
|
|
26
|
+
* @param element Element to get the siblings of.
|
|
27
|
+
* @returns `element`'s siblings, including `element`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getSiblings(element: AnyNode): AnyNode[];
|
|
30
|
+
/**
|
|
31
|
+
* Gets an attribute from an element.
|
|
32
|
+
*
|
|
33
|
+
* @category Traversal
|
|
34
|
+
* @param element Element to check.
|
|
35
|
+
* @param name Attribute name to retrieve.
|
|
36
|
+
* @returns The element's attribute value, or `undefined`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getAttributeValue(element: Element, name: string): string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Checks whether an element has an attribute.
|
|
41
|
+
*
|
|
42
|
+
* @category Traversal
|
|
43
|
+
* @param element Element to check.
|
|
44
|
+
* @param name Attribute name to look for.
|
|
45
|
+
* @returns Returns whether `element` has the attribute `name`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function hasAttrib(element: Element, name: string): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Get the tag name of an element.
|
|
50
|
+
*
|
|
51
|
+
* @category Traversal
|
|
52
|
+
* @param element The element to get the name for.
|
|
53
|
+
* @returns The tag name of `element`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function getName(element: Element): string;
|
|
56
|
+
/**
|
|
57
|
+
* Returns the next element sibling of a node.
|
|
58
|
+
*
|
|
59
|
+
* @category Traversal
|
|
60
|
+
* @param element The element to get the next sibling of.
|
|
61
|
+
* @returns `element`'s next sibling that is a tag, or `null` if there is no next
|
|
62
|
+
* sibling.
|
|
63
|
+
*/
|
|
64
|
+
export declare function nextElementSibling(element: AnyNode): Element | null;
|
|
65
|
+
/**
|
|
66
|
+
* Returns the previous element sibling of a node.
|
|
67
|
+
*
|
|
68
|
+
* @category Traversal
|
|
69
|
+
* @param element The element to get the previous sibling of.
|
|
70
|
+
* @returns `element`'s previous sibling that is a tag, or `null` if there is no
|
|
71
|
+
* previous sibling.
|
|
72
|
+
*/
|
|
73
|
+
export declare function prevElementSibling(element: AnyNode): Element | null;
|
|
74
|
+
//# sourceMappingURL=traversal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traversal.d.ts","sourceRoot":"","sources":["../src/traversal.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,OAAO,EAGZ,KAAK,UAAU,EAClB,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,CAEzD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAAC;AAK/D;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CAevD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC7B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,GACb,MAAM,GAAG,SAAS,CAKpB;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAKjE;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEhD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAInE;AAED;;;;;;;GAOG;AAEH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAInE"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { hasChildren, isTag, } from "domhandler";
|
|
2
|
+
/**
|
|
3
|
+
* Get a node's children.
|
|
4
|
+
*
|
|
5
|
+
* @category Traversal
|
|
6
|
+
* @param element Node to get the children of.
|
|
7
|
+
* @returns `element`'s children, or an empty array.
|
|
8
|
+
*/
|
|
9
|
+
export function getChildren(element) {
|
|
10
|
+
return hasChildren(element) ? element.children : [];
|
|
11
|
+
}
|
|
12
|
+
export function getParent(element) {
|
|
13
|
+
return element.parent || null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Gets an elements siblings, including the element itself.
|
|
17
|
+
*
|
|
18
|
+
* Attempts to get the children through the element's parent first. If we don't
|
|
19
|
+
* have a parent (the element is a root node), we walk the element's `prev` &
|
|
20
|
+
* `next` to get all remaining nodes.
|
|
21
|
+
*
|
|
22
|
+
* @category Traversal
|
|
23
|
+
* @param element Element to get the siblings of.
|
|
24
|
+
* @returns `element`'s siblings, including `element`.
|
|
25
|
+
*/
|
|
26
|
+
export function getSiblings(element) {
|
|
27
|
+
const parent = getParent(element);
|
|
28
|
+
if (parent != null)
|
|
29
|
+
return getChildren(parent);
|
|
30
|
+
const siblings = [element];
|
|
31
|
+
let { prev, next } = element;
|
|
32
|
+
while (prev != null) {
|
|
33
|
+
siblings.unshift(prev);
|
|
34
|
+
({ prev } = prev);
|
|
35
|
+
}
|
|
36
|
+
while (next != null) {
|
|
37
|
+
siblings.push(next);
|
|
38
|
+
({ next } = next);
|
|
39
|
+
}
|
|
40
|
+
return siblings;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Gets an attribute from an element.
|
|
44
|
+
*
|
|
45
|
+
* @category Traversal
|
|
46
|
+
* @param element Element to check.
|
|
47
|
+
* @param name Attribute name to retrieve.
|
|
48
|
+
* @returns The element's attribute value, or `undefined`.
|
|
49
|
+
*/
|
|
50
|
+
export function getAttributeValue(element, name) {
|
|
51
|
+
const { attribs } = element;
|
|
52
|
+
return attribs?.[name];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Checks whether an element has an attribute.
|
|
56
|
+
*
|
|
57
|
+
* @category Traversal
|
|
58
|
+
* @param element Element to check.
|
|
59
|
+
* @param name Attribute name to look for.
|
|
60
|
+
* @returns Returns whether `element` has the attribute `name`.
|
|
61
|
+
*/
|
|
62
|
+
export function hasAttrib(element, name) {
|
|
63
|
+
const { attribs } = element;
|
|
64
|
+
return (attribs != null && Object.hasOwn(attribs, name) && attribs[name] != null);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get the tag name of an element.
|
|
68
|
+
*
|
|
69
|
+
* @category Traversal
|
|
70
|
+
* @param element The element to get the name for.
|
|
71
|
+
* @returns The tag name of `element`.
|
|
72
|
+
*/
|
|
73
|
+
export function getName(element) {
|
|
74
|
+
return element.name;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Returns the next element sibling of a node.
|
|
78
|
+
*
|
|
79
|
+
* @category Traversal
|
|
80
|
+
* @param element The element to get the next sibling of.
|
|
81
|
+
* @returns `element`'s next sibling that is a tag, or `null` if there is no next
|
|
82
|
+
* sibling.
|
|
83
|
+
*/
|
|
84
|
+
export function nextElementSibling(element) {
|
|
85
|
+
let { next } = element;
|
|
86
|
+
while (next !== null && !isTag(next))
|
|
87
|
+
({ next } = next);
|
|
88
|
+
return next;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Returns the previous element sibling of a node.
|
|
92
|
+
*
|
|
93
|
+
* @category Traversal
|
|
94
|
+
* @param element The element to get the previous sibling of.
|
|
95
|
+
* @returns `element`'s previous sibling that is a tag, or `null` if there is no
|
|
96
|
+
* previous sibling.
|
|
97
|
+
*/
|
|
98
|
+
// eslint-disable-next-line unicorn/prevent-abbreviations -- Keep public API name for backwards compatibility.
|
|
99
|
+
export function prevElementSibling(element) {
|
|
100
|
+
let { prev } = element;
|
|
101
|
+
while (prev !== null && !isTag(prev))
|
|
102
|
+
({ prev } = prev);
|
|
103
|
+
return prev;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=traversal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traversal.js","sourceRoot":"","sources":["../src/traversal.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,WAAW,EACX,KAAK,GAER,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,OAAgB;IACxC,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;AACxD,CAAC;AAUD,MAAM,UAAU,SAAS,CAAC,OAAgB;IACtC,OAAO,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC;AAClC,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CAAC,OAAgB;IACxC,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;IAClC,IAAI,MAAM,IAAI,IAAI;QAAE,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC;IAE/C,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,CAAC;IAC3B,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAC7B,OAAO,IAAI,IAAI,IAAI,EAAE,CAAC;QAClB,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,IAAI,IAAI,IAAI,EAAE,CAAC;QAClB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAC7B,OAAgB,EAChB,IAAY;IAEZ,MAAM,EAAE,OAAO,EAAE,GAAG,OAEnB,CAAC;IACF,OAAO,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,OAAgB,EAAE,IAAY;IACpD,MAAM,EAAE,OAAO,EAAE,GAAG,OAAsD,CAAC;IAC3E,OAAO,CACH,OAAO,IAAI,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAC3E,CAAC;AACN,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,OAAgB;IACpC,OAAO,OAAO,CAAC,IAAI,CAAC;AACxB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IAC/C,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACvB,OAAO,IAAI,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QAAE,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;IACxD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;;;;;;GAOG;AACH,8GAA8G;AAC9G,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IAC/C,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACvB,OAAO,IAAI,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QAAE,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;IACxD,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "module",
|
|
3
|
+
"name": "domutils",
|
|
4
|
+
"version": "4.0.2",
|
|
5
|
+
"description": "Utilities for working with htmlparser2's dom",
|
|
6
|
+
"author": "Felix Boehm <me@feedic.com>",
|
|
7
|
+
"funding": {
|
|
8
|
+
"type": "github",
|
|
9
|
+
"url": "https://github.com/fb55/domutils?sponsor=1"
|
|
10
|
+
},
|
|
11
|
+
"license": "BSD-2-Clause",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"main": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"src",
|
|
24
|
+
"!**/*.spec.ts",
|
|
25
|
+
"!**/__fixtures__/**"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc",
|
|
29
|
+
"build:docs": "typedoc src",
|
|
30
|
+
"format": "npm run format:es && npm run format:biome",
|
|
31
|
+
"format:biome": "biome check --write .",
|
|
32
|
+
"format:es": "npm run lint:es -- --fix",
|
|
33
|
+
"lint": "npm run lint:es && npm run lint:biome",
|
|
34
|
+
"lint:biome": "biome check .",
|
|
35
|
+
"lint:es": "eslint .",
|
|
36
|
+
"prepublishOnly": "npm run build",
|
|
37
|
+
"test": "npm run test:vi && npm run lint",
|
|
38
|
+
"test:vi": "vitest run"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git://github.com/fb55/domutils.git"
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"dom",
|
|
46
|
+
"htmlparser2"
|
|
47
|
+
],
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"dom-serializer": "^3.0.0",
|
|
50
|
+
"domelementtype": "^3.0.0",
|
|
51
|
+
"domhandler": "^6.0.0"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@biomejs/biome": "^2.4.7",
|
|
55
|
+
"@eslint/compat": "^2.0.3",
|
|
56
|
+
"@feedic/eslint-config": "^0.3.1",
|
|
57
|
+
"@types/node": "^25.5.0",
|
|
58
|
+
"eslint": "^10.0.3",
|
|
59
|
+
"eslint-config-biome": "^2.1.3",
|
|
60
|
+
"htmlparser2": "~10.1.0",
|
|
61
|
+
"typedoc": "^0.28.17",
|
|
62
|
+
"typescript": "^5.9.3",
|
|
63
|
+
"typescript-eslint": "^8.57.1",
|
|
64
|
+
"vitest": "^4.0.18"
|
|
65
|
+
},
|
|
66
|
+
"engines": {
|
|
67
|
+
"node": ">=20.19.0"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -23,9 +23,3 @@ License: BSD-2-Clause
|
|
|
23
23
|
|
|
24
24
|
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
|
|
25
25
|
Tidelift will coordinate the fix and disclosure.
|
|
26
|
-
|
|
27
|
-
## `domutils` for enterprise
|
|
28
|
-
|
|
29
|
-
Available as part of the Tidelift Subscription
|
|
30
|
-
|
|
31
|
-
The maintainers of `domutils` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-domutils?utm_source=npm-domutils&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`getFeed > Atom_Example.xml 1`] = `
|
|
4
|
+
{
|
|
5
|
+
"author": "johndoe@example.com",
|
|
6
|
+
"description": "A subtitle.",
|
|
7
|
+
"id": "urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6",
|
|
8
|
+
"items": [
|
|
9
|
+
{
|
|
10
|
+
"description": "Some content.",
|
|
11
|
+
"id": "urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a",
|
|
12
|
+
"link": "http://example.org/2003/12/13/atom03",
|
|
13
|
+
"media": [],
|
|
14
|
+
"pubDate": 2003-12-13T18:30:02.000Z,
|
|
15
|
+
"title": "Atom-Powered Robots Run Amok",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"media": [],
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
"link": "http://example.org/feed/",
|
|
22
|
+
"title": "Example Feed",
|
|
23
|
+
"type": "atom",
|
|
24
|
+
"updated": 2003-12-13T18:30:02.000Z,
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
exports[`getFeed > RDF_Example.xml 1`] = `
|
|
29
|
+
{
|
|
30
|
+
"id": "",
|
|
31
|
+
"items": [
|
|
32
|
+
{
|
|
33
|
+
"description": "Great test content<br>A link: <a href="http://github.com">Github</a>",
|
|
34
|
+
"link": "http://somefakesite/path/to/something.html",
|
|
35
|
+
"media": [],
|
|
36
|
+
"pubDate": 2011-11-04T16:35:17.000Z,
|
|
37
|
+
"title": "Fast HTML Parsing",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"description": "The early bird gets the worm",
|
|
41
|
+
"link": "http://somefakesite/path/to/something-else.html",
|
|
42
|
+
"media": [],
|
|
43
|
+
"pubDate": 2011-11-04T16:34:54.000Z,
|
|
44
|
+
"title": "This space intentionally left blank",
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
"link": "https://github.com/fb55/htmlparser2/",
|
|
48
|
+
"title": "A title to parse and remember",
|
|
49
|
+
"type": "rdf",
|
|
50
|
+
}
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
exports[`getFeed > RSS_Example.xml 1`] = `
|
|
54
|
+
{
|
|
55
|
+
"author": "editor@example.com",
|
|
56
|
+
"description": "Liftoff to Space Exploration.",
|
|
57
|
+
"id": "",
|
|
58
|
+
"items": [
|
|
59
|
+
{
|
|
60
|
+
"description": "How do Americans get ready to work with Russians aboard the International Space Station? They take a crash course in culture, language and protocol at Russia's <a href="http://howe.iki.rssi.ru/GCTC/gctc_e.htm">Star City</a>.",
|
|
61
|
+
"id": "http://liftoff.msfc.nasa.gov/2003/06/03.html#item573",
|
|
62
|
+
"link": "http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp",
|
|
63
|
+
"media": [],
|
|
64
|
+
"pubDate": 2003-06-03T09:39:21.000Z,
|
|
65
|
+
"title": "Star City",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"description": "Sky watchers in Europe, Asia, and parts of Alaska and Canada will experience a <a href="http://science.nasa.gov/headlines/y2003/30may_solareclipse.htm">partial eclipse of the Sun</a> on Saturday, May 31st.",
|
|
69
|
+
"id": "http://liftoff.msfc.nasa.gov/2003/05/30.html#item572",
|
|
70
|
+
"media": [],
|
|
71
|
+
"pubDate": 2003-05-30T11:06:42.000Z,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"description": "Before man travels to Mars, NASA hopes to design new engines that will let us fly through the Solar System more quickly. The proposed VASIMR engine would do that.",
|
|
75
|
+
"id": "http://liftoff.msfc.nasa.gov/2003/05/27.html#item571",
|
|
76
|
+
"link": "http://liftoff.msfc.nasa.gov/news/2003/news-VASIMR.asp",
|
|
77
|
+
"media": [],
|
|
78
|
+
"pubDate": 2003-05-27T08:37:32.000Z,
|
|
79
|
+
"title": "The Engine That Does More",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"description": "Compared to earlier spacecraft, the International Space Station has many luxuries, but laundry facilities are not one of them. Instead, astronauts have other options.",
|
|
83
|
+
"id": "http://liftoff.msfc.nasa.gov/2003/05/20.html#item570",
|
|
84
|
+
"link": "http://liftoff.msfc.nasa.gov/news/2003/news-laundry.asp",
|
|
85
|
+
"media": [
|
|
86
|
+
{
|
|
87
|
+
"height": 200,
|
|
88
|
+
"isDefault": false,
|
|
89
|
+
"medium": "image",
|
|
90
|
+
"url": "https://picsum.photos/200",
|
|
91
|
+
"width": 200,
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
"pubDate": 2003-05-20T08:56:02.000Z,
|
|
95
|
+
"title": "Astronauts' Dirty Laundry",
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
"link": "http://liftoff.msfc.nasa.gov/",
|
|
99
|
+
"title": "Liftoff News",
|
|
100
|
+
"type": "rss",
|
|
101
|
+
"updated": 2003-06-10T09:41:01.000Z,
|
|
102
|
+
}
|
|
103
|
+
`;
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import type { AnyNode, Element } from "domhandler";
|
|
2
|
+
import { getElementsByTagName } from "./legacy.js";
|
|
3
|
+
import { textContent } from "./stringify.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The medium of a media item.
|
|
7
|
+
*
|
|
8
|
+
* @category Feeds
|
|
9
|
+
*/
|
|
10
|
+
export type FeedItemMediaMedium =
|
|
11
|
+
| "image"
|
|
12
|
+
| "audio"
|
|
13
|
+
| "video"
|
|
14
|
+
| "document"
|
|
15
|
+
| "executable";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The type of a media item.
|
|
19
|
+
*
|
|
20
|
+
* @category Feeds
|
|
21
|
+
*/
|
|
22
|
+
export type FeedItemMediaExpression = "sample" | "full" | "nonstop";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A media item of a feed entry.
|
|
26
|
+
*
|
|
27
|
+
* @category Feeds
|
|
28
|
+
*/
|
|
29
|
+
export interface FeedItemMedia {
|
|
30
|
+
medium: FeedItemMediaMedium | undefined;
|
|
31
|
+
isDefault: boolean;
|
|
32
|
+
url?: string;
|
|
33
|
+
fileSize?: number;
|
|
34
|
+
type?: string;
|
|
35
|
+
expression?: FeedItemMediaExpression;
|
|
36
|
+
bitrate?: number;
|
|
37
|
+
framerate?: number;
|
|
38
|
+
samplingrate?: number;
|
|
39
|
+
channels?: number;
|
|
40
|
+
duration?: number;
|
|
41
|
+
height?: number;
|
|
42
|
+
width?: number;
|
|
43
|
+
lang?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* An entry of a feed.
|
|
48
|
+
*
|
|
49
|
+
* @category Feeds
|
|
50
|
+
*/
|
|
51
|
+
export interface FeedItem {
|
|
52
|
+
id?: string;
|
|
53
|
+
title?: string;
|
|
54
|
+
link?: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
pubDate?: Date;
|
|
57
|
+
media: FeedItemMedia[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The root of a feed.
|
|
62
|
+
*
|
|
63
|
+
* @category Feeds
|
|
64
|
+
*/
|
|
65
|
+
export interface Feed {
|
|
66
|
+
type: string;
|
|
67
|
+
id?: string;
|
|
68
|
+
title?: string;
|
|
69
|
+
link?: string;
|
|
70
|
+
description?: string;
|
|
71
|
+
updated?: Date;
|
|
72
|
+
author?: string;
|
|
73
|
+
items: FeedItem[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Get the feed object from the root of a DOM tree.
|
|
78
|
+
*
|
|
79
|
+
* @category Feeds
|
|
80
|
+
* @param document The DOM to extract the feed from.
|
|
81
|
+
* @returns The feed.
|
|
82
|
+
*/
|
|
83
|
+
export function getFeed(document: AnyNode[]): Feed | null {
|
|
84
|
+
const feedRoot = getOneElement(isValidFeed, document);
|
|
85
|
+
|
|
86
|
+
return feedRoot
|
|
87
|
+
? feedRoot.name === "feed"
|
|
88
|
+
? getAtomFeed(feedRoot)
|
|
89
|
+
: getRssFeed(feedRoot)
|
|
90
|
+
: null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Parse an Atom feed.
|
|
95
|
+
*
|
|
96
|
+
* @param feedRoot The root of the feed.
|
|
97
|
+
* @returns The parsed feed.
|
|
98
|
+
*/
|
|
99
|
+
function getAtomFeed(feedRoot: Element) {
|
|
100
|
+
const childs = feedRoot.children;
|
|
101
|
+
|
|
102
|
+
const feed: Feed = {
|
|
103
|
+
type: "atom",
|
|
104
|
+
items: getElementsByTagName("entry", childs).map((item) => {
|
|
105
|
+
const { children } = item;
|
|
106
|
+
const entry: FeedItem = { media: getMediaElements(children) };
|
|
107
|
+
|
|
108
|
+
addConditionally(entry, "id", "id", children);
|
|
109
|
+
addConditionally(entry, "title", "title", children);
|
|
110
|
+
|
|
111
|
+
const href = getOneElement("link", children)?.attribs["href"];
|
|
112
|
+
if (href) {
|
|
113
|
+
entry.link = href;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const description =
|
|
117
|
+
fetch("summary", children) || fetch("content", children);
|
|
118
|
+
if (description) {
|
|
119
|
+
entry.description = description;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const pubDate = fetch("updated", children);
|
|
123
|
+
if (pubDate) {
|
|
124
|
+
entry.pubDate = new Date(pubDate);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return entry;
|
|
128
|
+
}),
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
addConditionally(feed, "id", "id", childs);
|
|
132
|
+
addConditionally(feed, "title", "title", childs);
|
|
133
|
+
const href = getOneElement("link", childs)?.attribs["href"];
|
|
134
|
+
if (href) {
|
|
135
|
+
feed.link = href;
|
|
136
|
+
}
|
|
137
|
+
addConditionally(feed, "description", "subtitle", childs);
|
|
138
|
+
|
|
139
|
+
const updated = fetch("updated", childs);
|
|
140
|
+
if (updated) {
|
|
141
|
+
feed.updated = new Date(updated);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
addConditionally(feed, "author", "email", childs, true);
|
|
145
|
+
|
|
146
|
+
return feed;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Parse a RSS feed.
|
|
151
|
+
*
|
|
152
|
+
* @param feedRoot The root of the feed.
|
|
153
|
+
* @returns The parsed feed.
|
|
154
|
+
*/
|
|
155
|
+
function getRssFeed(feedRoot: Element) {
|
|
156
|
+
const childs = getOneElement("channel", feedRoot.children)?.children ?? [];
|
|
157
|
+
|
|
158
|
+
const feed: Feed = {
|
|
159
|
+
type: feedRoot.name.substr(0, 3),
|
|
160
|
+
id: "",
|
|
161
|
+
items: getElementsByTagName("item", feedRoot.children).map(
|
|
162
|
+
(item: Element) => {
|
|
163
|
+
const { children } = item;
|
|
164
|
+
const entry: FeedItem = { media: getMediaElements(children) };
|
|
165
|
+
addConditionally(entry, "id", "guid", children);
|
|
166
|
+
addConditionally(entry, "title", "title", children);
|
|
167
|
+
addConditionally(entry, "link", "link", children);
|
|
168
|
+
addConditionally(entry, "description", "description", children);
|
|
169
|
+
const pubDate =
|
|
170
|
+
fetch("pubDate", children) || fetch("dc:date", children);
|
|
171
|
+
if (pubDate) entry.pubDate = new Date(pubDate);
|
|
172
|
+
|
|
173
|
+
return entry;
|
|
174
|
+
},
|
|
175
|
+
),
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
addConditionally(feed, "title", "title", childs);
|
|
179
|
+
addConditionally(feed, "link", "link", childs);
|
|
180
|
+
addConditionally(feed, "description", "description", childs);
|
|
181
|
+
|
|
182
|
+
const updated = fetch("lastBuildDate", childs);
|
|
183
|
+
if (updated) {
|
|
184
|
+
feed.updated = new Date(updated);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
addConditionally(feed, "author", "managingEditor", childs, true);
|
|
188
|
+
|
|
189
|
+
return feed;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const MEDIA_KEYS_STRING = ["url", "type", "lang"] as const;
|
|
193
|
+
const MEDIA_KEYS_INT = [
|
|
194
|
+
"fileSize",
|
|
195
|
+
"bitrate",
|
|
196
|
+
"framerate",
|
|
197
|
+
"samplingrate",
|
|
198
|
+
"channels",
|
|
199
|
+
"duration",
|
|
200
|
+
"height",
|
|
201
|
+
"width",
|
|
202
|
+
] as const;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Get all media elements of a feed item.
|
|
206
|
+
*
|
|
207
|
+
* @param where Nodes to search in.
|
|
208
|
+
* @returns Media elements.
|
|
209
|
+
*/
|
|
210
|
+
function getMediaElements(where: AnyNode[]): FeedItemMedia[] {
|
|
211
|
+
return getElementsByTagName("media:content", where).map((element) => {
|
|
212
|
+
const { attribs } = element;
|
|
213
|
+
|
|
214
|
+
const media: FeedItemMedia = {
|
|
215
|
+
medium: attribs["medium"] as unknown as
|
|
216
|
+
| FeedItemMediaMedium
|
|
217
|
+
| undefined,
|
|
218
|
+
isDefault: !!attribs["isDefault"],
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
for (const attrib of MEDIA_KEYS_STRING) {
|
|
222
|
+
if (attribs[attrib]) {
|
|
223
|
+
media[attrib] = attribs[attrib];
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
for (const attrib of MEDIA_KEYS_INT) {
|
|
228
|
+
if (attribs[attrib]) {
|
|
229
|
+
media[attrib] = Number.parseInt(attribs[attrib], 10);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (attribs["expression"]) {
|
|
234
|
+
media.expression = attribs[
|
|
235
|
+
"expression"
|
|
236
|
+
] as unknown as FeedItemMediaExpression;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return media;
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Get one element by tag name.
|
|
245
|
+
*
|
|
246
|
+
* @param tagName Tag name to look for
|
|
247
|
+
* @param node Node to search in
|
|
248
|
+
* @returns The element or null
|
|
249
|
+
*/
|
|
250
|
+
function getOneElement(
|
|
251
|
+
tagName: string | ((name: string) => boolean),
|
|
252
|
+
node: AnyNode[],
|
|
253
|
+
): Element | null {
|
|
254
|
+
return getElementsByTagName(tagName, node, true, 1)[0];
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Get the text content of an element with a certain tag name.
|
|
259
|
+
*
|
|
260
|
+
* @param tagName Tag name to look for.
|
|
261
|
+
* @param where Node to search in.
|
|
262
|
+
* @param recurse Whether to recurse into child nodes.
|
|
263
|
+
* @returns The text content of the element.
|
|
264
|
+
*/
|
|
265
|
+
function fetch(
|
|
266
|
+
tagName: string,
|
|
267
|
+
where: AnyNode | AnyNode[],
|
|
268
|
+
recurse = false,
|
|
269
|
+
): string {
|
|
270
|
+
return textContent(getElementsByTagName(tagName, where, recurse, 1)).trim();
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Adds a property to an object if it has a value.
|
|
275
|
+
*
|
|
276
|
+
* @param object Object to be extended.
|
|
277
|
+
* @param property Property name.
|
|
278
|
+
* @param tagName Tag name that contains the conditionally added property.
|
|
279
|
+
* @param where Element to search for the property.
|
|
280
|
+
* @param recurse Whether to recurse into child nodes.
|
|
281
|
+
*/
|
|
282
|
+
function addConditionally<T>(
|
|
283
|
+
object: T,
|
|
284
|
+
property: keyof T,
|
|
285
|
+
tagName: string,
|
|
286
|
+
where: AnyNode[],
|
|
287
|
+
recurse = false,
|
|
288
|
+
) {
|
|
289
|
+
const value = fetch(tagName, where, recurse);
|
|
290
|
+
if (value) object[property] = value as unknown as T[keyof T];
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Checks if an element is a feed root node.
|
|
295
|
+
*
|
|
296
|
+
* @param value The name of the element to check.
|
|
297
|
+
* @returns Whether an element is a feed root node.
|
|
298
|
+
*/
|
|
299
|
+
function isValidFeed(value: string) {
|
|
300
|
+
return value === "rss" || value === "feed" || value === "rdf:RDF";
|
|
301
|
+
}
|