polytypo 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/{chunk-MDYQWNEL.js → chunk-6PEHEU6F.js} +2 -2
- package/dist/{chunk-5XVEBCNU.js → chunk-ANHMGSED.js} +8 -7
- package/dist/chunk-ANHMGSED.js.map +1 -0
- package/dist/chunk-CJIH6CFO.cjs +34 -0
- package/dist/chunk-CJIH6CFO.cjs.map +1 -0
- package/dist/{chunk-IOW5V47B.js → chunk-E2HHFHG2.js} +8 -7
- package/dist/chunk-E2HHFHG2.js.map +1 -0
- package/dist/{chunk-BS2J3F7M.js → chunk-EL7R55TV.js} +2 -2
- package/dist/{chunk-ZLR7P7VH.cjs → chunk-FDNDYPPY.cjs} +3 -3
- package/dist/{chunk-ZLR7P7VH.cjs.map → chunk-FDNDYPPY.cjs.map} +1 -1
- package/dist/{chunk-3H6XONGO.js → chunk-MCQOMIWF.js} +2 -2
- package/dist/chunk-MDIDDG32.cjs +38 -0
- package/dist/chunk-MDIDDG32.cjs.map +1 -0
- package/dist/{chunk-QDF6EDLT.js → chunk-MF6PJO7O.js} +330 -9
- package/dist/chunk-MF6PJO7O.js.map +1 -0
- package/dist/chunk-OPHUDB2T.cjs +36 -0
- package/dist/chunk-OPHUDB2T.cjs.map +1 -0
- package/dist/{chunk-PMCNXHAP.js → chunk-OWTDZ6UD.js} +10 -9
- package/dist/{chunk-PMCNXHAP.js.map → chunk-OWTDZ6UD.js.map} +1 -1
- package/dist/{chunk-S3EQ4IDS.js → chunk-R5VKBH3P.js} +9 -2
- package/dist/chunk-R5VKBH3P.js.map +1 -0
- package/dist/{chunk-FRT6ATZR.cjs → chunk-TUDHJRJN.cjs} +6 -6
- package/dist/{chunk-FRT6ATZR.cjs.map → chunk-TUDHJRJN.cjs.map} +1 -1
- package/dist/{chunk-QZEJRXXP.cjs → chunk-W52W6XGA.cjs} +4 -4
- package/dist/{chunk-QZEJRXXP.cjs.map → chunk-W52W6XGA.cjs.map} +1 -1
- package/dist/{chunk-R2AZYV4E.cjs → chunk-WQEB33J2.cjs} +324 -3
- package/dist/chunk-WQEB33J2.cjs.map +1 -0
- package/dist/{chunk-VQB2LXMW.cjs → chunk-WWKSWVMX.cjs} +22 -21
- package/dist/chunk-WWKSWVMX.cjs.map +1 -0
- 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-MDYQWNEL.js.map → chunk-6PEHEU6F.js.map} +0 -0
- /package/dist/{chunk-BS2J3F7M.js.map → chunk-EL7R55TV.js.map} +0 -0
- /package/dist/{chunk-3H6XONGO.js.map → chunk-MCQOMIWF.js.map} +0 -0
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 _chunkWWKSWVMXcjs = require('./chunk-WWKSWVMX.cjs');
|
|
5
|
+
require('./chunk-W52W6XGA.cjs');
|
|
6
|
+
require('./chunk-TUDHJRJN.cjs');
|
|
8
7
|
|
|
9
8
|
|
|
10
|
-
var
|
|
9
|
+
var _chunkFDNDYPPYcjs = require('./chunk-FDNDYPPY.cjs');
|
|
11
10
|
|
|
12
11
|
|
|
13
|
-
var
|
|
12
|
+
var _chunkWQEB33J2cjs = require('./chunk-WQEB33J2.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
|
+
_chunkFDNDYPPYcjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
|
|
18
|
+
return _chunkWWKSWVMXcjs.runMarkdownPipeline.call(void 0, input, given);
|
|
20
19
|
}
|
|
21
20
|
function analyze(input, options) {
|
|
22
21
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
23
|
-
|
|
24
|
-
return
|
|
22
|
+
_chunkFDNDYPPYcjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
|
|
23
|
+
return _chunkWWKSWVMXcjs.analyzeMarkdownPipeline.call(void 0, input, given);
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
|
|
28
27
|
|
|
29
28
|
|
|
30
|
-
exports.PolytypoError =
|
|
29
|
+
exports.PolytypoError = _chunkWQEB33J2cjs.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-OWTDZ6UD.js";
|
|
5
|
+
import "./chunk-MCQOMIWF.js";
|
|
6
|
+
import "./chunk-6PEHEU6F.js";
|
|
8
7
|
import {
|
|
9
8
|
assertFixedMode
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EL7R55TV.js";
|
|
11
10
|
import {
|
|
12
11
|
PolytypoError
|
|
13
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MF6PJO7O.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 _chunkMDIDDG32cjs = require('./chunk-MDIDDG32.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkFDNDYPPYcjs = require('./chunk-FDNDYPPY.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkWQEB33J2cjs = require('./chunk-WQEB33J2.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
|
+
_chunkFDNDYPPYcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
|
|
16
|
+
return _chunkMDIDDG32cjs.runTextPipeline.call(void 0, input, given);
|
|
17
17
|
}
|
|
18
18
|
function analyze(input, options) {
|
|
19
19
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
20
|
-
|
|
21
|
-
return
|
|
20
|
+
_chunkFDNDYPPYcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
|
|
21
|
+
return _chunkMDIDDG32cjs.analyzeTextPipeline.call(void 0, input, given);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
exports.PolytypoError =
|
|
27
|
+
exports.PolytypoError = _chunkWQEB33J2cjs.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-R5VKBH3P.js";
|
|
5
5
|
import {
|
|
6
6
|
assertFixedMode
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EL7R55TV.js";
|
|
8
8
|
import {
|
|
9
9
|
PolytypoError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MF6PJO7O.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 _chunkOPHUDB2Tcjs = require('./chunk-OPHUDB2T.cjs');
|
|
5
|
+
require('./chunk-TUDHJRJN.cjs');
|
|
7
6
|
|
|
8
7
|
|
|
9
|
-
var
|
|
8
|
+
var _chunkFDNDYPPYcjs = require('./chunk-FDNDYPPY.cjs');
|
|
10
9
|
|
|
11
10
|
|
|
12
|
-
var
|
|
11
|
+
var _chunkWQEB33J2cjs = require('./chunk-WQEB33J2.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
|
+
_chunkFDNDYPPYcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
|
|
17
|
+
return _chunkOPHUDB2Tcjs.runYamlPipeline.call(void 0, input, given);
|
|
19
18
|
}
|
|
20
19
|
function analyze(input, options) {
|
|
21
20
|
const given = _nullishCoalesce(options, () => ( {}));
|
|
22
|
-
|
|
23
|
-
return
|
|
21
|
+
_chunkFDNDYPPYcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
|
|
22
|
+
return _chunkOPHUDB2Tcjs.analyzeYamlPipeline.call(void 0, input, given);
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
|
|
28
27
|
|
|
29
|
-
exports.PolytypoError =
|
|
28
|
+
exports.PolytypoError = _chunkWQEB33J2cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
|
|
30
29
|
//# 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
|
|
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;ACaO,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;ADhBA;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<\n Options,\n \"mode\" | \"dialect\" | \"keys\" | \"frontmatterKeys\" | \"protect\"\n> & {\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-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/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" | "frontmatterKeys"> & {
|
|
16
|
+
type YamlOptions = Omit<Options, "mode" | "dialect" | "keys" | "frontmatterKeys" | "protect"> & {
|
|
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-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/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" | "frontmatterKeys"> & {
|
|
16
|
+
type YamlOptions = Omit<Options, "mode" | "dialect" | "keys" | "frontmatterKeys" | "protect"> & {
|
|
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,15 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
analyzeYamlPipeline,
|
|
3
3
|
runYamlPipeline
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-SUX5QWB6.js";
|
|
4
|
+
} from "./chunk-ANHMGSED.js";
|
|
5
|
+
import "./chunk-6PEHEU6F.js";
|
|
7
6
|
import {
|
|
8
7
|
assertFixedMode
|
|
9
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EL7R55TV.js";
|
|
10
9
|
import {
|
|
11
10
|
PolytypoError
|
|
12
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MF6PJO7O.js";
|
|
13
12
|
|
|
14
13
|
// src/index.yaml.ts
|
|
15
14
|
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
|
|
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<\n Options,\n \"mode\" | \"dialect\" | \"keys\" | \"frontmatterKeys\" | \"protect\"\n> & {\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":";;;;;;;;;;;;;AAyBO,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/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/engine/yaml-pipeline.ts"],"sourcesContent":["import { yamlSpans } from \"../modes/yaml.js\";\nimport type { Options } from \"../types.js\";\nimport { getLocaleData } from \"./locale.js\";\nimport { resolveNarrowTarget } from \"./narrow-target.js\";\nimport { resolveYamlKeys } from \"./yaml-keys.js\";\nimport { planRules } from \"./rule-runner.js\";\nimport { analyzeOverSpans, runOverSpans } from \"./span-runner.js\";\nimport type { Change } from \"./origin.js\";\n\n/**\n * `yaml` mode only, and the only mode pipeline with **no parser dependency at all** — span\n * selection is the specified scan of modes.md 3.8, not a library. There is likewise no\n * `POLYTYPO_MALFORMED_INPUT` counterpart here: with no declared grammar to violate, a file that\n * is not YAML yields few spans or none and comes back byte for byte (modes.md 3.8.3). The only\n * throw this mode adds is `keys`, which is about the call and not the input.\n */\nexport function runYamlPipeline(input: string, options: Partial<Options>): string {\n const narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n const keys = resolveYamlKeys(options.keys);\n return runOverSpans(input, yamlSpans(input, keys), planned, locale, \"yaml\", narrowTarget);\n}\n\n/** analyze.md §1, `yaml` mode: offsets are into the document, not into a span (analyze.md §6). */\nexport function analyzeYamlPipeline(input: string, options: Partial<Options>): Change[] {\n const narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n const keys = resolveYamlKeys(options.keys);\n return analyzeOverSpans(input, yamlSpans(input, keys), planned, locale, \"yaml\", narrowTarget);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgBO,SAAS,gBAAgB,OAAe,SAAmC;AAChF,QAAM,eAAe,oBAAoB,QAAQ,UAAU;AAC3D,QAAM,UAAU,UAAU,QAAQ,KAAK;AACvC,QAAM,SAAS,cAAc,QAAQ,MAAM;AAC3C,QAAM,OAAO,gBAAgB,QAAQ,IAAI;AACzC,SAAO,aAAa,OAAO,UAAU,OAAO,IAAI,GAAG,SAAS,QAAQ,QAAQ,YAAY;AAC1F;AAGO,SAAS,oBAAoB,OAAe,SAAqC;AACtF,QAAM,eAAe,oBAAoB,QAAQ,UAAU;AAC3D,QAAM,UAAU,UAAU,QAAQ,KAAK;AACvC,QAAM,SAAS,cAAc,QAAQ,MAAM;AAC3C,QAAM,OAAO,gBAAgB,QAAQ,IAAI;AACzC,SAAO,iBAAiB,OAAO,UAAU,OAAO,IAAI,GAAG,SAAS,QAAQ,QAAQ,YAAY;AAC9F;","names":[]}
|
package/dist/chunk-GLMNIX54.cjs
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunkR2AZYV4Ecjs = require('./chunk-R2AZYV4E.cjs');
|
|
10
|
-
|
|
11
|
-
// src/engine/text-pipeline.ts
|
|
12
|
-
function runTextPipeline(input, options) {
|
|
13
|
-
const narrowTarget = _chunkR2AZYV4Ecjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
|
|
14
|
-
const planned = _chunkR2AZYV4Ecjs.planRules.call(void 0, options.rules);
|
|
15
|
-
const locale = _chunkR2AZYV4Ecjs.getLocaleData.call(void 0, options.locale);
|
|
16
|
-
return _chunkR2AZYV4Ecjs.fromCodePoints.call(void 0, _chunkR2AZYV4Ecjs.runRules.call(void 0, _chunkR2AZYV4Ecjs.toCodePoints.call(void 0, input), planned, locale, "text", narrowTarget));
|
|
17
|
-
}
|
|
18
|
-
function analyzeTextPipeline(input, options) {
|
|
19
|
-
const narrowTarget = _chunkR2AZYV4Ecjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
|
|
20
|
-
const planned = _chunkR2AZYV4Ecjs.planRules.call(void 0, options.rules);
|
|
21
|
-
const locale = _chunkR2AZYV4Ecjs.getLocaleData.call(void 0, options.locale);
|
|
22
|
-
const cp = _chunkR2AZYV4Ecjs.toCodePoints.call(void 0, input);
|
|
23
|
-
const origin = cp.map((_value, index) => index);
|
|
24
|
-
return _chunkR2AZYV4Ecjs.runRulesRecording.call(void 0, cp, planned, locale, "text", narrowTarget, origin, cp.length);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
exports.runTextPipeline = runTextPipeline; exports.analyzeTextPipeline = analyzeTextPipeline;
|
|
31
|
-
//# sourceMappingURL=chunk-GLMNIX54.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/chunk-GLMNIX54.cjs","../src/engine/text-pipeline.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACQO,SAAS,eAAA,CAAgB,KAAA,EAAe,OAAA,EAAmC;AAChF,EAAA,MAAM,aAAA,EAAe,mDAAA,OAAoB,CAAQ,UAAU,CAAA;AAC3D,EAAA,MAAM,QAAA,EAAU,yCAAA,OAAU,CAAQ,KAAK,CAAA;AACvC,EAAA,MAAM,OAAA,EAAS,6CAAA,OAAc,CAAQ,MAAM,CAAA;AAC3C,EAAA,OAAO,8CAAA,wCAAe,4CAAS,KAAkB,CAAA,EAAG,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,YAAY,CAAC,CAAA;AAC5F;AAGO,SAAS,mBAAA,CAAoB,KAAA,EAAe,OAAA,EAAqC;AACtF,EAAA,MAAM,aAAA,EAAe,mDAAA,OAAoB,CAAQ,UAAU,CAAA;AAC3D,EAAA,MAAM,QAAA,EAAU,yCAAA,OAAU,CAAQ,KAAK,CAAA;AACvC,EAAA,MAAM,OAAA,EAAS,6CAAA,OAAc,CAAQ,MAAM,CAAA;AAC3C,EAAA,MAAM,GAAA,EAAK,4CAAA,KAAkB,CAAA;AAC7B,EAAA,MAAM,OAAA,EAAS,EAAA,CAAG,GAAA,CAAI,CAAC,MAAA,EAAQ,KAAA,EAAA,GAAU,KAAK,CAAA;AAC9C,EAAA,OAAO,iDAAA,EAAkB,EAAI,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,YAAA,EAAc,MAAA,EAAQ,EAAA,CAAG,MAAM,CAAA;AACvF;ADRA;AACA;AACE;AACA;AACF,6FAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/chunk-GLMNIX54.cjs","sourcesContent":[null,"import type { Options } from \"../types.js\";\nimport { fromCodePoints, toCodePoints } from \"./codepoints.js\";\nimport type { Change } from \"./origin.js\";\nimport { getLocaleData } from \"./locale.js\";\nimport { resolveNarrowTarget } from \"./narrow-target.js\";\nimport { planRules, runRules, runRulesRecording } from \"./rule-runner.js\";\n\n/**\n * `text` mode only. Deliberately imports nothing from `../modes/html.js` or\n * `../modes/markdown.js` (or their parser dependencies) — this is what makes `polytypo/text`'s\n * module graph exclude `parse5` and the Micromark stack (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md\n * 5.1).\n *\n * Validation order — `planRules` before `getLocaleData` — mirrors the pre-Stage-5 aggregate\n * `runPipeline` exactly (an unknown-rule error must win over an unknown-locale error when both\n * are present, since that is public, tested behaviour, not an implementation detail this\n * refactor was authorised to change).\n */\nexport function runTextPipeline(input: string, options: Partial<Options>): string {\n const narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n return fromCodePoints(runRules(toCodePoints(input), planned, locale, \"text\", narrowTarget));\n}\n\n/** analyze.md §1: the same pipeline as `runTextPipeline`, reporting instead of applying. */\nexport function analyzeTextPipeline(input: string, options: Partial<Options>): Change[] {\n const narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n const cp = toCodePoints(input);\n const origin = cp.map((_value, index) => index);\n return runRulesRecording(cp, planned, locale, \"text\", narrowTarget, origin, cp.length);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/engine/html-pipeline.ts"],"sourcesContent":["import { htmlSpans } from \"../modes/html.js\";\nimport type { Options } from \"../types.js\";\nimport { getLocaleData } from \"./locale.js\";\nimport { resolveNarrowTarget } from \"./narrow-target.js\";\nimport { planRules } from \"./rule-runner.js\";\nimport { analyzeOverSpans, runOverSpans } from \"./span-runner.js\";\nimport type { Change } from \"./origin.js\";\n\n/**\n * `html` mode only. Imports `parse5` (via `../modes/html.js`) and nothing from\n * `../modes/markdown.js` or the Micromark/MDX stack — this is what makes `polytypo/html`'s\n * module graph exclude the Markdown parser (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1).\n *\n * Validation order — `planRules` before `getLocaleData` before parsing — mirrors the pre-Stage-5\n * aggregate `runPipeline` exactly (an unknown-rule error must win over an unknown-locale error,\n * and both must win over a parse failure, since that is public, tested behaviour).\n */\nexport function runHtmlPipeline(input: string, options: Partial<Options>): string {\n const narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n const spans = htmlSpans(input);\n return runOverSpans(input, spans, planned, locale, \"html\", narrowTarget);\n}\n\n/** analyze.md §1, `html` mode: offsets are into the document, not into a span (analyze.md §6). */\nexport function analyzeHtmlPipeline(input: string, options: Partial<Options>): Change[] {\n const narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n return analyzeOverSpans(input, htmlSpans(input), planned, locale, \"html\", narrowTarget);\n}\n"],"mappings":";;;;;;;;;;;;;;AAiBO,SAAS,gBAAgB,OAAe,SAAmC;AAChF,QAAM,eAAe,oBAAoB,QAAQ,UAAU;AAC3D,QAAM,UAAU,UAAU,QAAQ,KAAK;AACvC,QAAM,SAAS,cAAc,QAAQ,MAAM;AAC3C,QAAM,QAAQ,UAAU,KAAK;AAC7B,SAAO,aAAa,OAAO,OAAO,SAAS,QAAQ,QAAQ,YAAY;AACzE;AAGO,SAAS,oBAAoB,OAAe,SAAqC;AACtF,QAAM,eAAe,oBAAoB,QAAQ,UAAU;AAC3D,QAAM,UAAU,UAAU,QAAQ,KAAK;AACvC,QAAM,SAAS,cAAc,QAAQ,MAAM;AAC3C,SAAO,iBAAiB,OAAO,UAAU,KAAK,GAAG,SAAS,QAAQ,QAAQ,YAAY;AACxF;","names":[]}
|
package/dist/chunk-IQIHJIZW.cjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkFRT6ATZRcjs = require('./chunk-FRT6ATZR.cjs');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _chunkX7L2QLB6cjs = require('./chunk-X7L2QLB6.cjs');
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _chunkR2AZYV4Ecjs = require('./chunk-R2AZYV4E.cjs');
|
|
14
|
-
|
|
15
|
-
// src/engine/yaml-pipeline.ts
|
|
16
|
-
function runYamlPipeline(input, options) {
|
|
17
|
-
const narrowTarget = _chunkR2AZYV4Ecjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
|
|
18
|
-
const planned = _chunkR2AZYV4Ecjs.planRules.call(void 0, options.rules);
|
|
19
|
-
const locale = _chunkR2AZYV4Ecjs.getLocaleData.call(void 0, options.locale);
|
|
20
|
-
const keys = _chunkFRT6ATZRcjs.resolveYamlKeys.call(void 0, options.keys);
|
|
21
|
-
return _chunkX7L2QLB6cjs.runOverSpans.call(void 0, input, _chunkFRT6ATZRcjs.yamlSpans.call(void 0, input, keys), planned, locale, "yaml", narrowTarget);
|
|
22
|
-
}
|
|
23
|
-
function analyzeYamlPipeline(input, options) {
|
|
24
|
-
const narrowTarget = _chunkR2AZYV4Ecjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
|
|
25
|
-
const planned = _chunkR2AZYV4Ecjs.planRules.call(void 0, options.rules);
|
|
26
|
-
const locale = _chunkR2AZYV4Ecjs.getLocaleData.call(void 0, options.locale);
|
|
27
|
-
const keys = _chunkFRT6ATZRcjs.resolveYamlKeys.call(void 0, options.keys);
|
|
28
|
-
return _chunkX7L2QLB6cjs.analyzeOverSpans.call(void 0, input, _chunkFRT6ATZRcjs.yamlSpans.call(void 0, input, keys), planned, locale, "yaml", narrowTarget);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
exports.runYamlPipeline = runYamlPipeline; exports.analyzeYamlPipeline = analyzeYamlPipeline;
|
|
35
|
-
//# sourceMappingURL=chunk-IQIHJIZW.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/chunk-IQIHJIZW.cjs","../src/engine/yaml-pipeline.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACEO,SAAS,eAAA,CAAgB,KAAA,EAAe,OAAA,EAAmC;AAChF,EAAA,MAAM,aAAA,EAAe,mDAAA,OAAoB,CAAQ,UAAU,CAAA;AAC3D,EAAA,MAAM,QAAA,EAAU,yCAAA,OAAU,CAAQ,KAAK,CAAA;AACvC,EAAA,MAAM,OAAA,EAAS,6CAAA,OAAc,CAAQ,MAAM,CAAA;AAC3C,EAAA,MAAM,KAAA,EAAO,+CAAA,OAAgB,CAAQ,IAAI,CAAA;AACzC,EAAA,OAAO,4CAAA,KAAa,EAAO,yCAAA,KAAU,EAAO,IAAI,CAAA,EAAG,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,YAAY,CAAA;AAC1F;AAGO,SAAS,mBAAA,CAAoB,KAAA,EAAe,OAAA,EAAqC;AACtF,EAAA,MAAM,aAAA,EAAe,mDAAA,OAAoB,CAAQ,UAAU,CAAA;AAC3D,EAAA,MAAM,QAAA,EAAU,yCAAA,OAAU,CAAQ,KAAK,CAAA;AACvC,EAAA,MAAM,OAAA,EAAS,6CAAA,OAAc,CAAQ,MAAM,CAAA;AAC3C,EAAA,MAAM,KAAA,EAAO,+CAAA,OAAgB,CAAQ,IAAI,CAAA;AACzC,EAAA,OAAO,gDAAA,KAAiB,EAAO,yCAAA,KAAU,EAAO,IAAI,CAAA,EAAG,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,YAAY,CAAA;AAC9F;ADFA;AACA;AACE;AACA;AACF,6FAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/chunk-IQIHJIZW.cjs","sourcesContent":[null,"import { yamlSpans } from \"../modes/yaml.js\";\nimport type { Options } from \"../types.js\";\nimport { getLocaleData } from \"./locale.js\";\nimport { resolveNarrowTarget } from \"./narrow-target.js\";\nimport { resolveYamlKeys } from \"./yaml-keys.js\";\nimport { planRules } from \"./rule-runner.js\";\nimport { analyzeOverSpans, runOverSpans } from \"./span-runner.js\";\nimport type { Change } from \"./origin.js\";\n\n/**\n * `yaml` mode only, and the only mode pipeline with **no parser dependency at all** — span\n * selection is the specified scan of modes.md 3.8, not a library. There is likewise no\n * `POLYTYPO_MALFORMED_INPUT` counterpart here: with no declared grammar to violate, a file that\n * is not YAML yields few spans or none and comes back byte for byte (modes.md 3.8.3). The only\n * throw this mode adds is `keys`, which is about the call and not the input.\n */\nexport function runYamlPipeline(input: string, options: Partial<Options>): string {\n const narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n const keys = resolveYamlKeys(options.keys);\n return runOverSpans(input, yamlSpans(input, keys), planned, locale, \"yaml\", narrowTarget);\n}\n\n/** analyze.md §1, `yaml` mode: offsets are into the document, not into a span (analyze.md §6). */\nexport function analyzeYamlPipeline(input: string, options: Partial<Options>): Change[] {\n const narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n const keys = resolveYamlKeys(options.keys);\n return analyzeOverSpans(input, yamlSpans(input, keys), planned, locale, \"yaml\", narrowTarget);\n}\n"]}
|
package/dist/chunk-OTHSRFQL.cjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkQZEJRXXPcjs = require('./chunk-QZEJRXXP.cjs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _chunkX7L2QLB6cjs = require('./chunk-X7L2QLB6.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _chunkR2AZYV4Ecjs = require('./chunk-R2AZYV4E.cjs');
|
|
13
|
-
|
|
14
|
-
// src/engine/html-pipeline.ts
|
|
15
|
-
function runHtmlPipeline(input, options) {
|
|
16
|
-
const narrowTarget = _chunkR2AZYV4Ecjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
|
|
17
|
-
const planned = _chunkR2AZYV4Ecjs.planRules.call(void 0, options.rules);
|
|
18
|
-
const locale = _chunkR2AZYV4Ecjs.getLocaleData.call(void 0, options.locale);
|
|
19
|
-
const spans = _chunkQZEJRXXPcjs.htmlSpans.call(void 0, input);
|
|
20
|
-
return _chunkX7L2QLB6cjs.runOverSpans.call(void 0, input, spans, planned, locale, "html", narrowTarget);
|
|
21
|
-
}
|
|
22
|
-
function analyzeHtmlPipeline(input, options) {
|
|
23
|
-
const narrowTarget = _chunkR2AZYV4Ecjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
|
|
24
|
-
const planned = _chunkR2AZYV4Ecjs.planRules.call(void 0, options.rules);
|
|
25
|
-
const locale = _chunkR2AZYV4Ecjs.getLocaleData.call(void 0, options.locale);
|
|
26
|
-
return _chunkX7L2QLB6cjs.analyzeOverSpans.call(void 0, input, _chunkQZEJRXXPcjs.htmlSpans.call(void 0, input), planned, locale, "html", narrowTarget);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
exports.runHtmlPipeline = runHtmlPipeline; exports.analyzeHtmlPipeline = analyzeHtmlPipeline;
|
|
33
|
-
//# sourceMappingURL=chunk-OTHSRFQL.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/chunk-OTHSRFQL.cjs","../src/engine/html-pipeline.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACIO,SAAS,eAAA,CAAgB,KAAA,EAAe,OAAA,EAAmC;AAChF,EAAA,MAAM,aAAA,EAAe,mDAAA,OAAoB,CAAQ,UAAU,CAAA;AAC3D,EAAA,MAAM,QAAA,EAAU,yCAAA,OAAU,CAAQ,KAAK,CAAA;AACvC,EAAA,MAAM,OAAA,EAAS,6CAAA,OAAc,CAAQ,MAAM,CAAA;AAC3C,EAAA,MAAM,MAAA,EAAQ,yCAAA,KAAe,CAAA;AAC7B,EAAA,OAAO,4CAAA,KAAa,EAAO,KAAA,EAAO,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,YAAY,CAAA;AACzE;AAGO,SAAS,mBAAA,CAAoB,KAAA,EAAe,OAAA,EAAqC;AACtF,EAAA,MAAM,aAAA,EAAe,mDAAA,OAAoB,CAAQ,UAAU,CAAA;AAC3D,EAAA,MAAM,QAAA,EAAU,yCAAA,OAAU,CAAQ,KAAK,CAAA;AACvC,EAAA,MAAM,OAAA,EAAS,6CAAA,OAAc,CAAQ,MAAM,CAAA;AAC3C,EAAA,OAAO,gDAAA,KAAiB,EAAO,yCAAA,KAAe,CAAA,EAAG,OAAA,EAAS,MAAA,EAAQ,MAAA,EAAQ,YAAY,CAAA;AACxF;ADJA;AACA;AACE;AACA;AACF,6FAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/chunk-OTHSRFQL.cjs","sourcesContent":[null,"import { htmlSpans } from \"../modes/html.js\";\nimport type { Options } from \"../types.js\";\nimport { getLocaleData } from \"./locale.js\";\nimport { resolveNarrowTarget } from \"./narrow-target.js\";\nimport { planRules } from \"./rule-runner.js\";\nimport { analyzeOverSpans, runOverSpans } from \"./span-runner.js\";\nimport type { Change } from \"./origin.js\";\n\n/**\n * `html` mode only. Imports `parse5` (via `../modes/html.js`) and nothing from\n * `../modes/markdown.js` or the Micromark/MDX stack — this is what makes `polytypo/html`'s\n * module graph exclude the Markdown parser (AUDIT_REMEDIATION_AND_RELEASE_PLAN.md 5.1).\n *\n * Validation order — `planRules` before `getLocaleData` before parsing — mirrors the pre-Stage-5\n * aggregate `runPipeline` exactly (an unknown-rule error must win over an unknown-locale error,\n * and both must win over a parse failure, since that is public, tested behaviour).\n */\nexport function runHtmlPipeline(input: string, options: Partial<Options>): string {\n const narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n const spans = htmlSpans(input);\n return runOverSpans(input, spans, planned, locale, \"html\", narrowTarget);\n}\n\n/** analyze.md §1, `html` mode: offsets are into the document, not into a span (analyze.md §6). */\nexport function analyzeHtmlPipeline(input: string, options: Partial<Options>): Change[] {\n const narrowTarget = resolveNarrowTarget(options.narrowNbsp);\n const planned = planRules(options.rules);\n const locale = getLocaleData(options.locale);\n return analyzeOverSpans(input, htmlSpans(input), planned, locale, \"html\", narrowTarget);\n}\n"]}
|