polytypo 1.17.4 → 1.17.5

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.
Files changed (47) hide show
  1. package/dist/{chunk-GQKLJ73E.cjs → chunk-5NNYCXAY.cjs} +6 -6
  2. package/dist/{chunk-GQKLJ73E.cjs.map → chunk-5NNYCXAY.cjs.map} +1 -1
  3. package/dist/{chunk-ZTHGDNKA.cjs → chunk-6K24ORC5.cjs} +35 -1
  4. package/dist/chunk-6K24ORC5.cjs.map +1 -0
  5. package/dist/{chunk-7ZKTX4XN.js → chunk-6LD3PNML.js} +2 -2
  6. package/dist/chunk-DY6SB6P5.cjs +34 -0
  7. package/dist/{chunk-3LFCYGJ2.cjs.map → chunk-DY6SB6P5.cjs.map} +1 -1
  8. package/dist/{chunk-MTB7GEW4.cjs → chunk-GBCWL22D.cjs} +3 -3
  9. package/dist/{chunk-MTB7GEW4.cjs.map → chunk-GBCWL22D.cjs.map} +1 -1
  10. package/dist/{chunk-3YFHGJLX.js → chunk-GDPTDX27.js} +4 -4
  11. package/dist/{chunk-PJMNCAM6.js → chunk-H6XVGE3W.js} +3 -3
  12. package/dist/{chunk-SFAHXSBP.cjs → chunk-J5QSJEEK.cjs} +23 -23
  13. package/dist/{chunk-SFAHXSBP.cjs.map → chunk-J5QSJEEK.cjs.map} +1 -1
  14. package/dist/{chunk-4C6Q4VWE.js → chunk-JY3LROUM.js} +2 -2
  15. package/dist/{chunk-KFRNMKKO.cjs → chunk-MNKTURJI.cjs} +4 -4
  16. package/dist/{chunk-KFRNMKKO.cjs.map → chunk-MNKTURJI.cjs.map} +1 -1
  17. package/dist/chunk-O4QRECCM.cjs +36 -0
  18. package/dist/{chunk-SUDJFZXB.cjs.map → chunk-O4QRECCM.cjs.map} +1 -1
  19. package/dist/{chunk-HOVHQ7FV.js → chunk-QDCBN2MY.js} +3 -3
  20. package/dist/{chunk-CBZVCWYE.js → chunk-QSGNKUHE.js} +35 -1
  21. package/dist/{chunk-CBZVCWYE.js.map → chunk-QSGNKUHE.js.map} +1 -1
  22. package/dist/{chunk-3B7OFB3Z.js → chunk-S3O4HAUT.js} +2 -2
  23. package/dist/chunk-WSJG4QWF.cjs +38 -0
  24. package/dist/{chunk-DKIKUSWJ.cjs.map → chunk-WSJG4QWF.cjs.map} +1 -1
  25. package/dist/{chunk-67JPAOD6.js → chunk-YEV5P25M.js} +2 -2
  26. package/dist/html.cjs +9 -9
  27. package/dist/html.js +4 -4
  28. package/dist/index.cjs +17 -17
  29. package/dist/index.js +7 -7
  30. package/dist/markdown.cjs +10 -10
  31. package/dist/markdown.js +5 -5
  32. package/dist/text.cjs +8 -8
  33. package/dist/text.js +3 -3
  34. package/dist/yaml.cjs +9 -9
  35. package/dist/yaml.js +4 -4
  36. package/package.json +1 -1
  37. package/dist/chunk-3LFCYGJ2.cjs +0 -34
  38. package/dist/chunk-DKIKUSWJ.cjs +0 -38
  39. package/dist/chunk-SUDJFZXB.cjs +0 -36
  40. package/dist/chunk-ZTHGDNKA.cjs.map +0 -1
  41. /package/dist/{chunk-7ZKTX4XN.js.map → chunk-6LD3PNML.js.map} +0 -0
  42. /package/dist/{chunk-3YFHGJLX.js.map → chunk-GDPTDX27.js.map} +0 -0
  43. /package/dist/{chunk-PJMNCAM6.js.map → chunk-H6XVGE3W.js.map} +0 -0
  44. /package/dist/{chunk-4C6Q4VWE.js.map → chunk-JY3LROUM.js.map} +0 -0
  45. /package/dist/{chunk-HOVHQ7FV.js.map → chunk-QDCBN2MY.js.map} +0 -0
  46. /package/dist/{chunk-3B7OFB3Z.js.map → chunk-S3O4HAUT.js.map} +0 -0
  47. /package/dist/{chunk-67JPAOD6.js.map → chunk-YEV5P25M.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PolytypoError
3
- } from "./chunk-CBZVCWYE.js";
3
+ } from "./chunk-QSGNKUHE.js";
4
4
 
