@bendyline/gezel-sdk 1.0.8 → 1.0.9

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 (2) hide show
  1. package/dist/checks.js +8 -3
  2. package/package.json +2 -2
package/dist/checks.js CHANGED
@@ -690,9 +690,14 @@ function valuesSubsetOf(outputText, sourceTexts, spec) {
690
690
  return out;
691
691
  };
692
692
  const caseInsensitive = flags.includes("i");
693
- const sourceHaystacks = sourceTexts.map((t) => caseInsensitive ? t.toLowerCase() : t);
693
+ const foldSpace = (t) => t.replace(/ | | | /g, " ").replace(/\u00a0/g, " ").replace(/\s+/g, " ");
694
+ const normalize = (t) => {
695
+ const folded = foldSpace(t);
696
+ return caseInsensitive ? folded.toLowerCase() : folded;
697
+ };
698
+ const sourceHaystacks = sourceTexts.map(normalize);
694
699
  const appearsInSources = (value) => {
695
- const needle = caseInsensitive ? value.toLowerCase() : value;
700
+ const needle = normalize(value);
696
701
  return sourceHaystacks.some((t) => t.includes(needle));
697
702
  };
698
703
  const seen = /* @__PURE__ */ new Set();
@@ -1681,7 +1686,7 @@ function wrapperReturnHint(outputLines) {
1681
1686
 
1682
1687
  // ../core/src/checks/markdown.ts
1683
1688
  function cleanHeading(text) {
1684
- return text.replace(/\s+#+\s*$/, "").replace(/[*_`]/g, "").replace(/[–—]/g, "-").replace(/[^\p{L}\p{N}]+/gu, " ").trim().toLocaleLowerCase();
1689
+ return text.replace(/\s+#+\s*$/, "").replace(/\s+\{\[[^\]\r\n]+\]\}\s*$/, "").replace(/[*_`]/g, "").replace(/[–—]/g, "-").replace(/[^\p{L}\p{N}]+/gu, " ").trim().toLocaleLowerCase();
1685
1690
  }
1686
1691
  function documentH1s(markdown) {
1687
1692
  return [...markdown.matchAll(/^#\s+(.+?)\s*$/gm)].map((match) => match[1].trim());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/gezel-sdk",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "SDK imported by scripts running in the Gezel sandbox. Exposes the `gezel` object and `defineScript` helper.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -59,7 +59,7 @@
59
59
  "!dist/**/*.map"
60
60
  ],
61
61
  "devDependencies": {
62
- "@bendyline/gezel": "1.1.0",
62
+ "@bendyline/gezel": "1.1.1",
63
63
  "tsup": "^8.5.1",
64
64
  "typescript": "^6.0.3",
65
65
  "vitest": "^4.1.10"