@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/generator.js CHANGED
@@ -35,9 +35,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
35
35
  mod
36
36
  ));
37
37
 
38
- // ../../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
38
+ // ../../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
39
39
  var init_esm_shims = __esm({
40
- "../../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"() {
40
+ "../../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"() {
41
41
  "use strict";
42
42
  }
43
43
  });
@@ -781,6 +781,23 @@ import { joinPaths } from "@stryke/path/join-paths";
781
781
  // ../string-format/src/title-case.ts
782
782
  init_esm_shims();
783
783
 
784
+ // ../string-format/src/combine.ts
785
+ init_esm_shims();
786
+ function combine(acc, str) {
787
+ return `${acc} ${str}`;
788
+ }
789
+ __name(combine, "combine");
790
+
791
+ // ../string-format/src/decamelize.ts
792
+ init_esm_shims();
793
+ function decamelize(value) {
794
+ return value.replace(/([a-z\d])([A-Z])/g, "$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g, "$1_$2").toLowerCase();
795
+ }
796
+ __name(decamelize, "decamelize");
797
+
798
+ // ../string-format/src/format-special-cases.ts
799
+ init_esm_shims();
800
+
784
801
  // ../string-format/src/acronyms.ts
785
802
  init_esm_shims();
786
803
  var ACRONYMS = {
@@ -880,6 +897,9 @@ var ACRONYMS = {
880
897
  "CAPTCHA": {
881
898
  description: "Completely Automated Public Turing test to tell Computers and Humans Apart"
882
899
  },
900
+ "CCTV": {
901
+ description: "Closed-Circuit Television"
902
+ },
883
903
  "CD": {
884
904
  description: "Continuous Delivery / Compact Disc"
885
905
  },
@@ -1056,6 +1076,10 @@ var ACRONYMS = {
1056
1076
  display: "FaaS"
1057
1077
  },
1058
1078
  "FAQ": {
1079
+ description: "Frequently Asked Questions",
1080
+ display: "FAQs"
1081
+ },
1082
+ "FAQS": {
1059
1083
  description: "Frequently Asked Questions"
1060
1084
  },
1061
1085
  "FBI": {
@@ -1237,6 +1261,9 @@ var ACRONYMS = {
1237
1261
  "IPS": {
1238
1262
  description: "Intrusion Prevention System"
1239
1263
  },
1264
+ "ISO": {
1265
+ description: "International Organization for Standardization"
1266
+ },
1240
1267
  "IQ": {
1241
1268
  description: "Intelligence Quotient",
1242
1269
  display: "IQ"
@@ -1563,6 +1590,9 @@ var ACRONYMS = {
1563
1590
  "TLS1.3": {
1564
1591
  description: "Transport Layer Security 1.3"
1565
1592
  },
1593
+ "TOR": {
1594
+ description: "The Onion Router"
1595
+ },
1566
1596
  "TOTP": {
1567
1597
  description: "Time-based One-Time Password"
1568
1598
  },
@@ -1641,6 +1671,18 @@ var ACRONYMS = {
1641
1671
  "WPA": {
1642
1672
  description: "Wi-Fi Protected Access"
1643
1673
  },
1674
+ "WPA2": {
1675
+ description: "Wi-Fi Protected Access II"
1676
+ },
1677
+ "WPA3": {
1678
+ description: "Wi-Fi Protected Access III"
1679
+ },
1680
+ "WWW": {
1681
+ description: "World Wide Web"
1682
+ },
1683
+ "WYSIWYG": {
1684
+ description: "What You See Is What You Get"
1685
+ },
1644
1686
  "XACML": {
1645
1687
  description: "eXtensible Access Control Markup Language"
1646
1688
  },
@@ -1682,19 +1724,194 @@ var ACRONYM_DESCRIPTION = Object.fromEntries(Object.entries(ACRONYMS).map(([key,
1682
1724
  ]));
1683
1725
  var ACRONYM_LIST = Object.keys(ACRONYMS);
1684
1726
 
1685
- // ../string-format/src/get-words.ts
1727
+ // ../string-format/src/articles.ts
1686
1728
  init_esm_shims();
1687
- var CASE_SPLIT_PATTERN = /[A-Z]?[a-z]+|\d+|[A-Z]+(?![a-z])/g;
1688
- var RELAXED_SPLIT_PATTERN = /[A-Z/.-]?[a-z/.-]+|\d+|[A-Z/.-]+(?![a-z/.-])/g;
1689
- function getWords(str, options = {}) {
1690
- if (str.length > 5e3) {
1691
- throw new Error("The regular expression parameter of `get-words` can't handle strings longer than 2000 characters");
1692
- }
1693
- return [
1694
- ...str.match(options.split ?? (options.relaxed ? RELAXED_SPLIT_PATTERN : CASE_SPLIT_PATTERN)) ?? []
1695
- ];
1729
+ var ARTICLES = [
1730
+ "a",
1731
+ "an",
1732
+ "the"
1733
+ ];
1734
+
1735
+ // ../string-format/src/conjunctions.ts
1736
+ init_esm_shims();
1737
+ var CONJUNCTIONS = [
1738
+ "and",
1739
+ "that",
1740
+ "but",
1741
+ "or",
1742
+ "as",
1743
+ "if",
1744
+ "when",
1745
+ "than",
1746
+ "because",
1747
+ "while",
1748
+ "where",
1749
+ "after",
1750
+ "so",
1751
+ "though",
1752
+ "since",
1753
+ "until",
1754
+ "whether",
1755
+ "before",
1756
+ "although",
1757
+ "nor",
1758
+ "like",
1759
+ "once",
1760
+ "unless",
1761
+ "now",
1762
+ "except"
1763
+ ];
1764
+
1765
+ // ../string-format/src/prepositions.ts
1766
+ init_esm_shims();
1767
+ var PREPOSITIONS = [
1768
+ "about",
1769
+ "above",
1770
+ "across",
1771
+ "after",
1772
+ "against",
1773
+ "along",
1774
+ "among",
1775
+ "around",
1776
+ "at",
1777
+ "because of",
1778
+ "before",
1779
+ "behind",
1780
+ "below",
1781
+ "beneath",
1782
+ "beside",
1783
+ "besides",
1784
+ "between",
1785
+ "beyond",
1786
+ "but",
1787
+ "by",
1788
+ "concerning",
1789
+ "despite",
1790
+ "down",
1791
+ "during",
1792
+ "except",
1793
+ "excepting",
1794
+ "for",
1795
+ "from",
1796
+ "in",
1797
+ "in front of",
1798
+ "inside",
1799
+ "in spite of",
1800
+ "instead of",
1801
+ "into",
1802
+ "like",
1803
+ "near",
1804
+ "of",
1805
+ "off",
1806
+ "on",
1807
+ "onto",
1808
+ "out",
1809
+ "outside",
1810
+ "over",
1811
+ "past",
1812
+ "regarding",
1813
+ "since",
1814
+ "through",
1815
+ "throughout",
1816
+ "to",
1817
+ "toward",
1818
+ "under",
1819
+ "underneath",
1820
+ "until",
1821
+ "up",
1822
+ "upon",
1823
+ "up to",
1824
+ "with",
1825
+ "within",
1826
+ "without",
1827
+ "with regard to",
1828
+ "with respect to"
1829
+ ];
1830
+
1831
+ // ../string-format/src/special-cases.ts
1832
+ init_esm_shims();
1833
+ var SPECIAL_CASES = [
1834
+ "2FA",
1835
+ "4K",
1836
+ "5K",
1837
+ "8K",
1838
+ "AGI",
1839
+ "BI",
1840
+ "ChatGPT",
1841
+ "CTA",
1842
+ "DateTime",
1843
+ "FMS",
1844
+ "GitHub",
1845
+ "GPT",
1846
+ "HD",
1847
+ "IBMid",
1848
+ "IDs",
1849
+ "iMac",
1850
+ "IMAX",
1851
+ "iOS",
1852
+ "iPad",
1853
+ "iPhone",
1854
+ "iPod",
1855
+ "LDAP",
1856
+ "LinkedIn",
1857
+ "LLM",
1858
+ "macOS",
1859
+ "McDonalds",
1860
+ "MCP",
1861
+ "ML",
1862
+ "MySQL",
1863
+ "NLG",
1864
+ "NLP",
1865
+ "NLU",
1866
+ "OpenAI",
1867
+ "PDFs",
1868
+ "PIM",
1869
+ "PEFT",
1870
+ "pH",
1871
+ "PostgreSQL",
1872
+ "SEO",
1873
+ "TTS",
1874
+ "UHD",
1875
+ "UUID",
1876
+ "XSS",
1877
+ "YouTube",
1878
+ "CSpell",
1879
+ "ESLint"
1880
+ ];
1881
+
1882
+ // ../string-format/src/format-special-cases.ts
1883
+ function formatSpecialCases(value, index, words, options) {
1884
+ const lowercaseStr = value.toLowerCase();
1885
+ const uppercaseStr = value.toUpperCase();
1886
+ for (const special of SPECIAL_CASES) {
1887
+ if (special.toLowerCase() === lowercaseStr) {
1888
+ return special;
1889
+ }
1890
+ }
1891
+ if (ACRONYMS[uppercaseStr]) {
1892
+ return options?.useDescriptions !== false ? ACRONYMS[uppercaseStr].description : ACRONYMS[uppercaseStr].display || uppercaseStr;
1893
+ }
1894
+ if (index === 0) {
1895
+ return value;
1896
+ }
1897
+ if (index === words.length - 1) {
1898
+ return value;
1899
+ }
1900
+ if (value.length >= 4) {
1901
+ return value;
1902
+ }
1903
+ if (PREPOSITIONS.includes(lowercaseStr)) {
1904
+ return lowercaseStr;
1905
+ }
1906
+ if (CONJUNCTIONS.includes(lowercaseStr)) {
1907
+ return lowercaseStr;
1908
+ }
1909
+ if (ARTICLES.includes(lowercaseStr)) {
1910
+ return lowercaseStr;
1911
+ }
1912
+ return value;
1696
1913
  }
1697
- __name(getWords, "getWords");
1914
+ __name(formatSpecialCases, "formatSpecialCases");
1698
1915
 
1699
1916
  // ../string-format/src/upper-case-first.ts
1700
1917
  init_esm_shims();
@@ -1704,75 +1921,8 @@ function upperCaseFirst(input) {
1704
1921
  __name(upperCaseFirst, "upperCaseFirst");
1705
1922
 
1706
1923
  // ../string-format/src/title-case.ts
1707
- var FORMAT_MAPPING = ACRONYM_LIST.reduce((ret, acronym) => {
1708
- ret[acronym.toUpperCase()] = {
1709
- description: ACRONYMS[acronym]?.description || ACRONYMS[acronym]?.display || acronym,
1710
- display: ACRONYMS[acronym]?.display || acronym
1711
- };
1712
- return ret;
1713
- }, {
1714
- CSPELL: {
1715
- description: "CSpell",
1716
- display: "CSpell"
1717
- },
1718
- ESLINT: {
1719
- description: "ESLint",
1720
- display: "ESLint"
1721
- }
1722
- });
1723
- var LOWER_CASE_WHEN_NOT_FIRST = [
1724
- "a",
1725
- "an",
1726
- "the",
1727
- "is",
1728
- "are",
1729
- "of",
1730
- "and",
1731
- "to",
1732
- "in",
1733
- "for",
1734
- "on",
1735
- "with",
1736
- "as",
1737
- "at",
1738
- "by"
1739
- ];
1740
- function isTitleCase(input) {
1741
- if (!input) {
1742
- return false;
1743
- }
1744
- const words = input.split(/[\s\-_]+/).filter(Boolean);
1745
- return words.every((word, idx) => {
1746
- if (FORMAT_MAPPING[word.toUpperCase()]) {
1747
- return true;
1748
- }
1749
- if (idx > 0 && LOWER_CASE_WHEN_NOT_FIRST.includes(word.toLowerCase()) && word === word.toLowerCase()) {
1750
- return true;
1751
- }
1752
- return /^[A-Z][a-z0-9]*$/.test(word);
1753
- });
1754
- }
1755
- __name(isTitleCase, "isTitleCase");
1756
- function titleCase(input, options = {}) {
1757
- if (isTitleCase(input) || input === void 0) {
1758
- return input;
1759
- }
1760
- return input.split(/\s+-\s+/).map((segment) => getWords(segment).filter(Boolean).map((word, index) => {
1761
- if (!options.skipLowerCaseWhenNotFirst && LOWER_CASE_WHEN_NOT_FIRST.includes(word.toLowerCase()) && index > 0) {
1762
- return word.toLowerCase();
1763
- }
1764
- if (!options.skipFormatMapping && FORMAT_MAPPING[word.toUpperCase()]) {
1765
- if (options.useDescriptions !== false) {
1766
- return FORMAT_MAPPING[word.toUpperCase()]?.description;
1767
- } else {
1768
- return FORMAT_MAPPING[word.toUpperCase()]?.display;
1769
- }
1770
- }
1771
- if (options.mapping && Object.keys(options.mapping).includes(word.toUpperCase())) {
1772
- return options.mapping[word.toUpperCase()];
1773
- }
1774
- return `${upperCaseFirst(word)}`;
1775
- }).join(" ")).join(" - ");
1924
+ function titleCase(input, options) {
1925
+ 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(" - ");
1776
1926
  }
1777
1927
  __name(titleCase, "titleCase");
1778
1928