5
5
  // src/modes/html.ts
6
6
  import { parse, parseFragment } from "parse5";
@@ -144,4 +144,4 @@ export {
144
144
  htmlSpans,
145
145
  htmlFragmentSpans
146
146
  };
147
- //# sourceMappingURL=chunk-3B7OFB3Z.js.map
147
+ //# sourceMappingURL=chunk-S3O4HAUT.js.map
@@ -0,0 +1,38 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+ var _chunk6K24ORC5cjs = require('./chunk-6K24ORC5.cjs');
13
+
14
+ // src/engine/text-pipeline.ts
15
+ function runTextPipeline(input, options) {
16
+ const narrowTarget = _chunk6K24ORC5cjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
17
+ const planned = _chunk6K24ORC5cjs.planRules.call(void 0, options.rules);
18
+ const locale = _chunk6K24ORC5cjs.getLocaleData.call(void 0, options.locale);
19
+ const holes = _chunk6K24ORC5cjs.resolveProtect.call(void 0, options.protect, _chunk6K24ORC5cjs.toCodePoints.call(void 0, input).length);
20
+ if (holes.length > 0) return _chunk6K24ORC5cjs.runProtected.call(void 0, input, holes, planned, locale, narrowTarget);
21
+ return _chunk6K24ORC5cjs.fromCodePoints.call(void 0, _chunk6K24ORC5cjs.runRules.call(void 0, _chunk6K24ORC5cjs.toCodePoints.call(void 0, input), planned, locale, "text", narrowTarget));
22
+ }
23
+ function analyzeTextPipeline(input, options) {
24
+ const narrowTarget = _chunk6K24ORC5cjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
25
+ const planned = _chunk6K24ORC5cjs.planRules.call(void 0, options.rules);
26
+ const locale = _chunk6K24ORC5cjs.getLocaleData.call(void 0, options.locale);
27
+ const cp = _chunk6K24ORC5cjs.toCodePoints.call(void 0, input);
28
+ const holes = _chunk6K24ORC5cjs.resolveProtect.call(void 0, options.protect, cp.length);
29
+ if (holes.length > 0) return _chunk6K24ORC5cjs.analyzeProtected.call(void 0, input, holes, planned, locale, narrowTarget);
30
+ const origin = cp.map((_value, index) => index);
31
+ return _chunk6K24ORC5cjs.runRulesRecording.call(void 0, cp, planned, locale, "text", narrowTarget, origin, cp.length);
32
+ }
33
+
34
+
35
+
36
+
37
+ exports.runTextPipeline = runTextPipeline; exports.analyzeTextPipeline = analyzeTextPipeline;
38
+ //# sourceMappingURL=chunk-WSJG4QWF.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/chunk-DKIKUSWJ.cjs","../src/engine/text-pipeline.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACMO,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,8CAAA,OAAe,CAAQ,OAAA,EAAS,4CAAA,KAAkB,CAAA,CAAE,MAAM,CAAA;AACxE,EAAA,GAAA,CAAI,KAAA,CAAM,OAAA,EAAS,CAAA,EAAG,OAAO,4CAAA,KAAa,EAAO,KAAA,EAAO,OAAA,EAAS,MAAA,EAAQ,YAAY,CAAA;AACrF,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,MAAA,EAAQ,8CAAA,OAAe,CAAQ,OAAA,EAAS,EAAA,CAAG,MAAM,CAAA;AACvD,EAAA,GAAA,CAAI,KAAA,CAAM,OAAA,EAAS,CAAA,EAAG,OAAO,gDAAA,KAAiB,EAAO,KAAA,EAAO,OAAA,EAAS,MAAA,EAAQ,YAAY,CAAA;AACzF,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;ADNA;AACA;AACE;AACA;AACF,6FAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/chunk-DKIKUSWJ.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\";\nimport { analyzeProtected, resolveProtect, runProtected } from \"./protect.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 const holes = resolveProtect(options.protect, toCodePoints(input).length);\n if (holes.length > 0) return runProtected(input, holes, planned, locale, narrowTarget);\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 holes = resolveProtect(options.protect, cp.length);\n if (holes.length > 0) return analyzeProtected(input, holes, planned, locale, narrowTarget);\n const origin = cp.map((_value, index) => index);\n return runRulesRecording(cp, planned, locale, \"text\", narrowTarget, origin, cp.length);\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/polytypo-js/polytypo-js/dist/chunk-WSJG4QWF.cjs","../src/engine/text-pipeline.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACMO,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,8CAAA,OAAe,CAAQ,OAAA,EAAS,4CAAA,KAAkB,CAAA,CAAE,MAAM,CAAA;AACxE,EAAA,GAAA,CAAI,KAAA,CAAM,OAAA,EAAS,CAAA,EAAG,OAAO,4CAAA,KAAa,EAAO,KAAA,EAAO,OAAA,EAAS,MAAA,EAAQ,YAAY,CAAA;AACrF,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,MAAA,EAAQ,8CAAA,OAAe,CAAQ,OAAA,EAAS,EAAA,CAAG,MAAM,CAAA;AACvD,EAAA,GAAA,CAAI,KAAA,CAAM,OAAA,EAAS,CAAA,EAAG,OAAO,gDAAA,KAAiB,EAAO,KAAA,EAAO,OAAA,EAAS,MAAA,EAAQ,YAAY,CAAA;AACzF,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;ADNA;AACA;AACE;AACA;AACF,6FAAC","file":"/home/runner/work/polytypo-js/polytypo-js/dist/chunk-WSJG4QWF.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\";\nimport { analyzeProtected, resolveProtect, runProtected } from \"./protect.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 const holes = resolveProtect(options.protect, toCodePoints(input).length);\n if (holes.length > 0) return runProtected(input, holes, planned, locale, narrowTarget);\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 holes = resolveProtect(options.protect, cp.length);\n if (holes.length > 0) return analyzeProtected(input, holes, planned, locale, narrowTarget);\n const origin = cp.map((_value, index) => index);\n return runRulesRecording(cp, planned, locale, \"text\", narrowTarget, origin, cp.length);\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  PolytypoError
3
- } from "./chunk-CBZVCWYE.js";
3
+ } from "./chunk-QSGNKUHE.js";
4
4
 
