@stryke/prisma-trpc-generator 0.12.17 → 0.12.18
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/dist/generator.cjs +232 -82
- package/dist/generator.js +232 -82
- package/dist/index.cjs +232 -82
- package/dist/index.js +232 -82
- package/package.json +4 -4
package/dist/generator.cjs
CHANGED
|
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
mod
|
|
31
31
|
));
|
|
32
32
|
|
|
33
|
-
// ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.
|
|
33
|
+
// ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.53.1_@types+node@24.7.0__@swc+core@1.11.9_@swc+he_0503eaf6fe6b9b80407e1d94bfc28ff9/node_modules/tsup/assets/cjs_shims.js
|
|
34
34
|
var init_cjs_shims = __esm({
|
|
35
|
-
"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.
|
|
35
|
+
"../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.53.1_@types+node@24.7.0__@swc+core@1.11.9_@swc+he_0503eaf6fe6b9b80407e1d94bfc28ff9/node_modules/tsup/assets/cjs_shims.js"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
}
|
|
38
38
|
});
|
|
@@ -776,6 +776,23 @@ var import_join_paths = require("@stryke/path/join-paths");
|
|
|
776
776
|
// ../string-format/src/title-case.ts
|
|
777
777
|
init_cjs_shims();
|
|
778
778
|
|
|
779
|
+
// ../string-format/src/combine.ts
|
|
780
|
+
init_cjs_shims();
|
|
781
|
+
function combine(acc, str) {
|
|
782
|
+
return `${acc} ${str}`;
|
|
783
|
+
}
|
|
784
|
+
__name(combine, "combine");
|
|
785
|
+
|
|
786
|
+
// ../string-format/src/decamelize.ts
|
|
787
|
+
init_cjs_shims();
|
|
788
|
+
function decamelize(value) {
|
|
789
|
+
return value.replace(/([a-z\d])([A-Z])/g, "$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g, "$1_$2").toLowerCase();
|
|
790
|
+
}
|
|
791
|
+
__name(decamelize, "decamelize");
|
|
792
|
+
|
|
793
|
+
// ../string-format/src/format-special-cases.ts
|
|
794
|
+
init_cjs_shims();
|
|
795
|
+
|
|
779
796
|
// ../string-format/src/acronyms.ts
|
|
780
797
|
init_cjs_shims();
|
|
781
798
|
var ACRONYMS = {
|
|
@@ -875,6 +892,9 @@ var ACRONYMS = {
|
|
|
875
892
|
"CAPTCHA": {
|
|
876
893
|
description: "Completely Automated Public Turing test to tell Computers and Humans Apart"
|
|
877
894
|
},
|
|
895
|
+
"CCTV": {
|
|
896
|
+
description: "Closed-Circuit Television"
|
|
897
|
+
},
|
|
878
898
|
"CD": {
|
|
879
899
|
description: "Continuous Delivery / Compact Disc"
|
|
880
900
|
},
|
|
@@ -1051,6 +1071,10 @@ var ACRONYMS = {
|
|
|
1051
1071
|
display: "FaaS"
|
|
1052
1072
|
},
|
|
1053
1073
|
"FAQ": {
|
|
1074
|
+
description: "Frequently Asked Questions",
|
|
1075
|
+
display: "FAQs"
|
|
1076
|
+
},
|
|
1077
|
+
"FAQS": {
|
|
1054
1078
|
description: "Frequently Asked Questions"
|
|
1055
1079
|
},
|
|
1056
1080
|
"FBI": {
|
|
@@ -1232,6 +1256,9 @@ var ACRONYMS = {
|
|
|
1232
1256
|
"IPS": {
|
|
1233
1257
|
description: "Intrusion Prevention System"
|
|
1234
1258
|
},
|
|
1259
|
+
"ISO": {
|
|
1260
|
+
description: "International Organization for Standardization"
|
|
1261
|
+
},
|
|
1235
1262
|
"IQ": {
|
|
1236
1263
|
description: "Intelligence Quotient",
|
|
1237
1264
|
display: "IQ"
|
|
@@ -1558,6 +1585,9 @@ var ACRONYMS = {
|
|
|
1558
1585
|
"TLS1.3": {
|
|
1559
1586
|
description: "Transport Layer Security 1.3"
|
|
1560
1587
|
},
|
|
1588
|
+
"TOR": {
|
|
1589
|
+
description: "The Onion Router"
|
|
1590
|
+
},
|
|
1561
1591
|
"TOTP": {
|
|
1562
1592
|
description: "Time-based One-Time Password"
|
|
1563
1593
|
},
|
|
@@ -1636,6 +1666,18 @@ var ACRONYMS = {
|
|
|
1636
1666
|
"WPA": {
|
|
1637
1667
|
description: "Wi-Fi Protected Access"
|
|
1638
1668
|
},
|
|
1669
|
+
"WPA2": {
|
|
1670
|
+
description: "Wi-Fi Protected Access II"
|
|
1671
|
+
},
|
|
1672
|
+
"WPA3": {
|
|
1673
|
+
description: "Wi-Fi Protected Access III"
|
|
1674
|
+
},
|
|
1675
|
+
"WWW": {
|
|
1676
|
+
description: "World Wide Web"
|
|
1677
|
+
},
|
|
1678
|
+
"WYSIWYG": {
|
|
1679
|
+
description: "What You See Is What You Get"
|
|
1680
|
+
},
|
|
1639
1681
|
"XACML": {
|
|
1640
1682
|
description: "eXtensible Access Control Markup Language"
|
|
1641
1683
|
},
|
|
@@ -1677,19 +1719,194 @@ var ACRONYM_DESCRIPTION = Object.fromEntries(Object.entries(ACRONYMS).map(([key,
|
|
|
1677
1719
|
]));
|
|
1678
1720
|
var ACRONYM_LIST = Object.keys(ACRONYMS);
|
|
1679
1721
|
|
|
1680
|
-
// ../string-format/src/
|
|
1722
|
+
// ../string-format/src/articles.ts
|
|
1681
1723
|
init_cjs_shims();
|
|
1682
|
-
var
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1724
|
+
var ARTICLES = [
|
|
1725
|
+
"a",
|
|
1726
|
+
"an",
|
|
1727
|
+
"the"
|
|
1728
|
+
];
|
|
1729
|
+
|
|
1730
|
+
// ../string-format/src/conjunctions.ts
|
|
1731
|
+
init_cjs_shims();
|
|
1732
|
+
var CONJUNCTIONS = [
|
|
1733
|
+
"and",
|
|
1734
|
+
"that",
|
|
1735
|
+
"but",
|
|
1736
|
+
"or",
|
|
1737
|
+
"as",
|
|
1738
|
+
"if",
|
|
1739
|
+
"when",
|
|
1740
|
+
"than",
|
|
1741
|
+
"because",
|
|
1742
|
+
"while",
|
|
1743
|
+
"where",
|
|
1744
|
+
"after",
|
|
1745
|
+
"so",
|
|
1746
|
+
"though",
|
|
1747
|
+
"since",
|
|
1748
|
+
"until",
|
|
1749
|
+
"whether",
|
|
1750
|
+
"before",
|
|
1751
|
+
"although",
|
|
1752
|
+
"nor",
|
|
1753
|
+
"like",
|
|
1754
|
+
"once",
|
|
1755
|
+
"unless",
|
|
1756
|
+
"now",
|
|
1757
|
+
"except"
|
|
1758
|
+
];
|
|
1759
|
+
|
|
1760
|
+
// ../string-format/src/prepositions.ts
|
|
1761
|
+
init_cjs_shims();
|
|
1762
|
+
var PREPOSITIONS = [
|
|
1763
|
+
"about",
|
|
1764
|
+
"above",
|
|
1765
|
+
"across",
|
|
1766
|
+
"after",
|
|
1767
|
+
"against",
|
|
1768
|
+
"along",
|
|
1769
|
+
"among",
|
|
1770
|
+
"around",
|
|
1771
|
+
"at",
|
|
1772
|
+
"because of",
|
|
1773
|
+
"before",
|
|
1774
|
+
"behind",
|
|
1775
|
+
"below",
|
|
1776
|
+
"beneath",
|
|
1777
|
+
"beside",
|
|
1778
|
+
"besides",
|
|
1779
|
+
"between",
|
|
1780
|
+
"beyond",
|
|
1781
|
+
"but",
|
|
1782
|
+
"by",
|
|
1783
|
+
"concerning",
|
|
1784
|
+
"despite",
|
|
1785
|
+
"down",
|
|
1786
|
+
"during",
|
|
1787
|
+
"except",
|
|
1788
|
+
"excepting",
|
|
1789
|
+
"for",
|
|
1790
|
+
"from",
|
|
1791
|
+
"in",
|
|
1792
|
+
"in front of",
|
|
1793
|
+
"inside",
|
|
1794
|
+
"in spite of",
|
|
1795
|
+
"instead of",
|
|
1796
|
+
"into",
|
|
1797
|
+
"like",
|
|
1798
|
+
"near",
|
|
1799
|
+
"of",
|
|
1800
|
+
"off",
|
|
1801
|
+
"on",
|
|
1802
|
+
"onto",
|
|
1803
|
+
"out",
|
|
1804
|
+
"outside",
|
|
1805
|
+
"over",
|
|
1806
|
+
"past",
|
|
1807
|
+
"regarding",
|
|
1808
|
+
"since",
|
|
1809
|
+
"through",
|
|
1810
|
+
"throughout",
|
|
1811
|
+
"to",
|
|
1812
|
+
"toward",
|
|
1813
|
+
"under",
|
|
1814
|
+
"underneath",
|
|
1815
|
+
"until",
|
|
1816
|
+
"up",
|
|
1817
|
+
"upon",
|
|
1818
|
+
"up to",
|
|
1819
|
+
"with",
|
|
1820
|
+
"within",
|
|
1821
|
+
"without",
|
|
1822
|
+
"with regard to",
|
|
1823
|
+
"with respect to"
|
|
1824
|
+
];
|
|
1825
|
+
|
|
1826
|
+
// ../string-format/src/special-cases.ts
|
|
1827
|
+
init_cjs_shims();
|
|
1828
|
+
var SPECIAL_CASES = [
|
|
1829
|
+
"2FA",
|
|
1830
|
+
"4K",
|
|
1831
|
+
"5K",
|
|
1832
|
+
"8K",
|
|
1833
|
+
"AGI",
|
|
1834
|
+
"BI",
|
|
1835
|
+
"ChatGPT",
|
|
1836
|
+
"CTA",
|
|
1837
|
+
"DateTime",
|
|
1838
|
+
"FMS",
|
|
1839
|
+
"GitHub",
|
|
1840
|
+
"GPT",
|
|
1841
|
+
"HD",
|
|
1842
|
+
"IBMid",
|
|
1843
|
+
"IDs",
|
|
1844
|
+
"iMac",
|
|
1845
|
+
"IMAX",
|
|
1846
|
+
"iOS",
|
|
1847
|
+
"iPad",
|
|
1848
|
+
"iPhone",
|
|
1849
|
+
"iPod",
|
|
1850
|
+
"LDAP",
|
|
1851
|
+
"LinkedIn",
|
|
1852
|
+
"LLM",
|
|
1853
|
+
"macOS",
|
|
1854
|
+
"McDonalds",
|
|
1855
|
+
"MCP",
|
|
1856
|
+
"ML",
|
|
1857
|
+
"MySQL",
|
|
1858
|
+
"NLG",
|
|
1859
|
+
"NLP",
|
|
1860
|
+
"NLU",
|
|
1861
|
+
"OpenAI",
|
|
1862
|
+
"PDFs",
|
|
1863
|
+
"PIM",
|
|
1864
|
+
"PEFT",
|
|
1865
|
+
"pH",
|
|
1866
|
+
"PostgreSQL",
|
|
1867
|
+
"SEO",
|
|
1868
|
+
"TTS",
|
|
1869
|
+
"UHD",
|
|
1870
|
+
"UUID",
|
|
1871
|
+
"XSS",
|
|
1872
|
+
"YouTube",
|
|
1873
|
+
"CSpell",
|
|
1874
|
+
"ESLint"
|
|
1875
|
+
];
|
|
1876
|
+
|
|
1877
|
+
// ../string-format/src/format-special-cases.ts
|
|
1878
|
+
function formatSpecialCases(value, index, words, options) {
|
|
1879
|
+
const lowercaseStr = value.toLowerCase();
|
|
1880
|
+
const uppercaseStr = value.toUpperCase();
|
|
1881
|
+
for (const special of SPECIAL_CASES) {
|
|
1882
|
+
if (special.toLowerCase() === lowercaseStr) {
|
|
1883
|
+
return special;
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
if (ACRONYMS[uppercaseStr]) {
|
|
1887
|
+
return options?.useDescriptions !== false ? ACRONYMS[uppercaseStr].description : ACRONYMS[uppercaseStr].display || uppercaseStr;
|
|
1888
|
+
}
|
|
1889
|
+
if (index === 0) {
|
|
1890
|
+
return value;
|
|
1891
|
+
}
|
|
1892
|
+
if (index === words.length - 1) {
|
|
1893
|
+
return value;
|
|
1894
|
+
}
|
|
1895
|
+
if (value.length >= 4) {
|
|
1896
|
+
return value;
|
|
1897
|
+
}
|
|
1898
|
+
if (PREPOSITIONS.includes(lowercaseStr)) {
|
|
1899
|
+
return lowercaseStr;
|
|
1900
|
+
}
|
|
1901
|
+
if (CONJUNCTIONS.includes(lowercaseStr)) {
|
|
1902
|
+
return lowercaseStr;
|
|
1903
|
+
}
|
|
1904
|
+
if (ARTICLES.includes(lowercaseStr)) {
|
|
1905
|
+
return lowercaseStr;
|
|
1906
|
+
}
|
|
1907
|
+
return value;
|
|
1691
1908
|
}
|
|
1692
|
-
__name(
|
|
1909
|
+
__name(formatSpecialCases, "formatSpecialCases");
|
|
1693
1910
|
|
|
1694
1911
|
// ../string-format/src/upper-case-first.ts
|
|
1695
1912
|
init_cjs_shims();
|
|
@@ -1699,75 +1916,8 @@ function upperCaseFirst(input) {
|
|
|
1699
1916
|
__name(upperCaseFirst, "upperCaseFirst");
|
|
1700
1917
|
|
|
1701
1918
|
// ../string-format/src/title-case.ts
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
description: ACRONYMS[acronym]?.description || ACRONYMS[acronym]?.display || acronym,
|
|
1705
|
-
display: ACRONYMS[acronym]?.display || acronym
|
|
1706
|
-
};
|
|
1707
|
-
return ret;
|
|
1708
|
-
}, {
|
|
1709
|
-
CSPELL: {
|
|
1710
|
-
description: "CSpell",
|
|
1711
|
-
display: "CSpell"
|
|
1712
|
-
},
|
|
1713
|
-
ESLINT: {
|
|
1714
|
-
description: "ESLint",
|
|
1715
|
-
display: "ESLint"
|
|
1716
|
-
}
|
|
1717
|
-
});
|
|
1718
|
-
var LOWER_CASE_WHEN_NOT_FIRST = [
|
|
1719
|
-
"a",
|
|
1720
|
-
"an",
|
|
1721
|
-
"the",
|
|
1722
|
-
"is",
|
|
1723
|
-
"are",
|
|
1724
|
-
"of",
|
|
1725
|
-
"and",
|
|
1726
|
-
"to",
|
|
1727
|
-
"in",
|
|
1728
|
-
"for",
|
|
1729
|
-
"on",
|
|
1730
|
-
"with",
|
|
1731
|
-
"as",
|
|
1732
|
-
"at",
|
|
1733
|
-
"by"
|
|
1734
|
-
];
|
|
1735
|
-
function isTitleCase(input) {
|
|
1736
|
-
if (!input) {
|
|
1737
|
-
return false;
|
|
1738
|
-
}
|
|
1739
|
-
const words = input.split(/[\s\-_]+/).filter(Boolean);
|
|
1740
|
-
return words.every((word, idx) => {
|
|
1741
|
-
if (FORMAT_MAPPING[word.toUpperCase()]) {
|
|
1742
|
-
return true;
|
|
1743
|
-
}
|
|
1744
|
-
if (idx > 0 && LOWER_CASE_WHEN_NOT_FIRST.includes(word.toLowerCase()) && word === word.toLowerCase()) {
|
|
1745
|
-
return true;
|
|
1746
|
-
}
|
|
1747
|
-
return /^[A-Z][a-z0-9]*$/.test(word);
|
|
1748
|
-
});
|
|
1749
|
-
}
|
|
1750
|
-
__name(isTitleCase, "isTitleCase");
|
|
1751
|
-
function titleCase(input, options = {}) {
|
|
1752
|
-
if (isTitleCase(input) || input === void 0) {
|
|
1753
|
-
return input;
|
|
1754
|
-
}
|
|
1755
|
-
return input.split(/\s+-\s+/).map((segment) => getWords(segment).filter(Boolean).map((word, index) => {
|
|
1756
|
-
if (!options.skipLowerCaseWhenNotFirst && LOWER_CASE_WHEN_NOT_FIRST.includes(word.toLowerCase()) && index > 0) {
|
|
1757
|
-
return word.toLowerCase();
|
|
1758
|
-
}
|
|
1759
|
-
if (!options.skipFormatMapping && FORMAT_MAPPING[word.toUpperCase()]) {
|
|
1760
|
-
if (options.useDescriptions !== false) {
|
|
1761
|
-
return FORMAT_MAPPING[word.toUpperCase()]?.description;
|
|
1762
|
-
} else {
|
|
1763
|
-
return FORMAT_MAPPING[word.toUpperCase()]?.display;
|
|
1764
|
-
}
|
|
1765
|
-
}
|
|
1766
|
-
if (options.mapping && Object.keys(options.mapping).includes(word.toUpperCase())) {
|
|
1767
|
-
return options.mapping[word.toUpperCase()];
|
|
1768
|
-
}
|
|
1769
|
-
return `${upperCaseFirst(word)}`;
|
|
1770
|
-
}).join(" ")).join(" - ");
|
|
1919
|
+
function titleCase(input, options) {
|
|
1920
|
+
return input?.split(/\s+-\s+/).map((segment) => decamelize(segment).split(/[\s\-_]/).map(upperCaseFirst).map((value, index, array) => formatSpecialCases(value, index, array, options)).reduce(combine)).join(" - ");
|
|
1771
1921
|
}
|
|
1772
1922
|
__name(titleCase, "titleCase");
|
|
1773
1923
|
|