polytypo 1.12.0 → 1.14.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 +18 -0
- package/dist/{chunk-VQB2LXMW.cjs → chunk-322C3P5R.cjs} +22 -21
- package/dist/chunk-322C3P5R.cjs.map +1 -0
- package/dist/{chunk-3H6XONGO.js → chunk-HQCC44TB.js} +2 -2
- package/dist/{chunk-FRT6ATZR.cjs → chunk-LHB4LGNZ.cjs} +6 -6
- package/dist/{chunk-FRT6ATZR.cjs.map → chunk-LHB4LGNZ.cjs.map} +1 -1
- package/dist/chunk-LI552TEW.cjs +34 -0
- package/dist/chunk-LI552TEW.cjs.map +1 -0
- package/dist/{chunk-MDYQWNEL.js → chunk-MO5JWB5U.js} +2 -2
- package/dist/{chunk-IOW5V47B.js → chunk-MXNL2VZN.js} +8 -7
- package/dist/chunk-MXNL2VZN.js.map +1 -0
- package/dist/{chunk-QDF6EDLT.js → chunk-NVKII62N.js} +332 -9
- package/dist/chunk-NVKII62N.js.map +1 -0
- package/dist/{chunk-R2AZYV4E.cjs → chunk-OIYA4373.cjs} +326 -3
- package/dist/chunk-OIYA4373.cjs.map +1 -0
- package/dist/{chunk-PMCNXHAP.js → chunk-OVOWG5D6.js} +10 -9
- package/dist/{chunk-PMCNXHAP.js.map → chunk-OVOWG5D6.js.map} +1 -1
- package/dist/{chunk-BS2J3F7M.js → chunk-PTHKCPJ4.js} +2 -2
- package/dist/{chunk-S3EQ4IDS.js → chunk-PW54OWBC.js} +9 -2
- package/dist/chunk-PW54OWBC.js.map +1 -0
- package/dist/chunk-Q6WLYDP7.cjs +38 -0
- package/dist/chunk-Q6WLYDP7.cjs.map +1 -0
- package/dist/{chunk-5XVEBCNU.js → chunk-QQMGHBNF.js} +8 -7
- package/dist/chunk-QQMGHBNF.js.map +1 -0
- package/dist/chunk-ULWRPPEH.cjs +36 -0
- package/dist/chunk-ULWRPPEH.cjs.map +1 -0
- package/dist/{chunk-QZEJRXXP.cjs → chunk-UYAECAEW.cjs} +4 -4
- package/dist/{chunk-QZEJRXXP.cjs.map → chunk-UYAECAEW.cjs.map} +1 -1
- package/dist/{chunk-ZLR7P7VH.cjs → chunk-ZNCO7THZ.cjs} +3 -3
- package/dist/{chunk-ZLR7P7VH.cjs.map → chunk-ZNCO7THZ.cjs.map} +1 -1
- package/dist/{errors-DeHxbXRn.d.ts → errors-DrNAlWLt.d.cts} +12 -1
- package/dist/{errors-DeHxbXRn.d.cts → errors-DrNAlWLt.d.ts} +12 -1
- package/dist/html.cjs +9 -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 +4 -5
- package/dist/html.js.map +1 -1
- package/dist/index.cjs +17 -18
- 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 +7 -8
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs +10 -11
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.d.cts +3 -3
- package/dist/markdown.d.ts +3 -3
- package/dist/markdown.js +5 -6
- 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 +2 -2
- package/dist/text.d.ts +2 -2
- package/dist/text.js +3 -3
- package/dist/text.js.map +1 -1
- package/dist/yaml.cjs +9 -10
- 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 +4 -5
- package/dist/yaml.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-5XVEBCNU.js.map +0 -1
- package/dist/chunk-GLMNIX54.cjs +0 -31
- package/dist/chunk-GLMNIX54.cjs.map +0 -1
- package/dist/chunk-IOW5V47B.js.map +0 -1
- package/dist/chunk-IQIHJIZW.cjs +0 -35
- package/dist/chunk-IQIHJIZW.cjs.map +0 -1
- package/dist/chunk-OTHSRFQL.cjs +0 -33
- package/dist/chunk-OTHSRFQL.cjs.map +0 -1
- package/dist/chunk-QDF6EDLT.js.map +0 -1
- package/dist/chunk-R2AZYV4E.cjs.map +0 -1
- package/dist/chunk-S3EQ4IDS.js.map +0 -1
- package/dist/chunk-SUX5QWB6.js +0 -218
- package/dist/chunk-SUX5QWB6.js.map +0 -1
- package/dist/chunk-VQB2LXMW.cjs.map +0 -1
- package/dist/chunk-X7L2QLB6.cjs +0 -218
- package/dist/chunk-X7L2QLB6.cjs.map +0 -1
- /package/dist/{chunk-3H6XONGO.js.map → chunk-HQCC44TB.js.map} +0 -0
- /package/dist/{chunk-MDYQWNEL.js.map → chunk-MO5JWB5U.js.map} +0 -0
- /package/dist/{chunk-BS2J3F7M.js.map → chunk-PTHKCPJ4.js.map} +0 -0
package/dist/html.cjs
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
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-X7L2QLB6.cjs');
|
|
4
|
+
var _chunkLI552TEWcjs = require('./chunk-LI552TEW.cjs');
|
|
5
|
+
require('./chunk-UYAECAEW.cjs');
|
|
7
6
|
|
|
8
7
|
|
|
9
|
-
var
|
|
8
|
+
var _chunkZNCO7THZcjs = require('./chunk-ZNCO7THZ.cjs');
|
|
10
9
|
|
|
11
10
|
|
|
12
|
-
var
|
|
11
|
+
var _chunkOIYA4373cjs = require('./chunk-OIYA4373.cjs');
|
|
13
12
|
|
|
14
13
|
// src/index.html.ts
|
|
15
14
|
function transform(input, options) {
|
|
16
15
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
17
|
-
|
|
18
|
-
return
|
|
16
|
+
_chunkZNCO7THZcjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
|
|
17
|
+
return _chunkLI552TEWcjs.runHtmlPipeline.call(void 0, input, given);
|
|
19
18
|
}
|
|
20
19
|
function analyze(input, options) {
|
|
21
20
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
22
|
-
|
|
23
|
-
return
|
|
21
|
+
_chunkZNCO7THZcjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
|
|
22
|
+
return _chunkLI552TEWcjs.analyzeHtmlPipeline.call(void 0, input, given);
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
|
|
28
27
|
|
|
29
|
-
exports.PolytypoError =
|
|
28
|
+
exports.PolytypoError = _chunkOIYA4373cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
30
29
|
//# sourceMappingURL=html.cjs.map
|
package/dist/html.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/html.cjs","../src/index.html.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/html.cjs","../src/index.html.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACIO,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;AAOO,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;ADRA;AACE;AACA;AACA;AACF,kHAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/html.cjs","sourcesContent":[null,"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\" | \"protect\">;\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"]}
|
package/dist/html.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-DrNAlWLt.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-DrNAlWLt.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `polytypo/html` — HTML-only entry point. Its module graph includes `parse5` but excludes the
|
|
@@ -10,7 +10,7 @@ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError
|
|
|
10
10
|
* likewise absent — it has no effect in `html` mode even in the aggregate entry (types.ts), so
|
|
11
11
|
* there is nothing for it to conflict with here.
|
|
12
12
|
*/
|
|
13
|
-
type HtmlOptions = Omit<Options, "mode" | "dialect" | "frontmatterKeys">;
|
|
13
|
+
type HtmlOptions = Omit<Options, "mode" | "dialect" | "frontmatterKeys" | "protect">;
|
|
14
14
|
declare function transform(input: string, options: HtmlOptions): string;
|
|
15
15
|
/**
|
|
16
16
|
* The same pipeline as this entry's `transform`, reporting instead of applying
|
package/dist/html.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-DrNAlWLt.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-DrNAlWLt.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `polytypo/html` — HTML-only entry point. Its module graph includes `parse5` but excludes the
|
|
@@ -10,7 +10,7 @@ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError
|
|
|
10
10
|
* likewise absent — it has no effect in `html` mode even in the aggregate entry (types.ts), so
|
|
11
11
|
* there is nothing for it to conflict with here.
|
|
12
12
|
*/
|
|
13
|
-
type HtmlOptions = Omit<Options, "mode" | "dialect" | "frontmatterKeys">;
|
|
13
|
+
type HtmlOptions = Omit<Options, "mode" | "dialect" | "frontmatterKeys" | "protect">;
|
|
14
14
|
declare function transform(input: string, options: HtmlOptions): string;
|
|
15
15
|
/**
|
|
16
16
|
* The same pipeline as this entry's `transform`, reporting instead of applying
|
package/dist/html.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeHtmlPipeline,
|
|
3
3
|
runHtmlPipeline
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-SUX5QWB6.js";
|
|
4
|
+
} from "./chunk-MXNL2VZN.js";
|
|
5
|
+
import "./chunk-HQCC44TB.js";
|
|
7
6
|
import {
|
|
8
7
|
assertFixedMode
|
|
9
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PTHKCPJ4.js";
|
|
10
9
|
import {
|
|
11
10
|
PolytypoError
|
|
12
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-NVKII62N.js";
|
|
13
12
|
|
|
14
13
|
// src/index.html.ts
|
|
15
14
|
function transform(input, options) {
|
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\" | \"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":"
|
|
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\" | \"protect\">;\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,31 +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
|
|
4
|
+
var _chunkQ6WLYDP7cjs = require('./chunk-Q6WLYDP7.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkLI552TEWcjs = require('./chunk-LI552TEW.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
12
|
+
var _chunk322C3P5Rcjs = require('./chunk-322C3P5R.cjs');
|
|
13
|
+
require('./chunk-UYAECAEW.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
18
|
-
require('./chunk-
|
|
19
|
-
require('./chunk-X7L2QLB6.cjs');
|
|
17
|
+
var _chunkULWRPPEHcjs = require('./chunk-ULWRPPEH.cjs');
|
|
18
|
+
require('./chunk-LHB4LGNZ.cjs');
|
|
20
19
|
|
|
21
20
|
|
|
22
|
-
var
|
|
21
|
+
var _chunkOIYA4373cjs = require('./chunk-OIYA4373.cjs');
|
|
23
22
|
|
|
24
23
|
// src/engine/pipeline.ts
|
|
25
24
|
function resolveMode(mode) {
|
|
26
25
|
if (mode === void 0 || mode === "text") return "text";
|
|
27
26
|
if (mode === "html" || mode === "markdown" || mode === "yaml") return mode;
|
|
28
|
-
throw new (0,
|
|
27
|
+
throw new (0, _chunkOIYA4373cjs.PolytypoError)(
|
|
29
28
|
"POLYTYPO_INVALID_MODE",
|
|
30
29
|
`Unknown mode "${String(mode)}". Expected "text", "html", "markdown" or "yaml".`
|
|
31
30
|
);
|
|
@@ -33,18 +32,18 @@ function resolveMode(mode) {
|
|
|
33
32
|
function runPipeline(input, options) {
|
|
34
33
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
35
34
|
const mode = resolveMode(given.mode);
|
|
36
|
-
if (mode === "text") return
|
|
37
|
-
if (mode === "html") return
|
|
38
|
-
if (mode === "yaml") return
|
|
39
|
-
return
|
|
35
|
+
if (mode === "text") return _chunkQ6WLYDP7cjs.runTextPipeline.call(void 0, input, given);
|
|
36
|
+
if (mode === "html") return _chunkLI552TEWcjs.runHtmlPipeline.call(void 0, input, given);
|
|
37
|
+
if (mode === "yaml") return _chunkULWRPPEHcjs.runYamlPipeline.call(void 0, input, given);
|
|
38
|
+
return _chunk322C3P5Rcjs.runMarkdownPipeline.call(void 0, input, given);
|
|
40
39
|
}
|
|
41
40
|
function runAnalyze(input, options) {
|
|
42
41
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
43
42
|
const mode = resolveMode(given.mode);
|
|
44
|
-
if (mode === "text") return
|
|
45
|
-
if (mode === "html") return
|
|
46
|
-
if (mode === "yaml") return
|
|
47
|
-
return
|
|
43
|
+
if (mode === "text") return _chunkQ6WLYDP7cjs.analyzeTextPipeline.call(void 0, input, given);
|
|
44
|
+
if (mode === "html") return _chunkLI552TEWcjs.analyzeHtmlPipeline.call(void 0, input, given);
|
|
45
|
+
if (mode === "yaml") return _chunkULWRPPEHcjs.analyzeYamlPipeline.call(void 0, input, given);
|
|
46
|
+
return _chunk322C3P5Rcjs.analyzeMarkdownPipeline.call(void 0, input, given);
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
// src/index.ts
|
|
@@ -58,5 +57,5 @@ function analyze(input, options) {
|
|
|
58
57
|
|
|
59
58
|
|
|
60
59
|
|
|
61
|
-
exports.PolytypoError =
|
|
60
|
+
exports.PolytypoError = _chunkOIYA4373cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
62
61
|
//# 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
|
|
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;ACZA,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;ADHA;AACA;AE5CO,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;AFmCA;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 ProtectRange,\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-DrNAlWLt.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, e as ProtectRange, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-DrNAlWLt.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-DrNAlWLt.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, e as ProtectRange, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-DrNAlWLt.js';
|
|
3
3
|
|
|
4
4
|
declare function transform(input: string, options: Options): string;
|
|
5
5
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeTextPipeline,
|
|
3
3
|
runTextPipeline
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PW54OWBC.js";
|
|
5
5
|
import {
|
|
6
6
|
analyzeHtmlPipeline,
|
|
7
7
|
runHtmlPipeline
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MXNL2VZN.js";
|
|
9
9
|
import {
|
|
10
10
|
analyzeMarkdownPipeline,
|
|
11
11
|
runMarkdownPipeline
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-OVOWG5D6.js";
|
|
13
|
+
import "./chunk-HQCC44TB.js";
|
|
14
14
|
import {
|
|
15
15
|
analyzeYamlPipeline,
|
|
16
16
|
runYamlPipeline
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-SUX5QWB6.js";
|
|
17
|
+
} from "./chunk-QQMGHBNF.js";
|
|
18
|
+
import "./chunk-MO5JWB5U.js";
|
|
20
19
|
import {
|
|
21
20
|
PolytypoError
|
|
22
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-NVKII62N.js";
|
|
23
22
|
|
|
24
23
|
// src/engine/pipeline.ts
|
|
25
24
|
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 ProtectRange,\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,31 +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-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-X7L2QLB6.cjs');
|
|
4
|
+
var _chunk322C3P5Rcjs = require('./chunk-322C3P5R.cjs');
|
|
5
|
+
require('./chunk-UYAECAEW.cjs');
|
|
6
|
+
require('./chunk-LHB4LGNZ.cjs');
|
|
8
7
|
|
|
9
8
|
|
|
10
|
-
var
|
|
9
|
+
var _chunkZNCO7THZcjs = require('./chunk-ZNCO7THZ.cjs');
|
|
11
10
|
|
|
12
11
|
|
|
13
|
-
var
|
|
12
|
+
var _chunkOIYA4373cjs = require('./chunk-OIYA4373.cjs');
|
|
14
13
|
|
|
15
14
|
// src/index.markdown.ts
|
|
16
15
|
function transform(input, options) {
|
|
17
16
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
18
|
-
|
|
19
|
-
return
|
|
17
|
+
_chunkZNCO7THZcjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
|
|
18
|
+
return _chunk322C3P5Rcjs.runMarkdownPipeline.call(void 0, input, given);
|
|
20
19
|
}
|
|
21
20
|
function analyze(input, options) {
|
|
22
21
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
23
|
-
|
|
24
|
-
return
|
|
22
|
+
_chunkZNCO7THZcjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
|
|
23
|
+
return _chunk322C3P5Rcjs.analyzeMarkdownPipeline.call(void 0, input, given);
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
|
|
28
27
|
|
|
29
28
|
|
|
30
|
-
exports.PolytypoError =
|
|
29
|
+
exports.PolytypoError = _chunkOIYA4373cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
31
30
|
//# 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
|
|
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;ACMO,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;ADVA;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\" | \"protect\"> & {\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-DrNAlWLt.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-DrNAlWLt.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `polytypo/markdown` — Markdown-only entry point. Its module graph includes the Micromark/MDX
|
|
@@ -11,7 +11,7 @@ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError
|
|
|
11
11
|
* `mode` is absent from `MarkdownOptions`, since this entry only ever runs `markdown` mode.
|
|
12
12
|
* `dialect` keeps the aggregate entry's contract: required, no default (types.ts).
|
|
13
13
|
*/
|
|
14
|
-
type MarkdownOptions = Omit<Options, "mode"> & {
|
|
14
|
+
type MarkdownOptions = Omit<Options, "mode" | "protect"> & {
|
|
15
15
|
dialect: Dialect;
|
|
16
16
|
};
|
|
17
17
|
declare function transform(input: string, options: MarkdownOptions): string;
|
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-DrNAlWLt.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-DrNAlWLt.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `polytypo/markdown` — Markdown-only entry point. Its module graph includes the Micromark/MDX
|
|
@@ -11,7 +11,7 @@ export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError
|
|
|
11
11
|
* `mode` is absent from `MarkdownOptions`, since this entry only ever runs `markdown` mode.
|
|
12
12
|
* `dialect` keeps the aggregate entry's contract: required, no default (types.ts).
|
|
13
13
|
*/
|
|
14
|
-
type MarkdownOptions = Omit<Options, "mode"> & {
|
|
14
|
+
type MarkdownOptions = Omit<Options, "mode" | "protect"> & {
|
|
15
15
|
dialect: Dialect;
|
|
16
16
|
};
|
|
17
17
|
declare function transform(input: string, options: MarkdownOptions): string;
|
package/dist/markdown.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeMarkdownPipeline,
|
|
3
3
|
runMarkdownPipeline
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-SUX5QWB6.js";
|
|
4
|
+
} from "./chunk-OVOWG5D6.js";
|
|
5
|
+
import "./chunk-HQCC44TB.js";
|
|
6
|
+
import "./chunk-MO5JWB5U.js";
|
|
8
7
|
import {
|
|
9
8
|
assertFixedMode
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PTHKCPJ4.js";
|
|
11
10
|
import {
|
|
12
11
|
PolytypoError
|
|
13
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NVKII62N.js";
|
|
14
13
|
|
|
15
14
|
// src/index.markdown.ts
|
|
16
15
|
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\" | \"protect\"> & {\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 _chunkQ6WLYDP7cjs = require('./chunk-Q6WLYDP7.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkZNCO7THZcjs = require('./chunk-ZNCO7THZ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkOIYA4373cjs = require('./chunk-OIYA4373.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
|
+
_chunkZNCO7THZcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
|
|
16
|
+
return _chunkQ6WLYDP7cjs.runTextPipeline.call(void 0, input, given);
|
|
17
17
|
}
|
|
18
18
|
function analyze(input, options) {
|
|
19
19
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
20
|
-
|
|
21
|
-
return
|
|
20
|
+
_chunkZNCO7THZcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
|
|
21
|
+
return _chunkQ6WLYDP7cjs.analyzeTextPipeline.call(void 0, input, given);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
exports.PolytypoError =
|
|
27
|
+
exports.PolytypoError = _chunkOIYA4373cjs.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\" | \"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"]}
|
|
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, ProtectRange } 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-DrNAlWLt.cjs';
|
|
2
|
+
export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, e as ProtectRange, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-DrNAlWLt.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the
|
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-DrNAlWLt.js';
|
|
2
|
+
export { L as LocaleData, a as LocaleSource, N as NarrowNbsp, P as PolytypoError, b as PolytypoErrorCode, e as ProtectRange, Q as QuotePair, R as Rule, c as RuleContext, d as RuleId } from './errors-DrNAlWLt.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* `polytypo/text` — text-only entry point. Its module graph excludes `parse5` and the
|
package/dist/text.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeTextPipeline,
|
|
3
3
|
runTextPipeline
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PW54OWBC.js";
|
|
5
5
|
import {
|
|
6
6
|
assertFixedMode
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PTHKCPJ4.js";
|
|
8
8
|
import {
|
|
9
9
|
PolytypoError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NVKII62N.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\" | \"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":[]}
|
|
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, ProtectRange } 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,30 +1,29 @@
|
|
|
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-X7L2QLB6.cjs');
|
|
4
|
+
var _chunkULWRPPEHcjs = require('./chunk-ULWRPPEH.cjs');
|
|
5
|
+
require('./chunk-LHB4LGNZ.cjs');
|
|
7
6
|
|
|
8
7
|
|
|
9
|
-
var
|
|
8
|
+
var _chunkZNCO7THZcjs = require('./chunk-ZNCO7THZ.cjs');
|
|
10
9
|
|
|
11
10
|
|
|
12
|
-
var
|
|
11
|
+
var _chunkOIYA4373cjs = require('./chunk-OIYA4373.cjs');
|
|
13
12
|
|
|
14
13
|
// src/index.yaml.ts
|
|
15
14
|
function transform(input, options) {
|
|
16
15
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
17
|
-
|
|
18
|
-
return
|
|
16
|
+
_chunkZNCO7THZcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
|
|
17
|
+
return _chunkULWRPPEHcjs.runYamlPipeline.call(void 0, input, given);
|
|
19
18
|
}
|
|
20
19
|
function analyze(input, options) {
|
|
21
20
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
22
|
-
|
|
23
|
-
return
|
|
21
|
+
_chunkZNCO7THZcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
|
|
22
|
+
return _chunkULWRPPEHcjs.analyzeYamlPipeline.call(void 0, input, given);
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
|
|
28
27
|
|
|
29
|
-
exports.PolytypoError =
|
|
28
|
+
exports.PolytypoError = _chunkOIYA4373cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
30
29
|
//# sourceMappingURL=yaml.cjs.map
|