5
5
  // src/engine/assert-fixed-mode.ts
6
6
  function assertFixedMode(mode, fixed, entryPoint) {
@@ -14,4 +14,4 @@ function assertFixedMode(mode, fixed, entryPoint) {
14
14
  export {
15
15
  assertFixedMode
16
16
  };
17
- //# sourceMappingURL=chunk-67JPAOD6.js.map
17
+ //# sourceMappingURL=chunk-YEV5P25M.js.map
package/dist/html.cjs CHANGED
@@ -1,29 +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 _chunk3LFCYGJ2cjs = require('./chunk-3LFCYGJ2.cjs');
5
- require('./chunk-KFRNMKKO.cjs');
4
+ var _chunkDY6SB6P5cjs = require('./chunk-DY6SB6P5.cjs');
5
+ require('./chunk-MNKTURJI.cjs');
6
6
 
7
7
 
8
- var _chunkMTB7GEW4cjs = require('./chunk-MTB7GEW4.cjs');
8
+ var _chunkGBCWL22Dcjs = require('./chunk-GBCWL22D.cjs');
9
9
 
10
10
 
11
- var _chunkZTHGDNKAcjs = require('./chunk-ZTHGDNKA.cjs');
11
+ var _chunk6K24ORC5cjs = require('./chunk-6K24ORC5.cjs');
12
12
 
13
13
  // src/index.html.ts
14
14
  function transform(input, options) {
15
15
  const given = _nullishCoalesce(options, () => ( {}));
16
- _chunkMTB7GEW4cjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
17
- return _chunk3LFCYGJ2cjs.runHtmlPipeline.call(void 0, input, given);
16
+ _chunkGBCWL22Dcjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
17
+ return _chunkDY6SB6P5cjs.runHtmlPipeline.call(void 0, input, given);
18
18
  }
19
19
  function analyze(input, options) {
20
20
  const given = _nullishCoalesce(options, () => ( {}));
21
- _chunkMTB7GEW4cjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
22
- return _chunk3LFCYGJ2cjs.analyzeHtmlPipeline.call(void 0, input, given);
21
+ _chunkGBCWL22Dcjs.assertFixedMode.call(void 0, given.mode, "html", "polytypo/html");
22
+ return _chunkDY6SB6P5cjs.analyzeHtmlPipeline.call(void 0, input, given);
23
23
  }
24
24
 
25
25
 
26
26
 
27
27
 
28
- exports.PolytypoError = _chunkZTHGDNKAcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
28
+ exports.PolytypoError = _chunk6K24ORC5cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
29
29
  //# sourceMappingURL=html.cjs.map
package/dist/html.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  analyzeHtmlPipeline,
3
3
  runHtmlPipeline
4
- } from "./chunk-PJMNCAM6.js";
5
- import "./chunk-3B7OFB3Z.js";
4
+ } from "./chunk-H6XVGE3W.js";
5
+ import "./chunk-S3O4HAUT.js";
6
6
  import {
7
7
  assertFixedMode
8
- } from "./chunk-67JPAOD6.js";
8
+ } from "./chunk-YEV5P25M.js";
9
9
  import {
10
10
  PolytypoError
11
- } from "./chunk-CBZVCWYE.js";
11
+ } from "./chunk-QSGNKUHE.js";
12
12
 
