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