@ncukondo/search-hub 0.12.1 → 0.13.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/dist/_virtual/_commonjsHelpers.js +30 -0
- package/dist/_virtual/_commonjsHelpers.js.map +1 -0
- package/dist/_virtual/aliases.js +5 -0
- package/dist/_virtual/aliases.js.map +1 -0
- package/dist/_virtual/attributes.js +5 -0
- package/dist/_virtual/attributes.js.map +1 -0
- package/dist/_virtual/back.js +5 -0
- package/dist/_virtual/back.js.map +1 -0
- package/dist/_virtual/comment.js +5 -0
- package/dist/_virtual/comment.js.map +1 -0
- package/dist/_virtual/compile.js +5 -0
- package/dist/_virtual/compile.js.map +1 -0
- package/dist/_virtual/compile2.js +5 -0
- package/dist/_virtual/compile2.js.map +1 -0
- package/dist/_virtual/decode-data-html.js +5 -0
- package/dist/_virtual/decode-data-html.js.map +1 -0
- package/dist/_virtual/decode-data-xml.js +5 -0
- package/dist/_virtual/decode-data-xml.js.map +1 -0
- package/dist/_virtual/decode.js +5 -0
- package/dist/_virtual/decode.js.map +1 -0
- package/dist/_virtual/decode_codepoint.js +5 -0
- package/dist/_virtual/decode_codepoint.js.map +1 -0
- package/dist/_virtual/encode-html.js +5 -0
- package/dist/_virtual/encode-html.js.map +1 -0
- package/dist/_virtual/encode.js +5 -0
- package/dist/_virtual/encode.js.map +1 -0
- package/dist/_virtual/escape.js +5 -0
- package/dist/_virtual/escape.js.map +1 -0
- package/dist/_virtual/feeds.js +5 -0
- package/dist/_virtual/feeds.js.map +1 -0
- package/dist/_virtual/filters.js +5 -0
- package/dist/_virtual/filters.js.map +1 -0
- package/dist/_virtual/foreignNames.js +5 -0
- package/dist/_virtual/foreignNames.js.map +1 -0
- package/dist/_virtual/general.js +5 -0
- package/dist/_virtual/general.js.map +1 -0
- package/dist/_virtual/he.js +5 -0
- package/dist/_virtual/he.js.map +1 -0
- package/dist/_virtual/helpers.js +5 -0
- package/dist/_virtual/helpers.js.map +1 -0
- package/dist/_virtual/html.js +5 -0
- package/dist/_virtual/html.js.map +1 -0
- package/dist/_virtual/index.js +6 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/index10.js +5 -0
- package/dist/_virtual/index10.js.map +1 -0
- package/dist/_virtual/index11.js +5 -0
- package/dist/_virtual/index11.js.map +1 -0
- package/dist/_virtual/index2.js +5 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/index3.js +5 -0
- package/dist/_virtual/index3.js.map +1 -0
- package/dist/_virtual/index4.js +5 -0
- package/dist/_virtual/index4.js.map +1 -0
- package/dist/_virtual/index5.js +7 -0
- package/dist/_virtual/index5.js.map +1 -0
- package/dist/_virtual/index6.js +5 -0
- package/dist/_virtual/index6.js.map +1 -0
- package/dist/_virtual/index7.js +5 -0
- package/dist/_virtual/index7.js.map +1 -0
- package/dist/_virtual/index8.js +5 -0
- package/dist/_virtual/index8.js.map +1 -0
- package/dist/_virtual/index9.js +5 -0
- package/dist/_virtual/index9.js.map +1 -0
- package/dist/_virtual/legacy.js +5 -0
- package/dist/_virtual/legacy.js.map +1 -0
- package/dist/_virtual/manipulation.js +5 -0
- package/dist/_virtual/manipulation.js.map +1 -0
- package/dist/_virtual/matcher.js +5 -0
- package/dist/_virtual/matcher.js.map +1 -0
- package/dist/_virtual/node.js +5 -0
- package/dist/_virtual/node.js.map +1 -0
- package/dist/_virtual/node2.js +5 -0
- package/dist/_virtual/node2.js.map +1 -0
- package/dist/_virtual/parse.js +5 -0
- package/dist/_virtual/parse.js.map +1 -0
- package/dist/_virtual/parse2.js +5 -0
- package/dist/_virtual/parse2.js.map +1 -0
- package/dist/_virtual/pseudos.js +5 -0
- package/dist/_virtual/pseudos.js.map +1 -0
- package/dist/_virtual/querying.js +5 -0
- package/dist/_virtual/querying.js.map +1 -0
- package/dist/_virtual/sort.js +5 -0
- package/dist/_virtual/sort.js.map +1 -0
- package/dist/_virtual/stringify.js +5 -0
- package/dist/_virtual/stringify.js.map +1 -0
- package/dist/_virtual/subselects.js +5 -0
- package/dist/_virtual/subselects.js.map +1 -0
- package/dist/_virtual/text.js +5 -0
- package/dist/_virtual/text.js.map +1 -0
- package/dist/_virtual/traversal.js +5 -0
- package/dist/_virtual/traversal.js.map +1 -0
- package/dist/_virtual/type.js +5 -0
- package/dist/_virtual/type.js.map +1 -0
- package/dist/_virtual/valid.js +5 -0
- package/dist/_virtual/valid.js.map +1 -0
- package/dist/_virtual/void-tag.js +5 -0
- package/dist/_virtual/void-tag.js.map +1 -0
- package/dist/cli/commands/diff.js +2 -2
- package/dist/cli/commands/diff.js.map +1 -1
- package/dist/cli/commands/fulltext/attach.js +1 -1
- package/dist/cli/commands/fulltext/attach.js.map +1 -1
- package/dist/cli/commands/fulltext/check.d.ts +1 -2
- package/dist/cli/commands/fulltext/check.d.ts.map +1 -1
- package/dist/cli/commands/fulltext/check.js +4 -2
- package/dist/cli/commands/fulltext/check.js.map +1 -1
- package/dist/cli/commands/fulltext/convert.d.ts.map +1 -1
- package/dist/cli/commands/fulltext/convert.js +8 -8
- package/dist/cli/commands/fulltext/convert.js.map +1 -1
- package/dist/cli/commands/fulltext/fetch.d.ts.map +1 -1
- package/dist/cli/commands/fulltext/fetch.js +10 -6
- package/dist/cli/commands/fulltext/fetch.js.map +1 -1
- package/dist/cli/commands/fulltext/index.d.ts.map +1 -1
- package/dist/cli/commands/fulltext/index.js +2 -0
- package/dist/cli/commands/fulltext/index.js.map +1 -1
- package/dist/cli/commands/fulltext/init.d.ts.map +1 -1
- package/dist/cli/commands/fulltext/init.js +6 -5
- package/dist/cli/commands/fulltext/init.js.map +1 -1
- package/dist/cli/commands/fulltext/pending.d.ts +1 -1
- package/dist/cli/commands/fulltext/pending.d.ts.map +1 -1
- package/dist/cli/commands/fulltext/pending.js +4 -2
- package/dist/cli/commands/fulltext/pending.js.map +1 -1
- package/dist/cli/commands/fulltext/status.d.ts.map +1 -1
- package/dist/cli/commands/fulltext/status.js +4 -2
- package/dist/cli/commands/fulltext/status.js.map +1 -1
- package/dist/cli/commands/fulltext/sync.d.ts.map +1 -1
- package/dist/cli/commands/fulltext/sync.js +6 -2
- package/dist/cli/commands/fulltext/sync.js.map +1 -1
- package/dist/cli/commands/query/init.d.ts +5 -0
- package/dist/cli/commands/query/init.d.ts.map +1 -1
- package/dist/cli/commands/query/init.js +9 -1
- package/dist/cli/commands/query/init.js.map +1 -1
- package/dist/cli/commands/query/translate.d.ts.map +1 -1
- package/dist/cli/commands/query/translate.js +5 -0
- package/dist/cli/commands/query/translate.js.map +1 -1
- package/dist/cli/commands/query/validate.d.ts +22 -1
- package/dist/cli/commands/query/validate.d.ts.map +1 -1
- package/dist/cli/commands/query/validate.js +65 -22
- package/dist/cli/commands/query/validate.js.map +1 -1
- package/dist/cli/commands/review/extract.d.ts.map +1 -1
- package/dist/cli/commands/review/extract.js +1 -2
- package/dist/cli/commands/review/extract.js.map +1 -1
- package/dist/cli/commands/review/finalize.d.ts.map +1 -1
- package/dist/cli/commands/review/finalize.js +1 -2
- package/dist/cli/commands/review/finalize.js.map +1 -1
- package/dist/cli/commands/review/init.d.ts.map +1 -1
- package/dist/cli/commands/review/init.js +2 -5
- package/dist/cli/commands/review/init.js.map +1 -1
- package/dist/cli/commands/review/merge.d.ts.map +1 -1
- package/dist/cli/commands/review/merge.js +1 -2
- package/dist/cli/commands/review/merge.js.map +1 -1
- package/dist/cli/commands/review/types.d.ts +1 -1
- package/dist/cli/commands/review/types.d.ts.map +1 -1
- package/dist/cli/commands/review/types.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +81 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/suggestions/index.d.ts.map +1 -1
- package/dist/cli/suggestions/index.js +10 -0
- package/dist/cli/suggestions/index.js.map +1 -1
- package/dist/cli/suggestions/rules.d.ts.map +1 -1
- package/dist/cli/suggestions/rules.js +21 -8
- package/dist/cli/suggestions/rules.js.map +1 -1
- package/dist/cli/suggestions/types.d.ts +11 -0
- package/dist/cli/suggestions/types.d.ts.map +1 -1
- package/dist/config/schema.d.ts +2 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +6 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/{fulltext → integration}/attach-shared.d.ts +2 -2
- package/dist/integration/attach-shared.d.ts.map +1 -0
- package/dist/integration/attach-shared.js.map +1 -0
- package/dist/integration/fulltext-attach.js +1 -1
- package/dist/integration/fulltext-attach.js.map +1 -1
- package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/citation-key.js +1 -1
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/citation-key.js.map +1 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/convert/arxiv-html-parser.js +434 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/convert/arxiv-html-parser.js.map +1 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/convert/index.js +93 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/convert/index.js.map +1 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/convert/jats-parser.js +1060 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/convert/jats-parser.js.map +1 -0
- package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/convert/markdown-writer.js +146 -117
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/convert/markdown-writer.js.map +1 -0
- package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/discovery/arxiv.js +8 -1
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/arxiv.js.map +1 -0
- package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/discovery/core.js +6 -3
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/core.js.map +1 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/index.js +139 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/index.js.map +1 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/ncbi-id-converter.js +46 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/ncbi-id-converter.js.map +1 -0
- package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/discovery/pmc.js +8 -4
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/pmc.js.map +1 -0
- package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/discovery/unpaywall.js +43 -9
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/discovery/unpaywall.js.map +1 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/download/arxiv-html.js +48 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/download/arxiv-html.js.map +1 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/download/downloader.js +64 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/download/downloader.js.map +1 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/download/orchestrator.js +236 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/download/orchestrator.js.map +1 -0
- package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/download/pmc-xml.js +2 -1
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/download/pmc-xml.js.map +1 -0
- package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/meta.js +15 -10
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/meta.js.map +1 -0
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/paths.js.map +1 -0
- package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/readme.js +8 -4
- package/dist/node_modules/@ncukondo/academic-fulltext/dist/readme.js.map +1 -0
- package/dist/node_modules/boolbase/index.js +19 -0
- package/dist/node_modules/boolbase/index.js.map +1 -0
- package/dist/node_modules/css-select/lib/attributes.js +203 -0
- package/dist/node_modules/css-select/lib/attributes.js.map +1 -0
- package/dist/node_modules/css-select/lib/compile.js +141 -0
- package/dist/node_modules/css-select/lib/compile.js.map +1 -0
- package/dist/node_modules/css-select/lib/general.js +154 -0
- package/dist/node_modules/css-select/lib/general.js.map +1 -0
- package/dist/node_modules/css-select/lib/index.js +128 -0
- package/dist/node_modules/css-select/lib/index.js.map +1 -0
- package/dist/node_modules/css-select/lib/pseudo-selectors/aliases.js +40 -0
- package/dist/node_modules/css-select/lib/pseudo-selectors/aliases.js.map +1 -0
- package/dist/node_modules/css-select/lib/pseudo-selectors/filters.js +163 -0
- package/dist/node_modules/css-select/lib/pseudo-selectors/filters.js.map +1 -0
- package/dist/node_modules/css-select/lib/pseudo-selectors/index.js +71 -0
- package/dist/node_modules/css-select/lib/pseudo-selectors/index.js.map +1 -0
- package/dist/node_modules/css-select/lib/pseudo-selectors/pseudos.js +93 -0
- package/dist/node_modules/css-select/lib/pseudo-selectors/pseudos.js.map +1 -0
- package/dist/node_modules/css-select/lib/pseudo-selectors/subselects.js +111 -0
- package/dist/node_modules/css-select/lib/pseudo-selectors/subselects.js.map +1 -0
- package/dist/node_modules/css-select/lib/sort.js +78 -0
- package/dist/node_modules/css-select/lib/sort.js.map +1 -0
- package/dist/node_modules/css-what/lib/es/index.js +12 -0
- package/dist/node_modules/css-what/lib/es/index.js.map +1 -0
- package/dist/node_modules/css-what/lib/es/parse.js +349 -0
- package/dist/node_modules/css-what/lib/es/parse.js.map +1 -0
- package/dist/node_modules/css-what/lib/es/stringify.js +102 -0
- package/dist/node_modules/css-what/lib/es/stringify.js.map +1 -0
- package/dist/node_modules/css-what/lib/es/types.js +37 -0
- package/dist/node_modules/css-what/lib/es/types.js.map +1 -0
- package/dist/node_modules/dom-serializer/lib/foreignNames.js +117 -0
- package/dist/node_modules/dom-serializer/lib/foreignNames.js.map +1 -0
- package/dist/node_modules/dom-serializer/lib/index.js +207 -0
- package/dist/node_modules/dom-serializer/lib/index.js.map +1 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode.js +368 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode.js.map +1 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js +70 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/decode_codepoint.js.map +1 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/encode.js +61 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/encode.js.map +1 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/escape.js +79 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/escape.js.map +1 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js +18 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js +18 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js +19 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/generated/encode-html.js.map +1 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/index.js +139 -0
- package/dist/node_modules/dom-serializer/node_modules/entities/lib/index.js.map +1 -0
- package/dist/node_modules/domelementtype/lib/index.js +40 -0
- package/dist/node_modules/domelementtype/lib/index.js.map +1 -0
- package/dist/node_modules/domhandler/lib/index.js +167 -0
- package/dist/node_modules/domhandler/lib/index.js.map +1 -0
- package/dist/node_modules/domhandler/lib/node.js +439 -0
- package/dist/node_modules/domhandler/lib/node.js.map +1 -0
- package/dist/node_modules/domutils/lib/feeds.js +146 -0
- package/dist/node_modules/domutils/lib/feeds.js.map +1 -0
- package/dist/node_modules/domutils/lib/helpers.js +97 -0
- package/dist/node_modules/domutils/lib/helpers.js.map +1 -0
- package/dist/node_modules/domutils/lib/index.js +65 -0
- package/dist/node_modules/domutils/lib/index.js.map +1 -0
- package/dist/node_modules/domutils/lib/legacy.js +124 -0
- package/dist/node_modules/domutils/lib/legacy.js.map +1 -0
- package/dist/node_modules/domutils/lib/manipulation.js +107 -0
- package/dist/node_modules/domutils/lib/manipulation.js.map +1 -0
- package/dist/node_modules/domutils/lib/querying.js +102 -0
- package/dist/node_modules/domutils/lib/querying.js.map +1 -0
- package/dist/node_modules/domutils/lib/stringify.js +65 -0
- package/dist/node_modules/domutils/lib/stringify.js.map +1 -0
- package/dist/node_modules/domutils/lib/traversal.js +69 -0
- package/dist/node_modules/domutils/lib/traversal.js.map +1 -0
- package/dist/node_modules/he/he.js +256 -0
- package/dist/node_modules/he/he.js.map +1 -0
- package/dist/node_modules/node-html-parser/dist/back.js +16 -0
- package/dist/node_modules/node-html-parser/dist/back.js.map +1 -0
- package/dist/node_modules/node-html-parser/dist/index.js +48 -0
- package/dist/node_modules/node-html-parser/dist/index.js.map +1 -0
- package/dist/node_modules/node-html-parser/dist/matcher.js +112 -0
- package/dist/node_modules/node-html-parser/dist/matcher.js.map +1 -0
- package/dist/node_modules/node-html-parser/dist/nodes/comment.js +41 -0
- package/dist/node_modules/node-html-parser/dist/nodes/comment.js.map +1 -0
- package/dist/node_modules/node-html-parser/dist/nodes/html.js +1048 -0
- package/dist/node_modules/node-html-parser/dist/nodes/html.js.map +1 -0
- package/dist/node_modules/node-html-parser/dist/nodes/node.js +49 -0
- package/dist/node_modules/node-html-parser/dist/nodes/node.js.map +1 -0
- package/dist/node_modules/node-html-parser/dist/nodes/text.js +106 -0
- package/dist/node_modules/node-html-parser/dist/nodes/text.js.map +1 -0
- package/dist/node_modules/node-html-parser/dist/nodes/type.js +19 -0
- package/dist/node_modules/node-html-parser/dist/nodes/type.js.map +1 -0
- package/dist/node_modules/node-html-parser/dist/parse.js +20 -0
- package/dist/node_modules/node-html-parser/dist/parse.js.map +1 -0
- package/dist/node_modules/node-html-parser/dist/valid.js +19 -0
- package/dist/node_modules/node-html-parser/dist/valid.js.map +1 -0
- package/dist/node_modules/node-html-parser/dist/void-tag.js +36 -0
- package/dist/node_modules/node-html-parser/dist/void-tag.js.map +1 -0
- package/dist/node_modules/nth-check/lib/compile.js +76 -0
- package/dist/node_modules/nth-check/lib/compile.js.map +1 -0
- package/dist/node_modules/nth-check/lib/index.js +36 -0
- package/dist/node_modules/nth-check/lib/index.js.map +1 -0
- package/dist/node_modules/nth-check/lib/parse.js +69 -0
- package/dist/node_modules/nth-check/lib/parse.js.map +1 -0
- package/dist/providers/arxiv/translator.d.ts.map +1 -1
- package/dist/providers/arxiv/translator.js +5 -2
- package/dist/providers/arxiv/translator.js.map +1 -1
- package/dist/providers/base/types.d.ts +2 -0
- package/dist/providers/base/types.d.ts.map +1 -1
- package/dist/providers/base/types.js.map +1 -1
- package/dist/providers/base/warnings.d.ts +14 -0
- package/dist/providers/base/warnings.d.ts.map +1 -0
- package/dist/providers/base/warnings.js +33 -0
- package/dist/providers/base/warnings.js.map +1 -0
- package/dist/providers/eric/translator.d.ts.map +1 -1
- package/dist/providers/eric/translator.js +5 -2
- package/dist/providers/eric/translator.js.map +1 -1
- package/dist/providers/pubmed/translator.d.ts.map +1 -1
- package/dist/providers/pubmed/translator.js +5 -2
- package/dist/providers/pubmed/translator.js.map +1 -1
- package/dist/providers/scopus/translator.d.ts.map +1 -1
- package/dist/providers/scopus/translator.js +22 -5
- package/dist/providers/scopus/translator.js.map +1 -1
- package/dist/query/__test-helpers__/mock-mesh-client.d.ts +12 -0
- package/dist/query/__test-helpers__/mock-mesh-client.d.ts.map +1 -0
- package/dist/query/index.d.ts +4 -0
- package/dist/query/index.d.ts.map +1 -1
- package/dist/query/json-schema.d.ts +3 -0
- package/dist/query/json-schema.d.ts.map +1 -0
- package/dist/query/json-schema.js +48 -0
- package/dist/query/json-schema.js.map +1 -0
- package/dist/query/mesh-lookup.d.ts +47 -0
- package/dist/query/mesh-lookup.d.ts.map +1 -0
- package/dist/query/mesh-lookup.js +151 -0
- package/dist/query/mesh-lookup.js.map +1 -0
- package/dist/query/parser.js +1 -1
- package/dist/query/parser.js.map +1 -1
- package/dist/query/types.d.ts +2 -2
- package/dist/query/types.d.ts.map +1 -1
- package/dist/query/validator.d.ts +5 -5
- package/dist/query/validator.d.ts.map +1 -1
- package/dist/query/validator.js +5 -2
- package/dist/query/validator.js.map +1 -1
- package/dist/query/vocab-cache.d.ts +15 -0
- package/dist/query/vocab-cache.d.ts.map +1 -0
- package/dist/query/vocab-cache.js +44 -0
- package/dist/query/vocab-cache.js.map +1 -0
- package/dist/query/vocab-validator.d.ts +71 -0
- package/dist/query/vocab-validator.d.ts.map +1 -0
- package/dist/query/vocab-validator.js +153 -0
- package/dist/query/vocab-validator.js.map +1 -0
- package/dist/utils/levenshtein.d.ts +6 -0
- package/dist/utils/levenshtein.d.ts.map +1 -0
- package/dist/utils/levenshtein.js +21 -0
- package/dist/utils/levenshtein.js.map +1 -0
- package/package.json +2 -2
- package/dist/fulltext/attach-shared.d.ts.map +0 -1
- package/dist/fulltext/attach-shared.js.map +0 -1
- package/dist/fulltext/citation-key.d.ts +0 -15
- package/dist/fulltext/citation-key.d.ts.map +0 -1
- package/dist/fulltext/citation-key.js.map +0 -1
- package/dist/fulltext/convert/index.d.ts +0 -20
- package/dist/fulltext/convert/index.d.ts.map +0 -1
- package/dist/fulltext/convert/index.js +0 -50
- package/dist/fulltext/convert/index.js.map +0 -1
- package/dist/fulltext/convert/jats-parser.d.ts +0 -36
- package/dist/fulltext/convert/jats-parser.d.ts.map +0 -1
- package/dist/fulltext/convert/jats-parser.js +0 -887
- package/dist/fulltext/convert/jats-parser.js.map +0 -1
- package/dist/fulltext/convert/markdown-writer.d.ts +0 -6
- package/dist/fulltext/convert/markdown-writer.d.ts.map +0 -1
- package/dist/fulltext/convert/markdown-writer.js.map +0 -1
- package/dist/fulltext/convert/types.d.ts +0 -141
- package/dist/fulltext/convert/types.d.ts.map +0 -1
- package/dist/fulltext/discovery/arxiv.d.ts +0 -11
- package/dist/fulltext/discovery/arxiv.d.ts.map +0 -1
- package/dist/fulltext/discovery/arxiv.js.map +0 -1
- package/dist/fulltext/discovery/core.d.ts +0 -11
- package/dist/fulltext/discovery/core.d.ts.map +0 -1
- package/dist/fulltext/discovery/core.js.map +0 -1
- package/dist/fulltext/discovery/index.d.ts +0 -28
- package/dist/fulltext/discovery/index.d.ts.map +0 -1
- package/dist/fulltext/discovery/index.js +0 -75
- package/dist/fulltext/discovery/index.js.map +0 -1
- package/dist/fulltext/discovery/pmc.d.ts +0 -19
- package/dist/fulltext/discovery/pmc.d.ts.map +0 -1
- package/dist/fulltext/discovery/pmc.js.map +0 -1
- package/dist/fulltext/discovery/unpaywall.d.ts +0 -11
- package/dist/fulltext/discovery/unpaywall.d.ts.map +0 -1
- package/dist/fulltext/discovery/unpaywall.js.map +0 -1
- package/dist/fulltext/download/downloader.d.ts +0 -21
- package/dist/fulltext/download/downloader.d.ts.map +0 -1
- package/dist/fulltext/download/downloader.js +0 -59
- package/dist/fulltext/download/downloader.js.map +0 -1
- package/dist/fulltext/download/orchestrator.d.ts +0 -33
- package/dist/fulltext/download/orchestrator.d.ts.map +0 -1
- package/dist/fulltext/download/orchestrator.js +0 -125
- package/dist/fulltext/download/orchestrator.js.map +0 -1
- package/dist/fulltext/download/pmc-xml.d.ts +0 -13
- package/dist/fulltext/download/pmc-xml.d.ts.map +0 -1
- package/dist/fulltext/download/pmc-xml.js.map +0 -1
- package/dist/fulltext/meta.d.ts +0 -25
- package/dist/fulltext/meta.d.ts.map +0 -1
- package/dist/fulltext/meta.js.map +0 -1
- package/dist/fulltext/paths.d.ts +0 -12
- package/dist/fulltext/paths.d.ts.map +0 -1
- package/dist/fulltext/paths.js.map +0 -1
- package/dist/fulltext/readme.d.ts +0 -4
- package/dist/fulltext/readme.d.ts.map +0 -1
- package/dist/fulltext/readme.js.map +0 -1
- package/dist/fulltext/types.d.ts +0 -90
- package/dist/fulltext/types.d.ts.map +0 -1
- /package/dist/{fulltext → integration}/attach-shared.js +0 -0
- /package/dist/{fulltext → node_modules/@ncukondo/academic-fulltext/dist}/paths.js +0 -0
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import { SelectorType, AttributeAction } from "./types.js";
|
|
2
|
+
const reName = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/;
|
|
3
|
+
const reEscape = /\\([\da-f]{1,6}\s?|(\s)|.)/gi;
|
|
4
|
+
const actionTypes = /* @__PURE__ */ new Map([
|
|
5
|
+
[126, AttributeAction.Element],
|
|
6
|
+
[94, AttributeAction.Start],
|
|
7
|
+
[36, AttributeAction.End],
|
|
8
|
+
[42, AttributeAction.Any],
|
|
9
|
+
[33, AttributeAction.Not],
|
|
10
|
+
[124, AttributeAction.Hyphen]
|
|
11
|
+
]);
|
|
12
|
+
const unpackPseudos = /* @__PURE__ */ new Set([
|
|
13
|
+
"has",
|
|
14
|
+
"not",
|
|
15
|
+
"matches",
|
|
16
|
+
"is",
|
|
17
|
+
"where",
|
|
18
|
+
"host",
|
|
19
|
+
"host-context"
|
|
20
|
+
]);
|
|
21
|
+
function isTraversal(selector) {
|
|
22
|
+
switch (selector.type) {
|
|
23
|
+
case SelectorType.Adjacent:
|
|
24
|
+
case SelectorType.Child:
|
|
25
|
+
case SelectorType.Descendant:
|
|
26
|
+
case SelectorType.Parent:
|
|
27
|
+
case SelectorType.Sibling:
|
|
28
|
+
case SelectorType.ColumnCombinator:
|
|
29
|
+
return true;
|
|
30
|
+
default:
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const stripQuotesFromPseudos = /* @__PURE__ */ new Set(["contains", "icontains"]);
|
|
35
|
+
function funescape(_, escaped, escapedWhitespace) {
|
|
36
|
+
const high = parseInt(escaped, 16) - 65536;
|
|
37
|
+
return high !== high || escapedWhitespace ? escaped : high < 0 ? (
|
|
38
|
+
// BMP codepoint
|
|
39
|
+
String.fromCharCode(high + 65536)
|
|
40
|
+
) : (
|
|
41
|
+
// Supplemental Plane codepoint (surrogate pair)
|
|
42
|
+
String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function unescapeCSS(str) {
|
|
46
|
+
return str.replace(reEscape, funescape);
|
|
47
|
+
}
|
|
48
|
+
function isQuote(c) {
|
|
49
|
+
return c === 39 || c === 34;
|
|
50
|
+
}
|
|
51
|
+
function isWhitespace(c) {
|
|
52
|
+
return c === 32 || c === 9 || c === 10 || c === 12 || c === 13;
|
|
53
|
+
}
|
|
54
|
+
function parse(selector) {
|
|
55
|
+
const subselects = [];
|
|
56
|
+
const endIndex = parseSelector(subselects, `${selector}`, 0);
|
|
57
|
+
if (endIndex < selector.length) {
|
|
58
|
+
throw new Error(`Unmatched selector: ${selector.slice(endIndex)}`);
|
|
59
|
+
}
|
|
60
|
+
return subselects;
|
|
61
|
+
}
|
|
62
|
+
function parseSelector(subselects, selector, selectorIndex) {
|
|
63
|
+
let tokens = [];
|
|
64
|
+
function getName(offset) {
|
|
65
|
+
const match = selector.slice(selectorIndex + offset).match(reName);
|
|
66
|
+
if (!match) {
|
|
67
|
+
throw new Error(`Expected name, found ${selector.slice(selectorIndex)}`);
|
|
68
|
+
}
|
|
69
|
+
const [name] = match;
|
|
70
|
+
selectorIndex += offset + name.length;
|
|
71
|
+
return unescapeCSS(name);
|
|
72
|
+
}
|
|
73
|
+
function stripWhitespace(offset) {
|
|
74
|
+
selectorIndex += offset;
|
|
75
|
+
while (selectorIndex < selector.length && isWhitespace(selector.charCodeAt(selectorIndex))) {
|
|
76
|
+
selectorIndex++;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function readValueWithParenthesis() {
|
|
80
|
+
selectorIndex += 1;
|
|
81
|
+
const start = selectorIndex;
|
|
82
|
+
let counter = 1;
|
|
83
|
+
for (; counter > 0 && selectorIndex < selector.length; selectorIndex++) {
|
|
84
|
+
if (selector.charCodeAt(selectorIndex) === 40 && !isEscaped(selectorIndex)) {
|
|
85
|
+
counter++;
|
|
86
|
+
} else if (selector.charCodeAt(selectorIndex) === 41 && !isEscaped(selectorIndex)) {
|
|
87
|
+
counter--;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (counter) {
|
|
91
|
+
throw new Error("Parenthesis not matched");
|
|
92
|
+
}
|
|
93
|
+
return unescapeCSS(selector.slice(start, selectorIndex - 1));
|
|
94
|
+
}
|
|
95
|
+
function isEscaped(pos) {
|
|
96
|
+
let slashCount = 0;
|
|
97
|
+
while (selector.charCodeAt(--pos) === 92)
|
|
98
|
+
slashCount++;
|
|
99
|
+
return (slashCount & 1) === 1;
|
|
100
|
+
}
|
|
101
|
+
function ensureNotTraversal() {
|
|
102
|
+
if (tokens.length > 0 && isTraversal(tokens[tokens.length - 1])) {
|
|
103
|
+
throw new Error("Did not expect successive traversals.");
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function addTraversal(type) {
|
|
107
|
+
if (tokens.length > 0 && tokens[tokens.length - 1].type === SelectorType.Descendant) {
|
|
108
|
+
tokens[tokens.length - 1].type = type;
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
ensureNotTraversal();
|
|
112
|
+
tokens.push({ type });
|
|
113
|
+
}
|
|
114
|
+
function addSpecialAttribute(name, action) {
|
|
115
|
+
tokens.push({
|
|
116
|
+
type: SelectorType.Attribute,
|
|
117
|
+
name,
|
|
118
|
+
action,
|
|
119
|
+
value: getName(1),
|
|
120
|
+
namespace: null,
|
|
121
|
+
ignoreCase: "quirks"
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function finalizeSubselector() {
|
|
125
|
+
if (tokens.length && tokens[tokens.length - 1].type === SelectorType.Descendant) {
|
|
126
|
+
tokens.pop();
|
|
127
|
+
}
|
|
128
|
+
if (tokens.length === 0) {
|
|
129
|
+
throw new Error("Empty sub-selector");
|
|
130
|
+
}
|
|
131
|
+
subselects.push(tokens);
|
|
132
|
+
}
|
|
133
|
+
stripWhitespace(0);
|
|
134
|
+
if (selector.length === selectorIndex) {
|
|
135
|
+
return selectorIndex;
|
|
136
|
+
}
|
|
137
|
+
loop: while (selectorIndex < selector.length) {
|
|
138
|
+
const firstChar = selector.charCodeAt(selectorIndex);
|
|
139
|
+
switch (firstChar) {
|
|
140
|
+
// Whitespace
|
|
141
|
+
case 32:
|
|
142
|
+
case 9:
|
|
143
|
+
case 10:
|
|
144
|
+
case 12:
|
|
145
|
+
case 13: {
|
|
146
|
+
if (tokens.length === 0 || tokens[0].type !== SelectorType.Descendant) {
|
|
147
|
+
ensureNotTraversal();
|
|
148
|
+
tokens.push({ type: SelectorType.Descendant });
|
|
149
|
+
}
|
|
150
|
+
stripWhitespace(1);
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
// Traversals
|
|
154
|
+
case 62: {
|
|
155
|
+
addTraversal(SelectorType.Child);
|
|
156
|
+
stripWhitespace(1);
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
case 60: {
|
|
160
|
+
addTraversal(SelectorType.Parent);
|
|
161
|
+
stripWhitespace(1);
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
case 126: {
|
|
165
|
+
addTraversal(SelectorType.Sibling);
|
|
166
|
+
stripWhitespace(1);
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
case 43: {
|
|
170
|
+
addTraversal(SelectorType.Adjacent);
|
|
171
|
+
stripWhitespace(1);
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
// Special attribute selectors: .class, #id
|
|
175
|
+
case 46: {
|
|
176
|
+
addSpecialAttribute("class", AttributeAction.Element);
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
case 35: {
|
|
180
|
+
addSpecialAttribute("id", AttributeAction.Equals);
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
case 91: {
|
|
184
|
+
stripWhitespace(1);
|
|
185
|
+
let name;
|
|
186
|
+
let namespace = null;
|
|
187
|
+
if (selector.charCodeAt(selectorIndex) === 124) {
|
|
188
|
+
name = getName(1);
|
|
189
|
+
} else if (selector.startsWith("*|", selectorIndex)) {
|
|
190
|
+
namespace = "*";
|
|
191
|
+
name = getName(2);
|
|
192
|
+
} else {
|
|
193
|
+
name = getName(0);
|
|
194
|
+
if (selector.charCodeAt(selectorIndex) === 124 && selector.charCodeAt(selectorIndex + 1) !== 61) {
|
|
195
|
+
namespace = name;
|
|
196
|
+
name = getName(1);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
stripWhitespace(0);
|
|
200
|
+
let action = AttributeAction.Exists;
|
|
201
|
+
const possibleAction = actionTypes.get(selector.charCodeAt(selectorIndex));
|
|
202
|
+
if (possibleAction) {
|
|
203
|
+
action = possibleAction;
|
|
204
|
+
if (selector.charCodeAt(selectorIndex + 1) !== 61) {
|
|
205
|
+
throw new Error("Expected `=`");
|
|
206
|
+
}
|
|
207
|
+
stripWhitespace(2);
|
|
208
|
+
} else if (selector.charCodeAt(selectorIndex) === 61) {
|
|
209
|
+
action = AttributeAction.Equals;
|
|
210
|
+
stripWhitespace(1);
|
|
211
|
+
}
|
|
212
|
+
let value = "";
|
|
213
|
+
let ignoreCase = null;
|
|
214
|
+
if (action !== "exists") {
|
|
215
|
+
if (isQuote(selector.charCodeAt(selectorIndex))) {
|
|
216
|
+
const quote = selector.charCodeAt(selectorIndex);
|
|
217
|
+
let sectionEnd = selectorIndex + 1;
|
|
218
|
+
while (sectionEnd < selector.length && (selector.charCodeAt(sectionEnd) !== quote || isEscaped(sectionEnd))) {
|
|
219
|
+
sectionEnd += 1;
|
|
220
|
+
}
|
|
221
|
+
if (selector.charCodeAt(sectionEnd) !== quote) {
|
|
222
|
+
throw new Error("Attribute value didn't end");
|
|
223
|
+
}
|
|
224
|
+
value = unescapeCSS(selector.slice(selectorIndex + 1, sectionEnd));
|
|
225
|
+
selectorIndex = sectionEnd + 1;
|
|
226
|
+
} else {
|
|
227
|
+
const valueStart = selectorIndex;
|
|
228
|
+
while (selectorIndex < selector.length && (!isWhitespace(selector.charCodeAt(selectorIndex)) && selector.charCodeAt(selectorIndex) !== 93 || isEscaped(selectorIndex))) {
|
|
229
|
+
selectorIndex += 1;
|
|
230
|
+
}
|
|
231
|
+
value = unescapeCSS(selector.slice(valueStart, selectorIndex));
|
|
232
|
+
}
|
|
233
|
+
stripWhitespace(0);
|
|
234
|
+
const forceIgnore = selector.charCodeAt(selectorIndex) | 32;
|
|
235
|
+
if (forceIgnore === 115) {
|
|
236
|
+
ignoreCase = false;
|
|
237
|
+
stripWhitespace(1);
|
|
238
|
+
} else if (forceIgnore === 105) {
|
|
239
|
+
ignoreCase = true;
|
|
240
|
+
stripWhitespace(1);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (selector.charCodeAt(selectorIndex) !== 93) {
|
|
244
|
+
throw new Error("Attribute selector didn't terminate");
|
|
245
|
+
}
|
|
246
|
+
selectorIndex += 1;
|
|
247
|
+
const attributeSelector = {
|
|
248
|
+
type: SelectorType.Attribute,
|
|
249
|
+
name,
|
|
250
|
+
action,
|
|
251
|
+
value,
|
|
252
|
+
namespace,
|
|
253
|
+
ignoreCase
|
|
254
|
+
};
|
|
255
|
+
tokens.push(attributeSelector);
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
case 58: {
|
|
259
|
+
if (selector.charCodeAt(selectorIndex + 1) === 58) {
|
|
260
|
+
tokens.push({
|
|
261
|
+
type: SelectorType.PseudoElement,
|
|
262
|
+
name: getName(2).toLowerCase(),
|
|
263
|
+
data: selector.charCodeAt(selectorIndex) === 40 ? readValueWithParenthesis() : null
|
|
264
|
+
});
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
267
|
+
const name = getName(1).toLowerCase();
|
|
268
|
+
let data = null;
|
|
269
|
+
if (selector.charCodeAt(selectorIndex) === 40) {
|
|
270
|
+
if (unpackPseudos.has(name)) {
|
|
271
|
+
if (isQuote(selector.charCodeAt(selectorIndex + 1))) {
|
|
272
|
+
throw new Error(`Pseudo-selector ${name} cannot be quoted`);
|
|
273
|
+
}
|
|
274
|
+
data = [];
|
|
275
|
+
selectorIndex = parseSelector(data, selector, selectorIndex + 1);
|
|
276
|
+
if (selector.charCodeAt(selectorIndex) !== 41) {
|
|
277
|
+
throw new Error(`Missing closing parenthesis in :${name} (${selector})`);
|
|
278
|
+
}
|
|
279
|
+
selectorIndex += 1;
|
|
280
|
+
} else {
|
|
281
|
+
data = readValueWithParenthesis();
|
|
282
|
+
if (stripQuotesFromPseudos.has(name)) {
|
|
283
|
+
const quot = data.charCodeAt(0);
|
|
284
|
+
if (quot === data.charCodeAt(data.length - 1) && isQuote(quot)) {
|
|
285
|
+
data = data.slice(1, -1);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
data = unescapeCSS(data);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
tokens.push({ type: SelectorType.Pseudo, name, data });
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
case 44: {
|
|
295
|
+
finalizeSubselector();
|
|
296
|
+
tokens = [];
|
|
297
|
+
stripWhitespace(1);
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
default: {
|
|
301
|
+
if (selector.startsWith("/*", selectorIndex)) {
|
|
302
|
+
const endIndex = selector.indexOf("*/", selectorIndex + 2);
|
|
303
|
+
if (endIndex < 0) {
|
|
304
|
+
throw new Error("Comment was not terminated");
|
|
305
|
+
}
|
|
306
|
+
selectorIndex = endIndex + 2;
|
|
307
|
+
if (tokens.length === 0) {
|
|
308
|
+
stripWhitespace(0);
|
|
309
|
+
}
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
let namespace = null;
|
|
313
|
+
let name;
|
|
314
|
+
if (firstChar === 42) {
|
|
315
|
+
selectorIndex += 1;
|
|
316
|
+
name = "*";
|
|
317
|
+
} else if (firstChar === 124) {
|
|
318
|
+
name = "";
|
|
319
|
+
if (selector.charCodeAt(selectorIndex + 1) === 124) {
|
|
320
|
+
addTraversal(SelectorType.ColumnCombinator);
|
|
321
|
+
stripWhitespace(2);
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
} else if (reName.test(selector.slice(selectorIndex))) {
|
|
325
|
+
name = getName(0);
|
|
326
|
+
} else {
|
|
327
|
+
break loop;
|
|
328
|
+
}
|
|
329
|
+
if (selector.charCodeAt(selectorIndex) === 124 && selector.charCodeAt(selectorIndex + 1) !== 124) {
|
|
330
|
+
namespace = name;
|
|
331
|
+
if (selector.charCodeAt(selectorIndex + 1) === 42) {
|
|
332
|
+
name = "*";
|
|
333
|
+
selectorIndex += 2;
|
|
334
|
+
} else {
|
|
335
|
+
name = getName(1);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
tokens.push(name === "*" ? { type: SelectorType.Universal, namespace } : { type: SelectorType.Tag, name, namespace });
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
finalizeSubselector();
|
|
343
|
+
return selectorIndex;
|
|
344
|
+
}
|
|
345
|
+
export {
|
|
346
|
+
isTraversal,
|
|
347
|
+
parse
|
|
348
|
+
};
|
|
349
|
+
//# sourceMappingURL=parse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.js","sources":["../../../../../node_modules/css-what/lib/es/parse.js"],"sourcesContent":["import { SelectorType, AttributeAction, } from \"./types\";\nconst reName = /^[^\\\\#]?(?:\\\\(?:[\\da-f]{1,6}\\s?|.)|[\\w\\-\\u00b0-\\uFFFF])+/;\nconst reEscape = /\\\\([\\da-f]{1,6}\\s?|(\\s)|.)/gi;\nconst actionTypes = new Map([\n [126 /* Tilde */, AttributeAction.Element],\n [94 /* Circumflex */, AttributeAction.Start],\n [36 /* Dollar */, AttributeAction.End],\n [42 /* Asterisk */, AttributeAction.Any],\n [33 /* ExclamationMark */, AttributeAction.Not],\n [124 /* Pipe */, AttributeAction.Hyphen],\n]);\n// Pseudos, whose data property is parsed as well.\nconst unpackPseudos = new Set([\n \"has\",\n \"not\",\n \"matches\",\n \"is\",\n \"where\",\n \"host\",\n \"host-context\",\n]);\n/**\n * Checks whether a specific selector is a traversal.\n * This is useful eg. in swapping the order of elements that\n * are not traversals.\n *\n * @param selector Selector to check.\n */\nexport function isTraversal(selector) {\n switch (selector.type) {\n case SelectorType.Adjacent:\n case SelectorType.Child:\n case SelectorType.Descendant:\n case SelectorType.Parent:\n case SelectorType.Sibling:\n case SelectorType.ColumnCombinator:\n return true;\n default:\n return false;\n }\n}\nconst stripQuotesFromPseudos = new Set([\"contains\", \"icontains\"]);\n// Unescape function taken from https://github.com/jquery/sizzle/blob/master/src/sizzle.js#L152\nfunction funescape(_, escaped, escapedWhitespace) {\n const high = parseInt(escaped, 16) - 0x10000;\n // NaN means non-codepoint\n return high !== high || escapedWhitespace\n ? escaped\n : high < 0\n ? // BMP codepoint\n String.fromCharCode(high + 0x10000)\n : // Supplemental Plane codepoint (surrogate pair)\n String.fromCharCode((high >> 10) | 0xd800, (high & 0x3ff) | 0xdc00);\n}\nfunction unescapeCSS(str) {\n return str.replace(reEscape, funescape);\n}\nfunction isQuote(c) {\n return c === 39 /* SingleQuote */ || c === 34 /* DoubleQuote */;\n}\nfunction isWhitespace(c) {\n return (c === 32 /* Space */ ||\n c === 9 /* Tab */ ||\n c === 10 /* NewLine */ ||\n c === 12 /* FormFeed */ ||\n c === 13 /* CarriageReturn */);\n}\n/**\n * Parses `selector`, optionally with the passed `options`.\n *\n * @param selector Selector to parse.\n * @param options Options for parsing.\n * @returns Returns a two-dimensional array.\n * The first dimension represents selectors separated by commas (eg. `sub1, sub2`),\n * the second contains the relevant tokens for that selector.\n */\nexport function parse(selector) {\n const subselects = [];\n const endIndex = parseSelector(subselects, `${selector}`, 0);\n if (endIndex < selector.length) {\n throw new Error(`Unmatched selector: ${selector.slice(endIndex)}`);\n }\n return subselects;\n}\nfunction parseSelector(subselects, selector, selectorIndex) {\n let tokens = [];\n function getName(offset) {\n const match = selector.slice(selectorIndex + offset).match(reName);\n if (!match) {\n throw new Error(`Expected name, found ${selector.slice(selectorIndex)}`);\n }\n const [name] = match;\n selectorIndex += offset + name.length;\n return unescapeCSS(name);\n }\n function stripWhitespace(offset) {\n selectorIndex += offset;\n while (selectorIndex < selector.length &&\n isWhitespace(selector.charCodeAt(selectorIndex))) {\n selectorIndex++;\n }\n }\n function readValueWithParenthesis() {\n selectorIndex += 1;\n const start = selectorIndex;\n let counter = 1;\n for (; counter > 0 && selectorIndex < selector.length; selectorIndex++) {\n if (selector.charCodeAt(selectorIndex) ===\n 40 /* LeftParenthesis */ &&\n !isEscaped(selectorIndex)) {\n counter++;\n }\n else if (selector.charCodeAt(selectorIndex) ===\n 41 /* RightParenthesis */ &&\n !isEscaped(selectorIndex)) {\n counter--;\n }\n }\n if (counter) {\n throw new Error(\"Parenthesis not matched\");\n }\n return unescapeCSS(selector.slice(start, selectorIndex - 1));\n }\n function isEscaped(pos) {\n let slashCount = 0;\n while (selector.charCodeAt(--pos) === 92 /* BackSlash */)\n slashCount++;\n return (slashCount & 1) === 1;\n }\n function ensureNotTraversal() {\n if (tokens.length > 0 && isTraversal(tokens[tokens.length - 1])) {\n throw new Error(\"Did not expect successive traversals.\");\n }\n }\n function addTraversal(type) {\n if (tokens.length > 0 &&\n tokens[tokens.length - 1].type === SelectorType.Descendant) {\n tokens[tokens.length - 1].type = type;\n return;\n }\n ensureNotTraversal();\n tokens.push({ type });\n }\n function addSpecialAttribute(name, action) {\n tokens.push({\n type: SelectorType.Attribute,\n name,\n action,\n value: getName(1),\n namespace: null,\n ignoreCase: \"quirks\",\n });\n }\n /**\n * We have finished parsing the current part of the selector.\n *\n * Remove descendant tokens at the end if they exist,\n * and return the last index, so that parsing can be\n * picked up from here.\n */\n function finalizeSubselector() {\n if (tokens.length &&\n tokens[tokens.length - 1].type === SelectorType.Descendant) {\n tokens.pop();\n }\n if (tokens.length === 0) {\n throw new Error(\"Empty sub-selector\");\n }\n subselects.push(tokens);\n }\n stripWhitespace(0);\n if (selector.length === selectorIndex) {\n return selectorIndex;\n }\n loop: while (selectorIndex < selector.length) {\n const firstChar = selector.charCodeAt(selectorIndex);\n switch (firstChar) {\n // Whitespace\n case 32 /* Space */:\n case 9 /* Tab */:\n case 10 /* NewLine */:\n case 12 /* FormFeed */:\n case 13 /* CarriageReturn */: {\n if (tokens.length === 0 ||\n tokens[0].type !== SelectorType.Descendant) {\n ensureNotTraversal();\n tokens.push({ type: SelectorType.Descendant });\n }\n stripWhitespace(1);\n break;\n }\n // Traversals\n case 62 /* GreaterThan */: {\n addTraversal(SelectorType.Child);\n stripWhitespace(1);\n break;\n }\n case 60 /* LessThan */: {\n addTraversal(SelectorType.Parent);\n stripWhitespace(1);\n break;\n }\n case 126 /* Tilde */: {\n addTraversal(SelectorType.Sibling);\n stripWhitespace(1);\n break;\n }\n case 43 /* Plus */: {\n addTraversal(SelectorType.Adjacent);\n stripWhitespace(1);\n break;\n }\n // Special attribute selectors: .class, #id\n case 46 /* Period */: {\n addSpecialAttribute(\"class\", AttributeAction.Element);\n break;\n }\n case 35 /* Hash */: {\n addSpecialAttribute(\"id\", AttributeAction.Equals);\n break;\n }\n case 91 /* LeftSquareBracket */: {\n stripWhitespace(1);\n // Determine attribute name and namespace\n let name;\n let namespace = null;\n if (selector.charCodeAt(selectorIndex) === 124 /* Pipe */) {\n // Equivalent to no namespace\n name = getName(1);\n }\n else if (selector.startsWith(\"*|\", selectorIndex)) {\n namespace = \"*\";\n name = getName(2);\n }\n else {\n name = getName(0);\n if (selector.charCodeAt(selectorIndex) === 124 /* Pipe */ &&\n selector.charCodeAt(selectorIndex + 1) !==\n 61 /* Equal */) {\n namespace = name;\n name = getName(1);\n }\n }\n stripWhitespace(0);\n // Determine comparison operation\n let action = AttributeAction.Exists;\n const possibleAction = actionTypes.get(selector.charCodeAt(selectorIndex));\n if (possibleAction) {\n action = possibleAction;\n if (selector.charCodeAt(selectorIndex + 1) !==\n 61 /* Equal */) {\n throw new Error(\"Expected `=`\");\n }\n stripWhitespace(2);\n }\n else if (selector.charCodeAt(selectorIndex) === 61 /* Equal */) {\n action = AttributeAction.Equals;\n stripWhitespace(1);\n }\n // Determine value\n let value = \"\";\n let ignoreCase = null;\n if (action !== \"exists\") {\n if (isQuote(selector.charCodeAt(selectorIndex))) {\n const quote = selector.charCodeAt(selectorIndex);\n let sectionEnd = selectorIndex + 1;\n while (sectionEnd < selector.length &&\n (selector.charCodeAt(sectionEnd) !== quote ||\n isEscaped(sectionEnd))) {\n sectionEnd += 1;\n }\n if (selector.charCodeAt(sectionEnd) !== quote) {\n throw new Error(\"Attribute value didn't end\");\n }\n value = unescapeCSS(selector.slice(selectorIndex + 1, sectionEnd));\n selectorIndex = sectionEnd + 1;\n }\n else {\n const valueStart = selectorIndex;\n while (selectorIndex < selector.length &&\n ((!isWhitespace(selector.charCodeAt(selectorIndex)) &&\n selector.charCodeAt(selectorIndex) !==\n 93 /* RightSquareBracket */) ||\n isEscaped(selectorIndex))) {\n selectorIndex += 1;\n }\n value = unescapeCSS(selector.slice(valueStart, selectorIndex));\n }\n stripWhitespace(0);\n // See if we have a force ignore flag\n const forceIgnore = selector.charCodeAt(selectorIndex) | 0x20;\n // If the forceIgnore flag is set (either `i` or `s`), use that value\n if (forceIgnore === 115 /* LowerS */) {\n ignoreCase = false;\n stripWhitespace(1);\n }\n else if (forceIgnore === 105 /* LowerI */) {\n ignoreCase = true;\n stripWhitespace(1);\n }\n }\n if (selector.charCodeAt(selectorIndex) !==\n 93 /* RightSquareBracket */) {\n throw new Error(\"Attribute selector didn't terminate\");\n }\n selectorIndex += 1;\n const attributeSelector = {\n type: SelectorType.Attribute,\n name,\n action,\n value,\n namespace,\n ignoreCase,\n };\n tokens.push(attributeSelector);\n break;\n }\n case 58 /* Colon */: {\n if (selector.charCodeAt(selectorIndex + 1) === 58 /* Colon */) {\n tokens.push({\n type: SelectorType.PseudoElement,\n name: getName(2).toLowerCase(),\n data: selector.charCodeAt(selectorIndex) ===\n 40 /* LeftParenthesis */\n ? readValueWithParenthesis()\n : null,\n });\n continue;\n }\n const name = getName(1).toLowerCase();\n let data = null;\n if (selector.charCodeAt(selectorIndex) ===\n 40 /* LeftParenthesis */) {\n if (unpackPseudos.has(name)) {\n if (isQuote(selector.charCodeAt(selectorIndex + 1))) {\n throw new Error(`Pseudo-selector ${name} cannot be quoted`);\n }\n data = [];\n selectorIndex = parseSelector(data, selector, selectorIndex + 1);\n if (selector.charCodeAt(selectorIndex) !==\n 41 /* RightParenthesis */) {\n throw new Error(`Missing closing parenthesis in :${name} (${selector})`);\n }\n selectorIndex += 1;\n }\n else {\n data = readValueWithParenthesis();\n if (stripQuotesFromPseudos.has(name)) {\n const quot = data.charCodeAt(0);\n if (quot === data.charCodeAt(data.length - 1) &&\n isQuote(quot)) {\n data = data.slice(1, -1);\n }\n }\n data = unescapeCSS(data);\n }\n }\n tokens.push({ type: SelectorType.Pseudo, name, data });\n break;\n }\n case 44 /* Comma */: {\n finalizeSubselector();\n tokens = [];\n stripWhitespace(1);\n break;\n }\n default: {\n if (selector.startsWith(\"/*\", selectorIndex)) {\n const endIndex = selector.indexOf(\"*/\", selectorIndex + 2);\n if (endIndex < 0) {\n throw new Error(\"Comment was not terminated\");\n }\n selectorIndex = endIndex + 2;\n // Remove leading whitespace\n if (tokens.length === 0) {\n stripWhitespace(0);\n }\n break;\n }\n let namespace = null;\n let name;\n if (firstChar === 42 /* Asterisk */) {\n selectorIndex += 1;\n name = \"*\";\n }\n else if (firstChar === 124 /* Pipe */) {\n name = \"\";\n if (selector.charCodeAt(selectorIndex + 1) === 124 /* Pipe */) {\n addTraversal(SelectorType.ColumnCombinator);\n stripWhitespace(2);\n break;\n }\n }\n else if (reName.test(selector.slice(selectorIndex))) {\n name = getName(0);\n }\n else {\n break loop;\n }\n if (selector.charCodeAt(selectorIndex) === 124 /* Pipe */ &&\n selector.charCodeAt(selectorIndex + 1) !== 124 /* Pipe */) {\n namespace = name;\n if (selector.charCodeAt(selectorIndex + 1) ===\n 42 /* Asterisk */) {\n name = \"*\";\n selectorIndex += 2;\n }\n else {\n name = getName(1);\n }\n }\n tokens.push(name === \"*\"\n ? { type: SelectorType.Universal, namespace }\n : { type: SelectorType.Tag, name, namespace });\n }\n }\n }\n finalizeSubselector();\n return selectorIndex;\n}\n"],"names":[],"mappings":";AACA,MAAM,SAAS;AACf,MAAM,WAAW;AACjB,MAAM,cAAc,oBAAI,IAAI;AAAA,EACxB,CAAC,KAAiB,gBAAgB,OAAO;AAAA,EACzC,CAAC,IAAqB,gBAAgB,KAAK;AAAA,EAC3C,CAAC,IAAiB,gBAAgB,GAAG;AAAA,EACrC,CAAC,IAAmB,gBAAgB,GAAG;AAAA,EACvC,CAAC,IAA0B,gBAAgB,GAAG;AAAA,EAC9C,CAAC,KAAgB,gBAAgB,MAAM;AAC3C,CAAC;AAED,MAAM,gBAAgB,oBAAI,IAAI;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,CAAC;AAQM,SAAS,YAAY,UAAU;AAClC,UAAQ,SAAS,MAAI;AAAA,IACjB,KAAK,aAAa;AAAA,IAClB,KAAK,aAAa;AAAA,IAClB,KAAK,aAAa;AAAA,IAClB,KAAK,aAAa;AAAA,IAClB,KAAK,aAAa;AAAA,IAClB,KAAK,aAAa;AACd,aAAO;AAAA,IACX;AACI,aAAO;AAAA,EACnB;AACA;AACA,MAAM,yBAAyB,oBAAI,IAAI,CAAC,YAAY,WAAW,CAAC;AAEhE,SAAS,UAAU,GAAG,SAAS,mBAAmB;AAC9C,QAAM,OAAO,SAAS,SAAS,EAAE,IAAI;AAErC,SAAO,SAAS,QAAQ,oBAClB,UACA,OAAO;AAAA;AAAA,IAED,OAAO,aAAa,OAAO,KAAO;AAAA;AAAA;AAAA,IAElC,OAAO,aAAc,QAAQ,KAAM,OAAS,OAAO,OAAS,KAAM;AAAA;AAClF;AACA,SAAS,YAAY,KAAK;AACtB,SAAO,IAAI,QAAQ,UAAU,SAAS;AAC1C;AACA,SAAS,QAAQ,GAAG;AAChB,SAAO,MAAM,M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import { SelectorType, AttributeAction } from "./types.js";
|
|
2
|
+
const attribValChars = ["\\", '"'];
|
|
3
|
+
const pseudoValChars = [...attribValChars, "(", ")"];
|
|
4
|
+
const charsToEscapeInAttributeValue = new Set(attribValChars.map((c) => c.charCodeAt(0)));
|
|
5
|
+
const charsToEscapeInPseudoValue = new Set(pseudoValChars.map((c) => c.charCodeAt(0)));
|
|
6
|
+
const charsToEscapeInName = new Set([
|
|
7
|
+
...pseudoValChars,
|
|
8
|
+
"~",
|
|
9
|
+
"^",
|
|
10
|
+
"$",
|
|
11
|
+
"*",
|
|
12
|
+
"+",
|
|
13
|
+
"!",
|
|
14
|
+
"|",
|
|
15
|
+
":",
|
|
16
|
+
"[",
|
|
17
|
+
"]",
|
|
18
|
+
" ",
|
|
19
|
+
"."
|
|
20
|
+
].map((c) => c.charCodeAt(0)));
|
|
21
|
+
function stringify(selector) {
|
|
22
|
+
return selector.map((token) => token.map(stringifyToken).join("")).join(", ");
|
|
23
|
+
}
|
|
24
|
+
function stringifyToken(token, index, arr) {
|
|
25
|
+
switch (token.type) {
|
|
26
|
+
// Simple types
|
|
27
|
+
case SelectorType.Child:
|
|
28
|
+
return index === 0 ? "> " : " > ";
|
|
29
|
+
case SelectorType.Parent:
|
|
30
|
+
return index === 0 ? "< " : " < ";
|
|
31
|
+
case SelectorType.Sibling:
|
|
32
|
+
return index === 0 ? "~ " : " ~ ";
|
|
33
|
+
case SelectorType.Adjacent:
|
|
34
|
+
return index === 0 ? "+ " : " + ";
|
|
35
|
+
case SelectorType.Descendant:
|
|
36
|
+
return " ";
|
|
37
|
+
case SelectorType.ColumnCombinator:
|
|
38
|
+
return index === 0 ? "|| " : " || ";
|
|
39
|
+
case SelectorType.Universal:
|
|
40
|
+
return token.namespace === "*" && index + 1 < arr.length && "name" in arr[index + 1] ? "" : `${getNamespace(token.namespace)}*`;
|
|
41
|
+
case SelectorType.Tag:
|
|
42
|
+
return getNamespacedName(token);
|
|
43
|
+
case SelectorType.PseudoElement:
|
|
44
|
+
return `::${escapeName(token.name, charsToEscapeInName)}${token.data === null ? "" : `(${escapeName(token.data, charsToEscapeInPseudoValue)})`}`;
|
|
45
|
+
case SelectorType.Pseudo:
|
|
46
|
+
return `:${escapeName(token.name, charsToEscapeInName)}${token.data === null ? "" : `(${typeof token.data === "string" ? escapeName(token.data, charsToEscapeInPseudoValue) : stringify(token.data)})`}`;
|
|
47
|
+
case SelectorType.Attribute: {
|
|
48
|
+
if (token.name === "id" && token.action === AttributeAction.Equals && token.ignoreCase === "quirks" && !token.namespace) {
|
|
49
|
+
return `#${escapeName(token.value, charsToEscapeInName)}`;
|
|
50
|
+
}
|
|
51
|
+
if (token.name === "class" && token.action === AttributeAction.Element && token.ignoreCase === "quirks" && !token.namespace) {
|
|
52
|
+
return `.${escapeName(token.value, charsToEscapeInName)}`;
|
|
53
|
+
}
|
|
54
|
+
const name = getNamespacedName(token);
|
|
55
|
+
if (token.action === AttributeAction.Exists) {
|
|
56
|
+
return `[${name}]`;
|
|
57
|
+
}
|
|
58
|
+
return `[${name}${getActionValue(token.action)}="${escapeName(token.value, charsToEscapeInAttributeValue)}"${token.ignoreCase === null ? "" : token.ignoreCase ? " i" : " s"}]`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function getActionValue(action) {
|
|
63
|
+
switch (action) {
|
|
64
|
+
case AttributeAction.Equals:
|
|
65
|
+
return "";
|
|
66
|
+
case AttributeAction.Element:
|
|
67
|
+
return "~";
|
|
68
|
+
case AttributeAction.Start:
|
|
69
|
+
return "^";
|
|
70
|
+
case AttributeAction.End:
|
|
71
|
+
return "$";
|
|
72
|
+
case AttributeAction.Any:
|
|
73
|
+
return "*";
|
|
74
|
+
case AttributeAction.Not:
|
|
75
|
+
return "!";
|
|
76
|
+
case AttributeAction.Hyphen:
|
|
77
|
+
return "|";
|
|
78
|
+
case AttributeAction.Exists:
|
|
79
|
+
throw new Error("Shouldn't be here");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function getNamespacedName(token) {
|
|
83
|
+
return `${getNamespace(token.namespace)}${escapeName(token.name, charsToEscapeInName)}`;
|
|
84
|
+
}
|
|
85
|
+
function getNamespace(namespace) {
|
|
86
|
+
return namespace !== null ? `${namespace === "*" ? "*" : escapeName(namespace, charsToEscapeInName)}|` : "";
|
|
87
|
+
}
|
|
88
|
+
function escapeName(str, charsToEscape) {
|
|
89
|
+
let lastIdx = 0;
|
|
90
|
+
let ret = "";
|
|
91
|
+
for (let i = 0; i < str.length; i++) {
|
|
92
|
+
if (charsToEscape.has(str.charCodeAt(i))) {
|
|
93
|
+
ret += `${str.slice(lastIdx, i)}\\${str.charAt(i)}`;
|
|
94
|
+
lastIdx = i + 1;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return ret.length > 0 ? ret + str.slice(lastIdx) : str;
|
|
98
|
+
}
|
|
99
|
+
export {
|
|
100
|
+
stringify
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=stringify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stringify.js","sources":["../../../../../node_modules/css-what/lib/es/stringify.js"],"sourcesContent":["import { SelectorType, AttributeAction } from \"./types\";\nconst attribValChars = [\"\\\\\", '\"'];\nconst pseudoValChars = [...attribValChars, \"(\", \")\"];\nconst charsToEscapeInAttributeValue = new Set(attribValChars.map((c) => c.charCodeAt(0)));\nconst charsToEscapeInPseudoValue = new Set(pseudoValChars.map((c) => c.charCodeAt(0)));\nconst charsToEscapeInName = new Set([\n ...pseudoValChars,\n \"~\",\n \"^\",\n \"$\",\n \"*\",\n \"+\",\n \"!\",\n \"|\",\n \":\",\n \"[\",\n \"]\",\n \" \",\n \".\",\n].map((c) => c.charCodeAt(0)));\n/**\n * Turns `selector` back into a string.\n *\n * @param selector Selector to stringify.\n */\nexport function stringify(selector) {\n return selector\n .map((token) => token.map(stringifyToken).join(\"\"))\n .join(\", \");\n}\nfunction stringifyToken(token, index, arr) {\n switch (token.type) {\n // Simple types\n case SelectorType.Child:\n return index === 0 ? \"> \" : \" > \";\n case SelectorType.Parent:\n return index === 0 ? \"< \" : \" < \";\n case SelectorType.Sibling:\n return index === 0 ? \"~ \" : \" ~ \";\n case SelectorType.Adjacent:\n return index === 0 ? \"+ \" : \" + \";\n case SelectorType.Descendant:\n return \" \";\n case SelectorType.ColumnCombinator:\n return index === 0 ? \"|| \" : \" || \";\n case SelectorType.Universal:\n // Return an empty string if the selector isn't needed.\n return token.namespace === \"*\" &&\n index + 1 < arr.length &&\n \"name\" in arr[index + 1]\n ? \"\"\n : `${getNamespace(token.namespace)}*`;\n case SelectorType.Tag:\n return getNamespacedName(token);\n case SelectorType.PseudoElement:\n return `::${escapeName(token.name, charsToEscapeInName)}${token.data === null\n ? \"\"\n : `(${escapeName(token.data, charsToEscapeInPseudoValue)})`}`;\n case SelectorType.Pseudo:\n return `:${escapeName(token.name, charsToEscapeInName)}${token.data === null\n ? \"\"\n : `(${typeof token.data === \"string\"\n ? escapeName(token.data, charsToEscapeInPseudoValue)\n : stringify(token.data)})`}`;\n case SelectorType.Attribute: {\n if (token.name === \"id\" &&\n token.action === AttributeAction.Equals &&\n token.ignoreCase === \"quirks\" &&\n !token.namespace) {\n return `#${escapeName(token.value, charsToEscapeInName)}`;\n }\n if (token.name === \"class\" &&\n token.action === AttributeAction.Element &&\n token.ignoreCase === \"quirks\" &&\n !token.namespace) {\n return `.${escapeName(token.value, charsToEscapeInName)}`;\n }\n const name = getNamespacedName(token);\n if (token.action === AttributeAction.Exists) {\n return `[${name}]`;\n }\n return `[${name}${getActionValue(token.action)}=\"${escapeName(token.value, charsToEscapeInAttributeValue)}\"${token.ignoreCase === null ? \"\" : token.ignoreCase ? \" i\" : \" s\"}]`;\n }\n }\n}\nfunction getActionValue(action) {\n switch (action) {\n case AttributeAction.Equals:\n return \"\";\n case AttributeAction.Element:\n return \"~\";\n case AttributeAction.Start:\n return \"^\";\n case AttributeAction.End:\n return \"$\";\n case AttributeAction.Any:\n return \"*\";\n case AttributeAction.Not:\n return \"!\";\n case AttributeAction.Hyphen:\n return \"|\";\n case AttributeAction.Exists:\n throw new Error(\"Shouldn't be here\");\n }\n}\nfunction getNamespacedName(token) {\n return `${getNamespace(token.namespace)}${escapeName(token.name, charsToEscapeInName)}`;\n}\nfunction getNamespace(namespace) {\n return namespace !== null\n ? `${namespace === \"*\"\n ? \"*\"\n : escapeName(namespace, charsToEscapeInName)}|`\n : \"\";\n}\nfunction escapeName(str, charsToEscape) {\n let lastIdx = 0;\n let ret = \"\";\n for (let i = 0; i < str.length; i++) {\n if (charsToEscape.has(str.charCodeAt(i))) {\n ret += `${str.slice(lastIdx, i)}\\\\${str.charAt(i)}`;\n lastIdx = i + 1;\n }\n }\n return ret.length > 0 ? ret + str.slice(lastIdx) : str;\n}\n"],"names":[],"mappings":";AACA,MAAM,iBAAiB,CAAC,MAAM,GAAG;AACjC,MAAM,iBAAiB,CAAC,GAAG,gBAAgB,KAAK,GAAG;AACnD,MAAM,gCAAgC,IAAI,IAAI,eAAe,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AACxF,MAAM,6BAA6B,IAAI,IAAI,eAAe,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AACrF,MAAM,sBAAsB,IAAI,IAAI;AAAA,EAChC,GAAG;AAAA,EACH;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,EAAE,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAMtB,SAAS,UAAU,UAAU;AAChC,SAAO,SACF,IAAI,CAAC,UAAU,MAAM,IAAI,cAAc,EAAE,KAAK,EAAE,CAAC,EACjD,KAAK,IAAI;AAClB;AACA,SAAS,eAAe,OAAO,OAAO,KAAK;AACvC,UAAQ,MAAM,MAAI;AAAA;AAAA,IAE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orType;
|
|
2
|
+
(function(SelectorType2) {
|
|
3
|
+
SelectorType2["Attribute"] = "attribute";
|
|
4
|
+
SelectorType2["Pseudo"] = "pseudo";
|
|
5
|
+
SelectorType2["PseudoElement"] = "pseudo-element";
|
|
6
|
+
SelectorType2["Tag"] = "tag";
|
|
7
|
+
SelectorType2["Universal"] = "universal";
|
|
8
|
+
SelectorType2["Adjacent"] = "adjacent";
|
|
9
|
+
SelectorType2["Child"] = "child";
|
|
10
|
+
SelectorType2["Descendant"] = "descendant";
|
|
11
|
+
SelectorType2["Parent"] = "parent";
|
|
12
|
+
SelectorType2["Sibling"] = "sibling";
|
|
13
|
+
SelectorType2["ColumnCombinator"] = "column-combinator";
|
|
14
|
+
})(SelectorType || (SelectorType = {}));
|
|
15
|
+
const IgnoreCaseMode = {
|
|
16
|
+
Unknown: null,
|
|
17
|
+
QuirksMode: "quirks",
|
|
18
|
+
IgnoreCase: true,
|
|
19
|
+
CaseSensitive: false
|
|
20
|
+
};
|
|
21
|
+
var AttributeAction;
|
|
22
|
+
(function(AttributeAction2) {
|
|
23
|
+
AttributeAction2["Any"] = "any";
|
|
24
|
+
AttributeAction2["Element"] = "element";
|
|
25
|
+
AttributeAction2["End"] = "end";
|
|
26
|
+
AttributeAction2["Equals"] = "equals";
|
|
27
|
+
AttributeAction2["Exists"] = "exists";
|
|
28
|
+
AttributeAction2["Hyphen"] = "hyphen";
|
|
29
|
+
AttributeAction2["Not"] = "not";
|
|
30
|
+
AttributeAction2["Start"] = "start";
|
|
31
|
+
})(AttributeAction || (AttributeAction = {}));
|
|
32
|
+
export {
|
|
33
|
+
AttributeAction,
|
|
34
|
+
IgnoreCaseMode,
|
|
35
|
+
SelectorType
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../../../../node_modules/css-what/lib/es/types.js"],"sourcesContent":["export var SelectorType;\n(function (SelectorType) {\n SelectorType[\"Attribute\"] = \"attribute\";\n SelectorType[\"Pseudo\"] = \"pseudo\";\n SelectorType[\"PseudoElement\"] = \"pseudo-element\";\n SelectorType[\"Tag\"] = \"tag\";\n SelectorType[\"Universal\"] = \"universal\";\n // Traversals\n SelectorType[\"Adjacent\"] = \"adjacent\";\n SelectorType[\"Child\"] = \"child\";\n SelectorType[\"Descendant\"] = \"descendant\";\n SelectorType[\"Parent\"] = \"parent\";\n SelectorType[\"Sibling\"] = \"sibling\";\n SelectorType[\"ColumnCombinator\"] = \"column-combinator\";\n})(SelectorType || (SelectorType = {}));\n/**\n * Modes for ignore case.\n *\n * This could be updated to an enum, and the object is\n * the current stand-in that will allow code to be updated\n * without big changes.\n */\nexport const IgnoreCaseMode = {\n Unknown: null,\n QuirksMode: \"quirks\",\n IgnoreCase: true,\n CaseSensitive: false,\n};\nexport var AttributeAction;\n(function (AttributeAction) {\n AttributeAction[\"Any\"] = \"any\";\n AttributeAction[\"Element\"] = \"element\";\n AttributeAction[\"End\"] = \"end\";\n AttributeAction[\"Equals\"] = \"equals\";\n AttributeAction[\"Exists\"] = \"exists\";\n AttributeAction[\"Hyphen\"] = \"hyphen\";\n AttributeAction[\"Not\"] = \"not\";\n AttributeAction[\"Start\"] = \"start\";\n})(AttributeAction || (AttributeAction = {}));\n"],"names":["SelectorType","AttributeAction"],"mappings":"AAAU,IAAC;AAAA,CACV,SAAUA,eAAc;AACrB,EAAAA,cAAa,WAAW,IAAI;AAC5B,EAAAA,cAAa,QAAQ,IAAI;AACzB,EAAAA,cAAa,eAAe,IAAI;AAChC,EAAAA,cAAa,KAAK,IAAI;AACtB,EAAAA,cAAa,WAAW,IAAI;AAE5B,EAAAA,cAAa,UAAU,IAAI;AAC3B,EAAAA,cAAa,OAAO,IAAI;AACxB,EAAAA,cAAa,YAAY,IAAI;AAC7B,EAAAA,cAAa,QAAQ,IAAI;AACzB,EAAAA,cAAa,SAAS,IAAI;AAC1B,EAAAA,cAAa,kBAAkB,IAAI;AACvC,GAAG,iBAAiB,eAAe,CAAA,EAAG;AAQ1B,MAAC,iBAAiB;AAAA,EAC1B,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,eAAe;AACnB;AACU,IAAC;AAAA,CACV,SAAUC,kBAAiB;AACxB,EAAAA,iBAAgB,KAAK,IAAI;AACzB,EAAAA,iBAAgB,SAAS,IAAI;AAC7B,EAAAA,iBAAgB,KAAK,IAAI;AACzB,EAAAA,iBAAgB,QAAQ,IAAI;AAC5B,EAAAA,iBAAgB,QAAQ,IAAI;AAC5B,EAAAA,iBAAgB,QAAQ,IAAI;AAC5B,EAAAA,iBAAgB,KAAK,IAAI;AACzB,EAAAA,iBAAgB,OAAO,IAAI;AAC/B,GAAG,oBAAoB,kBAAkB,CAAA,EAAG;","x_google_ignoreList":[0]}
|