13
13
  // src/index.html.ts
14
14
  function transform(input, options) {
package/dist/index.cjs CHANGED
@@ -1,30 +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 _chunkDKIKUSWJcjs = require('./chunk-DKIKUSWJ.cjs');
4
+ var _chunkWSJG4QWFcjs = require('./chunk-WSJG4QWF.cjs');
5
5
 
6
6
 
7
7
 
8
- var _chunk3LFCYGJ2cjs = require('./chunk-3LFCYGJ2.cjs');
8
+ var _chunkDY6SB6P5cjs = require('./chunk-DY6SB6P5.cjs');
9
9
 
10
10
 
11
11
 
12
- var _chunkSFAHXSBPcjs = require('./chunk-SFAHXSBP.cjs');
13
- require('./chunk-KFRNMKKO.cjs');
12
+ var _chunkJ5QSJEEKcjs = require('./chunk-J5QSJEEK.cjs');
13
+ require('./chunk-MNKTURJI.cjs');
14
14
 
15
15
 
16
16
 
17
- var _chunkSUDJFZXBcjs = require('./chunk-SUDJFZXB.cjs');
18
- require('./chunk-GQKLJ73E.cjs');
17
+ var _chunkO4QRECCMcjs = require('./chunk-O4QRECCM.cjs');
18
+ require('./chunk-5NNYCXAY.cjs');
19
19
 
20
20
 
21
- var _chunkZTHGDNKAcjs = require('./chunk-ZTHGDNKA.cjs');
21
+ var _chunk6K24ORC5cjs = require('./chunk-6K24ORC5.cjs');
22
22
 
23
23
  // src/engine/pipeline.ts
24
24
  function resolveMode(mode) {
25
25
  if (mode === void 0 || mode === "text") return "text";
26
26
  if (mode === "html" || mode === "markdown" || mode === "yaml") return mode;
27
- throw new (0, _chunkZTHGDNKAcjs.PolytypoError)(
27
+ throw new (0, _chunk6K24ORC5cjs.PolytypoError)(
28
28
  "POLYTYPO_INVALID_MODE",
29
29
  `Unknown mode "${String(mode)}". Expected "text", "html", "markdown" or "yaml".`
30
30
  );
@@ -32,18 +32,18 @@ function resolveMode(mode) {
32
32
  function runPipeline(input, options) {
33
33
  const given = _nullishCoalesce(options, () => ( {}));
34
34
  const mode = resolveMode(given.mode);
35
- if (mode === "text") return _chunkDKIKUSWJcjs.runTextPipeline.call(void 0, input, given);
36
- if (mode === "html") return _chunk3LFCYGJ2cjs.runHtmlPipeline.call(void 0, input, given);
37
- if (mode === "yaml") return _chunkSUDJFZXBcjs.runYamlPipeline.call(void 0, input, given);
38
- return _chunkSFAHXSBPcjs.runMarkdownPipeline.call(void 0, input, given);
35
+ if (mode === "text") return _chunkWSJG4QWFcjs.runTextPipeline.call(void 0, input, given);
36
+ if (mode === "html") return _chunkDY6SB6P5cjs.runHtmlPipeline.call(void 0, input, given);
37
+ if (mode === "yaml") return _chunkO4QRECCMcjs.runYamlPipeline.call(void 0, input, given);
38
+ return _chunkJ5QSJEEKcjs.runMarkdownPipeline.call(void 0, input, given);
39
39
  }
40
40
  function runAnalyze(input, options) {
41
41
  const given = _nullishCoalesce(options, () => ( {}));
42
42
  const mode = resolveMode(given.mode);
43
- if (mode === "text") return _chunkDKIKUSWJcjs.analyzeTextPipeline.call(void 0, input, given);
44
- if (mode === "html") return _chunk3LFCYGJ2cjs.analyzeHtmlPipeline.call(void 0, input, given);
45
- if (mode === "yaml") return _chunkSUDJFZXBcjs.analyzeYamlPipeline.call(void 0, input, given);
46
- return _chunkSFAHXSBPcjs.analyzeMarkdownPipeline.call(void 0, input, given);
43
+ if (mode === "text") return _chunkWSJG4QWFcjs.analyzeTextPipeline.call(void 0, input, given);
44
+ if (mode === "html") return _chunkDY6SB6P5cjs.analyzeHtmlPipeline.call(void 0, input, given);
45
+ if (mode === "yaml") return _chunkO4QRECCMcjs.analyzeYamlPipeline.call(void 0, input, given);
46
+ return _chunkJ5QSJEEKcjs.analyzeMarkdownPipeline.call(void 0, input, given);
47
47
  }
48
48
 
49
49
  // src/index.ts
@@ -57,5 +57,5 @@ function analyze(input, options) {
57
57
 
58
58
 
59
59
 
60
- exports.PolytypoError = _chunkZTHGDNKAcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
60
+ exports.PolytypoError = _chunk6K24ORC5cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
61
61
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,24 +1,24 @@
1
1
  import {
2
2
  analyzeTextPipeline,
3
3
  runTextPipeline
4
- } from "./chunk-7ZKTX4XN.js";
4
+ } from "./chunk-6LD3PNML.js";
5
5
  import {
6
6
  analyzeHtmlPipeline,
7
7
  runHtmlPipeline
8
- } from "./chunk-PJMNCAM6.js";
8
+ } from "./chunk-H6XVGE3W.js";
9
9
  import {
10
10
  analyzeMarkdownPipeline,
11
11
  runMarkdownPipeline
12
- } from "./chunk-3YFHGJLX.js";
13
- import "./chunk-3B7OFB3Z.js";
12
+ } from "./chunk-GDPTDX27.js";
13
+ import "./chunk-S3O4HAUT.js";
14
14
  import {
15
15
  analyzeYamlPipeline,
16
16
  runYamlPipeline
17
- } from "./chunk-HOVHQ7FV.js";
18
- import "./chunk-4C6Q4VWE.js";
17
+ } from "./chunk-QDCBN2MY.js";
18
+ import "./chunk-JY3LROUM.js";
19
19
  import {
20
20
  PolytypoError
21
- } from "./chunk-CBZVCWYE.js";
21
+ } from "./chunk-QSGNKUHE.js";
22
22
 
