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