polytypo 1.6.3 → 1.7.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/README.md +27 -0
- package/dist/{chunk-VVBJZBXR.js → chunk-25XZKUNP.js} +1 -1
- package/dist/{chunk-VVBJZBXR.js.map → chunk-25XZKUNP.js.map} +1 -1
- package/dist/chunk-33SLJJSZ.cjs +33 -0
- package/dist/{chunk-TV4AZVHZ.cjs.map → chunk-33SLJJSZ.cjs.map} +1 -1
- package/dist/{chunk-RNH6KTYZ.cjs → chunk-54TSHDNC.cjs} +68 -20
- package/dist/chunk-54TSHDNC.cjs.map +1 -0
- package/dist/chunk-74I62TZ2.js +35 -0
- package/dist/chunk-74I62TZ2.js.map +1 -0
- package/dist/{chunk-ODTH774G.js → chunk-DAIPI5CX.js} +2 -2
- package/dist/{chunk-UB7HJ4MX.cjs → chunk-FMU74VA6.cjs} +1 -1
- package/dist/{chunk-UB7HJ4MX.cjs.map → chunk-FMU74VA6.cjs.map} +1 -1
- package/dist/{chunk-UOPLHOTJ.js → chunk-GUTUSN4K.js} +4 -4
- package/dist/{chunk-4ELGGQ7B.js → chunk-HBIIWBB5.js} +23 -27
- package/dist/chunk-HBIIWBB5.js.map +1 -0
- package/dist/chunk-HTCGXDEG.cjs +31 -0
- package/dist/{chunk-GZSUAD6M.cjs.map → chunk-HTCGXDEG.cjs.map} +1 -1
- package/dist/{chunk-JT3VGUUU.cjs → chunk-I2QPXPHX.cjs} +3 -3
- package/dist/{chunk-JT3VGUUU.cjs.map → chunk-I2QPXPHX.cjs.map} +1 -1
- package/dist/{chunk-2XWZW3RU.cjs → chunk-IQHYZG2K.cjs} +23 -27
- package/dist/chunk-IQHYZG2K.cjs.map +1 -0
- package/dist/{chunk-RZYVLO3Z.js → chunk-ITDTGCLJ.js} +2 -2
- package/dist/{chunk-27B32RJQ.js → chunk-JE2MK4CC.js} +59 -11
- package/dist/chunk-JE2MK4CC.js.map +1 -0
- package/dist/{chunk-UIUJSDBS.js → chunk-JVBK3LG3.js} +2 -2
- package/dist/{chunk-BCU7YHWD.cjs → chunk-MMXKQUAS.cjs} +4 -4
- package/dist/{chunk-BCU7YHWD.cjs.map → chunk-MMXKQUAS.cjs.map} +1 -1
- package/dist/{chunk-OHMN6WPZ.js → chunk-U5Y7C2L4.js} +21 -8
- package/dist/{chunk-OHMN6WPZ.js.map → chunk-U5Y7C2L4.js.map} +1 -1
- package/dist/{chunk-7DKZNZUD.cjs → chunk-VDLHT5CW.cjs} +35 -22
- package/dist/chunk-VDLHT5CW.cjs.map +1 -0
- package/dist/chunk-X6CI7GWV.cjs +35 -0
- package/dist/chunk-X6CI7GWV.cjs.map +1 -0
- package/dist/{errors-C1_sHGgx.d.ts → errors-DeHxbXRn.d.cts} +8 -0
- package/dist/{errors-C1_sHGgx.d.cts → errors-DeHxbXRn.d.ts} +8 -0
- package/dist/html.cjs +10 -10
- package/dist/html.cjs.map +1 -1
- package/dist/html.d.cts +3 -3
- package/dist/html.d.ts +3 -3
- package/dist/html.js +5 -5
- package/dist/html.js.map +1 -1
- package/dist/index.cjs +18 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs +11 -10
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.d.cts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.js +6 -5
- package/dist/markdown.js.map +1 -1
- package/dist/text.cjs +8 -8
- package/dist/text.cjs.map +1 -1
- package/dist/text.d.cts +3 -3
- package/dist/text.d.ts +3 -3
- package/dist/text.js +3 -3
- package/dist/text.js.map +1 -1
- package/dist/yaml.cjs +10 -9
- package/dist/yaml.cjs.map +1 -1
- package/dist/yaml.d.cts +3 -3
- package/dist/yaml.d.ts +3 -3
- package/dist/yaml.js +5 -4
- package/dist/yaml.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-27B32RJQ.js.map +0 -1
- package/dist/chunk-2XWZW3RU.cjs.map +0 -1
- package/dist/chunk-4ELGGQ7B.js.map +0 -1
- package/dist/chunk-7DKZNZUD.cjs.map +0 -1
- package/dist/chunk-GZSUAD6M.cjs +0 -31
- package/dist/chunk-RNH6KTYZ.cjs.map +0 -1
- package/dist/chunk-TV4AZVHZ.cjs +0 -33
- /package/dist/{chunk-ODTH774G.js.map → chunk-DAIPI5CX.js.map} +0 -0
- /package/dist/{chunk-UOPLHOTJ.js.map → chunk-GUTUSN4K.js.map} +0 -0
- /package/dist/{chunk-RZYVLO3Z.js.map → chunk-ITDTGCLJ.js.map} +0 -0
- /package/dist/{chunk-UIUJSDBS.js.map → chunk-JVBK3LG3.js.map} +0 -0
package/dist/html.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.html.ts"],"sourcesContent":["import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeHtmlPipeline, runHtmlPipeline } from \"./engine/html-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/html` — HTML-only entry point. Its module graph includes `parse5` but excludes the\n * Micromark/MDX stack (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1): it imports\n * `./engine/html-pipeline.js` directly and never `./engine/pipeline.js` or `./modes/markdown.js`.\n *\n * `mode` is absent from `HtmlOptions`, since this entry only ever runs `html` mode. `dialect` is\n * likewise absent — it has no effect in `html` mode even in the aggregate entry (types.ts), so\n * there is nothing for it to conflict with here.\n */\nexport type HtmlOptions = Omit<Options, \"mode\" | \"dialect\">;\n\nexport function transform(input: string, options: HtmlOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"html\", \"polytypo/html\");\n return runHtmlPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` — into the document,\n * not into a span (analyze.md §6).\n */\nexport function analyze(input: string, options: HtmlOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"html\", \"polytypo/html\");\n return analyzeHtmlPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;;;AAgBO,SAAS,UAAU,OAAe,SAA8B;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,gBAAgB,OAAO,KAAK;AACrC;AAOO,SAAS,QAAQ,OAAe,SAAgC;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,oBAAoB,OAAO,KAAK;AACzC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.html.ts"],"sourcesContent":["import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeHtmlPipeline, runHtmlPipeline } from \"./engine/html-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/html` — HTML-only entry point. Its module graph includes `parse5` but excludes the\n * Micromark/MDX stack (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1): it imports\n * `./engine/html-pipeline.js` directly and never `./engine/pipeline.js` or `./modes/markdown.js`.\n *\n * `mode` is absent from `HtmlOptions`, since this entry only ever runs `html` mode. `dialect` is\n * likewise absent — it has no effect in `html` mode even in the aggregate entry (types.ts), so\n * there is nothing for it to conflict with here.\n */\nexport type HtmlOptions = Omit<Options, \"mode\" | \"dialect\" | \"frontmatterKeys\">;\n\nexport function transform(input: string, options: HtmlOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"html\", \"polytypo/html\");\n return runHtmlPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` — into the document,\n * not into a span (analyze.md §6).\n */\nexport function analyze(input: string, options: HtmlOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"html\", \"polytypo/html\");\n return analyzeHtmlPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;;;AAgBO,SAAS,UAAU,OAAe,SAA8B;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,gBAAgB,OAAO,KAAK;AACrC;AAOO,SAAS,QAAQ,OAAe,SAAgC;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,oBAAoB,OAAO,KAAK;AACzC;","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkHTCGXDEGcjs = require('./chunk-HTCGXDEG.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk33SLJJSZcjs = require('./chunk-33SLJJSZ.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
12
|
+
var _chunk54TSHDNCcjs = require('./chunk-54TSHDNC.cjs');
|
|
13
|
+
require('./chunk-MMXKQUAS.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
18
|
-
require('./chunk-
|
|
17
|
+
var _chunkX6CI7GWVcjs = require('./chunk-X6CI7GWV.cjs');
|
|
18
|
+
require('./chunk-IQHYZG2K.cjs');
|
|
19
|
+
require('./chunk-VDLHT5CW.cjs');
|
|
19
20
|
|
|
20
21
|
|
|
21
|
-
var
|
|
22
|
+
var _chunkFMU74VA6cjs = require('./chunk-FMU74VA6.cjs');
|
|
22
23
|
|
|
23
24
|
// src/engine/pipeline.ts
|
|
24
25
|
function resolveMode(mode) {
|
|
25
26
|
if (mode === void 0 || mode === "text") return "text";
|
|
26
27
|
if (mode === "html" || mode === "markdown" || mode === "yaml") return mode;
|
|
27
|
-
throw new (0,
|
|
28
|
+
throw new (0, _chunkFMU74VA6cjs.PolytypoError)(
|
|
28
29
|
"POLYTYPO_INVALID_MODE",
|
|
29
30
|
`Unknown mode "${String(mode)}". Expected "text", "html", "markdown" or "yaml".`
|
|
30
31
|
);
|
|
@@ -32,18 +33,18 @@ function resolveMode(mode) {
|
|
|
32
33
|
function runPipeline(input, options) {
|
|
33
34
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
34
35
|
const mode = resolveMode(given.mode);
|
|
35
|
-
if (mode === "text") return
|
|
36
|
-
if (mode === "html") return
|
|
37
|
-
if (mode === "yaml") return
|
|
38
|
-
return
|
|
36
|
+
if (mode === "text") return _chunkHTCGXDEGcjs.runTextPipeline.call(void 0, input, given);
|
|
37
|
+
if (mode === "html") return _chunk33SLJJSZcjs.runHtmlPipeline.call(void 0, input, given);
|
|
38
|
+
if (mode === "yaml") return _chunkX6CI7GWVcjs.runYamlPipeline.call(void 0, input, given);
|
|
39
|
+
return _chunk54TSHDNCcjs.runMarkdownPipeline.call(void 0, input, given);
|
|
39
40
|
}
|
|
40
41
|
function runAnalyze(input, options) {
|
|
41
42
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
42
43
|
const mode = resolveMode(given.mode);
|
|
43
|
-
if (mode === "text") return
|
|
44
|
-
if (mode === "html") return
|
|
45
|
-
if (mode === "yaml") return
|
|
46
|
-
return
|
|
44
|
+
if (mode === "text") return _chunkHTCGXDEGcjs.analyzeTextPipeline.call(void 0, input, given);
|
|
45
|
+
if (mode === "html") return _chunk33SLJJSZcjs.analyzeHtmlPipeline.call(void 0, input, given);
|
|
46
|
+
if (mode === "yaml") return _chunkX6CI7GWVcjs.analyzeYamlPipeline.call(void 0, input, given);
|
|
47
|
+
return _chunk54TSHDNCcjs.analyzeMarkdownPipeline.call(void 0, input, given);
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
// src/index.ts
|
|
@@ -57,5 +58,5 @@ function analyze(input, options) {
|
|
|
57
58
|
|
|
58
59
|
|
|
59
60
|
|
|
60
|
-
exports.PolytypoError =
|
|
61
|
+
exports.PolytypoError = _chunkFMU74VA6cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
61
62
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/index.cjs","../src/engine/pipeline.ts","../src/index.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/index.cjs","../src/engine/pipeline.ts","../src/index.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACbA,SAAS,WAAA,CAAY,IAAA,EAA8B;AACjD,EAAA,GAAA,CAAI,KAAA,IAAS,KAAA,EAAA,GAAa,KAAA,IAAS,MAAA,EAAQ,OAAO,MAAA;AAClD,EAAA,GAAA,CAAI,KAAA,IAAS,OAAA,GAAU,KAAA,IAAS,WAAA,GAAc,KAAA,IAAS,MAAA,EAAQ,OAAO,IAAA;AACtE,EAAA,MAAM,IAAI,oCAAA;AAAA,IACR,uBAAA;AAAA,IACA,CAAA,cAAA,EAAiB,MAAA,CAAO,IAAI,CAAC,CAAA,iDAAA;AAAA,EAC/B,CAAA;AACF;AASO,SAAS,WAAA,CAAY,KAAA,EAAe,OAAA,EAA0B;AAInE,EAAA,MAAM,MAAA,mBAA0B,OAAA,UAAW,CAAC,GAAA;AAC5C,EAAA,MAAM,KAAA,EAAO,WAAA,CAAY,KAAA,CAAM,IAAI,CAAA;AACnC,EAAA,GAAA,CAAI,KAAA,IAAS,MAAA,EAAQ,OAAO,+CAAA,KAAgB,EAAO,KAAK,CAAA;AACxD,EAAA,GAAA,CAAI,KAAA,IAAS,MAAA,EAAQ,OAAO,+CAAA,KAAgB,EAAO,KAAK,CAAA;AACxD,EAAA,GAAA,CAAI,KAAA,IAAS,MAAA,EAAQ,OAAO,+CAAA,KAAgB,EAAO,KAAK,CAAA;AACxD,EAAA,OAAO,mDAAA,KAAoB,EAAO,KAAK,CAAA;AACzC;AAOO,SAAS,UAAA,CAAW,KAAA,EAAe,OAAA,EAA4B;AACpE,EAAA,MAAM,MAAA,mBAA0B,OAAA,UAAW,CAAC,GAAA;AAC5C,EAAA,MAAM,KAAA,EAAO,WAAA,CAAY,KAAA,CAAM,IAAI,CAAA;AACnC,EAAA,GAAA,CAAI,KAAA,IAAS,MAAA,EAAQ,OAAO,mDAAA,KAAoB,EAAO,KAAK,CAAA;AAC5D,EAAA,GAAA,CAAI,KAAA,IAAS,MAAA,EAAQ,OAAO,mDAAA,KAAoB,EAAO,KAAK,CAAA;AAC5D,EAAA,GAAA,CAAI,KAAA,IAAS,MAAA,EAAQ,OAAO,mDAAA,KAAoB,EAAO,KAAK,CAAA;AAC5D,EAAA,OAAO,uDAAA,KAAwB,EAAO,KAAK,CAAA;AAC7C;ADFA;AACA;AE7CO,SAAS,SAAA,CAAU,KAAA,EAAe,OAAA,EAA0B;AACjE,EAAA,OAAO,WAAA,CAAY,KAAA,EAAO,OAAO,CAAA;AACnC;AAYO,SAAS,OAAA,CAAQ,KAAA,EAAe,OAAA,EAA4B;AACjE,EAAA,OAAO,UAAA,CAAW,KAAA,EAAO,OAAO,CAAA;AAClC;AFoCA;AACE;AACA;AACA;AACF,kHAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/index.cjs","sourcesContent":[null,"import { PolytypoError } from \"../errors.js\";\nimport type { Mode, Options } from \"../types.js\";\nimport { analyzeHtmlPipeline, runHtmlPipeline } from \"./html-pipeline.js\";\nimport { analyzeMarkdownPipeline, runMarkdownPipeline } from \"./markdown-pipeline.js\";\nimport { analyzeTextPipeline, runTextPipeline } from \"./text-pipeline.js\";\nimport { analyzeYamlPipeline, runYamlPipeline } from \"./yaml-pipeline.js\";\nimport type { Change } from \"./origin.js\";\n\nexport { planRules } from \"./rule-runner.js\";\n\nfunction resolveMode(mode: Mode | undefined): Mode {\n if (mode === undefined || mode === \"text\") return \"text\";\n if (mode === \"html\" || mode === \"markdown\" || mode === \"yaml\") return mode;\n throw new PolytypoError(\n \"POLYTYPO_INVALID_MODE\",\n `Unknown mode \"${String(mode)}\". Expected \"text\", \"html\", \"markdown\" or \"yaml\".`,\n );\n}\n\n/**\n * The aggregate entry's dispatcher: every mode is reachable, so it is the only pipeline module\n * that imports all four mode-specific ones (and therefore the only one whose module graph\n * includes both `parse5` and the Micromark/MDX stack). `polytypo/text`, `polytypo/html` and\n * `polytypo/markdown` each call their own mode-specific pipeline directly and never import this\n * module (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1).\n */\nexport function runPipeline(input: string, options: Options): string {\n // A plain-JS caller can omit the options object entirely. Reading through a null here would\n // raise a native TypeError, which is outside the error taxonomy; an absent `locale` is an\n // unknown locale and must say so with a code (locale-resolution.md 3.1).\n const given: Partial<Options> = options ?? {};\n const mode = resolveMode(given.mode);\n if (mode === \"text\") return runTextPipeline(input, given);\n if (mode === \"html\") return runHtmlPipeline(input, given);\n if (mode === \"yaml\") return runYamlPipeline(input, given);\n return runMarkdownPipeline(input, given);\n}\n\n/**\n * The dispatcher for `analyze` (analyze.md §1). Mode resolution, and therefore\n * POLYTYPO_INVALID_MODE, is shared with `runPipeline` rather than duplicated: A1 requires the\n * two entry points to accept and reject exactly the same arguments.\n */\nexport function runAnalyze(input: string, options: Options): Change[] {\n const given: Partial<Options> = options ?? {};\n const mode = resolveMode(given.mode);\n if (mode === \"text\") return analyzeTextPipeline(input, given);\n if (mode === \"html\") return analyzeHtmlPipeline(input, given);\n if (mode === \"yaml\") return analyzeYamlPipeline(input, given);\n return analyzeMarkdownPipeline(input, given);\n}\n","import { runAnalyze, runPipeline } from \"./engine/pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\nexport function transform(input: string, options: Options): string {\n return runPipeline(input, options);\n}\n\n/**\n * The same pipeline as `transform`, reporting what it would do instead of doing it\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` in every mode.\n *\n * What it guarantees: the list is empty exactly when `transform` would return the input\n * unchanged, every `ruleId` was enabled for the call, and every offset is inside the input.\n * What it does not: the list is a report, not a patch — two rules may touch the same original\n * range, so replaying it is not guaranteed to reproduce `transform`'s output. Call `transform`\n * for the text (analyze.md §4, §5).\n */\nexport function analyze(input: string, options: Options): Change[] {\n return runAnalyze(input, options);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type {\n Dialect,\n Edit,\n LocaleData,\n LocaleSource,\n Mode,\n NarrowNbsp,\n Options,\n QuotePair,\n Rule,\n RuleContext,\n RuleId,\n} from \"./types.js\";\n"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as Options, C as Change } from './errors-
|
|
2
|
-
export { D as Dialect, E as Edit, L as LocaleData, a as LocaleSource, M as Mode, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-
|
|
1
|
+
import { O as Options, C as Change } from './errors-DeHxbXRn.cjs';
|
|
2
|
+
export { D as Dialect, E as Edit, L as LocaleData, a as LocaleSource, M as Mode, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-DeHxbXRn.cjs';
|
|
3
3
|
|
|
4
4
|
declare function transform(input: string, options: Options): string;
|
|
5
5
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as Options, C as Change } from './errors-
|
|
2
|
-
export { D as Dialect, E as Edit, L as LocaleData, a as LocaleSource, M as Mode, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-
|
|
1
|
+
import { O as Options, C as Change } from './errors-DeHxbXRn.js';
|
|
2
|
+
export { D as Dialect, E as Edit, L as LocaleData, a as LocaleSource, M as Mode, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-DeHxbXRn.js';
|
|
3
3
|
|
|
4
4
|
declare function transform(input: string, options: Options): string;
|
|
5
5
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeTextPipeline,
|
|
3
3
|
runTextPipeline
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DAIPI5CX.js";
|
|
5
5
|
import {
|
|
6
6
|
analyzeHtmlPipeline,
|
|
7
7
|
runHtmlPipeline
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GUTUSN4K.js";
|
|
9
9
|
import {
|
|
10
10
|
analyzeMarkdownPipeline,
|
|
11
11
|
runMarkdownPipeline
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-JE2MK4CC.js";
|
|
13
|
+
import "./chunk-ITDTGCLJ.js";
|
|
14
14
|
import {
|
|
15
15
|
analyzeYamlPipeline,
|
|
16
16
|
runYamlPipeline
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-74I62TZ2.js";
|
|
18
|
+
import "./chunk-HBIIWBB5.js";
|
|
19
|
+
import "./chunk-U5Y7C2L4.js";
|
|
19
20
|
import {
|
|
20
21
|
PolytypoError
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-25XZKUNP.js";
|
|
22
23
|
|
|
23
24
|
// src/engine/pipeline.ts
|
|
24
25
|
function resolveMode(mode) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/engine/pipeline.ts","../src/index.ts"],"sourcesContent":["import { PolytypoError } from \"../errors.js\";\nimport type { Mode, Options } from \"../types.js\";\nimport { analyzeHtmlPipeline, runHtmlPipeline } from \"./html-pipeline.js\";\nimport { analyzeMarkdownPipeline, runMarkdownPipeline } from \"./markdown-pipeline.js\";\nimport { analyzeTextPipeline, runTextPipeline } from \"./text-pipeline.js\";\nimport { analyzeYamlPipeline, runYamlPipeline } from \"./yaml-pipeline.js\";\nimport type { Change } from \"./origin.js\";\n\nexport { planRules } from \"./rule-runner.js\";\n\nfunction resolveMode(mode: Mode | undefined): Mode {\n if (mode === undefined || mode === \"text\") return \"text\";\n if (mode === \"html\" || mode === \"markdown\" || mode === \"yaml\") return mode;\n throw new PolytypoError(\n \"POLYTYPO_INVALID_MODE\",\n `Unknown mode \"${String(mode)}\". Expected \"text\", \"html\", \"markdown\" or \"yaml\".`,\n );\n}\n\n/**\n * The aggregate entry's dispatcher: every mode is reachable, so it is the only pipeline module\n * that imports all four mode-specific ones (and therefore the only one whose module graph\n * includes both `parse5` and the Micromark/MDX stack). `polytypo/text`, `polytypo/html` and\n * `polytypo/markdown` each call their own mode-specific pipeline directly and never import this\n * module (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1).\n */\nexport function runPipeline(input: string, options: Options): string {\n // A plain-JS caller can omit the options object entirely. Reading through a null here would\n // raise a native TypeError, which is outside the error taxonomy; an absent `locale` is an\n // unknown locale and must say so with a code (locale-resolution.md 3.1).\n const given: Partial<Options> = options ?? {};\n const mode = resolveMode(given.mode);\n if (mode === \"text\") return runTextPipeline(input, given);\n if (mode === \"html\") return runHtmlPipeline(input, given);\n if (mode === \"yaml\") return runYamlPipeline(input, given);\n return runMarkdownPipeline(input, given);\n}\n\n/**\n * The dispatcher for `analyze` (analyze.md §1). Mode resolution, and therefore\n * POLYTYPO_INVALID_MODE, is shared with `runPipeline` rather than duplicated: A1 requires the\n * two entry points to accept and reject exactly the same arguments.\n */\nexport function runAnalyze(input: string, options: Options): Change[] {\n const given: Partial<Options> = options ?? {};\n const mode = resolveMode(given.mode);\n if (mode === \"text\") return analyzeTextPipeline(input, given);\n if (mode === \"html\") return analyzeHtmlPipeline(input, given);\n if (mode === \"yaml\") return analyzeYamlPipeline(input, given);\n return analyzeMarkdownPipeline(input, given);\n}\n","import { runAnalyze, runPipeline } from \"./engine/pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\nexport function transform(input: string, options: Options): string {\n return runPipeline(input, options);\n}\n\n/**\n * The same pipeline as `transform`, reporting what it would do instead of doing it\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` in every mode.\n *\n * What it guarantees: the list is empty exactly when `transform` would return the input\n * unchanged, every `ruleId` was enabled for the call, and every offset is inside the input.\n * What it does not: the list is a report, not a patch — two rules may touch the same original\n * range, so replaying it is not guaranteed to reproduce `transform`'s output. Call `transform`\n * for the text (analyze.md §4, §5).\n */\nexport function analyze(input: string, options: Options): Change[] {\n return runAnalyze(input, options);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type {\n Dialect,\n Edit,\n LocaleData,\n LocaleSource,\n Mode,\n NarrowNbsp,\n Options,\n QuotePair,\n Rule,\n RuleContext,\n RuleId,\n} from \"./types.js\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/engine/pipeline.ts","../src/index.ts"],"sourcesContent":["import { PolytypoError } from \"../errors.js\";\nimport type { Mode, Options } from \"../types.js\";\nimport { analyzeHtmlPipeline, runHtmlPipeline } from \"./html-pipeline.js\";\nimport { analyzeMarkdownPipeline, runMarkdownPipeline } from \"./markdown-pipeline.js\";\nimport { analyzeTextPipeline, runTextPipeline } from \"./text-pipeline.js\";\nimport { analyzeYamlPipeline, runYamlPipeline } from \"./yaml-pipeline.js\";\nimport type { Change } from \"./origin.js\";\n\nexport { planRules } from \"./rule-runner.js\";\n\nfunction resolveMode(mode: Mode | undefined): Mode {\n if (mode === undefined || mode === \"text\") return \"text\";\n if (mode === \"html\" || mode === \"markdown\" || mode === \"yaml\") return mode;\n throw new PolytypoError(\n \"POLYTYPO_INVALID_MODE\",\n `Unknown mode \"${String(mode)}\". Expected \"text\", \"html\", \"markdown\" or \"yaml\".`,\n );\n}\n\n/**\n * The aggregate entry's dispatcher: every mode is reachable, so it is the only pipeline module\n * that imports all four mode-specific ones (and therefore the only one whose module graph\n * includes both `parse5` and the Micromark/MDX stack). `polytypo/text`, `polytypo/html` and\n * `polytypo/markdown` each call their own mode-specific pipeline directly and never import this\n * module (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1).\n */\nexport function runPipeline(input: string, options: Options): string {\n // A plain-JS caller can omit the options object entirely. Reading through a null here would\n // raise a native TypeError, which is outside the error taxonomy; an absent `locale` is an\n // unknown locale and must say so with a code (locale-resolution.md 3.1).\n const given: Partial<Options> = options ?? {};\n const mode = resolveMode(given.mode);\n if (mode === \"text\") return runTextPipeline(input, given);\n if (mode === \"html\") return runHtmlPipeline(input, given);\n if (mode === \"yaml\") return runYamlPipeline(input, given);\n return runMarkdownPipeline(input, given);\n}\n\n/**\n * The dispatcher for `analyze` (analyze.md §1). Mode resolution, and therefore\n * POLYTYPO_INVALID_MODE, is shared with `runPipeline` rather than duplicated: A1 requires the\n * two entry points to accept and reject exactly the same arguments.\n */\nexport function runAnalyze(input: string, options: Options): Change[] {\n const given: Partial<Options> = options ?? {};\n const mode = resolveMode(given.mode);\n if (mode === \"text\") return analyzeTextPipeline(input, given);\n if (mode === \"html\") return analyzeHtmlPipeline(input, given);\n if (mode === \"yaml\") return analyzeYamlPipeline(input, given);\n return analyzeMarkdownPipeline(input, given);\n}\n","import { runAnalyze, runPipeline } from \"./engine/pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\nexport function transform(input: string, options: Options): string {\n return runPipeline(input, options);\n}\n\n/**\n * The same pipeline as `transform`, reporting what it would do instead of doing it\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` in every mode.\n *\n * What it guarantees: the list is empty exactly when `transform` would return the input\n * unchanged, every `ruleId` was enabled for the call, and every offset is inside the input.\n * What it does not: the list is a report, not a patch — two rules may touch the same original\n * range, so replaying it is not guaranteed to reproduce `transform`'s output. Call `transform`\n * for the text (analyze.md §4, §5).\n */\nexport function analyze(input: string, options: Options): Change[] {\n return runAnalyze(input, options);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type {\n Dialect,\n Edit,\n LocaleData,\n LocaleSource,\n Mode,\n NarrowNbsp,\n Options,\n QuotePair,\n Rule,\n RuleContext,\n RuleId,\n} from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,YAAY,MAA8B;AACjD,MAAI,SAAS,UAAa,SAAS,OAAQ,QAAO;AAClD,MAAI,SAAS,UAAU,SAAS,cAAc,SAAS,OAAQ,QAAO;AACtE,QAAM,IAAI;AAAA,IACR;AAAA,IACA,iBAAiB,OAAO,IAAI,CAAC;AAAA,EAC/B;AACF;AASO,SAAS,YAAY,OAAe,SAA0B;AAInE,QAAM,QAA0B,WAAW,CAAC;AAC5C,QAAM,OAAO,YAAY,MAAM,IAAI;AACnC,MAAI,SAAS,OAAQ,QAAO,gBAAgB,OAAO,KAAK;AACxD,MAAI,SAAS,OAAQ,QAAO,gBAAgB,OAAO,KAAK;AACxD,MAAI,SAAS,OAAQ,QAAO,gBAAgB,OAAO,KAAK;AACxD,SAAO,oBAAoB,OAAO,KAAK;AACzC;AAOO,SAAS,WAAW,OAAe,SAA4B;AACpE,QAAM,QAA0B,WAAW,CAAC;AAC5C,QAAM,OAAO,YAAY,MAAM,IAAI;AACnC,MAAI,SAAS,OAAQ,QAAO,oBAAoB,OAAO,KAAK;AAC5D,MAAI,SAAS,OAAQ,QAAO,oBAAoB,OAAO,KAAK;AAC5D,MAAI,SAAS,OAAQ,QAAO,oBAAoB,OAAO,KAAK;AAC5D,SAAO,wBAAwB,OAAO,KAAK;AAC7C;;;AC9CO,SAAS,UAAU,OAAe,SAA0B;AACjE,SAAO,YAAY,OAAO,OAAO;AACnC;AAYO,SAAS,QAAQ,OAAe,SAA4B;AACjE,SAAO,WAAW,OAAO,OAAO;AAClC;","names":[]}
|
package/dist/markdown.cjs
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
4
|
+
var _chunk54TSHDNCcjs = require('./chunk-54TSHDNC.cjs');
|
|
5
|
+
require('./chunk-MMXKQUAS.cjs');
|
|
6
|
+
require('./chunk-IQHYZG2K.cjs');
|
|
7
|
+
require('./chunk-VDLHT5CW.cjs');
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
var
|
|
10
|
+
var _chunkI2QPXPHXcjs = require('./chunk-I2QPXPHX.cjs');
|
|
10
11
|
|
|
11
12
|
|
|
12
|
-
var
|
|
13
|
+
var _chunkFMU74VA6cjs = require('./chunk-FMU74VA6.cjs');
|
|
13
14
|
|
|
14
15
|
// src/index.markdown.ts
|
|
15
16
|
function transform(input, options) {
|
|
16
17
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
17
|
-
|
|
18
|
-
return
|
|
18
|
+
_chunkI2QPXPHXcjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
|
|
19
|
+
return _chunk54TSHDNCcjs.runMarkdownPipeline.call(void 0, input, given);
|
|
19
20
|
}
|
|
20
21
|
function analyze(input, options) {
|
|
21
22
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
22
|
-
|
|
23
|
-
return
|
|
23
|
+
_chunkI2QPXPHXcjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
|
|
24
|
+
return _chunk54TSHDNCcjs.analyzeMarkdownPipeline.call(void 0, input, given);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
|
|
29
|
-
exports.PolytypoError =
|
|
30
|
+
exports.PolytypoError = _chunkFMU74VA6cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
30
31
|
//# sourceMappingURL=markdown.cjs.map
|
package/dist/markdown.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/markdown.cjs","../src/index.markdown.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/markdown.cjs","../src/index.markdown.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACKO,SAAS,SAAA,CAAU,KAAA,EAAe,OAAA,EAAkC;AACzE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,UAAA,EAAY,mBAAmB,CAAA;AAC3D,EAAA,OAAO,mDAAA,KAAoB,EAAO,KAAK,CAAA;AACzC;AAOO,SAAS,OAAA,CAAQ,KAAA,EAAe,OAAA,EAAoC;AACzE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,UAAA,EAAY,mBAAmB,CAAA;AAC3D,EAAA,OAAO,uDAAA,KAAwB,EAAO,KAAK,CAAA;AAC7C;ADTA;AACE;AACA;AACA;AACF,kHAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/markdown.cjs","sourcesContent":[null,"import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeMarkdownPipeline, runMarkdownPipeline } from \"./engine/markdown-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Dialect, Options } from \"./types.js\";\n\n/**\n * `polytypo/markdown` — Markdown-only entry point. Its module graph includes the Micromark/MDX\n * stack and `parse5` (the latter via `./modes/markdown.js` importing `./modes/html.js` for\n * normative embedded-HTML handling, modes.md 3.7) — both are legitimately reachable here\n * (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1). It imports `./engine/markdown-pipeline.js`\n * directly and never `./engine/pipeline.js`.\n *\n * `mode` is absent from `MarkdownOptions`, since this entry only ever runs `markdown` mode.\n * `dialect` keeps the aggregate entry's contract: required, no default (types.ts).\n */\nexport type MarkdownOptions = Omit<Options, \"mode\"> & {\n dialect: Dialect;\n};\n\nexport function transform(input: string, options: MarkdownOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"markdown\", \"polytypo/markdown\");\n return runMarkdownPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` — into the document,\n * not into a span (analyze.md §6).\n */\nexport function analyze(input: string, options: MarkdownOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"markdown\", \"polytypo/markdown\");\n return analyzeMarkdownPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type {\n Dialect,\n LocaleData,\n LocaleSource,\n NarrowNbsp,\n QuotePair,\n Rule,\n RuleContext,\n RuleId,\n} from \"./types.js\";\n"]}
|
package/dist/markdown.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as Options, D as Dialect, C as Change } from './errors-
|
|
2
|
-
export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-
|
|
1
|
+
import { O as Options, D as Dialect, C as Change } from './errors-DeHxbXRn.cjs';
|
|
2
|
+
export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-DeHxbXRn.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `polytypo/markdown` — Markdown-only entry point. Its module graph includes the Micromark/MDX
|
package/dist/markdown.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as Options, D as Dialect, C as Change } from './errors-
|
|
2
|
-
export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-
|
|
1
|
+
import { O as Options, D as Dialect, C as Change } from './errors-DeHxbXRn.js';
|
|
2
|
+
export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-DeHxbXRn.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `polytypo/markdown` — Markdown-only entry point. Its module graph includes the Micromark/MDX
|
package/dist/markdown.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeMarkdownPipeline,
|
|
3
3
|
runMarkdownPipeline
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-JE2MK4CC.js";
|
|
5
|
+
import "./chunk-ITDTGCLJ.js";
|
|
6
|
+
import "./chunk-HBIIWBB5.js";
|
|
7
|
+
import "./chunk-U5Y7C2L4.js";
|
|
7
8
|
import {
|
|
8
9
|
assertFixedMode
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JVBK3LG3.js";
|
|
10
11
|
import {
|
|
11
12
|
PolytypoError
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-25XZKUNP.js";
|
|
13
14
|
|
|
14
15
|
// src/index.markdown.ts
|
|
15
16
|
function transform(input, options) {
|
package/dist/markdown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.markdown.ts"],"sourcesContent":["import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeMarkdownPipeline, runMarkdownPipeline } from \"./engine/markdown-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Dialect, Options } from \"./types.js\";\n\n/**\n * `polytypo/markdown` — Markdown-only entry point. Its module graph includes the Micromark/MDX\n * stack and `parse5` (the latter via `./modes/markdown.js` importing `./modes/html.js` for\n * normative embedded-HTML handling, modes.md 3.7) — both are legitimately reachable here\n * (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1). It imports `./engine/markdown-pipeline.js`\n * directly and never `./engine/pipeline.js`.\n *\n * `mode` is absent from `MarkdownOptions`, since this entry only ever runs `markdown` mode.\n * `dialect` keeps the aggregate entry's contract: required, no default (types.ts).\n */\nexport type MarkdownOptions = Omit<Options, \"mode\"> & {\n dialect: Dialect;\n};\n\nexport function transform(input: string, options: MarkdownOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"markdown\", \"polytypo/markdown\");\n return runMarkdownPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` — into the document,\n * not into a span (analyze.md §6).\n */\nexport function analyze(input: string, options: MarkdownOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"markdown\", \"polytypo/markdown\");\n return analyzeMarkdownPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type {\n Dialect,\n LocaleData,\n LocaleSource,\n NarrowNbsp,\n QuotePair,\n Rule,\n RuleContext,\n RuleId,\n} from \"./types.js\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.markdown.ts"],"sourcesContent":["import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeMarkdownPipeline, runMarkdownPipeline } from \"./engine/markdown-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Dialect, Options } from \"./types.js\";\n\n/**\n * `polytypo/markdown` — Markdown-only entry point. Its module graph includes the Micromark/MDX\n * stack and `parse5` (the latter via `./modes/markdown.js` importing `./modes/html.js` for\n * normative embedded-HTML handling, modes.md 3.7) — both are legitimately reachable here\n * (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1). It imports `./engine/markdown-pipeline.js`\n * directly and never `./engine/pipeline.js`.\n *\n * `mode` is absent from `MarkdownOptions`, since this entry only ever runs `markdown` mode.\n * `dialect` keeps the aggregate entry's contract: required, no default (types.ts).\n */\nexport type MarkdownOptions = Omit<Options, \"mode\"> & {\n dialect: Dialect;\n};\n\nexport function transform(input: string, options: MarkdownOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"markdown\", \"polytypo/markdown\");\n return runMarkdownPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input` — into the document,\n * not into a span (analyze.md §6).\n */\nexport function analyze(input: string, options: MarkdownOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"markdown\", \"polytypo/markdown\");\n return analyzeMarkdownPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type {\n Dialect,\n LocaleData,\n LocaleSource,\n NarrowNbsp,\n QuotePair,\n Rule,\n RuleContext,\n RuleId,\n} from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;;;;AAmBO,SAAS,UAAU,OAAe,SAAkC;AACzE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,YAAY,mBAAmB;AAC3D,SAAO,oBAAoB,OAAO,KAAK;AACzC;AAOO,SAAS,QAAQ,OAAe,SAAoC;AACzE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,YAAY,mBAAmB;AAC3D,SAAO,wBAAwB,OAAO,KAAK;AAC7C;","names":[]}
|
package/dist/text.cjs
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkHTCGXDEGcjs = require('./chunk-HTCGXDEG.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkI2QPXPHXcjs = require('./chunk-I2QPXPHX.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkFMU74VA6cjs = require('./chunk-FMU74VA6.cjs');
|
|
11
11
|
|
|
12
12
|
// src/index.text.ts
|
|
13
13
|
function transform(input, options) {
|
|
14
14
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
15
|
-
|
|
16
|
-
return
|
|
15
|
+
_chunkI2QPXPHXcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
|
|
16
|
+
return _chunkHTCGXDEGcjs.runTextPipeline.call(void 0, input, given);
|
|
17
17
|
}
|
|
18
18
|
function analyze(input, options) {
|
|
19
19
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
20
|
-
|
|
21
|
-
return
|
|
20
|
+
_chunkI2QPXPHXcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
|
|
21
|
+
return _chunkHTCGXDEGcjs.analyzeTextPipeline.call(void 0, input, given);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
exports.PolytypoError =
|
|
27
|
+
exports.PolytypoError = _chunkFMU74VA6cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
28
28
|
//# sourceMappingURL=text.cjs.map
|
package/dist/text.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/text.cjs","../src/index.text.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACMO,SAAS,SAAA,CAAU,KAAA,EAAe,OAAA,EAA8B;AACrE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,MAAA,EAAQ,eAAe,CAAA;AACnD,EAAA,OAAO,+CAAA,KAAgB,EAAO,KAAK,CAAA;AACrC;AAMO,SAAS,OAAA,CAAQ,KAAA,EAAe,OAAA,EAAgC;AACrE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,MAAA,EAAQ,eAAe,CAAA;AACnD,EAAA,OAAO,mDAAA,KAAoB,EAAO,KAAK,CAAA;AACzC;ADTA;AACE;AACA;AACA;AACF,kHAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/text.cjs","sourcesContent":[null,"import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeTextPipeline, runTextPipeline } from \"./engine/text-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the\n * Micromark/MDX stack entirely (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1): it imports\n * `./engine/text-pipeline.js` directly and never `./engine/pipeline.js`, `./modes/html.js` or\n * `./modes/markdown.js`.\n *\n * `mode` is absent from `TextOptions`, since this entry only ever runs `text` mode. `dialect` is\n * likewise absent — it has no effect in `text` mode even in the aggregate entry (types.ts), so\n * there is nothing for it to conflict with here.\n */\nexport type TextOptions = Omit<Options, \"mode\" | \"dialect\">;\n\nexport function transform(input: string, options: TextOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"text\", \"polytypo/text\");\n return runTextPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input`.\n */\nexport function analyze(input: string, options: TextOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"text\", \"polytypo/text\");\n return analyzeTextPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/text.cjs","../src/index.text.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACMO,SAAS,SAAA,CAAU,KAAA,EAAe,OAAA,EAA8B;AACrE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,MAAA,EAAQ,eAAe,CAAA;AACnD,EAAA,OAAO,+CAAA,KAAgB,EAAO,KAAK,CAAA;AACrC;AAMO,SAAS,OAAA,CAAQ,KAAA,EAAe,OAAA,EAAgC;AACrE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,MAAA,EAAQ,eAAe,CAAA;AACnD,EAAA,OAAO,mDAAA,KAAoB,EAAO,KAAK,CAAA;AACzC;ADTA;AACE;AACA;AACA;AACF,kHAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/text.cjs","sourcesContent":[null,"import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeTextPipeline, runTextPipeline } from \"./engine/text-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the\n * Micromark/MDX stack entirely (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1): it imports\n * `./engine/text-pipeline.js` directly and never `./engine/pipeline.js`, `./modes/html.js` or\n * `./modes/markdown.js`.\n *\n * `mode` is absent from `TextOptions`, since this entry only ever runs `text` mode. `dialect` is\n * likewise absent — it has no effect in `text` mode even in the aggregate entry (types.ts), so\n * there is nothing for it to conflict with here.\n */\nexport type TextOptions = Omit<Options, \"mode\" | \"dialect\" | \"frontmatterKeys\">;\n\nexport function transform(input: string, options: TextOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"text\", \"polytypo/text\");\n return runTextPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input`.\n */\nexport function analyze(input: string, options: TextOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"text\", \"polytypo/text\");\n return analyzeTextPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"]}
|
package/dist/text.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as Options, C as Change } from './errors-
|
|
2
|
-
export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-
|
|
1
|
+
import { O as Options, C as Change } from './errors-DeHxbXRn.cjs';
|
|
2
|
+
export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-DeHxbXRn.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the
|
|
@@ -11,7 +11,7 @@ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError
|
|
|
11
11
|
* likewise absent — it has no effect in `text` mode even in the aggregate entry (types.ts), so
|
|
12
12
|
* there is nothing for it to conflict with here.
|
|
13
13
|
*/
|
|
14
|
-
type TextOptions = Omit<Options, "mode" | "dialect">;
|
|
14
|
+
type TextOptions = Omit<Options, "mode" | "dialect" | "frontmatterKeys">;
|
|
15
15
|
declare function transform(input: string, options: TextOptions): string;
|
|
16
16
|
/**
|
|
17
17
|
* The same pipeline as this entry's `transform`, reporting instead of applying
|
package/dist/text.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as Options, C as Change } from './errors-
|
|
2
|
-
export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-
|
|
1
|
+
import { O as Options, C as Change } from './errors-DeHxbXRn.js';
|
|
2
|
+
export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-DeHxbXRn.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the
|
|
@@ -11,7 +11,7 @@ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError
|
|
|
11
11
|
* likewise absent — it has no effect in `text` mode even in the aggregate entry (types.ts), so
|
|
12
12
|
* there is nothing for it to conflict with here.
|
|
13
13
|
*/
|
|
14
|
-
type TextOptions = Omit<Options, "mode" | "dialect">;
|
|
14
|
+
type TextOptions = Omit<Options, "mode" | "dialect" | "frontmatterKeys">;
|
|
15
15
|
declare function transform(input: string, options: TextOptions): string;
|
|
16
16
|
/**
|
|
17
17
|
* The same pipeline as this entry's `transform`, reporting instead of applying
|
package/dist/text.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeTextPipeline,
|
|
3
3
|
runTextPipeline
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-DAIPI5CX.js";
|
|
5
5
|
import {
|
|
6
6
|
assertFixedMode
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JVBK3LG3.js";
|
|
8
8
|
import {
|
|
9
9
|
PolytypoError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-25XZKUNP.js";
|
|
11
11
|
|
|
12
12
|
// src/index.text.ts
|
|
13
13
|
function transform(input, options) {
|
package/dist/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.text.ts"],"sourcesContent":["import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeTextPipeline, runTextPipeline } from \"./engine/text-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the\n * Micromark/MDX stack entirely (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1): it imports\n * `./engine/text-pipeline.js` directly and never `./engine/pipeline.js`, `./modes/html.js` or\n * `./modes/markdown.js`.\n *\n * `mode` is absent from `TextOptions`, since this entry only ever runs `text` mode. `dialect` is\n * likewise absent — it has no effect in `text` mode even in the aggregate entry (types.ts), so\n * there is nothing for it to conflict with here.\n */\nexport type TextOptions = Omit<Options, \"mode\" | \"dialect\">;\n\nexport function transform(input: string, options: TextOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"text\", \"polytypo/text\");\n return runTextPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input`.\n */\nexport function analyze(input: string, options: TextOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"text\", \"polytypo/text\");\n return analyzeTextPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;AAiBO,SAAS,UAAU,OAAe,SAA8B;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,gBAAgB,OAAO,KAAK;AACrC;AAMO,SAAS,QAAQ,OAAe,SAAgC;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,oBAAoB,OAAO,KAAK;AACzC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.text.ts"],"sourcesContent":["import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeTextPipeline, runTextPipeline } from \"./engine/text-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the\n * Micromark/MDX stack entirely (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1): it imports\n * `./engine/text-pipeline.js` directly and never `./engine/pipeline.js`, `./modes/html.js` or\n * `./modes/markdown.js`.\n *\n * `mode` is absent from `TextOptions`, since this entry only ever runs `text` mode. `dialect` is\n * likewise absent — it has no effect in `text` mode even in the aggregate entry (types.ts), so\n * there is nothing for it to conflict with here.\n */\nexport type TextOptions = Omit<Options, \"mode\" | \"dialect\" | \"frontmatterKeys\">;\n\nexport function transform(input: string, options: TextOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"text\", \"polytypo/text\");\n return runTextPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input`.\n */\nexport function analyze(input: string, options: TextOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"text\", \"polytypo/text\");\n return analyzeTextPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;AAiBO,SAAS,UAAU,OAAe,SAA8B;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,gBAAgB,OAAO,KAAK;AACrC;AAMO,SAAS,QAAQ,OAAe,SAAgC;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,oBAAoB,OAAO,KAAK;AACzC;","names":[]}
|
package/dist/yaml.cjs
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('./chunk-
|
|
4
|
+
var _chunkX6CI7GWVcjs = require('./chunk-X6CI7GWV.cjs');
|
|
5
|
+
require('./chunk-IQHYZG2K.cjs');
|
|
6
|
+
require('./chunk-VDLHT5CW.cjs');
|
|
6
7
|
|
|
7
8
|
|
|
8
|
-
var
|
|
9
|
+
var _chunkI2QPXPHXcjs = require('./chunk-I2QPXPHX.cjs');
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
var
|
|
12
|
+
var _chunkFMU74VA6cjs = require('./chunk-FMU74VA6.cjs');
|
|
12
13
|
|
|
13
14
|
// src/index.yaml.ts
|
|
14
15
|
function transform(input, options) {
|
|
15
16
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
16
|
-
|
|
17
|
-
return
|
|
17
|
+
_chunkI2QPXPHXcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
|
|
18
|
+
return _chunkX6CI7GWVcjs.runYamlPipeline.call(void 0, input, given);
|
|
18
19
|
}
|
|
19
20
|
function analyze(input, options) {
|
|
20
21
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
21
|
-
|
|
22
|
-
return
|
|
22
|
+
_chunkI2QPXPHXcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
|
|
23
|
+
return _chunkX6CI7GWVcjs.analyzeYamlPipeline.call(void 0, input, given);
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
|
|
28
|
-
exports.PolytypoError =
|
|
29
|
+
exports.PolytypoError = _chunkFMU74VA6cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
29
30
|
//# sourceMappingURL=yaml.cjs.map
|
package/dist/yaml.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/yaml.cjs","../src/index.yaml.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/yaml.cjs","../src/index.yaml.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACSO,SAAS,SAAA,CAAU,KAAA,EAAe,OAAA,EAA8B;AACrE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,MAAA,EAAQ,eAAe,CAAA;AACnD,EAAA,OAAO,+CAAA,KAAgB,EAAO,KAAK,CAAA;AACrC;AAMO,SAAS,OAAA,CAAQ,KAAA,EAAe,OAAA,EAAgC;AACrE,EAAA,MAAM,MAAA,mBAAS,OAAA,UAAW,CAAC,GAAA;AAC3B,EAAA,+CAAA,KAAgB,CAAM,IAAA,EAAM,MAAA,EAAQ,eAAe,CAAA;AACnD,EAAA,OAAO,mDAAA,KAAoB,EAAO,KAAK,CAAA;AACzC;ADZA;AACE;AACA;AACA;AACF,kHAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/yaml.cjs","sourcesContent":[null,"import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeYamlPipeline, runYamlPipeline } from \"./engine/yaml-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/yaml` — YAML-only entry point, and the lightest of the four: `yaml` mode uses no\n * parser at all (spec/rules/modes.md 3.8.1), so this entry's module graph excludes `parse5` and\n * the Micromark/MDX stack for the same reason `polytypo/text` does — it has nothing to import.\n * `scripts/check-entry-reach.mjs` asserts that against the real module graph, which is what\n * turns \"parser-free\" from a claim in the spec into a fact this package can be held to.\n *\n * `mode` is absent from `YamlOptions`, since this entry only ever runs `yaml` mode. `dialect` is\n * likewise absent — it belongs to `markdown` alone (types.ts). `keys` goes the other way: it is\n * optional on the aggregate `Options` because the other three modes ignore it, and **required**\n * here, where the mode is fixed and the option always applies.\n */\nexport type YamlOptions = Omit<Options, \"mode\" | \"dialect\" | \"keys\" | \"frontmatterKeys\"> & {\n /** Required here, with no default — modes.md §3.8.2. An empty list processes nothing. */\n readonly keys: readonly string[];\n};\n\nexport function transform(input: string, options: YamlOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"yaml\", \"polytypo/yaml\");\n return runYamlPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input`, not into a span.\n */\nexport function analyze(input: string, options: YamlOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"yaml\", \"polytypo/yaml\");\n return analyzeYamlPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"]}
|
package/dist/yaml.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as Options, C as Change } from './errors-
|
|
2
|
-
export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-
|
|
1
|
+
import { O as Options, C as Change } from './errors-DeHxbXRn.cjs';
|
|
2
|
+
export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-DeHxbXRn.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `polytypo/yaml` — YAML-only entry point, and the lightest of the four: `yaml` mode uses no
|
|
@@ -13,7 +13,7 @@ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError
|
|
|
13
13
|
* optional on the aggregate `Options` because the other three modes ignore it, and **required**
|
|
14
14
|
* here, where the mode is fixed and the option always applies.
|
|
15
15
|
*/
|
|
16
|
-
type YamlOptions = Omit<Options, "mode" | "dialect" | "keys"> & {
|
|
16
|
+
type YamlOptions = Omit<Options, "mode" | "dialect" | "keys" | "frontmatterKeys"> & {
|
|
17
17
|
/** Required here, with no default — modes.md §3.8.2. An empty list processes nothing. */
|
|
18
18
|
readonly keys: readonly string[];
|
|
19
19
|
};
|
package/dist/yaml.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as Options, C as Change } from './errors-
|
|
2
|
-
export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-
|
|
1
|
+
import { O as Options, C as Change } from './errors-DeHxbXRn.js';
|
|
2
|
+
export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-DeHxbXRn.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `polytypo/yaml` — YAML-only entry point, and the lightest of the four: `yaml` mode uses no
|
|
@@ -13,7 +13,7 @@ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError
|
|
|
13
13
|
* optional on the aggregate `Options` because the other three modes ignore it, and **required**
|
|
14
14
|
* here, where the mode is fixed and the option always applies.
|
|
15
15
|
*/
|
|
16
|
-
type YamlOptions = Omit<Options, "mode" | "dialect" | "keys"> & {
|
|
16
|
+
type YamlOptions = Omit<Options, "mode" | "dialect" | "keys" | "frontmatterKeys"> & {
|
|
17
17
|
/** Required here, with no default — modes.md §3.8.2. An empty list processes nothing. */
|
|
18
18
|
readonly keys: readonly string[];
|
|
19
19
|
};
|
package/dist/yaml.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeYamlPipeline,
|
|
3
3
|
runYamlPipeline
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-74I62TZ2.js";
|
|
5
|
+
import "./chunk-HBIIWBB5.js";
|
|
6
|
+
import "./chunk-U5Y7C2L4.js";
|
|
6
7
|
import {
|
|
7
8
|
assertFixedMode
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JVBK3LG3.js";
|
|
9
10
|
import {
|
|
10
11
|
PolytypoError
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-25XZKUNP.js";
|
|
12
13
|
|
|
13
14
|
// src/index.yaml.ts
|
|
14
15
|
function transform(input, options) {
|
package/dist/yaml.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.yaml.ts"],"sourcesContent":["import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeYamlPipeline, runYamlPipeline } from \"./engine/yaml-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/yaml` — YAML-only entry point, and the lightest of the four: `yaml` mode uses no\n * parser at all (spec/rules/modes.md 3.8.1), so this entry's module graph excludes `parse5` and\n * the Micromark/MDX stack for the same reason `polytypo/text` does — it has nothing to import.\n * `scripts/check-entry-reach.mjs` asserts that against the real module graph, which is what\n * turns \"parser-free\" from a claim in the spec into a fact this package can be held to.\n *\n * `mode` is absent from `YamlOptions`, since this entry only ever runs `yaml` mode. `dialect` is\n * likewise absent — it belongs to `markdown` alone (types.ts). `keys` goes the other way: it is\n * optional on the aggregate `Options` because the other three modes ignore it, and **required**\n * here, where the mode is fixed and the option always applies.\n */\nexport type YamlOptions = Omit<Options, \"mode\" | \"dialect\" | \"keys\"> & {\n /** Required here, with no default — modes.md §3.8.2. An empty list processes nothing. */\n readonly keys: readonly string[];\n};\n\nexport function transform(input: string, options: YamlOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"yaml\", \"polytypo/yaml\");\n return runYamlPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input`, not into a span.\n */\nexport function analyze(input: string, options: YamlOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"yaml\", \"polytypo/yaml\");\n return analyzeYamlPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.yaml.ts"],"sourcesContent":["import { assertFixedMode } from \"./engine/assert-fixed-mode.js\";\nimport { analyzeYamlPipeline, runYamlPipeline } from \"./engine/yaml-pipeline.js\";\nimport type { Change } from \"./engine/origin.js\";\nimport type { Options } from \"./types.js\";\n\n/**\n * `polytypo/yaml` — YAML-only entry point, and the lightest of the four: `yaml` mode uses no\n * parser at all (spec/rules/modes.md 3.8.1), so this entry's module graph excludes `parse5` and\n * the Micromark/MDX stack for the same reason `polytypo/text` does — it has nothing to import.\n * `scripts/check-entry-reach.mjs` asserts that against the real module graph, which is what\n * turns \"parser-free\" from a claim in the spec into a fact this package can be held to.\n *\n * `mode` is absent from `YamlOptions`, since this entry only ever runs `yaml` mode. `dialect` is\n * likewise absent — it belongs to `markdown` alone (types.ts). `keys` goes the other way: it is\n * optional on the aggregate `Options` because the other three modes ignore it, and **required**\n * here, where the mode is fixed and the option always applies.\n */\nexport type YamlOptions = Omit<Options, \"mode\" | \"dialect\" | \"keys\" | \"frontmatterKeys\"> & {\n /** Required here, with no default — modes.md §3.8.2. An empty list processes nothing. */\n readonly keys: readonly string[];\n};\n\nexport function transform(input: string, options: YamlOptions): string {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"yaml\", \"polytypo/yaml\");\n return runYamlPipeline(input, given);\n}\n\n/**\n * The same pipeline as this entry's `transform`, reporting instead of applying\n * (spec/rules/analyze.md). Offsets are code-point offsets into `input`, not into a span.\n */\nexport function analyze(input: string, options: YamlOptions): Change[] {\n const given = (options ?? {}) as Partial<Options>;\n assertFixedMode(given.mode, \"yaml\", \"polytypo/yaml\");\n return analyzeYamlPipeline(input, given);\n}\n\nexport { PolytypoError } from \"./errors.js\";\nexport type { PolytypoErrorCode } from \"./errors.js\";\nexport type { Change } from \"./engine/origin.js\";\nexport type { NarrowNbsp } from \"./types.js\";\nexport type { LocaleData, LocaleSource, QuotePair, Rule, RuleContext, RuleId } from \"./types.js\";\n"],"mappings":";;;;;;;;;;;;;;AAsBO,SAAS,UAAU,OAAe,SAA8B;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,gBAAgB,OAAO,KAAK;AACrC;AAMO,SAAS,QAAQ,OAAe,SAAgC;AACrE,QAAM,QAAS,WAAW,CAAC;AAC3B,kBAAgB,MAAM,MAAM,QAAQ,eAAe;AACnD,SAAO,oBAAoB,OAAO,KAAK;AACzC;","names":[]}
|