23
23
  // src/engine/pipeline.ts
24
24
  function resolveMode(mode) {
package/dist/markdown.cjs CHANGED
@@ -1,30 +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 _chunkSFAHXSBPcjs = require('./chunk-SFAHXSBP.cjs');
5
- require('./chunk-KFRNMKKO.cjs');
6
- require('./chunk-GQKLJ73E.cjs');
4
+ var _chunkJ5QSJEEKcjs = require('./chunk-J5QSJEEK.cjs');
5
+ require('./chunk-MNKTURJI.cjs');
6
+ require('./chunk-5NNYCXAY.cjs');
7
7
 
8
8
 
9
- var _chunkMTB7GEW4cjs = require('./chunk-MTB7GEW4.cjs');
9
+ var _chunkGBCWL22Dcjs = require('./chunk-GBCWL22D.cjs');
10
10
 
11
11
 
12
- var _chunkZTHGDNKAcjs = require('./chunk-ZTHGDNKA.cjs');
12
+ var _chunk6K24ORC5cjs = require('./chunk-6K24ORC5.cjs');
13
13
 
14
14
  // src/index.markdown.ts
15
15
  function transform(input, options) {
16
16
  const given = _nullishCoalesce(options, () => ( {}));
17
- _chunkMTB7GEW4cjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
18
- return _chunkSFAHXSBPcjs.runMarkdownPipeline.call(void 0, input, given);
17
+ _chunkGBCWL22Dcjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
18
+ return _chunkJ5QSJEEKcjs.runMarkdownPipeline.call(void 0, input, given);
19
19
  }
20
20
  function analyze(input, options) {
21
21
  const given = _nullishCoalesce(options, () => ( {}));
22
- _chunkMTB7GEW4cjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
23
- return _chunkSFAHXSBPcjs.analyzeMarkdownPipeline.call(void 0, input, given);
22
+ _chunkGBCWL22Dcjs.assertFixedMode.call(void 0, given.mode, "markdown", "polytypo/markdown");
23
+ return _chunkJ5QSJEEKcjs.analyzeMarkdownPipeline.call(void 0, input, given);
24
24
  }
25
25
 
26
26
 
27
27
 
28
28
 
29
- exports.PolytypoError = _chunkZTHGDNKAcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
29
+ exports.PolytypoError = _chunk6K24ORC5cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
30
30
  //# sourceMappingURL=markdown.cjs.map
package/dist/markdown.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  analyzeMarkdownPipeline,
3
3
  runMarkdownPipeline
4
- } from "./chunk-3YFHGJLX.js";
5
- import "./chunk-3B7OFB3Z.js";
6
- import "./chunk-4C6Q4VWE.js";
4
+ } from "./chunk-GDPTDX27.js";
5
+ import "./chunk-S3O4HAUT.js";
6
+ import "./chunk-JY3LROUM.js";
7
7
  import {
8
8
  assertFixedMode
9
- } from "./chunk-67JPAOD6.js";
9
+ } from "./chunk-YEV5P25M.js";
10
10
  import {
11
11
  PolytypoError
12
- } from "./chunk-CBZVCWYE.js";
12
+ } from "./chunk-QSGNKUHE.js";
13
13
 
