@ai-matrx/content-ir 0.22.6 → 0.23.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/CHANGELOG.md +21 -0
- package/dist/convert.cjs +36 -292
- package/dist/convert.cjs.map +1 -1
- package/dist/convert.js +35 -291
- package/dist/convert.js.map +1 -1
- package/dist/core.cjs +3 -290
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +2 -289
- package/dist/core.js.map +1 -1
- package/dist/directives.cjs +3 -37
- package/dist/directives.cjs.map +1 -1
- package/dist/directives.js +2 -36
- package/dist/directives.js.map +1 -1
- package/dist/index.cjs +235 -311
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +227 -310
- package/dist/index.js.map +1 -1
- package/dist/json-extract.cjs +942 -0
- package/dist/json-extract.cjs.map +1 -0
- package/dist/json-extract.d.cts +176 -0
- package/dist/json-extract.d.ts +176 -0
- package/dist/json-extract.js +928 -0
- package/dist/json-extract.js.map +1 -0
- package/dist/source.cjs +199 -0
- package/dist/source.cjs.map +1 -1
- package/dist/source.d.cts +138 -1
- package/dist/source.d.ts +138 -1
- package/dist/source.js +193 -1
- package/dist/source.js.map +1 -1
- package/dist/surfaces.cjs +4 -40
- package/dist/surfaces.cjs.map +1 -1
- package/dist/surfaces.js +2 -38
- package/dist/surfaces.js.map +1 -1
- package/package.json +28 -7
- package/dist/text-case.cjs +0 -333
- package/dist/text-case.cjs.map +0 -1
- package/dist/text-case.d.cts +0 -87
- package/dist/text-case.d.ts +0 -87
- package/dist/text-case.js +0 -320
- package/dist/text-case.js.map +0 -1
package/dist/surfaces.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { humanizeIdentifier } from '@ai-matrx/kit/text-case';
|
|
2
|
+
|
|
1
3
|
// source/fence-nesting.ts
|
|
2
4
|
var NESTING_FENCE_LANGUAGES = /* @__PURE__ */ new Set([
|
|
3
5
|
"markdown",
|
|
@@ -1877,42 +1879,6 @@ function deriveInstanceTitle(data, explicit, titleKey) {
|
|
|
1877
1879
|
}
|
|
1878
1880
|
return null;
|
|
1879
1881
|
}
|
|
1880
|
-
var IDENTIFIER_ACRONYMS = [
|
|
1881
|
-
"ID",
|
|
1882
|
-
"URL",
|
|
1883
|
-
"PDF",
|
|
1884
|
-
"HTML",
|
|
1885
|
-
"JSON",
|
|
1886
|
-
"API",
|
|
1887
|
-
"AI",
|
|
1888
|
-
"UI",
|
|
1889
|
-
"CSV",
|
|
1890
|
-
"SMS",
|
|
1891
|
-
"SEO",
|
|
1892
|
-
"LLM",
|
|
1893
|
-
"MCP",
|
|
1894
|
-
"UUID",
|
|
1895
|
-
"ISO"
|
|
1896
|
-
];
|
|
1897
|
-
var IDENTIFIER_ACRONYM_SET = new Set(IDENTIFIER_ACRONYMS.map((a) => a.toLowerCase()));
|
|
1898
|
-
function humanizeIdentifier(identifier) {
|
|
1899
|
-
const text = (identifier ?? "").trim();
|
|
1900
|
-
if (text === "") return "";
|
|
1901
|
-
if (!text.includes("_") && /\s/.test(text)) {
|
|
1902
|
-
return /^\p{Ll}/u.test(text) ? text.charAt(0).toUpperCase() + text.slice(1) : text;
|
|
1903
|
-
}
|
|
1904
|
-
return text.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)(?![A-Z]s(?![a-z]))([A-Z][a-z])/g, "$1 $2").split(/[_\-.\s]+/).filter((part) => part.length > 0).map(identifierWord).join(" ");
|
|
1905
|
-
}
|
|
1906
|
-
function identifierWord(part) {
|
|
1907
|
-
const lower = part.toLowerCase();
|
|
1908
|
-
if (IDENTIFIER_ACRONYM_SET.has(lower)) return part.toUpperCase();
|
|
1909
|
-
if (lower.length > 1 && lower.endsWith("s") && IDENTIFIER_ACRONYM_SET.has(lower.slice(0, -1))) {
|
|
1910
|
-
return `${lower.slice(0, -1).toUpperCase()}s`;
|
|
1911
|
-
}
|
|
1912
|
-
return part.charAt(0).toUpperCase() + part.slice(1).toLowerCase();
|
|
1913
|
-
}
|
|
1914
|
-
|
|
1915
|
-
// surfaces/kind-markdown-utils.ts
|
|
1916
1882
|
function isRecordValue(value) {
|
|
1917
1883
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1918
1884
|
}
|
|
@@ -2540,8 +2506,6 @@ function kindTextPreview(raw) {
|
|
|
2540
2506
|
const slug = firstKindSlug(md.slice(keyIndex));
|
|
2541
2507
|
return { text: head.trimEnd(), pendingKind: slug, pendingUnnamed: slug === null };
|
|
2542
2508
|
}
|
|
2543
|
-
|
|
2544
|
-
// surfaces/kind-one-line.ts
|
|
2545
2509
|
var UNNAMED = "Structured output";
|
|
2546
2510
|
function kindName(slug) {
|
|
2547
2511
|
return slug && humanizeIdentifier(slug) || UNNAMED;
|