14
14
  // src/index.markdown.ts
15
15
  function transform(input, options) {
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 _chunkDKIKUSWJcjs = require('./chunk-DKIKUSWJ.cjs');
4
+ var _chunkWSJG4QWFcjs = require('./chunk-WSJG4QWF.cjs');
5
5
 
6
6
 
7
- var _chunkMTB7GEW4cjs = require('./chunk-MTB7GEW4.cjs');
7
+ var _chunkGBCWL22Dcjs = require('./chunk-GBCWL22D.cjs');
8
8
 
9
9
 
10
- var _chunkZTHGDNKAcjs = require('./chunk-ZTHGDNKA.cjs');
10
+ var _chunk6K24ORC5cjs = require('./chunk-6K24ORC5.cjs');
11
11
 
12
12
  // src/index.text.ts
13
13
  function transform(input, options) {
14
14
  const given = _nullishCoalesce(options, () => ( {}));
15
- _chunkMTB7GEW4cjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
16
- return _chunkDKIKUSWJcjs.runTextPipeline.call(void 0, input, given);
15
+ _chunkGBCWL22Dcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
16
+ return _chunkWSJG4QWFcjs.runTextPipeline.call(void 0, input, given);
17
17
  }
18
18
  function analyze(input, options) {
19
19
  const given = _nullishCoalesce(options, () => ( {}));
20
- _chunkMTB7GEW4cjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
21
- return _chunkDKIKUSWJcjs.analyzeTextPipeline.call(void 0, input, given);
20
+ _chunkGBCWL22Dcjs.assertFixedMode.call(void 0, given.mode, "text", "polytypo/text");
21
+ return _chunkWSJG4QWFcjs.analyzeTextPipeline.call(void 0, input, given);
22
22
  }
23
23
 
24
24
 
25
25
 
26
26
 
27
- exports.PolytypoError = _chunkZTHGDNKAcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
27
+ exports.PolytypoError = _chunk6K24ORC5cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
28
28
  //# sourceMappingURL=text.cjs.map
package/dist/text.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  analyzeTextPipeline,
3
3
  runTextPipeline
4
- } from "./chunk-7ZKTX4XN.js";
4
+ } from "./chunk-6LD3PNML.js";
5
5
  import {
6
6
  assertFixedMode
7
- } from "./chunk-67JPAOD6.js";
7
+ } from "./chunk-YEV5P25M.js";
8
8
  import {
9
9
  PolytypoError
10
- } from "./chunk-CBZVCWYE.js";
10
+ } from "./chunk-QSGNKUHE.js";
11
11
 
12
12
  // src/index.text.ts
13
13
  function transform(input, options) {
package/dist/yaml.cjs CHANGED
@@ -1,29 +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 _chunkSUDJFZXBcjs = require('./chunk-SUDJFZXB.cjs');
5
- require('./chunk-GQKLJ73E.cjs');
4
+ var _chunkO4QRECCMcjs = require('./chunk-O4QRECCM.cjs');
5
+ require('./chunk-5NNYCXAY.cjs');
6
6
 
7
7
 
8
- var _chunkMTB7GEW4cjs = require('./chunk-MTB7GEW4.cjs');
8
+ var _chunkGBCWL22Dcjs = require('./chunk-GBCWL22D.cjs');
9
9
 
10
10
 
11
- var _chunkZTHGDNKAcjs = require('./chunk-ZTHGDNKA.cjs');
11
+ var _chunk6K24ORC5cjs = require('./chunk-6K24ORC5.cjs');
12
12
 
13
13
  // src/index.yaml.ts
14
14
  function transform(input, options) {
15
15
  const given = _nullishCoalesce(options, () => ( {}));
16
- _chunkMTB7GEW4cjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
17
- return _chunkSUDJFZXBcjs.runYamlPipeline.call(void 0, input, given);
16
+ _chunkGBCWL22Dcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
17
+ return _chunkO4QRECCMcjs.runYamlPipeline.call(void 0, input, given);
18
18
  }
19
19
  function analyze(input, options) {
20
20
  const given = _nullishCoalesce(options, () => ( {}));
21
- _chunkMTB7GEW4cjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
22
- return _chunkSUDJFZXBcjs.analyzeYamlPipeline.call(void 0, input, given);
21
+ _chunkGBCWL22Dcjs.assertFixedMode.call(void 0, given.mode, "yaml", "polytypo/yaml");
22
+ return _chunkO4QRECCMcjs.analyzeYamlPipeline.call(void 0, input, given);
23
23
  }
24
24
 
25
25
 
26
26
 
27
27
 
28
- exports.PolytypoError = _chunkZTHGDNKAcjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
28
+ exports.PolytypoError = _chunk6K24ORC5cjs.PolytypoError; exports.analyze = analyze; exports.transform = transform;
29
29
  //# sourceMappingURL=yaml.cjs.map
package/dist/yaml.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  analyzeYamlPipeline,
3
3
  runYamlPipeline
4
- } from "./chunk-HOVHQ7FV.js";
5
- import "./chunk-4C6Q4VWE.js";
4
+ } from "./chunk-QDCBN2MY.js";
5
+ import "./chunk-JY3LROUM.js";
6
6
  import {
7
7
  assertFixedMode
8
- } from "./chunk-67JPAOD6.js";
8
+ } from "./chunk-YEV5P25M.js";
9
9
  import {
10
10
  PolytypoError
11
- } from "./chunk-CBZVCWYE.js";
11
+ } from "./chunk-QSGNKUHE.js";
12
12
 
13
13
  // src/index.yaml.ts
14
14
  function transform(input, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polytypo",
3
- "version": "1.17.4",
3
+ "version": "1.17.5",
4
4
  "description": "Normalize typography across languages: locale-correct quotes, dashes, ellipses and no-break spaces.",
5
5
  "keywords": [
6
6
  "typography",
@@ -1,34 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkKFRNMKKOcjs = require('./chunk-KFRNMKKO.cjs');
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
- var _chunkZTHGDNKAcjs = require('./chunk-ZTHGDNKA.cjs');
12
-
13
- // src/engine/html-pipeline.ts
14
- function runHtmlPipeline(input, options) {
15
- const narrowTarget = _chunkZTHGDNKAcjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
16
- const planned = _chunkZTHGDNKAcjs.planRules.call(void 0, options.rules);
17
- const locale = _chunkZTHGDNKAcjs.getLocaleData.call(void 0, options.locale);
18
- _chunkZTHGDNKAcjs.assertNoProtect.call(void 0, options.protect, "html");
19
- const spans = _chunkKFRNMKKOcjs.htmlSpans.call(void 0, input);
20
- return _chunkZTHGDNKAcjs.runOverSpans.call(void 0, input, spans, planned, locale, "html", narrowTarget);
21
- }
22
- function analyzeHtmlPipeline(input, options) {
23
- const narrowTarget = _chunkZTHGDNKAcjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
24
- const planned = _chunkZTHGDNKAcjs.planRules.call(void 0, options.rules);
25
- const locale = _chunkZTHGDNKAcjs.getLocaleData.call(void 0, options.locale);
26
- _chunkZTHGDNKAcjs.assertNoProtect.call(void 0, options.protect, "html");
27
- return _chunkZTHGDNKAcjs.analyzeOverSpans.call(void 0, input, _chunkKFRNMKKOcjs.htmlSpans.call(void 0, input), planned, locale, "html", narrowTarget);
28
- }
29
-
30
-
31
-
32
-
33
- exports.runHtmlPipeline = runHtmlPipeline; exports.analyzeHtmlPipeline = analyzeHtmlPipeline;
34
- //# sourceMappingURL=chunk-3LFCYGJ2.cjs.map
@@ -1,38 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
- var _chunkZTHGDNKAcjs = require('./chunk-ZTHGDNKA.cjs');
13
-
14
- // src/engine/text-pipeline.ts
15
- function runTextPipeline(input, options) {
16
- const narrowTarget = _chunkZTHGDNKAcjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
17
- const planned = _chunkZTHGDNKAcjs.planRules.call(void 0, options.rules);
18
- const locale = _chunkZTHGDNKAcjs.getLocaleData.call(void 0, options.locale);
19
- const holes = _chunkZTHGDNKAcjs.resolveProtect.call(void 0, options.protect, _chunkZTHGDNKAcjs.toCodePoints.call(void 0, input).length);
20
- if (holes.length > 0) return _chunkZTHGDNKAcjs.runProtected.call(void 0, input, holes, planned, locale, narrowTarget);
21
- return _chunkZTHGDNKAcjs.fromCodePoints.call(void 0, _chunkZTHGDNKAcjs.runRules.call(void 0, _chunkZTHGDNKAcjs.toCodePoints.call(void 0, input), planned, locale, "text", narrowTarget));
22
- }
23
- function analyzeTextPipeline(input, options) {
24
- const narrowTarget = _chunkZTHGDNKAcjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
25
- const planned = _chunkZTHGDNKAcjs.planRules.call(void 0, options.rules);
26
- const locale = _chunkZTHGDNKAcjs.getLocaleData.call(void 0, options.locale);
27
- const cp = _chunkZTHGDNKAcjs.toCodePoints.call(void 0, input);
28
- const holes = _chunkZTHGDNKAcjs.resolveProtect.call(void 0, options.protect, cp.length);
29
- if (holes.length > 0) return _chunkZTHGDNKAcjs.analyzeProtected.call(void 0, input, holes, planned, locale, narrowTarget);
30
- const origin = cp.map((_value, index) => index);
31
- return _chunkZTHGDNKAcjs.runRulesRecording.call(void 0, cp, planned, locale, "text", narrowTarget, origin, cp.length);
32
- }
33
-
34
-
35
-
36
-
37
- exports.runTextPipeline = runTextPipeline; exports.analyzeTextPipeline = analyzeTextPipeline;
38
- //# sourceMappingURL=chunk-DKIKUSWJ.cjs.map
@@ -1,36 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
- var _chunkGQKLJ73Ecjs = require('./chunk-GQKLJ73E.cjs');
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
- var _chunkZTHGDNKAcjs = require('./chunk-ZTHGDNKA.cjs');
13
-
14
- // src/engine/yaml-pipeline.ts
15
- function runYamlPipeline(input, options) {
16
- const narrowTarget = _chunkZTHGDNKAcjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
17
- const planned = _chunkZTHGDNKAcjs.planRules.call(void 0, options.rules);
18
- const locale = _chunkZTHGDNKAcjs.getLocaleData.call(void 0, options.locale);
19
- const keys = _chunkGQKLJ73Ecjs.resolveYamlKeys.call(void 0, options.keys);
20
- _chunkZTHGDNKAcjs.assertNoProtect.call(void 0, options.protect, "yaml");
21
- return _chunkZTHGDNKAcjs.runOverSpans.call(void 0, input, _chunkGQKLJ73Ecjs.yamlSpans.call(void 0, input, keys), planned, locale, "yaml", narrowTarget);
22
- }
23
- function analyzeYamlPipeline(input, options) {
24
- const narrowTarget = _chunkZTHGDNKAcjs.resolveNarrowTarget.call(void 0, options.narrowNbsp);
25
- const planned = _chunkZTHGDNKAcjs.planRules.call(void 0, options.rules);
26
- const locale = _chunkZTHGDNKAcjs.getLocaleData.call(void 0, options.locale);
27
- const keys = _chunkGQKLJ73Ecjs.resolveYamlKeys.call(void 0, options.keys);
28
- _chunkZTHGDNKAcjs.assertNoProtect.call(void 0, options.protect, "yaml");
29
- return _chunkZTHGDNKAcjs.analyzeOverSpans.call(void 0, input, _chunkGQKLJ73Ecjs.yamlSpans.call(void 0, input, keys), planned, locale, "yaml", narrowTarget);
30
- }
31
-
32
-
33
-
34
-
35
- exports.runYamlPipeline = runYamlPipeline; exports.analyzeYamlPipeline = analyzeYamlPipeline;
36
- //# sourceMappingURL=chunk-SUDJFZXB.cjs.map