inferred-types 0.53.0 → 0.53.1
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/modules/constants/dist/index.cjs +2761 -0
- package/modules/constants/dist/index.cjs.map +1 -0
- package/modules/constants/dist/index.d.mts +4084 -0
- package/modules/constants/dist/index.d.ts +4084 -0
- package/modules/constants/dist/index.js +2576 -0
- package/modules/constants/dist/index.js.map +1 -0
- package/modules/inferred-types/dist/index.cjs +7210 -0
- package/modules/inferred-types/dist/index.cjs.map +1 -0
- package/modules/inferred-types/dist/index.js +6585 -0
- package/modules/inferred-types/dist/index.js.map +1 -0
- package/modules/runtime/dist/index.cjs +4865 -0
- package/modules/runtime/dist/index.cjs.map +1 -0
- package/modules/runtime/dist/index.js +4439 -0
- package/modules/runtime/dist/index.js.map +1 -0
- package/modules/types/dist/index.cjs +210 -0
- package/modules/types/dist/index.cjs.map +1 -0
- package/modules/types/dist/index.js +194 -0
- package/modules/types/dist/index.js.map +1 -0
- package/package.json +5 -2
|
@@ -0,0 +1,4865 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/api/defineApi.ts
|
|
4
|
+
function asEscapeFunction(fn2) {
|
|
5
|
+
return createFnWithProps(fn2, { escape: true });
|
|
6
|
+
}
|
|
7
|
+
function asOptionalParamFunction(fn2) {
|
|
8
|
+
return createFnWithProps(fn2, { optionalParams: true });
|
|
9
|
+
}
|
|
10
|
+
function asApi(api2) {
|
|
11
|
+
return isApi(api2) ? api2 : isApiSurface(api2) ? { _kind: "api", surface: api2 } : createErrorCondition("invalid-api");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// src/api/handleDoneFn.ts
|
|
15
|
+
function handleDoneFn(val, call_bare_fn = false) {
|
|
16
|
+
return isObject(val) || isFunction(val) ? isDoneFn(val) ? val.done() : isFunction(val) ? call_bare_fn ? val() : val : val : isFunction(val) ? call_bare_fn ? val() : val : val;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// src/boolean-logic/ifArray.ts
|
|
20
|
+
function ifArray(val, isAnArray, isNotAnArray) {
|
|
21
|
+
return Array.isArray(val) ? isAnArray(val) : isNotAnArray(val);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/boolean-logic/ifArrayPartial.ts
|
|
25
|
+
function ifArrayPartial() {
|
|
26
|
+
return (isAnArray, isNotAnArray) => {
|
|
27
|
+
return (val) => ifArray(val, isAnArray, isNotAnArray);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// src/boolean-logic/ifBoolean.ts
|
|
32
|
+
function ifBoolean(val, ifBoolean2, notBoolean) {
|
|
33
|
+
return isBoolean(val) ? ifBoolean2(val) : notBoolean(val);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// ../constants/dist/index.js
|
|
37
|
+
var LOWER_ALPHA_CHARS = [
|
|
38
|
+
"a",
|
|
39
|
+
"b",
|
|
40
|
+
"c",
|
|
41
|
+
"d",
|
|
42
|
+
"e",
|
|
43
|
+
"f",
|
|
44
|
+
"g",
|
|
45
|
+
"h",
|
|
46
|
+
"i",
|
|
47
|
+
"j",
|
|
48
|
+
"k",
|
|
49
|
+
"l",
|
|
50
|
+
"m",
|
|
51
|
+
"n",
|
|
52
|
+
"o",
|
|
53
|
+
"p",
|
|
54
|
+
"q",
|
|
55
|
+
"r",
|
|
56
|
+
"s",
|
|
57
|
+
"t",
|
|
58
|
+
"u",
|
|
59
|
+
"v",
|
|
60
|
+
"w",
|
|
61
|
+
"x",
|
|
62
|
+
"y",
|
|
63
|
+
"z"
|
|
64
|
+
];
|
|
65
|
+
var UPPER_ALPHA_CHARS = [
|
|
66
|
+
"A",
|
|
67
|
+
"B",
|
|
68
|
+
"C",
|
|
69
|
+
"D",
|
|
70
|
+
"E",
|
|
71
|
+
"F",
|
|
72
|
+
"G",
|
|
73
|
+
"H",
|
|
74
|
+
"I",
|
|
75
|
+
"J",
|
|
76
|
+
"K",
|
|
77
|
+
"L",
|
|
78
|
+
"M",
|
|
79
|
+
"N",
|
|
80
|
+
"O",
|
|
81
|
+
"P",
|
|
82
|
+
"Q",
|
|
83
|
+
"R",
|
|
84
|
+
"S",
|
|
85
|
+
"T",
|
|
86
|
+
"U",
|
|
87
|
+
"V",
|
|
88
|
+
"W",
|
|
89
|
+
"X",
|
|
90
|
+
"Y",
|
|
91
|
+
"Z"
|
|
92
|
+
];
|
|
93
|
+
var ALPHA_CHARS = [
|
|
94
|
+
...LOWER_ALPHA_CHARS,
|
|
95
|
+
...UPPER_ALPHA_CHARS
|
|
96
|
+
];
|
|
97
|
+
var WHITESPACE_CHARS = [
|
|
98
|
+
" ",
|
|
99
|
+
"\n",
|
|
100
|
+
" ",
|
|
101
|
+
"\b"
|
|
102
|
+
];
|
|
103
|
+
function createConstant(kind) {
|
|
104
|
+
return {
|
|
105
|
+
_type: "Constant",
|
|
106
|
+
kind
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
var FALSY_VALUES = [
|
|
110
|
+
false,
|
|
111
|
+
0,
|
|
112
|
+
-0,
|
|
113
|
+
"",
|
|
114
|
+
null,
|
|
115
|
+
void 0,
|
|
116
|
+
Number.NaN
|
|
117
|
+
];
|
|
118
|
+
var US_STATE_LOOKUP_STRICT = [
|
|
119
|
+
{ name: "Alabama", abbrev: "AL" },
|
|
120
|
+
{ name: "Alaska", abbrev: "AK" },
|
|
121
|
+
{ name: "Arizona", abbrev: "AZ" },
|
|
122
|
+
{ name: "Arkansas", abbrev: "AR" },
|
|
123
|
+
{ name: "California", abbrev: "CA" },
|
|
124
|
+
{ name: "Colorado", abbrev: "CO" },
|
|
125
|
+
{ name: "Connecticut", abbrev: "CT" },
|
|
126
|
+
{ name: "Delaware", abbrev: "DE" },
|
|
127
|
+
{ name: "Florida", abbrev: "FL" },
|
|
128
|
+
{ name: "Georgia", abbrev: "GA" },
|
|
129
|
+
{ name: "Hawaii", abbrev: "HI" },
|
|
130
|
+
{ name: "Idaho", abbrev: "ID" },
|
|
131
|
+
{ name: "Illinois", abbrev: "IL" },
|
|
132
|
+
{ name: "Indiana", abbrev: "IN" },
|
|
133
|
+
{ name: "Iowa", abbrev: "IA" },
|
|
134
|
+
{ name: "Kansas", abbrev: "KS" },
|
|
135
|
+
{ name: "Kentucky", abbrev: "KY" },
|
|
136
|
+
{ name: "Louisiana", abbrev: "LA" },
|
|
137
|
+
{ name: "Maine", abbrev: "ME" },
|
|
138
|
+
{ name: "Maryland", abbrev: "MD" },
|
|
139
|
+
{ name: "Massachusetts", abbrev: "MA" },
|
|
140
|
+
{ name: "Michigan", abbrev: "MI" },
|
|
141
|
+
{ name: "Minnesota", abbrev: "MN" },
|
|
142
|
+
{ name: "Mississippi", abbrev: "MS" },
|
|
143
|
+
{ name: "Missouri", abbrev: "MO" },
|
|
144
|
+
{ name: "Montana", abbrev: "MT" },
|
|
145
|
+
{ name: "Nebraska", abbrev: "NE" },
|
|
146
|
+
{ name: "Nevada", abbrev: "NV" },
|
|
147
|
+
{ name: "New Hampshire", abbrev: "NH" },
|
|
148
|
+
{ name: "New Jersey", abbrev: "NJ" },
|
|
149
|
+
{ name: "New Mexico", abbrev: "NM" },
|
|
150
|
+
{ name: "New York", abbrev: "NY" },
|
|
151
|
+
{ name: "North Carolina", abbrev: "NC" },
|
|
152
|
+
{ name: "North Dakota", abbrev: "ND" },
|
|
153
|
+
{ name: "Ohio", abbrev: "OH" },
|
|
154
|
+
{ name: "Oklahoma", abbrev: "OK" },
|
|
155
|
+
{ name: "Oregon", abbrev: "OR" },
|
|
156
|
+
{ name: "Pennsylvania", abbrev: "PA" },
|
|
157
|
+
{ name: "Rhode Island", abbrev: "RI" },
|
|
158
|
+
{ name: "South Carolina", abbrev: "SC" },
|
|
159
|
+
{ name: "South Dakota", abbrev: "SD" },
|
|
160
|
+
{ name: "Tennessee", abbrev: "TN" },
|
|
161
|
+
{ name: "Texas", abbrev: "TX" },
|
|
162
|
+
{ name: "Utah", abbrev: "UT" },
|
|
163
|
+
{ name: "Vermont", abbrev: "VT" },
|
|
164
|
+
{ name: "Virginia", abbrev: "VA" },
|
|
165
|
+
{ name: "Washington", abbrev: "WA" },
|
|
166
|
+
{ name: "West Virginia", abbrev: "WV" },
|
|
167
|
+
{ name: "Wisconsin", abbrev: "WI" },
|
|
168
|
+
{ name: "Wyoming", abbrev: "WY" }
|
|
169
|
+
];
|
|
170
|
+
var US_STATE_LOOKUP_PROVINCES = [
|
|
171
|
+
{ name: "Puerto Rico", abbrev: "PR" },
|
|
172
|
+
{ name: "Virgin Islands", abbrev: "VI" },
|
|
173
|
+
{ name: "Palau", abbrev: "PW" },
|
|
174
|
+
{ name: "Federated States of Micronesia", abbrev: "FM" },
|
|
175
|
+
{ name: "Northern Mariana Islands", abbrev: "MP" },
|
|
176
|
+
{ name: "District of Columbia", abbrev: "DC" },
|
|
177
|
+
{ name: "Marshall Islands", abbrev: "MH" },
|
|
178
|
+
{ name: "American Samoa", abbrev: "AS" },
|
|
179
|
+
{ name: "Guam", abbrev: "GU" }
|
|
180
|
+
];
|
|
181
|
+
var US_STATE_LOOKUP = [
|
|
182
|
+
...US_STATE_LOOKUP_STRICT,
|
|
183
|
+
...US_STATE_LOOKUP_PROVINCES
|
|
184
|
+
];
|
|
185
|
+
var ISO3166_1 = [
|
|
186
|
+
{ name: "Afghanistan", alpha2: "AF", countryCode: "004", alpha3: "AFG" },
|
|
187
|
+
{ name: "Albania", alpha2: "AL", countryCode: "008", alpha3: "ALB" },
|
|
188
|
+
{ name: "Algeria", alpha2: "DZ", countryCode: "012", alpha3: "DZA" },
|
|
189
|
+
{ name: "Andorra", alpha2: "AD", countryCode: "020", alpha3: "AND" },
|
|
190
|
+
{ name: "Angola", alpha2: "AO", countryCode: "024", alpha3: "AGO" },
|
|
191
|
+
{ name: "Argentina", alpha2: "AR", countryCode: "032", alpha3: "ARG" },
|
|
192
|
+
{ name: "Australia", alpha2: "AU", countryCode: "036", alpha3: "AUS" },
|
|
193
|
+
{ name: "Austria", alpha2: "AT", countryCode: "040", alpha3: "AUT" },
|
|
194
|
+
{ name: "Azerbaijan", alpha2: "AZ", countryCode: "031", alpha3: "AZE" },
|
|
195
|
+
{ name: "Bahamas", alpha2: "BS", countryCode: "044", alpha3: "BHS" },
|
|
196
|
+
{ name: "Bangladesh", alpha2: "BD", countryCode: "050", alpha3: "BGD" },
|
|
197
|
+
{ name: "Belgium", alpha2: "BE", countryCode: "056", alpha3: "BEL" },
|
|
198
|
+
{ name: "Belize", alpha2: "BZ", countryCode: "084", alpha3: "BLZ" },
|
|
199
|
+
{ name: "Benin", alpha2: "BJ", countryCode: "204", alpha3: "BEN" },
|
|
200
|
+
{ name: "Bhutan", alpha2: "BT", countryCode: "064", alpha3: "BTN" },
|
|
201
|
+
{ name: "Bolivia", alpha2: "BO", countryCode: "068", alpha3: "BOL" },
|
|
202
|
+
{ name: "Bosnia and Herzegovina", alpha2: "BA", countryCode: "070", alpha3: "BIH" },
|
|
203
|
+
{ name: "Botswana", alpha2: "BW", countryCode: "072", alpha3: "BWA" },
|
|
204
|
+
{ name: "Brazil", alpha2: "BR", countryCode: "076", alpha3: "BRA" },
|
|
205
|
+
{ name: "Brunei Darussalam", alpha2: "BN", countryCode: "096", alpha3: "BRN" },
|
|
206
|
+
{ name: "Bulgaria", alpha2: "BG", countryCode: "100", alpha3: "BGR" },
|
|
207
|
+
{ name: "Burkina Faso", alpha2: "BF", countryCode: "854", alpha3: "BFA" },
|
|
208
|
+
{ name: "Burundi", alpha2: "BI", countryCode: "108", alpha3: "BDI" },
|
|
209
|
+
{ name: "Cambodia", alpha2: "KH", countryCode: "116", alpha3: "KHM" },
|
|
210
|
+
{ name: "Cameroon", alpha2: "CM", countryCode: "120", alpha3: "CMR" },
|
|
211
|
+
{ name: "Canada", alpha2: "CA", countryCode: "124", alpha3: "CAN" },
|
|
212
|
+
{ name: "Afghanistan", alpha2: "AF", countryCode: "004", alpha3: "AFG" },
|
|
213
|
+
{ name: "Albania", alpha2: "AL", countryCode: "008", alpha3: "ALB" },
|
|
214
|
+
{ name: "Algeria", alpha2: "DZ", countryCode: "012", alpha3: "DZA" },
|
|
215
|
+
{ name: "Andorra", alpha2: "AD", countryCode: "020", alpha3: "AND" },
|
|
216
|
+
{ name: "Angola", alpha2: "AO", countryCode: "024", alpha3: "AGO" },
|
|
217
|
+
{ name: "Argentina", alpha2: "AR", countryCode: "032", alpha3: "ARG" },
|
|
218
|
+
{ name: "Australia", alpha2: "AU", countryCode: "036", alpha3: "AUS" },
|
|
219
|
+
{ name: "Austria", alpha2: "AT", countryCode: "040", alpha3: "AUT" },
|
|
220
|
+
{ name: "Azerbaijan", alpha2: "AZ", countryCode: "031", alpha3: "AZE" },
|
|
221
|
+
{ name: "Bahamas", alpha2: "BS", countryCode: "044", alpha3: "BHS" },
|
|
222
|
+
{ name: "Bangladesh", alpha2: "BD", countryCode: "050", alpha3: "BGD" },
|
|
223
|
+
{ name: "Belgium", alpha2: "BE", countryCode: "056", alpha3: "BEL" },
|
|
224
|
+
{ name: "Belize", alpha2: "BZ", countryCode: "084", alpha3: "BLZ" },
|
|
225
|
+
{ name: "Benin", alpha2: "BJ", countryCode: "204", alpha3: "BEN" },
|
|
226
|
+
{ name: "Bhutan", alpha2: "BT", countryCode: "064", alpha3: "BTN" },
|
|
227
|
+
{ name: "Bolivia", alpha2: "BO", countryCode: "068", alpha3: "BOL" },
|
|
228
|
+
{ name: "Bosnia and Herzegovina", alpha2: "BA", countryCode: "070", alpha3: "BIH" },
|
|
229
|
+
{ name: "Botswana", alpha2: "BW", countryCode: "072", alpha3: "BWA" },
|
|
230
|
+
{ name: "Brazil", alpha2: "BR", countryCode: "076", alpha3: "BRA" },
|
|
231
|
+
{ name: "Brunei Darussalam", alpha2: "BN", countryCode: "096", alpha3: "BRN" },
|
|
232
|
+
{ name: "Bulgaria", alpha2: "BG", countryCode: "100", alpha3: "BGR" },
|
|
233
|
+
{ name: "Burkina Faso", alpha2: "BF", countryCode: "854", alpha3: "BFA" },
|
|
234
|
+
{ name: "Burundi", alpha2: "BI", countryCode: "108", alpha3: "BDI" },
|
|
235
|
+
{ name: "Cambodia", alpha2: "KH", countryCode: "116", alpha3: "KHM" },
|
|
236
|
+
{ name: "Cameroon", alpha2: "CM", countryCode: "120", alpha3: "CMR" },
|
|
237
|
+
{ name: "Canada", alpha2: "CA", countryCode: "124", alpha3: "CAN" },
|
|
238
|
+
{ name: "Maldives", alpha2: "MV", countryCode: "462", alpha3: "MDV" },
|
|
239
|
+
{ name: "Mali", alpha2: "ML", countryCode: "466", alpha3: "MLI" },
|
|
240
|
+
{ name: "Malta", alpha2: "MT", countryCode: "470", alpha3: "MLT" },
|
|
241
|
+
{ name: "Marshall Islands", alpha2: "MH", countryCode: "584", alpha3: "MHL" },
|
|
242
|
+
{ name: "Mauritania", alpha2: "MR", countryCode: "478", alpha3: "MRT" },
|
|
243
|
+
{ name: "Mauritius", alpha2: "MU", countryCode: "480", alpha3: "MUS" },
|
|
244
|
+
{ name: "Mexico", alpha2: "MX", countryCode: "484", alpha3: "MEX" },
|
|
245
|
+
{ name: "Micronesia (Federated States of)", alpha2: "FM", countryCode: "583", alpha3: "FSM" },
|
|
246
|
+
{ name: "Moldova (Republic of)", alpha2: "MD", countryCode: "498", alpha3: "MDA" },
|
|
247
|
+
{ name: "Monaco", alpha2: "MC", countryCode: "492", alpha3: "MCO" },
|
|
248
|
+
{ name: "Mongolia", alpha2: "MN", countryCode: "496", alpha3: "MNG" },
|
|
249
|
+
{ name: "Montenegro", alpha2: "ME", countryCode: "499", alpha3: "MNE" },
|
|
250
|
+
{ name: "Morocco", alpha2: "MA", countryCode: "504", alpha3: "MAR" },
|
|
251
|
+
{ name: "Mozambique", alpha2: "MZ", countryCode: "508", alpha3: "MOZ" },
|
|
252
|
+
{ name: "Myanmar", alpha2: "MM", countryCode: "104", alpha3: "MMR" },
|
|
253
|
+
{ name: "Namibia", alpha2: "NA", countryCode: "516", alpha3: "NAM" },
|
|
254
|
+
{ name: "Nauru", alpha2: "NR", countryCode: "520", alpha3: "NRU" },
|
|
255
|
+
{ name: "Nepal", alpha2: "NP", countryCode: "524", alpha3: "NPL" },
|
|
256
|
+
{ name: "Netherlands", alpha2: "NL", countryCode: "528", alpha3: "NLD" },
|
|
257
|
+
{ name: "New Zealand", alpha2: "NZ", countryCode: "554", alpha3: "NZL" },
|
|
258
|
+
{ name: "Nicaragua", alpha2: "NI", countryCode: "558", alpha3: "NIC" },
|
|
259
|
+
{ name: "Niger", alpha2: "NE", countryCode: "562", alpha3: "NER" },
|
|
260
|
+
{ name: "Nigeria", alpha2: "NG", countryCode: "566", alpha3: "NGA" },
|
|
261
|
+
{ name: "North Macedonia", alpha2: "MK", countryCode: "807", alpha3: "MKD" },
|
|
262
|
+
{ name: "Norway", alpha2: "NO", countryCode: "578", alpha3: "NOR" },
|
|
263
|
+
{ name: "Oman", alpha2: "OM", countryCode: "512", alpha3: "OMN" },
|
|
264
|
+
{ name: "Pakistan", alpha2: "PK", countryCode: "586", alpha3: "PAK" },
|
|
265
|
+
{ name: "Palau", alpha2: "PW", countryCode: "585", alpha3: "PLW" },
|
|
266
|
+
{ name: "Panama", alpha2: "PA", countryCode: "591", alpha3: "PAN" },
|
|
267
|
+
{ name: "Papua New Guinea", alpha2: "PG", countryCode: "598", alpha3: "PNG" },
|
|
268
|
+
{ name: "Paraguay", alpha2: "PY", countryCode: "600", alpha3: "PRY" },
|
|
269
|
+
{ name: "Peru", alpha2: "PE", countryCode: "604", alpha3: "PER" },
|
|
270
|
+
{ name: "Philippines", alpha2: "PH", countryCode: "608", alpha3: "PHL" },
|
|
271
|
+
{ name: "Poland", alpha2: "PL", countryCode: "616", alpha3: "POL" },
|
|
272
|
+
{ name: "Portugal", alpha2: "PT", countryCode: "620", alpha3: "PRT" },
|
|
273
|
+
{ name: "Qatar", alpha2: "QA", countryCode: "634", alpha3: "QAT" },
|
|
274
|
+
{ name: "Romania", alpha2: "RO", countryCode: "642", alpha3: "ROU" },
|
|
275
|
+
{ name: "Russian Federation", alpha2: "RU", countryCode: "643", alpha3: "RUS" },
|
|
276
|
+
{ name: "Rwanda", alpha2: "RW", countryCode: "646", alpha3: "RWA" },
|
|
277
|
+
{ name: "Saint Kitts and Nevis", alpha2: "KN", countryCode: "659", alpha3: "KNA" },
|
|
278
|
+
{ name: "Saint Lucia", alpha2: "LC", countryCode: "662", alpha3: "LCA" },
|
|
279
|
+
{ name: "Saint Vincent and the Grenadines", alpha2: "VC", countryCode: "670", alpha3: "VCT" },
|
|
280
|
+
{ name: "Samoa", alpha2: "WS", countryCode: "882", alpha3: "WSM" },
|
|
281
|
+
{ name: "San Marino", alpha2: "SM", countryCode: "674", alpha3: "SMR" },
|
|
282
|
+
{ name: "Sao Tome and Principe", alpha2: "ST", countryCode: "678", alpha3: "STP" },
|
|
283
|
+
{ name: "Saudi Arabia", alpha2: "SA", countryCode: "682", alpha3: "SAU" },
|
|
284
|
+
{ name: "Senegal", alpha2: "SN", countryCode: "686", alpha3: "SEN" },
|
|
285
|
+
{ name: "Serbia", alpha2: "RS", countryCode: "688", alpha3: "SRB" },
|
|
286
|
+
{ name: "Seychelles", alpha2: "SC", countryCode: "690", alpha3: "SYC" },
|
|
287
|
+
{ name: "Sierra Leone", alpha2: "SL", countryCode: "694", alpha3: "SLE" },
|
|
288
|
+
{ name: "Singapore", alpha2: "SG", countryCode: "702", alpha3: "SGP" },
|
|
289
|
+
{ name: "Slovakia", alpha2: "SK", countryCode: "703", alpha3: "SVK" },
|
|
290
|
+
{ name: "Slovenia", alpha2: "SI", countryCode: "705", alpha3: "SVN" },
|
|
291
|
+
{ name: "Solomon Islands", alpha2: "SB", countryCode: "090", alpha3: "SLB" },
|
|
292
|
+
{ name: "Somalia", alpha2: "SO", countryCode: "706", alpha3: "SOM" },
|
|
293
|
+
{ name: "South Africa", alpha2: "ZA", countryCode: "710", alpha3: "ZAF" },
|
|
294
|
+
{ name: "South Sudan", alpha2: "SS", countryCode: "728", alpha3: "SSD" },
|
|
295
|
+
{ name: "Spain", alpha2: "ES", countryCode: "724", alpha3: "ESP" },
|
|
296
|
+
{ name: "Sri Lanka", alpha2: "LK", countryCode: "144", alpha3: "LKA" },
|
|
297
|
+
{ name: "Sudan", alpha2: "SD", countryCode: "729", alpha3: "SDN" },
|
|
298
|
+
{ name: "Suriname", alpha2: "SR", countryCode: "740", alpha3: "SUR" },
|
|
299
|
+
{ name: "Sweden", alpha2: "SE", countryCode: "752", alpha3: "SWE" },
|
|
300
|
+
{ name: "Switzerland", alpha2: "CH", countryCode: "756", alpha3: "CHE" },
|
|
301
|
+
{ name: "Syrian Arab Republic", alpha2: "SY", countryCode: "760", alpha3: "SYR" },
|
|
302
|
+
{ name: "Taiwan", alpha2: "TW", countryCode: "158", alpha3: "TWN" },
|
|
303
|
+
{ name: "Tajikistan", alpha2: "TJ", countryCode: "762", alpha3: "TJK" },
|
|
304
|
+
{ name: "Tanzania", alpha2: "TZ", countryCode: "834", alpha3: "TZA" },
|
|
305
|
+
{ name: "Thailand", alpha2: "TH", countryCode: "764", alpha3: "THA" },
|
|
306
|
+
{ name: "Timor-Leste", alpha2: "TL", countryCode: "626", alpha3: "TLS" },
|
|
307
|
+
{ name: "Togo", alpha2: "TG", countryCode: "768", alpha3: "TGO" },
|
|
308
|
+
{ name: "Tonga", alpha2: "TO", countryCode: "776", alpha3: "TON" },
|
|
309
|
+
{ name: "Tonga", alpha2: "TO", countryCode: "776", alpha3: "TON" },
|
|
310
|
+
{ name: "Trinidad and Tobago", alpha2: "TT", countryCode: "780", alpha3: "TTO" },
|
|
311
|
+
{ name: "Tunisia", alpha2: "TN", countryCode: "788", alpha3: "TUN" },
|
|
312
|
+
{ name: "Turkey", alpha2: "TR", countryCode: "792", alpha3: "TUR" },
|
|
313
|
+
{ name: "Turkmenistan", alpha2: "TM", countryCode: "795", alpha3: "TKM" },
|
|
314
|
+
{ name: "Tuvalu", alpha2: "TV", countryCode: "798", alpha3: "TUV" },
|
|
315
|
+
{ name: "Uganda", alpha2: "UG", countryCode: "800", alpha3: "UGA" },
|
|
316
|
+
{ name: "Ukraine", alpha2: "UA", countryCode: "804", alpha3: "UKR" },
|
|
317
|
+
{ name: "United Arab Emirates", alpha2: "AE", countryCode: "784", alpha3: "ARE" },
|
|
318
|
+
{ name: "United Kingdom", alpha2: "GB", countryCode: "826", alpha3: "GBR" },
|
|
319
|
+
{ name: "United States of America", alpha2: "US", countryCode: "840", alpha3: "USA" },
|
|
320
|
+
{ name: "Uruguay", alpha2: "UY", countryCode: "858", alpha3: "URY" },
|
|
321
|
+
{ name: "Uzbekistan", alpha2: "UZ", countryCode: "860", alpha3: "UZB" },
|
|
322
|
+
{ name: "Vanuatu", alpha2: "VU", countryCode: "548", alpha3: "VUT" },
|
|
323
|
+
{ name: "Venezuela", alpha2: "VE", countryCode: "862", alpha3: "VEN" },
|
|
324
|
+
{ name: "Viet Nam", alpha2: "VN", countryCode: "704", alpha3: "VNM" },
|
|
325
|
+
{ name: "Yemen", alpha2: "YE", countryCode: "887", alpha3: "YEM" },
|
|
326
|
+
{ name: "Zambia", alpha2: "ZM", countryCode: "894", alpha3: "ZMB" },
|
|
327
|
+
{ name: "Zimbabwe", alpha2: "ZW", countryCode: "716", alpha3: "ZWE" }
|
|
328
|
+
];
|
|
329
|
+
var DISTANCE_METRICS_LOOKUP = [
|
|
330
|
+
{ abbrev: "km", name: "kilometer" },
|
|
331
|
+
{ abbrev: "mi", name: "mile" },
|
|
332
|
+
{ abbrev: "mm", name: "millimeter" },
|
|
333
|
+
{ abbrev: "cm", name: "centimeter" },
|
|
334
|
+
{ abbrev: "yd", name: "yard" },
|
|
335
|
+
{ abbrev: "ft", name: "foot" },
|
|
336
|
+
{ abbrev: "in", name: "inch" },
|
|
337
|
+
{ abbrev: "m", name: "meter" },
|
|
338
|
+
{ abbrev: "nm", name: "nautical mile" },
|
|
339
|
+
{ abbrev: "nmi", name: "nanometer" },
|
|
340
|
+
{ abbrev: "\xB5m", name: "micrometer" },
|
|
341
|
+
{ abbrev: "dm", name: "decimeter" },
|
|
342
|
+
{ abbrev: "AU", name: "astronomical unit" },
|
|
343
|
+
{ abbrev: "ly", name: "light year" },
|
|
344
|
+
{ abbrev: "pc", name: "parsec" }
|
|
345
|
+
];
|
|
346
|
+
var MASS_METRICS_LOOKUP = [
|
|
347
|
+
{ abbrev: "g", name: "gram" },
|
|
348
|
+
{ abbrev: "kg", name: "kilogram" },
|
|
349
|
+
{ abbrev: "mg", name: "milligram" },
|
|
350
|
+
{ abbrev: "\xB5g", name: "microgram" },
|
|
351
|
+
{ abbrev: "t", name: "tonne" },
|
|
352
|
+
{ abbrev: "lb", name: "pound" },
|
|
353
|
+
{ abbrev: "oz", name: "ounce" },
|
|
354
|
+
{ abbrev: "st", name: "stone" },
|
|
355
|
+
{ abbrev: "ct", name: "carat" },
|
|
356
|
+
{ abbrev: "Mt", name: "megatonne" },
|
|
357
|
+
{ abbrev: "gt", name: "gigatonne" },
|
|
358
|
+
{ abbrev: "slug", name: "slug" },
|
|
359
|
+
{ abbrev: "dr", name: "dram" },
|
|
360
|
+
{ abbrev: "gr", name: "grain" },
|
|
361
|
+
{ abbrev: "q", name: "quintal" }
|
|
362
|
+
];
|
|
363
|
+
var SPEED_METRICS_LOOKUP = [
|
|
364
|
+
{ abbrev: "m/s", name: "meters per second" },
|
|
365
|
+
{ abbrev: "km/h", name: "kilometers per hour" },
|
|
366
|
+
{ abbrev: "mph", name: "miles per hour" },
|
|
367
|
+
{ abbrev: "kn", name: "knot" },
|
|
368
|
+
{ abbrev: "ft/s", name: "feet per second" },
|
|
369
|
+
{ abbrev: "c", name: "speed of light" },
|
|
370
|
+
{ abbrev: "mach", name: "mach" },
|
|
371
|
+
{ abbrev: "cm/s", name: "centimeters per second" },
|
|
372
|
+
{ abbrev: "in/s", name: "inches per second" },
|
|
373
|
+
{ abbrev: "ly/y", name: "light years per year" }
|
|
374
|
+
];
|
|
375
|
+
var ACCELERATION_METRICS_LOOKUP = [
|
|
376
|
+
{ abbrev: "m/s\xB2", name: "meters per second squared" },
|
|
377
|
+
{ abbrev: "ft/s\xB2", name: "feet per second squared" },
|
|
378
|
+
{ abbrev: "g", name: "g-force" },
|
|
379
|
+
{ abbrev: "Gal", name: "galileo" },
|
|
380
|
+
{ abbrev: "cm/s\xB2", name: "centimeters per second squared" },
|
|
381
|
+
{ abbrev: "km/h\xB2", name: "kilometers per hour squared" },
|
|
382
|
+
{ abbrev: "in/s\xB2", name: "inches per second squared" },
|
|
383
|
+
{ abbrev: "mi/h\xB2", name: "miles per hour squared" },
|
|
384
|
+
{ abbrev: "kn/s\xB2", name: "knots per second squared" }
|
|
385
|
+
];
|
|
386
|
+
var VOLUME_METRICS_LOOKUP = [
|
|
387
|
+
{ abbrev: "L", name: "liter" },
|
|
388
|
+
{ abbrev: "dL", name: "deciliter" },
|
|
389
|
+
{ abbrev: "mL", name: "milliliter" },
|
|
390
|
+
{ abbrev: "\xB5L", name: "microliter" },
|
|
391
|
+
{ abbrev: "cm\xB3", name: "cubic centimeter" },
|
|
392
|
+
{ abbrev: "m\xB3", name: "cubic meter" },
|
|
393
|
+
{ abbrev: "ft\xB3", name: "cubic foot" },
|
|
394
|
+
{ abbrev: "in\xB3", name: "cubic inch" },
|
|
395
|
+
{ abbrev: "gallon", name: "gallon" },
|
|
396
|
+
{ abbrev: "qt", name: "quart" },
|
|
397
|
+
{ abbrev: "pt", name: "pint" },
|
|
398
|
+
{ abbrev: "fl oz", name: "fluid ounce" },
|
|
399
|
+
{ abbrev: "barrel", name: "barrel" },
|
|
400
|
+
{ abbrev: "tbsp", name: "tablespoon" },
|
|
401
|
+
{ abbrev: "tsp", name: "teaspoon" }
|
|
402
|
+
];
|
|
403
|
+
var TEMPERATURE_METRICS_LOOKUP = [
|
|
404
|
+
{ abbrev: "\xB0C", name: "celsius" },
|
|
405
|
+
{ abbrev: "\xB0F", name: "fahrenheit" },
|
|
406
|
+
{ abbrev: "K", name: "kelvin" }
|
|
407
|
+
];
|
|
408
|
+
var PRESSURE_METRICS_LOOKUP = [
|
|
409
|
+
{ abbrev: "Pa", name: "pascal" },
|
|
410
|
+
{ abbrev: "bar", name: "bar" },
|
|
411
|
+
{ abbrev: "atm", name: "atmosphere" },
|
|
412
|
+
{ abbrev: "mmHg", name: "millimeters of mercury" },
|
|
413
|
+
{ abbrev: "psi", name: "pounds per square inch" }
|
|
414
|
+
];
|
|
415
|
+
var ENERGY_METRICS_LOOKUP = [
|
|
416
|
+
{ abbrev: "J", name: "joule" },
|
|
417
|
+
{ abbrev: "cal", name: "calorie" },
|
|
418
|
+
{ abbrev: "kcal", name: "kilocalorie" },
|
|
419
|
+
{ abbrev: "kWh", name: "kilowatt-hour" },
|
|
420
|
+
{ abbrev: "BTU", name: "british thermal unit" },
|
|
421
|
+
{ abbrev: "eV", name: "electronvolt" }
|
|
422
|
+
];
|
|
423
|
+
var TIME_METRICS_LOOKUP = [
|
|
424
|
+
{ abbrev: "s", name: "second" },
|
|
425
|
+
{ abbrev: "m", name: "minute" },
|
|
426
|
+
{ abbrev: "h", name: "hour" },
|
|
427
|
+
{ abbrev: "day", name: "day" },
|
|
428
|
+
{ abbrev: "week", name: "week" },
|
|
429
|
+
{ abbrev: "mo", name: "month" },
|
|
430
|
+
{ abbrev: "ms", name: "millisecond" },
|
|
431
|
+
{ abbrev: "\xB5s", name: "microsecond" },
|
|
432
|
+
{ abbrev: "ns", name: "nanosecond" }
|
|
433
|
+
];
|
|
434
|
+
var POWER_METRICS_LOOKUP = [
|
|
435
|
+
{ abbrev: "W", name: "Watt" },
|
|
436
|
+
{ abbrev: "kW", name: "kilowatt" },
|
|
437
|
+
{ abbrev: "MW", name: "megawatt" },
|
|
438
|
+
{ abbrev: "hp", name: "horsepower" },
|
|
439
|
+
{ abbrev: "GW", name: "gigawatt" }
|
|
440
|
+
];
|
|
441
|
+
var FREQUENCY_METRICS_LOOKUP = [
|
|
442
|
+
{ abbrev: "Hz", name: "hertz" },
|
|
443
|
+
{ abbrev: "kHz", name: "kilohertz" },
|
|
444
|
+
{ abbrev: "MHz", name: "megahertz" },
|
|
445
|
+
{ abbrev: "GHz", name: "gigahertz" },
|
|
446
|
+
{ abbrev: "THz", name: "terahertz" }
|
|
447
|
+
];
|
|
448
|
+
var VOLTAGE_METRICS_LOOKUP = [
|
|
449
|
+
{ abbrev: "V", name: "volt" },
|
|
450
|
+
{ abbrev: "kV", name: "kilovolt" },
|
|
451
|
+
{ abbrev: "mV", name: "millivolt" },
|
|
452
|
+
{ abbrev: "\xB5V", name: "microvolt" }
|
|
453
|
+
];
|
|
454
|
+
var CURRENT_METRICS_LOOKUP = [
|
|
455
|
+
{ abbrev: "A", name: "ampere" },
|
|
456
|
+
{ abbrev: "mA", name: "milliampere" },
|
|
457
|
+
{ abbrev: "\xB5A", name: "microampere" },
|
|
458
|
+
{ abbrev: "kA", name: "kiloampere" }
|
|
459
|
+
];
|
|
460
|
+
var RESISTANCE_METRICS_LOOKUP = [
|
|
461
|
+
{ abbrev: "\u03A9", name: "ohm" },
|
|
462
|
+
{ abbrev: "k\u03A9", name: "kiloohm" },
|
|
463
|
+
{ abbrev: "M\u03A9", name: "megaohm" }
|
|
464
|
+
];
|
|
465
|
+
var LUMINOSITY_METRICS_LOOKUP = [
|
|
466
|
+
{ abbrev: "cd", name: "candela" },
|
|
467
|
+
{ abbrev: "lm", name: "lumen" },
|
|
468
|
+
{ abbrev: "lx", name: "lux" }
|
|
469
|
+
];
|
|
470
|
+
var AREA_METRICS_LOOKUP = [
|
|
471
|
+
{ abbrev: "m\xB2", name: "square meter" },
|
|
472
|
+
{ abbrev: "cm\xB2", name: "square centimeter" },
|
|
473
|
+
{ abbrev: "mm\xB2", name: "square millimeter" },
|
|
474
|
+
{ abbrev: "km\xB2", name: "square kilometer" },
|
|
475
|
+
{ abbrev: "ft\xB2", name: "square foot" },
|
|
476
|
+
{ abbrev: "in\xB2", name: "square inch" },
|
|
477
|
+
{ abbrev: "acre", name: "acre" },
|
|
478
|
+
{ abbrev: "ha", name: "hectare" }
|
|
479
|
+
];
|
|
480
|
+
var NETWORK_PROTOCOL_LOOKUP = {
|
|
481
|
+
http: ["http", "https"],
|
|
482
|
+
ftp: ["ftp", "sftp"],
|
|
483
|
+
file: ["", "file"],
|
|
484
|
+
ws: ["ws", "wss"],
|
|
485
|
+
ssh: ["", "ssh"],
|
|
486
|
+
scp: ["", "scp"]
|
|
487
|
+
};
|
|
488
|
+
var Never = createConstant("never");
|
|
489
|
+
var US_NEWS = [
|
|
490
|
+
{ company: "New York Times", baseUrls: ["www.nytimes.com"] },
|
|
491
|
+
{ company: "CNN", baseUrls: ["www.cnn.com"] },
|
|
492
|
+
{ company: "Fox News", baseUrls: ["www.foxnews.com"] },
|
|
493
|
+
{ company: "NBC News", baseUrls: ["www.nbcnews.com", "www.msnbc.com"] },
|
|
494
|
+
{ company: "ABC News", baseUrls: ["abcnews.go.com"] },
|
|
495
|
+
{ company: "The Washington Post", baseUrls: ["www.washingtonpost.com"] },
|
|
496
|
+
{ company: "USA Today", baseUrls: ["www.usatoday.com"] },
|
|
497
|
+
{ company: "Bloomberg", baseUrls: ["www.bloomberg.com"] },
|
|
498
|
+
{ company: "NPR", baseUrls: ["www.npr.org"] },
|
|
499
|
+
{ company: "CBS News", baseUrls: ["www.cbsnews.com"] },
|
|
500
|
+
{ company: "The Wall Street Journal", baseUrls: ["www.wsj.com"] },
|
|
501
|
+
{ company: "Associated Press (AP)", baseUrls: ["www.apnews.com", "www.ap.org"] },
|
|
502
|
+
{ company: "Reuters", baseUrls: ["www.reuters.com"] },
|
|
503
|
+
{ company: "Newsweek", baseUrls: ["www.newsweek.com"] },
|
|
504
|
+
{ company: "Politico", baseUrls: ["www.politico.com"] },
|
|
505
|
+
{ company: "The Atlantic", baseUrls: ["www.theatlantic.com"] },
|
|
506
|
+
{ company: "Nexstar Media Group", baseUrls: ["www.nexstar.tv"] },
|
|
507
|
+
{ company: "PBS News", baseUrls: ["www.pbs.org"] },
|
|
508
|
+
{ company: "HuffPost", baseUrls: ["www.huffpost.com"] },
|
|
509
|
+
{ company: "The Boston Globe", baseUrls: ["www.bostonglobe.com"] }
|
|
510
|
+
];
|
|
511
|
+
var UK_NEWS = [
|
|
512
|
+
{ company: "BBC", baseUrls: ["www.bbc.co.uk", "www.bbc.com"] },
|
|
513
|
+
{ company: "The Guardian", baseUrls: ["www.theguardian.com/uk"] },
|
|
514
|
+
{ company: "The Daily Mail", baseUrls: ["www.dailymail.co.uk"] },
|
|
515
|
+
{ company: "The Sun", baseUrls: ["www.thesun.co.uk"] },
|
|
516
|
+
{ company: "The Times", baseUrls: ["www.thetimes.co.uk"] },
|
|
517
|
+
{ company: "Sky News", baseUrls: ["news.sky.com"] },
|
|
518
|
+
{ company: "The Telegraph", baseUrls: ["www.telegraph.co.uk"] },
|
|
519
|
+
{ company: "ITV News", baseUrls: ["www.itv.com/news"] },
|
|
520
|
+
{ company: "Financial Times", baseUrls: ["www.ft.com"] },
|
|
521
|
+
{ company: "Metro", baseUrls: ["www.metro.co.uk"] },
|
|
522
|
+
{ company: "The Independent", baseUrls: ["www.independent.co.uk"] },
|
|
523
|
+
{ company: "Evening Standard", baseUrls: ["www.standard.co.uk"] },
|
|
524
|
+
{ company: "Daily Mirror", baseUrls: ["www.mirror.co.uk"] },
|
|
525
|
+
{ company: "Channel 4 News", baseUrls: ["www.channel4.com/news"] },
|
|
526
|
+
{ company: "LBC", baseUrls: ["www.lbc.co.uk"] },
|
|
527
|
+
{ company: "Daily Express", baseUrls: ["www.express.co.uk"] },
|
|
528
|
+
{ company: "Birmingham Mail", baseUrls: ["www.birminghammail.co.uk"] },
|
|
529
|
+
{ company: "Manchester Evening News", baseUrls: ["www.manchestereveningnews.co.uk"] },
|
|
530
|
+
{ company: "The Scotsman", baseUrls: ["www.scotsman.com"] },
|
|
531
|
+
{ company: "Daily Record", baseUrls: ["www.dailyrecord.co.uk"] }
|
|
532
|
+
];
|
|
533
|
+
var GERMAN_NEWS = [
|
|
534
|
+
{ company: "BILD", baseUrls: ["www.bild.de"] },
|
|
535
|
+
{ company: "Die Zeit", baseUrls: ["www.zeit.de"] },
|
|
536
|
+
{ company: "Frankfurter Allgemeine Zeitung", baseUrls: ["www.faz.net"] },
|
|
537
|
+
{ company: "S\xFCddeutsche Zeitung", baseUrls: ["www.sueddeutsche.de"] },
|
|
538
|
+
{ company: "Der Spiegel", baseUrls: ["www.spiegel.de"] },
|
|
539
|
+
{ company: "Die Welt", baseUrls: ["www.welt.de"] },
|
|
540
|
+
{ company: "Tagesschau", baseUrls: ["www.tagesschau.de"] },
|
|
541
|
+
{ company: "t-online", baseUrls: ["www.t-online.de"] },
|
|
542
|
+
{ company: "n-tv", baseUrls: ["www.n-tv.de"] },
|
|
543
|
+
{ company: "Handelsblatt", baseUrls: ["www.handelsblatt.com"] },
|
|
544
|
+
{ company: "Focus Online", baseUrls: ["www.focus.de"] },
|
|
545
|
+
{ company: "Frankfurter Rundschau", baseUrls: ["www.fr.de", "www.fr-online.de"] },
|
|
546
|
+
{ company: "taz - die tageszeitung", baseUrls: ["www.taz.de"] },
|
|
547
|
+
{ company: "Der Tagesspiegel", baseUrls: ["www.tagesspiegel.de"] },
|
|
548
|
+
{ company: "Rheinische Post", baseUrls: ["www.rp-online.de"] },
|
|
549
|
+
{ company: "Express", baseUrls: ["www.express.de"] },
|
|
550
|
+
{ company: "M\xFCnchner Merkur", baseUrls: ["www.merkur.de"] },
|
|
551
|
+
{ company: "Stuttgarter Zeitung", baseUrls: ["www.stuttgarter-zeitung.de"] },
|
|
552
|
+
{ company: "Hamburger Abendblatt", baseUrls: ["www.abendblatt.de"] },
|
|
553
|
+
{ company: "Deutsche Welle", baseUrls: ["www.dw.com"] }
|
|
554
|
+
];
|
|
555
|
+
var FRENCH_NEWS = [
|
|
556
|
+
{ company: "Le Figaro", baseUrls: ["www.lefigaro.fr"] },
|
|
557
|
+
{ company: "Le Monde", baseUrls: ["www.lemonde.fr"] },
|
|
558
|
+
{ company: "France 24", baseUrls: ["www.france24.com"] },
|
|
559
|
+
{ company: "Lib\xE9ration", baseUrls: ["www.liberation.fr"] },
|
|
560
|
+
{ company: "Les Echos", baseUrls: ["www.lesechos.fr"] },
|
|
561
|
+
{ company: "Ouest-France", baseUrls: ["www.ouest-france.fr"] },
|
|
562
|
+
{ company: "Le Parisien", baseUrls: ["www.leparisien.fr"] },
|
|
563
|
+
{ company: "Mediapart", baseUrls: ["www.mediapart.fr"] },
|
|
564
|
+
{ company: "L'Express", baseUrls: ["www.lexpress.fr"] },
|
|
565
|
+
{ company: "La Croix", baseUrls: ["www.la-croix.com"] },
|
|
566
|
+
{ company: "20 Minutes", baseUrls: ["www.20minutes.fr"] },
|
|
567
|
+
{ company: "Courrier International", baseUrls: ["www.courrierinternational.com"] },
|
|
568
|
+
{ company: "Le Point", baseUrls: ["www.lepoint.fr"] },
|
|
569
|
+
{ company: "Marianne", baseUrls: ["www.marianne.net"] },
|
|
570
|
+
{ company: "BFM TV", baseUrls: ["www.bfmtv.com"] },
|
|
571
|
+
{ company: "RTL France", baseUrls: ["www.rtl.fr"] },
|
|
572
|
+
{ company: "Charlie Hebdo", baseUrls: ["www.charliehebdo.fr"] },
|
|
573
|
+
{ company: "Challenges", baseUrls: ["www.challenges.fr"] },
|
|
574
|
+
{ company: "T\xE9l\xE9rama", baseUrls: ["www.telerama.fr"] },
|
|
575
|
+
{ company: "L'Obs", baseUrls: ["www.nouvelobs.com"] }
|
|
576
|
+
];
|
|
577
|
+
var CANADIAN_NEWS = [
|
|
578
|
+
{ company: "CBC News", baseUrls: ["www.cbc.ca"] },
|
|
579
|
+
{ company: "CTV News", baseUrls: ["www.ctvnews.ca"] },
|
|
580
|
+
{ company: "The Globe and Mail", baseUrls: ["www.theglobeandmail.com"] },
|
|
581
|
+
{ company: "Global News", baseUrls: ["www.globalnews.ca"] },
|
|
582
|
+
{ company: "Toronto Star", baseUrls: ["www.thestar.com"] },
|
|
583
|
+
{ company: "National Post", baseUrls: ["www.nationalpost.com"] },
|
|
584
|
+
{ company: "La Presse", baseUrls: ["www.lapresse.ca"] },
|
|
585
|
+
{ company: "Radio-Canada", baseUrls: ["ici.radio-canada.ca"] },
|
|
586
|
+
{ company: "The Canadian Press", baseUrls: ["www.thecanadianpress.com"] },
|
|
587
|
+
{ company: "Financial Post", baseUrls: ["financialpost.com"] },
|
|
588
|
+
{ company: "The Weather Network", baseUrls: ["www.theweathernetwork.com"] },
|
|
589
|
+
{ company: "Le Devoir", baseUrls: ["www.ledevoir.com"] },
|
|
590
|
+
{ company: "TVA Nouvelles", baseUrls: ["www.tvanouvelles.ca"] },
|
|
591
|
+
{ company: "Journal de Montr\xE9al", baseUrls: ["www.journaldemontreal.com"] },
|
|
592
|
+
{ company: "CityNews", baseUrls: ["www.citynews.ca"] },
|
|
593
|
+
{ company: "BNN Bloomberg", baseUrls: ["www.bnnbloomberg.ca"] },
|
|
594
|
+
{ company: "The Hamilton Spectator", baseUrls: ["www.thespec.com"] },
|
|
595
|
+
{ company: "Ottawa Citizen", baseUrls: ["ottawacitizen.com"] },
|
|
596
|
+
{ company: "Windsor Star", baseUrls: ["windsorstar.com"] },
|
|
597
|
+
{ company: "Edmonton Journal", baseUrls: ["edmontonjournal.com"] }
|
|
598
|
+
];
|
|
599
|
+
var DUTCH_NEWS = [
|
|
600
|
+
{ company: "Algemeen Dagblad (AD)", baseUrls: ["www.ad.nl"] },
|
|
601
|
+
{ company: "NOS", baseUrls: ["www.nos.nl"] },
|
|
602
|
+
{ company: "De Telegraaf", baseUrls: ["www.telegraaf.nl"] },
|
|
603
|
+
{ company: "NU.nl", baseUrls: ["www.nu.nl"] },
|
|
604
|
+
{ company: "Volkskrant", baseUrls: ["www.volkskrant.nl"] },
|
|
605
|
+
{ company: "NRC Handelsblad", baseUrls: ["www.nrc.nl"] },
|
|
606
|
+
{ company: "Trouw", baseUrls: ["www.trouw.nl"] },
|
|
607
|
+
{ company: "Het Parool", baseUrls: ["www.parool.nl"] },
|
|
608
|
+
{ company: "RTL Nieuws", baseUrls: ["www.rtlnieuws.nl"] },
|
|
609
|
+
{ company: "BNR Nieuwsradio", baseUrls: ["www.bnr.nl"] },
|
|
610
|
+
{ company: "Emerce", baseUrls: ["www.emerce.nl"] },
|
|
611
|
+
{ company: "VPRO", baseUrls: ["www.vpro.nl"] },
|
|
612
|
+
{ company: "De Gelderlander", baseUrls: ["www.gelderlander.nl"] },
|
|
613
|
+
{ company: "Friesch Dagblad", baseUrls: ["www.frieschdagblad.nl"] },
|
|
614
|
+
{ company: "De Stentor", baseUrls: ["www.destentor.nl"] },
|
|
615
|
+
{ company: "Metro Nieuws", baseUrls: ["www.metronieuws.nl"] },
|
|
616
|
+
{ company: "ANP", baseUrls: ["www.anp.nl"] },
|
|
617
|
+
{ company: "Dagblad van het Noorden", baseUrls: ["www.dvhn.nl"] },
|
|
618
|
+
{ company: "Reformatorisch Dagblad", baseUrls: ["www.rd.nl"] },
|
|
619
|
+
{ company: "Financieele Dagblad", baseUrls: ["www.fd.nl"] }
|
|
620
|
+
];
|
|
621
|
+
var ITALIAN_NEWS = [
|
|
622
|
+
{ company: "ANSA", baseUrls: ["www.ansa.it", "www.ansamed.info"] },
|
|
623
|
+
{ company: "Corriere della Sera", baseUrls: ["www.corriere.it"] },
|
|
624
|
+
{ company: "la Repubblica", baseUrls: ["www.repubblica.it"] },
|
|
625
|
+
{ company: "Il Sole 24 Ore", baseUrls: ["www.ilsole24ore.com"] },
|
|
626
|
+
{ company: "La Stampa", baseUrls: ["www.lastampa.it"] },
|
|
627
|
+
{ company: "Il Messaggero", baseUrls: ["www.ilmessaggero.it"] },
|
|
628
|
+
{ company: "Il Giornale", baseUrls: ["www.ilgiornale.it"] },
|
|
629
|
+
{ company: "Avvenire", baseUrls: ["www.avvenire.it"] },
|
|
630
|
+
{ company: "Il Fatto Quotidiano", baseUrls: ["www.ilfattoquotidiano.it"] },
|
|
631
|
+
{ company: "La Nazione", baseUrls: ["www.lanazione.it"] },
|
|
632
|
+
{ company: "TgCom24", baseUrls: ["www.tgcom24.mediaset.it"] },
|
|
633
|
+
{ company: "Sky TG24", baseUrls: ["tg24.sky.it"] },
|
|
634
|
+
{ company: "Rai News", baseUrls: ["www.rainews.it"] },
|
|
635
|
+
{ company: "Gazzetta dello Sport", baseUrls: ["www.gazzetta.it"] },
|
|
636
|
+
{ company: "Il Resto del Carlino", baseUrls: ["www.ilrestodelcarlino.it"] },
|
|
637
|
+
{ company: "Il Mattino", baseUrls: ["www.ilmattino.it"] },
|
|
638
|
+
{ company: "Il Secolo XIX", baseUrls: ["www.ilsecoloxix.it"] },
|
|
639
|
+
{ company: "Italia Oggi", baseUrls: ["www.italiaoggi.it"] },
|
|
640
|
+
{ company: "Libero", baseUrls: ["www.liberoquotidiano.it"] },
|
|
641
|
+
{ company: "Il Tirreno", baseUrls: ["www.iltirreno.it"] }
|
|
642
|
+
];
|
|
643
|
+
var BELGIUM_NEWS = [
|
|
644
|
+
{ company: "Het Laatste Nieuws (HLN)", baseUrls: ["www.hln.be"] },
|
|
645
|
+
{ company: "Nieuwsblad", baseUrls: ["www.nieuwsblad.be"] },
|
|
646
|
+
{ company: "RTBF", baseUrls: ["www.rtbf.be"] },
|
|
647
|
+
{ company: "Sudinfo", baseUrls: ["www.sudinfo.be"] },
|
|
648
|
+
{ company: "7sur7", baseUrls: ["www.7sur7.be"] },
|
|
649
|
+
{ company: "Le Soir", baseUrls: ["www.lesoir.be"] },
|
|
650
|
+
{ company: "De Standaard", baseUrls: ["www.standaard.be"] },
|
|
651
|
+
{ company: "VRT NWS", baseUrls: ["www.vrt.be"] },
|
|
652
|
+
{ company: "La Libre", baseUrls: ["www.lalibre.be"] },
|
|
653
|
+
{ company: "Gazet van Antwerpen", baseUrls: ["www.gva.be"] },
|
|
654
|
+
{ company: "Het Belang van Limburg", baseUrls: ["www.hbvl.be"] },
|
|
655
|
+
{ company: "De Morgen", baseUrls: ["www.demorgen.be"] },
|
|
656
|
+
{ company: "L'Avenir", baseUrls: ["www.lavenir.net"] },
|
|
657
|
+
{ company: "The Brussels Times", baseUrls: ["www.brusselstimes.com"] },
|
|
658
|
+
{ company: "Metro Belgique", baseUrls: ["nl.metrotime.be"] },
|
|
659
|
+
{ company: "Sudpresse", baseUrls: ["www.sudpress.be"] },
|
|
660
|
+
{ company: "Flamish Radio and TV Broadcasting Organization (VRT)", baseUrls: ["www.vrt.be"] },
|
|
661
|
+
{ company: "Knack", baseUrls: ["www.knack.be"] },
|
|
662
|
+
{ company: "De Tijd", baseUrls: ["www.tijd.be"] },
|
|
663
|
+
{ company: "BX1", baseUrls: ["www.bx1.be"] }
|
|
664
|
+
];
|
|
665
|
+
var MEXICAN_NEWS = [
|
|
666
|
+
{ company: "Televisa", baseUrls: ["www.televisa.news"] },
|
|
667
|
+
{ company: "El Universal", baseUrls: ["www.eluniversal.com.mx"] },
|
|
668
|
+
{ company: "Milenio", baseUrls: ["www.milenio.com"] },
|
|
669
|
+
{ company: "Exc\xE9lsior", baseUrls: ["www.excelsior.com.mx"] },
|
|
670
|
+
{ company: "Reforma", baseUrls: ["www.reforma.com"] },
|
|
671
|
+
{ company: "La Jornada", baseUrls: ["www.jornada.com.mx"] },
|
|
672
|
+
{ company: "El Financiero", baseUrls: ["www.elfinanciero.com.mx"] },
|
|
673
|
+
{ company: "Proceso", baseUrls: ["www.proceso.com.mx"] },
|
|
674
|
+
{ company: "SDP Noticias", baseUrls: ["www.sdpnoticias.com"] },
|
|
675
|
+
{ company: "Diario de Yucat\xE1n", baseUrls: ["www.yucatan.com.mx"] },
|
|
676
|
+
{ company: "El Economista", baseUrls: ["www.eleconomista.com.mx"] },
|
|
677
|
+
{ company: "El Heraldo de M\xE9xico", baseUrls: ["www.heraldodemexico.com.mx"] },
|
|
678
|
+
{ company: "Noticieros Televisa", baseUrls: ["noticieros.televisa.com"] },
|
|
679
|
+
{ company: "Expansi\xF3n", baseUrls: ["expansion.mx"] },
|
|
680
|
+
{ company: "La Raz\xF3n", baseUrls: ["www.razon.com.mx"] },
|
|
681
|
+
{ company: "Noroeste", baseUrls: ["www.noroeste.com.mx"] },
|
|
682
|
+
{ company: "Uniradio Noticias", baseUrls: ["www.uniradionoticias.com"] },
|
|
683
|
+
{ company: "El Imparcial", baseUrls: ["www.elimparcial.com"] },
|
|
684
|
+
{ company: "Publimetro M\xE9xico", baseUrls: ["www.publimetro.com.mx"] },
|
|
685
|
+
{ company: "Notimex", baseUrls: ["www.notimex.gob.mx"] }
|
|
686
|
+
];
|
|
687
|
+
var SPANISH_NEWS = [
|
|
688
|
+
{ company: "El Pa\xEDs", baseUrls: ["www.elpais.com"] },
|
|
689
|
+
{ company: "El Mundo", baseUrls: ["www.elmundo.es"] },
|
|
690
|
+
{ company: "ABC", baseUrls: ["www.abc.es"] },
|
|
691
|
+
{ company: "La Vanguardia", baseUrls: ["www.lavanguardia.com"] },
|
|
692
|
+
{ company: "El Confidencial", baseUrls: ["www.elconfidencial.com"] },
|
|
693
|
+
{ company: "La Raz\xF3n", baseUrls: ["www.larazon.es"] },
|
|
694
|
+
{ company: "20 Minutos", baseUrls: ["www.20minutos.es"] },
|
|
695
|
+
{ company: "Agencia EFE", baseUrls: ["www.efe.com"] },
|
|
696
|
+
{ company: "Europa Press", baseUrls: ["www.europapress.es"] },
|
|
697
|
+
{ company: "Diario AS", baseUrls: ["www.as.com"] },
|
|
698
|
+
{ company: "Mundo Deportivo", baseUrls: ["www.mundodeportivo.com"] },
|
|
699
|
+
{ company: "El Peri\xF3dico", baseUrls: ["www.elperiodico.com"] },
|
|
700
|
+
{ company: "Cinco D\xEDas", baseUrls: ["www.cincodias.com"] },
|
|
701
|
+
{ company: "Expansi\xF3n", baseUrls: ["www.expansion.com"] },
|
|
702
|
+
{ company: "La Informaci\xF3n", baseUrls: ["www.lainformacion.com"] },
|
|
703
|
+
{ company: "OK Diario", baseUrls: ["www.okdiario.com"] },
|
|
704
|
+
{ company: "Heraldo de Arag\xF3n", baseUrls: ["www.heraldo.es"] },
|
|
705
|
+
{ company: "Faro de Vigo", baseUrls: ["www.farodevigo.es"] },
|
|
706
|
+
{ company: "El Correo", baseUrls: ["www.elcorreo.com"] },
|
|
707
|
+
{ company: "Diario Sur", baseUrls: ["www.diariosur.es"] }
|
|
708
|
+
];
|
|
709
|
+
var INDIAN_NEWS = [
|
|
710
|
+
{ company: "The Times of India", baseUrls: ["timesofindia.indiatimes.com"] },
|
|
711
|
+
{ company: "The Hindu", baseUrls: ["www.thehindu.com"] },
|
|
712
|
+
{ company: "Hindustan Times", baseUrls: ["www.hindustantimes.com"] },
|
|
713
|
+
{ company: "NDTV", baseUrls: ["www.ndtv.com"] },
|
|
714
|
+
{ company: "India Today", baseUrls: ["www.indiatoday.in"] },
|
|
715
|
+
{ company: "Zee News", baseUrls: ["zeenews.india.com"] },
|
|
716
|
+
{ company: "Indian Express", baseUrls: ["indianexpress.com"] },
|
|
717
|
+
{ company: "The Economic Times", baseUrls: ["economictimes.indiatimes.com"] },
|
|
718
|
+
{ company: "Deccan Herald", baseUrls: ["www.deccanherald.com"] },
|
|
719
|
+
{ company: "DNA India", baseUrls: ["www.dnaindia.com"] },
|
|
720
|
+
{ company: "The Print", baseUrls: ["theprint.in"] },
|
|
721
|
+
{ company: "News18", baseUrls: ["www.news18.com"] },
|
|
722
|
+
{ company: "Scroll.in", baseUrls: ["scroll.in"] },
|
|
723
|
+
{ company: "Asian News International (ANI)", baseUrls: ["www.aninews.in"] },
|
|
724
|
+
{ company: "Outlook India", baseUrls: ["www.outlookindia.com"] },
|
|
725
|
+
{ company: "Business Standard", baseUrls: ["www.business-standard.com"] },
|
|
726
|
+
{ company: "Mint", baseUrls: ["www.livemint.com"] },
|
|
727
|
+
{ company: "OneIndia", baseUrls: ["www.oneindia.com"] },
|
|
728
|
+
{ company: "Quint", baseUrls: ["www.thequint.com"] },
|
|
729
|
+
{ company: "Free Press Journal", baseUrls: ["www.freepressjournal.in"] }
|
|
730
|
+
];
|
|
731
|
+
var CHINESE_NEWS = [
|
|
732
|
+
{ company: "Xinhua News Agency", baseUrls: ["www.xinhuanet.com"] },
|
|
733
|
+
{ company: "China Central Television (CCTV)", baseUrls: ["www.cctv.com"] },
|
|
734
|
+
{ company: "China Daily", baseUrls: ["www.chinadaily.com.cn"] },
|
|
735
|
+
{ company: "CGTN (China Global Television Network)", baseUrls: ["www.cgtn.com"] },
|
|
736
|
+
{ company: "People's Daily", baseUrls: ["www.people.cn"] },
|
|
737
|
+
{ company: "Global Times", baseUrls: ["www.globaltimes.cn"] },
|
|
738
|
+
{ company: "South China Morning Post", baseUrls: ["www.scmp.com"] },
|
|
739
|
+
{ company: "Shanghai Daily", baseUrls: ["www.shanghaidaily.com"] },
|
|
740
|
+
{ company: "China News Service", baseUrls: ["www.ecns.cn"] },
|
|
741
|
+
{ company: "Caixin", baseUrls: ["www.caixinglobal.com"] },
|
|
742
|
+
{ company: "The Paper", baseUrls: ["www.thepaper.cn"] },
|
|
743
|
+
{ company: "Yicai Global", baseUrls: ["www.yicaiglobal.com"] },
|
|
744
|
+
{ company: "Economic Daily", baseUrls: ["www.ce.cn"] },
|
|
745
|
+
{ company: "21st Century Business Herald", baseUrls: ["www.21jingji.com"] },
|
|
746
|
+
{ company: "Beijing Review", baseUrls: ["www.bjreview.com"] },
|
|
747
|
+
{ company: "China Economic Net", baseUrls: ["www.ce.cn"] },
|
|
748
|
+
{ company: "Tencent News", baseUrls: ["news.qq.com"] },
|
|
749
|
+
{ company: "Sina News", baseUrls: ["news.sina.com.cn"] },
|
|
750
|
+
{ company: "NetEase News", baseUrls: ["news.163.com"] },
|
|
751
|
+
{ company: "Phoenix TV", baseUrls: ["www.ifeng.com"] }
|
|
752
|
+
];
|
|
753
|
+
var DANISH_NEWS = [
|
|
754
|
+
{ company: "Politiken", baseUrls: ["www.politiken.dk"] },
|
|
755
|
+
{ company: "Berlingske", baseUrls: ["www.berlingske.dk"] },
|
|
756
|
+
{ company: "Jyllands-Posten", baseUrls: ["jyllands-posten.dk"] },
|
|
757
|
+
{ company: "Ekstra Bladet", baseUrls: ["ekstrabladet.dk"] },
|
|
758
|
+
{ company: "Information", baseUrls: ["www.information.dk"] },
|
|
759
|
+
{ company: "BT", baseUrls: ["www.bt.dk"] },
|
|
760
|
+
{ company: "Weekendavisen", baseUrls: ["www.weekendavisen.dk"] },
|
|
761
|
+
{ company: "Fyens Stiftstidende", baseUrls: ["fyens.dk"] },
|
|
762
|
+
{ company: "Kristeligt Dagblad", baseUrls: ["www.kristeligt-dagblad.dk"] },
|
|
763
|
+
{ company: "Copenhagen Post", baseUrls: ["cphpost.dk"] },
|
|
764
|
+
{ company: "Nordjyske Stiftstidende", baseUrls: ["nordjyske.dk"] },
|
|
765
|
+
{ company: "\xC5rhus Stiftstidende", baseUrls: ["stiften.dk"] },
|
|
766
|
+
{ company: "Dagbladet B\xF8rsen", baseUrls: ["borsen.dk"] },
|
|
767
|
+
{ company: "Lokalavisen", baseUrls: ["lokalavisen.dk"] },
|
|
768
|
+
{ company: "TV2 Nyheder", baseUrls: ["tv2.dk"] },
|
|
769
|
+
{ company: "DR Nyheder", baseUrls: ["dr.dk"] },
|
|
770
|
+
{ company: "Avisen Danmark", baseUrls: ["avisen.dk"] },
|
|
771
|
+
{ company: "Fagbladet 3F", baseUrls: ["fagbladet3f.dk"] },
|
|
772
|
+
{ company: "Herning Folkeblad", baseUrls: ["herningfolkeblad.dk"] },
|
|
773
|
+
{ company: "Midtjyllands Avis", baseUrls: ["midtjyllandsavis.dk"] }
|
|
774
|
+
];
|
|
775
|
+
var SWISS_NEWS = [
|
|
776
|
+
{ company: "Neue Z\xFCrcher Zeitung (NZZ)", baseUrls: ["www.nzz.ch"], type: ["newspaper", "digital"] },
|
|
777
|
+
{ company: "Swissinfo", baseUrls: ["www.swissinfo.ch"], type: ["digital-first"] },
|
|
778
|
+
{ company: "20 Minuten", baseUrls: ["www.20min.ch"], type: ["newspaper", "digital"] },
|
|
779
|
+
{ company: "Blick", baseUrls: ["www.blick.ch"], type: ["newspaper", "digital"] },
|
|
780
|
+
{ company: "Le Temps", baseUrls: ["www.letemps.ch"], type: ["newspaper", "digital"] },
|
|
781
|
+
{ company: "Tages-Anzeiger", baseUrls: ["www.tagesanzeiger.ch"], type: ["newspaper", "digital"] },
|
|
782
|
+
{ company: "SRF News", baseUrls: ["www.srf.ch"], type: ["television", "radio", "digital"] },
|
|
783
|
+
{ company: "Luzerner Zeitung", baseUrls: ["www.luzernerzeitung.ch"], type: ["newspaper", "digital"] },
|
|
784
|
+
{ company: "La Tribune de Gen\xE8ve", baseUrls: ["www.tdg.ch"], type: ["newspaper", "digital"] },
|
|
785
|
+
{ company: "Aargauer Zeitung", baseUrls: ["www.aargauerzeitung.ch"], type: ["newspaper", "digital"] },
|
|
786
|
+
{ company: "24 Heures", baseUrls: ["www.24heures.ch"], type: ["newspaper", "digital"] },
|
|
787
|
+
{ company: "Radio T\xE9l\xE9vision Suisse (RTS)", baseUrls: ["www.rts.ch"], type: ["television", "radio", "digital"] },
|
|
788
|
+
{ company: "Der Bund", baseUrls: ["www.derbund.ch"], type: ["newspaper", "digital"] },
|
|
789
|
+
{ company: "Schweizer Radio und Fernsehen (SRF)", baseUrls: ["www.srf.ch"], type: ["television", "radio", "digital"] },
|
|
790
|
+
{ company: "Basler Zeitung", baseUrls: ["www.bazonline.ch"], type: ["newspaper", "digital"] },
|
|
791
|
+
{ company: "Handelszeitung", baseUrls: ["www.handelszeitung.ch"], type: ["newspaper", "digital"] },
|
|
792
|
+
{ company: "Watson", baseUrls: ["www.watson.ch"], type: ["digital-first"] },
|
|
793
|
+
{ company: "Le Matin", baseUrls: ["www.lematin.ch"], type: ["newspaper", "digital"] },
|
|
794
|
+
{ company: "La Libert\xE9", baseUrls: ["www.laliberte.ch"], type: ["newspaper", "digital"] },
|
|
795
|
+
{ company: "The Swiss Times", baseUrls: ["www.theswisstimes.ch"], type: ["digital-first"] }
|
|
796
|
+
];
|
|
797
|
+
var AUSTRALIAN_NEWS = [
|
|
798
|
+
{ company: "ABC News", baseUrls: ["www.abc.net.au"], type: ["television", "radio", "digital"] },
|
|
799
|
+
{ company: "The Sydney Morning Herald", baseUrls: ["www.smh.com.au"], type: ["newspaper", "digital"] },
|
|
800
|
+
{ company: "The Australian", baseUrls: ["www.theaustralian.com.au"], type: ["newspaper", "digital"] },
|
|
801
|
+
{ company: "Herald Sun", baseUrls: ["www.heraldsun.com.au"], type: ["newspaper", "digital"] },
|
|
802
|
+
{ company: "9News", baseUrls: ["www.9news.com.au"], type: ["television", "digital"] },
|
|
803
|
+
{ company: "SBS News", baseUrls: ["www.sbs.com.au"], type: ["television", "digital", "multicultural"] },
|
|
804
|
+
{ company: "The Age", baseUrls: ["www.theage.com.au"], type: ["newspaper", "digital"] },
|
|
805
|
+
{ company: "Sky News Australia", baseUrls: ["www.skynews.com.au"], type: ["television", "digital"] },
|
|
806
|
+
{ company: "Australian Financial Review", baseUrls: ["www.afr.com"], type: ["newspaper", "digital"] },
|
|
807
|
+
{ company: "news.com.au", baseUrls: ["www.news.com.au"], type: ["digital-first"] },
|
|
808
|
+
{ company: "The Courier-Mail", baseUrls: ["www.couriermail.com.au"], type: ["newspaper", "digital"] },
|
|
809
|
+
{ company: "7NEWS", baseUrls: ["7news.com.au"], type: ["television", "digital"] },
|
|
810
|
+
{ company: "The West Australian", baseUrls: ["www.thewest.com.au"], type: ["newspaper", "digital"] },
|
|
811
|
+
{ company: "Daily Telegraph", baseUrls: ["www.dailytelegraph.com.au"], type: ["newspaper", "digital"] },
|
|
812
|
+
{ company: "Guardian Australia", baseUrls: ["www.theguardian.com/au"], type: ["digital-first"] },
|
|
813
|
+
{ company: "Crikey", baseUrls: ["www.crikey.com.au"], type: ["digital-first", "independent"] },
|
|
814
|
+
{ company: "AAP (Australian Associated Press)", baseUrls: ["www.aap.com.au"], type: ["news agency", "digital"] },
|
|
815
|
+
{ company: "NT News", baseUrls: ["www.ntnews.com.au"], type: ["newspaper", "digital"] },
|
|
816
|
+
{ company: "The Canberra Times", baseUrls: ["www.canberratimes.com.au"], type: ["newspaper", "digital"] },
|
|
817
|
+
{ company: "Brisbane Times", baseUrls: ["www.brisbanetimes.com.au"], type: ["digital-first"] }
|
|
818
|
+
];
|
|
819
|
+
var JAPANESE_NEWS = [
|
|
820
|
+
{ company: "The Asahi Shimbun", baseUrls: ["www.asahi.com"], type: ["newspaper", "digital"] },
|
|
821
|
+
{ company: "Yomiuri Shimbun", baseUrls: ["www.yomiuri.co.jp"], type: ["newspaper", "digital"] },
|
|
822
|
+
{ company: "Nikkei", baseUrls: ["www.nikkei.com"], type: ["newspaper", "digital"] },
|
|
823
|
+
{ company: "Mainichi Shimbun", baseUrls: ["mainichi.jp"], type: ["newspaper", "digital"] },
|
|
824
|
+
{ company: "Kyodo News", baseUrls: ["www.kyodonews.jp"], type: ["news agency", "digital"] },
|
|
825
|
+
{ company: "Japan Times", baseUrls: ["www.japantimes.co.jp"], type: ["newspaper", "digital"] },
|
|
826
|
+
{ company: "NHK", baseUrls: ["www.nhk.or.jp"], type: ["television", "radio", "digital"] },
|
|
827
|
+
{ company: "Fuji News Network (FNN)", baseUrls: ["www.fnn.jp"], type: ["television", "digital"] },
|
|
828
|
+
{ company: "Sankei Shimbun", baseUrls: ["www.sankei.com"], type: ["newspaper", "digital"] },
|
|
829
|
+
{ company: "Toyo Keizai", baseUrls: ["www.toyokeizai.net"], type: ["digital", "business magazine"] },
|
|
830
|
+
{ company: "Hokkaido Shimbun", baseUrls: ["www.hokkaido-np.co.jp"], type: ["newspaper", "digital"] },
|
|
831
|
+
{ company: "Shizuoka Shimbun", baseUrls: ["www.at-s.com"], type: ["newspaper", "digital"] },
|
|
832
|
+
{ company: "Tokyo Shimbun", baseUrls: ["www.tokyo-np.co.jp"], type: ["newspaper", "digital"] },
|
|
833
|
+
{ company: "Yahoo Japan News", baseUrls: ["news.yahoo.co.jp"], type: ["digital-first"] },
|
|
834
|
+
{ company: "TBS News", baseUrls: ["news.tbs.co.jp"], type: ["television", "digital"] },
|
|
835
|
+
{ company: "Nippon TV News 24 Japan", baseUrls: ["www.news24.jp"], type: ["television", "digital"] },
|
|
836
|
+
{ company: "Jiji Press", baseUrls: ["www.jiji.com"], type: ["news agency", "digital"] },
|
|
837
|
+
{ company: "TV Asahi News", baseUrls: ["news.tv-asahi.co.jp"], type: ["television", "digital"] },
|
|
838
|
+
{ company: "WOWOW Prime News", baseUrls: ["www.wowow.co.jp"], type: ["television", "digital"] },
|
|
839
|
+
{ company: "Kansai Telecasting Corporation (KTV)", baseUrls: ["www.ktv.jp"], type: ["television", "digital"] }
|
|
840
|
+
];
|
|
841
|
+
var SOUTH_KOREAN_NEWS = [
|
|
842
|
+
{ company: "Yonhap News Agency", baseUrls: ["www.yonhapnews.co.kr"], type: ["news agency", "digital"] },
|
|
843
|
+
{ company: "The Korea Herald", baseUrls: ["www.koreaherald.com"], type: ["newspaper", "digital"] },
|
|
844
|
+
{ company: "The Korea Times", baseUrls: ["www.koreatimes.co.kr"], type: ["newspaper", "digital"] },
|
|
845
|
+
{ company: "Chosun Ilbo", baseUrls: ["www.chosun.com"], type: ["newspaper", "digital"] },
|
|
846
|
+
{ company: "JoongAng Ilbo", baseUrls: ["www.joongang.co.kr"], type: ["newspaper", "digital"] },
|
|
847
|
+
{ company: "Dong-A Ilbo", baseUrls: ["www.donga.com"], type: ["newspaper", "digital"] },
|
|
848
|
+
{ company: "MBC News", baseUrls: ["www.imnews.imbc.com"], type: ["television", "digital"] },
|
|
849
|
+
{ company: "SBS News", baseUrls: ["news.sbs.co.kr"], type: ["television", "digital"] },
|
|
850
|
+
{ company: "KBS News", baseUrls: ["news.kbs.co.kr"], type: ["television", "radio", "digital"] },
|
|
851
|
+
{ company: "Hankyoreh", baseUrls: ["english.hani.co.kr"], type: ["newspaper", "digital"] },
|
|
852
|
+
{ company: "Maeil Business Newspaper", baseUrls: ["www.mk.co.kr"], type: ["newspaper", "digital"] },
|
|
853
|
+
{ company: "MoneyToday", baseUrls: ["www.mt.co.kr"], type: ["digital-first", "business"] },
|
|
854
|
+
{ company: "Seoul Shinmun", baseUrls: ["www.seoul.co.kr"], type: ["newspaper", "digital"] },
|
|
855
|
+
{ company: "OhmyNews", baseUrls: ["www.ohmynews.com"], type: ["digital-first"] },
|
|
856
|
+
{ company: "News1 Korea", baseUrls: ["www.news1.kr"], type: ["news agency", "digital"] },
|
|
857
|
+
{ company: "Asia Business Daily", baseUrls: ["www.asiae.co.kr"], type: ["newspaper", "digital"] },
|
|
858
|
+
{ company: "Herald Business", baseUrls: ["biz.heraldcorp.com"], type: ["newspaper", "digital"] },
|
|
859
|
+
{ company: "eDaily", baseUrls: ["www.edaily.co.kr"], type: ["digital-first", "business"] },
|
|
860
|
+
{ company: "Seoul Economic Daily", baseUrls: ["www.sedaily.com"], type: ["newspaper", "digital"] },
|
|
861
|
+
{ company: "JTBC News", baseUrls: ["news.jtbc.co.kr"], type: ["television", "digital"] }
|
|
862
|
+
];
|
|
863
|
+
var TURKISH_NEWS = [
|
|
864
|
+
{ company: "Anadolu Agency (AA)", baseUrls: ["www.aa.com.tr"], type: ["news agency", "digital"] },
|
|
865
|
+
{ company: "H\xFCrriyet", baseUrls: ["www.hurriyet.com.tr"], type: ["newspaper", "digital"] },
|
|
866
|
+
{ company: "Sabah", baseUrls: ["www.sabah.com.tr"], type: ["newspaper", "digital"] },
|
|
867
|
+
{ company: "Milliyet", baseUrls: ["www.milliyet.com.tr"], type: ["newspaper", "digital"] },
|
|
868
|
+
{ company: "TRT World", baseUrls: ["www.trtworld.com"], type: ["television", "digital"] },
|
|
869
|
+
{ company: "CNN T\xFCrk", baseUrls: ["www.cnnturk.com"], type: ["television", "digital"] },
|
|
870
|
+
{ company: "Sozcu", baseUrls: ["www.sozcu.com.tr"], type: ["newspaper", "digital"] },
|
|
871
|
+
{ company: "Daily Sabah", baseUrls: ["www.dailysabah.com"], type: ["newspaper", "digital"] },
|
|
872
|
+
{ company: "Yeni \u015Eafak", baseUrls: ["www.yenisafak.com"], type: ["newspaper", "digital"] },
|
|
873
|
+
{ company: "Habert\xFCrk", baseUrls: ["www.haberturk.com"], type: ["television", "digital"] },
|
|
874
|
+
{ company: "BirG\xFCn", baseUrls: ["www.birgun.net"], type: ["newspaper", "digital"] },
|
|
875
|
+
{ company: "T\xFCrkiye Gazetesi", baseUrls: ["www.turkiyegazetesi.com.tr"], type: ["newspaper", "digital"] },
|
|
876
|
+
{ company: "Cumhuriyet", baseUrls: ["www.cumhuriyet.com.tr"], type: ["newspaper", "digital"] },
|
|
877
|
+
{ company: "Diken", baseUrls: ["www.diken.com.tr"], type: ["digital-first"] },
|
|
878
|
+
{ company: "NTV", baseUrls: ["www.ntv.com.tr"], type: ["television", "digital"] },
|
|
879
|
+
{ company: "Ensonhaber", baseUrls: ["www.ensonhaber.com"], type: ["digital-first"] },
|
|
880
|
+
{ company: "T24", baseUrls: ["www.t24.com.tr"], type: ["digital-first"] },
|
|
881
|
+
{ company: "Karar", baseUrls: ["www.karar.com"], type: ["newspaper", "digital"] },
|
|
882
|
+
{ company: "Gazete Duvar", baseUrls: ["www.gazeteduvar.com.tr"], type: ["digital-first"] },
|
|
883
|
+
{ company: "Bloomberg HT", baseUrls: ["www.bloomberght.com"], type: ["television", "digital"] }
|
|
884
|
+
];
|
|
885
|
+
var NORWEGIAN_NEWS = [
|
|
886
|
+
{ company: "Aftenposten", baseUrls: ["www.aftenposten.no"], type: ["newspaper", "digital"] },
|
|
887
|
+
{ company: "Verdens Gang (VG)", baseUrls: ["www.vg.no"], type: ["newspaper", "digital"] },
|
|
888
|
+
{ company: "Dagbladet", baseUrls: ["www.dagbladet.no"], type: ["newspaper", "digital"] },
|
|
889
|
+
{ company: "NRK", baseUrls: ["www.nrk.no"], type: ["television", "radio", "digital"] },
|
|
890
|
+
{ company: "Dagens N\xE6ringsliv", baseUrls: ["www.dn.no"], type: ["newspaper", "digital"] },
|
|
891
|
+
{ company: "Nettavisen", baseUrls: ["www.nettavisen.no"], type: ["digital-first"] },
|
|
892
|
+
{ company: "Klassekampen", baseUrls: ["www.klassekampen.no"], type: ["newspaper", "digital"] },
|
|
893
|
+
{ company: "Morgenbladet", baseUrls: ["www.morgenbladet.no"], type: ["newspaper", "digital"] },
|
|
894
|
+
{ company: "E24", baseUrls: ["www.e24.no"], type: ["digital-first", "business"] },
|
|
895
|
+
{ company: "TV2", baseUrls: ["www.tv2.no"], type: ["television", "digital"] },
|
|
896
|
+
{ company: "Bergens Tidende", baseUrls: ["www.bt.no"], type: ["newspaper", "digital"] },
|
|
897
|
+
{ company: "Adresseavisen", baseUrls: ["www.adressa.no"], type: ["newspaper", "digital"] },
|
|
898
|
+
{ company: "Stavanger Aftenblad", baseUrls: ["www.aftenbladet.no"], type: ["newspaper", "digital"] },
|
|
899
|
+
{ company: "F\xE6drelandsvennen", baseUrls: ["www.fvn.no"], type: ["newspaper", "digital"] },
|
|
900
|
+
{ company: "ABC Nyheter", baseUrls: ["www.abcnyheter.no"], type: ["digital-first"] },
|
|
901
|
+
{ company: "Romerikes Blad", baseUrls: ["www.rb.no"], type: ["newspaper", "digital"] },
|
|
902
|
+
{ company: "Sunnm\xF8rsposten", baseUrls: ["www.smp.no"], type: ["newspaper", "digital"] },
|
|
903
|
+
{ company: "Finansavisen", baseUrls: ["www.finansavisen.no"], type: ["newspaper", "digital"] },
|
|
904
|
+
{ company: "Nordlys", baseUrls: ["www.nordlys.no"], type: ["newspaper", "digital"] },
|
|
905
|
+
{ company: "Hamar Arbeiderblad", baseUrls: ["www.h-a.no"], type: ["newspaper", "digital"] }
|
|
906
|
+
];
|
|
907
|
+
var NO_DEFAULT_VALUE = createConstant("no-default-value");
|
|
908
|
+
var NOT_DEFINED = createConstant("not-defined");
|
|
909
|
+
var NUMERIC_CHAR = [
|
|
910
|
+
"0",
|
|
911
|
+
"1",
|
|
912
|
+
"2",
|
|
913
|
+
"3",
|
|
914
|
+
"4",
|
|
915
|
+
"5",
|
|
916
|
+
"6",
|
|
917
|
+
"7",
|
|
918
|
+
"8",
|
|
919
|
+
"9"
|
|
920
|
+
];
|
|
921
|
+
var PLURAL_EXCEPTIONS = {
|
|
922
|
+
photo: "photos",
|
|
923
|
+
piano: "pianos",
|
|
924
|
+
halo: "halos",
|
|
925
|
+
foot: "feet",
|
|
926
|
+
man: "men",
|
|
927
|
+
woman: "women",
|
|
928
|
+
person: "people",
|
|
929
|
+
mouse: "mice",
|
|
930
|
+
series: "series",
|
|
931
|
+
sheep: "sheep",
|
|
932
|
+
money: "monies",
|
|
933
|
+
deer: "deer",
|
|
934
|
+
goose: "geese",
|
|
935
|
+
child: "children",
|
|
936
|
+
tooth: "teeth",
|
|
937
|
+
ox: "oxen",
|
|
938
|
+
basis: "bases",
|
|
939
|
+
radius: "radii",
|
|
940
|
+
syllabus: "syllabi",
|
|
941
|
+
ice: "ice",
|
|
942
|
+
fish: "fish",
|
|
943
|
+
means: "means",
|
|
944
|
+
phenomenon: "phenomena",
|
|
945
|
+
criterion: "criteria",
|
|
946
|
+
datum: "data",
|
|
947
|
+
memorandum: "memoranda",
|
|
948
|
+
bacterium: "bacteria",
|
|
949
|
+
stratum: "strata",
|
|
950
|
+
curriculum: "curricula",
|
|
951
|
+
index: "indices",
|
|
952
|
+
appendix: "appendices",
|
|
953
|
+
vortex: "vortices",
|
|
954
|
+
bison: "bison",
|
|
955
|
+
axis: "axes",
|
|
956
|
+
antenna: "antennas",
|
|
957
|
+
cactus: "cacti",
|
|
958
|
+
corpus: "corpora",
|
|
959
|
+
beau: "beaux",
|
|
960
|
+
die: "dice",
|
|
961
|
+
ellipsis: "ellipses",
|
|
962
|
+
erratum: "errata",
|
|
963
|
+
focus: "foci",
|
|
964
|
+
formula: "formulas",
|
|
965
|
+
fungus: "fungi",
|
|
966
|
+
genus: "genera",
|
|
967
|
+
graffito: "graffiti",
|
|
968
|
+
grouse: "grouses",
|
|
969
|
+
half: "halves",
|
|
970
|
+
hoof: "hooves",
|
|
971
|
+
hypothesis: "hypothesis",
|
|
972
|
+
larva: "larvae",
|
|
973
|
+
libretto: "libretti",
|
|
974
|
+
loaf: "loaves",
|
|
975
|
+
locus: "loci",
|
|
976
|
+
medium: "mediums",
|
|
977
|
+
minutia: "minutiae",
|
|
978
|
+
nucleus: "nuclei",
|
|
979
|
+
oasis: "oases",
|
|
980
|
+
opus: "opuses",
|
|
981
|
+
ovum: "ova",
|
|
982
|
+
parenthesis: "parentheses",
|
|
983
|
+
phylum: "phyla",
|
|
984
|
+
quiz: "quizzes",
|
|
985
|
+
referendum: "referendums",
|
|
986
|
+
self: "selves",
|
|
987
|
+
species: "species",
|
|
988
|
+
stimulus: "stimuli",
|
|
989
|
+
swine: "swine",
|
|
990
|
+
synopsis: "synopses",
|
|
991
|
+
thesis: "theses",
|
|
992
|
+
thief: "thieves",
|
|
993
|
+
vertex: "vertexes",
|
|
994
|
+
wife: "wives",
|
|
995
|
+
wolf: "wolves"
|
|
996
|
+
};
|
|
997
|
+
var REPO_SOURCES = [
|
|
998
|
+
"github",
|
|
999
|
+
"bitbucket",
|
|
1000
|
+
"gitlab",
|
|
1001
|
+
"codecommit",
|
|
1002
|
+
"local"
|
|
1003
|
+
];
|
|
1004
|
+
var REPO_SOURCE_LOOKUP = {
|
|
1005
|
+
github: [`https://github.com`, "https://github.io"],
|
|
1006
|
+
bitbucket: ["https://bitbucket.org"],
|
|
1007
|
+
gitlab: ["https://gitlab.com"],
|
|
1008
|
+
codecommit: ["https://aws.amazon.com/codecommit/"],
|
|
1009
|
+
local: []
|
|
1010
|
+
};
|
|
1011
|
+
var AMAZON_DNS = [
|
|
1012
|
+
"www.amazon.com",
|
|
1013
|
+
`www.amazon.co.uk`,
|
|
1014
|
+
`www.amazon.fr`,
|
|
1015
|
+
`www.amazon.de`,
|
|
1016
|
+
`www.amazon.it`,
|
|
1017
|
+
`www.amazon.es`
|
|
1018
|
+
];
|
|
1019
|
+
var WALMART_DNS = [
|
|
1020
|
+
"www.walmart.com",
|
|
1021
|
+
"www.walmart.ca",
|
|
1022
|
+
"www.walmart.com.mx"
|
|
1023
|
+
];
|
|
1024
|
+
var APPLE_DNS = [
|
|
1025
|
+
"store.apple.com",
|
|
1026
|
+
"www.apple.com"
|
|
1027
|
+
];
|
|
1028
|
+
var HOME_DEPOT_DNS = [
|
|
1029
|
+
"www.homedepot.com",
|
|
1030
|
+
"www.homedepot.ca"
|
|
1031
|
+
];
|
|
1032
|
+
var EBAY_DNS = [
|
|
1033
|
+
"www.ebay.com",
|
|
1034
|
+
"www.ebay.co.uk",
|
|
1035
|
+
"www.ebay.fr",
|
|
1036
|
+
"www.ebay.de",
|
|
1037
|
+
"www.ebay.it"
|
|
1038
|
+
];
|
|
1039
|
+
var TARGET_DNS = [
|
|
1040
|
+
"www.target.com"
|
|
1041
|
+
];
|
|
1042
|
+
var ETSY_DNS = [
|
|
1043
|
+
"www.etsy.com"
|
|
1044
|
+
];
|
|
1045
|
+
var COSTCO_DNS = [
|
|
1046
|
+
"www.costco.com",
|
|
1047
|
+
"www.costco.co.uk",
|
|
1048
|
+
"www.costco.ca"
|
|
1049
|
+
];
|
|
1050
|
+
var BEST_BUY_DNS = [
|
|
1051
|
+
"www.bestbuy.com",
|
|
1052
|
+
"www.bestbuy.ca"
|
|
1053
|
+
];
|
|
1054
|
+
var WAYFAIR_DNS = [
|
|
1055
|
+
"www.wayfair.com",
|
|
1056
|
+
"www.wayfair.ca",
|
|
1057
|
+
"www.wayfair.co.uk"
|
|
1058
|
+
];
|
|
1059
|
+
var NIKE_DNS = [
|
|
1060
|
+
"www.nike.com"
|
|
1061
|
+
];
|
|
1062
|
+
var MACYS_DNS = [
|
|
1063
|
+
"www.macys.com"
|
|
1064
|
+
];
|
|
1065
|
+
var DELL_DNS = [
|
|
1066
|
+
"www.dell.com"
|
|
1067
|
+
];
|
|
1068
|
+
var HM_DNS = [
|
|
1069
|
+
"www2.hm.com"
|
|
1070
|
+
];
|
|
1071
|
+
var ZARA_DNS = [
|
|
1072
|
+
"www.zara.com"
|
|
1073
|
+
];
|
|
1074
|
+
var KROGER_DNS = [
|
|
1075
|
+
"www.kroger.com"
|
|
1076
|
+
];
|
|
1077
|
+
var WALGREENS_DNS = [
|
|
1078
|
+
"www.walgreens.com"
|
|
1079
|
+
];
|
|
1080
|
+
var CVS_DNS = [
|
|
1081
|
+
"www.cvs.com"
|
|
1082
|
+
];
|
|
1083
|
+
var WHOLE_FOODS_DNS = [
|
|
1084
|
+
"www.wholefoodsmarket.com",
|
|
1085
|
+
"www.wholefoodsmarket.co.uk"
|
|
1086
|
+
];
|
|
1087
|
+
var SHAPE_PREFIXES = [
|
|
1088
|
+
"string",
|
|
1089
|
+
"number",
|
|
1090
|
+
"boolean",
|
|
1091
|
+
"null",
|
|
1092
|
+
"undefined",
|
|
1093
|
+
"unknown",
|
|
1094
|
+
"opt::",
|
|
1095
|
+
"union::",
|
|
1096
|
+
"tuple::",
|
|
1097
|
+
"array::",
|
|
1098
|
+
"object",
|
|
1099
|
+
"record::"
|
|
1100
|
+
];
|
|
1101
|
+
var SINGULAR_NOUN_ENDINGS = [
|
|
1102
|
+
"s",
|
|
1103
|
+
"sh",
|
|
1104
|
+
"ch",
|
|
1105
|
+
"x",
|
|
1106
|
+
"z",
|
|
1107
|
+
"o"
|
|
1108
|
+
];
|
|
1109
|
+
var SOCIAL_MEDIA = [
|
|
1110
|
+
{
|
|
1111
|
+
name: "Facebook",
|
|
1112
|
+
description: "Connect with friends, family, and communities worldwide on one of the largest social networks.",
|
|
1113
|
+
baseUrls: ["https://www.facebook.com"],
|
|
1114
|
+
profileUrl: "https://www.facebook.com/:user_id",
|
|
1115
|
+
approximateUserSize: 3e9,
|
|
1116
|
+
// 3 billion
|
|
1117
|
+
tickerSymbol: "META"
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
name: "YouTube",
|
|
1121
|
+
description: "A platform for sharing and watching videos, connecting creators with audiences globally.",
|
|
1122
|
+
baseUrls: ["https://www.youtube.com"],
|
|
1123
|
+
profileUrl: "https://www.youtube.com/user/:user_id",
|
|
1124
|
+
approximateUserSize: 25e8,
|
|
1125
|
+
// 2.5 billion
|
|
1126
|
+
tickerSymbol: "GOOGL"
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
name: "WhatsApp",
|
|
1130
|
+
description: "A secure messaging app for personal and business communication.",
|
|
1131
|
+
baseUrls: ["https://www.whatsapp.com", "https://wa.me"],
|
|
1132
|
+
profileUrl: "https://wa.me/:user_id",
|
|
1133
|
+
approximateUserSize: 2e9,
|
|
1134
|
+
// 2 billion
|
|
1135
|
+
tickerSymbol: "META"
|
|
1136
|
+
},
|
|
1137
|
+
{
|
|
1138
|
+
name: "Instagram",
|
|
1139
|
+
description: "Share photos and videos with friends and followers through posts, stories, and reels.",
|
|
1140
|
+
baseUrls: ["https://www.instagram.com"],
|
|
1141
|
+
profileUrl: "https://www.instagram.com/:user_id",
|
|
1142
|
+
approximateUserSize: 2e9,
|
|
1143
|
+
// 2 billion
|
|
1144
|
+
tickerSymbol: "META"
|
|
1145
|
+
},
|
|
1146
|
+
{
|
|
1147
|
+
name: "TikTok",
|
|
1148
|
+
description: "A short-form video platform known for its highly engaging content and viral trends.",
|
|
1149
|
+
baseUrls: ["https://www.tiktok.com"],
|
|
1150
|
+
profileUrl: "https://www.tiktok.com/@:user_id",
|
|
1151
|
+
approximateUserSize: 16e8
|
|
1152
|
+
// 1.6 billion
|
|
1153
|
+
},
|
|
1154
|
+
{
|
|
1155
|
+
name: "WeChat",
|
|
1156
|
+
description: "China's popular messaging and lifestyle app, integrating social media and mobile payments.",
|
|
1157
|
+
baseUrls: ["https://www.wechat.com"],
|
|
1158
|
+
profileUrl: "https://www.wechat.com/:user_id",
|
|
1159
|
+
// Profile URLs typically restricted in China
|
|
1160
|
+
approximateUserSize: 13e8
|
|
1161
|
+
// 1.3 billion
|
|
1162
|
+
},
|
|
1163
|
+
{
|
|
1164
|
+
name: "Facebook Messenger",
|
|
1165
|
+
description: "A messaging app used for personal and business interactions, seamlessly integrated with Facebook.",
|
|
1166
|
+
baseUrls: ["https://www.messenger.com"],
|
|
1167
|
+
profileUrl: "https://www.messenger.com/t/:user_id",
|
|
1168
|
+
approximateUserSize: 1e9,
|
|
1169
|
+
// 1 billion
|
|
1170
|
+
tickerSymbol: "META"
|
|
1171
|
+
},
|
|
1172
|
+
{
|
|
1173
|
+
name: "Telegram",
|
|
1174
|
+
description: "A messaging platform focused on privacy, with channels and group capabilities.",
|
|
1175
|
+
baseUrls: ["https://www.telegram.org", "https://t.me"],
|
|
1176
|
+
profileUrl: "https://t.me/:user_id",
|
|
1177
|
+
approximateUserSize: 9e8
|
|
1178
|
+
// 900 million
|
|
1179
|
+
},
|
|
1180
|
+
{
|
|
1181
|
+
name: "Snapchat",
|
|
1182
|
+
description: "A multimedia app popular for its disappearing messages and creative filters.",
|
|
1183
|
+
baseUrls: ["https://www.snapchat.com"],
|
|
1184
|
+
profileUrl: "https://www.snapchat.com/add/:user_id",
|
|
1185
|
+
approximateUserSize: 8e8,
|
|
1186
|
+
// 800 million
|
|
1187
|
+
tickerSymbol: "SNAP"
|
|
1188
|
+
},
|
|
1189
|
+
{
|
|
1190
|
+
name: "Douyin",
|
|
1191
|
+
description: "The Chinese version of TikTok, with similar short-form video content tailored for China.",
|
|
1192
|
+
baseUrls: ["https://www.douyin.com"],
|
|
1193
|
+
profileUrl: "https://www.douyin.com/user/:user_id",
|
|
1194
|
+
approximateUserSize: 75e7
|
|
1195
|
+
// 750 million
|
|
1196
|
+
},
|
|
1197
|
+
{
|
|
1198
|
+
name: "LinkedIn",
|
|
1199
|
+
description: "The largest professional networking platform, where users connect for career opportunities, insights, and business networking.",
|
|
1200
|
+
baseUrls: ["https://www.linkedin.com"],
|
|
1201
|
+
profileUrl: "https://www.linkedin.com/in/:user_id",
|
|
1202
|
+
approximateUserSize: 93e7,
|
|
1203
|
+
// 930 million
|
|
1204
|
+
tickerSymbol: "MSFT"
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
name: "X (formerly Twitter)",
|
|
1208
|
+
description: "A platform for real-time updates, news sharing, and public discourse with a focus on brief, impactful posts.",
|
|
1209
|
+
baseUrls: ["https://www.twitter.com", "https://x.com"],
|
|
1210
|
+
profileUrl: "https://twitter.com/:user_id",
|
|
1211
|
+
approximateUserSize: 54e7
|
|
1212
|
+
// 540 million
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
name: "Pinterest",
|
|
1216
|
+
description: "A visually-driven platform for sharing ideas, DIY projects, fashion, and more.",
|
|
1217
|
+
baseUrls: ["https://www.pinterest.com"],
|
|
1218
|
+
profileUrl: "https://www.pinterest.com/:user_id",
|
|
1219
|
+
approximateUserSize: 46e7,
|
|
1220
|
+
// 460 million
|
|
1221
|
+
tickerSymbol: "PINS"
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
name: "Reddit",
|
|
1225
|
+
description: "A community-driven platform organized into niche forums or 'subreddits' focused on various topics.",
|
|
1226
|
+
baseUrls: ["https://www.reddit.com"],
|
|
1227
|
+
profileUrl: "https://www.reddit.com/user/:user_id",
|
|
1228
|
+
approximateUserSize: 43e7
|
|
1229
|
+
// 430 million
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
name: "Clubhouse",
|
|
1233
|
+
description: "A voice-based social network where users engage in live audio conversations on various topics.",
|
|
1234
|
+
baseUrls: ["https://www.clubhouse.com"],
|
|
1235
|
+
profileUrl: "https://www.clubhouse.com/:user_id",
|
|
1236
|
+
approximateUserSize: 1e7
|
|
1237
|
+
// 10 million
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
name: "Discord",
|
|
1241
|
+
description: "Originally aimed at gamers, Discord is now widely used by various communities for group chat, video, and voice calls.",
|
|
1242
|
+
baseUrls: ["https://www.discord.com", "https://discord.com"],
|
|
1243
|
+
profileUrl: "https://discord.com/users/:user_id",
|
|
1244
|
+
approximateUserSize: 3e8
|
|
1245
|
+
// 300 million
|
|
1246
|
+
}
|
|
1247
|
+
];
|
|
1248
|
+
var TW_HUE_NEUTRAL = {
|
|
1249
|
+
slate: 262,
|
|
1250
|
+
gray: 270,
|
|
1251
|
+
zinc: 269,
|
|
1252
|
+
neutral: 270,
|
|
1253
|
+
stone: 273
|
|
1254
|
+
};
|
|
1255
|
+
var TW_HUE_VIBRANT = {
|
|
1256
|
+
red: 24,
|
|
1257
|
+
orange: 44,
|
|
1258
|
+
amber: 79,
|
|
1259
|
+
yellow: 100,
|
|
1260
|
+
lime: 132,
|
|
1261
|
+
green: 144,
|
|
1262
|
+
emerald: 159,
|
|
1263
|
+
teal: 182,
|
|
1264
|
+
cyan: 192,
|
|
1265
|
+
sky: 219,
|
|
1266
|
+
blue: 240,
|
|
1267
|
+
indigo: 268,
|
|
1268
|
+
violet: 283,
|
|
1269
|
+
purple: 294,
|
|
1270
|
+
fuchsia: 319,
|
|
1271
|
+
pink: 334,
|
|
1272
|
+
rose: 15
|
|
1273
|
+
};
|
|
1274
|
+
var TW_HUE_STATIC = {
|
|
1275
|
+
black: 0,
|
|
1276
|
+
white: 106.37411429114086
|
|
1277
|
+
};
|
|
1278
|
+
var TW_HUE = {
|
|
1279
|
+
...TW_HUE_NEUTRAL,
|
|
1280
|
+
...TW_HUE_VIBRANT,
|
|
1281
|
+
...TW_HUE_STATIC
|
|
1282
|
+
};
|
|
1283
|
+
var TW_LUMINOSITY = {
|
|
1284
|
+
50: 97.78,
|
|
1285
|
+
100: 93.56,
|
|
1286
|
+
200: 88.11,
|
|
1287
|
+
300: 82.67,
|
|
1288
|
+
400: 74.22,
|
|
1289
|
+
500: 64.78,
|
|
1290
|
+
600: 57.33,
|
|
1291
|
+
700: 46.89,
|
|
1292
|
+
800: 39.44,
|
|
1293
|
+
900: 32,
|
|
1294
|
+
950: 23.78
|
|
1295
|
+
};
|
|
1296
|
+
var TW_CHROMA = {
|
|
1297
|
+
50: 0.0108,
|
|
1298
|
+
100: 0.0321,
|
|
1299
|
+
200: 0.0609,
|
|
1300
|
+
300: 0.0908,
|
|
1301
|
+
400: 0.1398,
|
|
1302
|
+
500: 0.1472,
|
|
1303
|
+
600: 0.1299,
|
|
1304
|
+
700: 0.1067,
|
|
1305
|
+
800: 0.0898,
|
|
1306
|
+
900: 0.0726,
|
|
1307
|
+
950: 0.054
|
|
1308
|
+
};
|
|
1309
|
+
var TW_COLOR_TARGETS = [
|
|
1310
|
+
"bg",
|
|
1311
|
+
"text",
|
|
1312
|
+
"border",
|
|
1313
|
+
"ring",
|
|
1314
|
+
"shadow",
|
|
1315
|
+
"border"
|
|
1316
|
+
];
|
|
1317
|
+
var TW_MODIFIERS_CORE = [
|
|
1318
|
+
"dark",
|
|
1319
|
+
"focus",
|
|
1320
|
+
"hover",
|
|
1321
|
+
"active",
|
|
1322
|
+
"visited",
|
|
1323
|
+
"disabled"
|
|
1324
|
+
];
|
|
1325
|
+
var TW_MODIFIERS_ORDER = [
|
|
1326
|
+
"first",
|
|
1327
|
+
"last",
|
|
1328
|
+
"odd",
|
|
1329
|
+
"even"
|
|
1330
|
+
];
|
|
1331
|
+
var TW_MODIFIERS_RELN = [
|
|
1332
|
+
"focus-within",
|
|
1333
|
+
"focus-visible",
|
|
1334
|
+
"checked",
|
|
1335
|
+
"peer-invalid",
|
|
1336
|
+
`peer-checked/{{string}}`
|
|
1337
|
+
];
|
|
1338
|
+
var TW_MODIFIERS_SIZING = [
|
|
1339
|
+
"sm",
|
|
1340
|
+
"md",
|
|
1341
|
+
"lg",
|
|
1342
|
+
"xl",
|
|
1343
|
+
"2xl"
|
|
1344
|
+
];
|
|
1345
|
+
var TW_MODIFIERS = [
|
|
1346
|
+
...TW_MODIFIERS_CORE,
|
|
1347
|
+
...TW_MODIFIERS_ORDER,
|
|
1348
|
+
...TW_MODIFIERS_SIZING,
|
|
1349
|
+
...TW_MODIFIERS_RELN
|
|
1350
|
+
];
|
|
1351
|
+
var WideAssignment = {
|
|
1352
|
+
boolean: () => "<<boolean>>",
|
|
1353
|
+
string: () => "<<string>>",
|
|
1354
|
+
number: () => "<<number>>",
|
|
1355
|
+
symbol: () => "<<symbol>>",
|
|
1356
|
+
null: () => "<<null>>",
|
|
1357
|
+
function: () => "<<function>>",
|
|
1358
|
+
tuple: () => "<<tuple>>",
|
|
1359
|
+
singularTuple: () => ["<<tuple>>"],
|
|
1360
|
+
object: () => "<<object>>",
|
|
1361
|
+
emptyObject: () => "<<empty-object>>",
|
|
1362
|
+
undefined: () => "<<undefined>>",
|
|
1363
|
+
/**
|
|
1364
|
+
* run-time value is a type token for `unknown` and type is of course `unknown`
|
|
1365
|
+
*/
|
|
1366
|
+
unknown: () => "<<unknown>>",
|
|
1367
|
+
nothing: () => "<<nothing>>",
|
|
1368
|
+
something: () => "<<something>>"
|
|
1369
|
+
};
|
|
1370
|
+
var wide = WideAssignment;
|
|
1371
|
+
function entry(refType, desc, ...params) {
|
|
1372
|
+
return [
|
|
1373
|
+
refType(wide),
|
|
1374
|
+
desc,
|
|
1375
|
+
params.map(
|
|
1376
|
+
(i) => typeof i === "function" ? i(wide) : i
|
|
1377
|
+
)
|
|
1378
|
+
];
|
|
1379
|
+
}
|
|
1380
|
+
({
|
|
1381
|
+
Extends: entry((t) => t.unknown(), "extends the type", (t) => t.unknown()),
|
|
1382
|
+
NotExtends: entry((t) => t.unknown(), "does not extent the type", (t) => t.unknown()),
|
|
1383
|
+
Equals: entry((t) => t.unknown(), "equals the type", (t) => t.unknown()),
|
|
1384
|
+
NotEqual: entry((t) => t.unknown(), "does not equal the type", (t) => t.unknown()),
|
|
1385
|
+
Truthy: entry((t) => t.unknown(), "must be a truthy value"),
|
|
1386
|
+
Falsy: entry((t) => t.unknown(), "must be a falsy value"),
|
|
1387
|
+
IsSomething: entry((t) => t.unknown(), "must be 'something' (aka, not null or undefined)"),
|
|
1388
|
+
IsNothing: entry((t) => t.unknown(), "must be 'nothing' (aka, null or undefined)"),
|
|
1389
|
+
IsString: entry((t) => t.string(), "must extend a string type"),
|
|
1390
|
+
IsNumber: entry((t) => t.number(), "must extend a number type"),
|
|
1391
|
+
IsBoolean: entry((t) => t.boolean(), "must extend a boolean type"),
|
|
1392
|
+
// numeric
|
|
1393
|
+
GreaterThan: entry((t) => t.number(), "must be a numeric literal greater than [[0]]", (t) => t.number()),
|
|
1394
|
+
LessThan: entry((t) => t.number(), "must be a numeric literal less than [[0]]", (t) => t.number()),
|
|
1395
|
+
// string
|
|
1396
|
+
StartsWith: entry((t) => t.string(), "must be a string literal that starts with '[[0]]'", (t) => t.string()),
|
|
1397
|
+
EndsWith: entry((t) => t.string(), "must be a string literal that ends with '[[0]]'", (t) => t.string()),
|
|
1398
|
+
Includes: entry((t) => t.string(), "must be a string literal that includes the substring '[[0]]'", (t) => t.string()),
|
|
1399
|
+
// function
|
|
1400
|
+
ReturnsSomething: entry((t) => t.function(), "must be a function which returns 'something' (aka, not null or undefined)"),
|
|
1401
|
+
ReturnsNothing: entry((t) => t.function(), "must be a function which returns 'nothing' (aka, null or undefined)"),
|
|
1402
|
+
ReturnsTrue: entry((t) => t.function(), "must be a function which returns 'true'"),
|
|
1403
|
+
ReturnsFalse: entry((t) => t.function(), "must be a function which returns 'false'"),
|
|
1404
|
+
ReturnsTruthy: entry((t) => t.function(), "must be a function which returns a 'truthy' value"),
|
|
1405
|
+
ReturnsFalsy: entry((t) => t.function(), "must be a function which returns a 'falsy' value"),
|
|
1406
|
+
ReturnsExtends: entry((t) => t.unknown(), "must be a function which returns a value which extends [[0]]", (t) => t.unknown()),
|
|
1407
|
+
ReturnsEquals: entry((t) => t.unknown(), "must be a function which returns a value which equals [[0]]", (t) => t.unknown()),
|
|
1408
|
+
Contains: entry((t) => t.tuple(), "must be a tuple and have elements that extends the value [[0]]", (t) => t.unknown()),
|
|
1409
|
+
// TODO: get the below working`
|
|
1410
|
+
ContainsSome: entry((t) => t.tuple(), "must be a tuple and have elements that extends the value [[0]]", (t) => t.singularTuple())
|
|
1411
|
+
});
|
|
1412
|
+
var SIMPLE_SCALAR_TOKENS = [
|
|
1413
|
+
"string",
|
|
1414
|
+
"number",
|
|
1415
|
+
`string(TOKEN)`,
|
|
1416
|
+
`number(TOKEN)`,
|
|
1417
|
+
"boolean",
|
|
1418
|
+
"true",
|
|
1419
|
+
"false",
|
|
1420
|
+
"null",
|
|
1421
|
+
"undefined",
|
|
1422
|
+
"unknown",
|
|
1423
|
+
"any",
|
|
1424
|
+
"never"
|
|
1425
|
+
];
|
|
1426
|
+
var SIMPLE_OPT_SCALAR_TOKENS = [
|
|
1427
|
+
"Opt<string>",
|
|
1428
|
+
"Opt<number>",
|
|
1429
|
+
"Opt<boolean>",
|
|
1430
|
+
"Opt<true>",
|
|
1431
|
+
"Opt<false>",
|
|
1432
|
+
"Opt<null>",
|
|
1433
|
+
"Opt<undefined>",
|
|
1434
|
+
"Opt<unknown>",
|
|
1435
|
+
"Opt<any>",
|
|
1436
|
+
"Opt<string(TOKEN)>",
|
|
1437
|
+
"Opt<number(TOKEN)>",
|
|
1438
|
+
"Opt<undefined>"
|
|
1439
|
+
];
|
|
1440
|
+
var SIMPLE_UNION_TOKENS = [
|
|
1441
|
+
`Union(TOKEN)`
|
|
1442
|
+
];
|
|
1443
|
+
var SIMPLE_DICT_TOKENS = [
|
|
1444
|
+
"Dict",
|
|
1445
|
+
"Dict<string, string>",
|
|
1446
|
+
"Dict<string, number>",
|
|
1447
|
+
"Dict<string, boolean>",
|
|
1448
|
+
"Dict<string, unknown>",
|
|
1449
|
+
"Dict<string, Opt<string>>",
|
|
1450
|
+
"Dict<string, Opt<number>>",
|
|
1451
|
+
"Dict<string, Opt<boolean>>",
|
|
1452
|
+
"Dict<string, Opt<unknown>>",
|
|
1453
|
+
"Dict<{TOKEN: TOKEN}>",
|
|
1454
|
+
"Dict<{TOKEN: TOKEN, TOKEN: TOKEN}>"
|
|
1455
|
+
];
|
|
1456
|
+
var SIMPLE_ARRAY_TOKENS = [
|
|
1457
|
+
"Array",
|
|
1458
|
+
"Array<string>",
|
|
1459
|
+
"Array<string(TOKEN)>",
|
|
1460
|
+
"Array<number>",
|
|
1461
|
+
"Array<number(TOKEN)>",
|
|
1462
|
+
"Array<boolean>",
|
|
1463
|
+
"Array<unknown>",
|
|
1464
|
+
`Array<Dict>`,
|
|
1465
|
+
`Array<Set>`,
|
|
1466
|
+
`Array<Map>`
|
|
1467
|
+
];
|
|
1468
|
+
var SIMPLE_MAP_TOKENS = [
|
|
1469
|
+
"Map",
|
|
1470
|
+
"Map<TOKEN, TOKEN>",
|
|
1471
|
+
"WeakMap"
|
|
1472
|
+
];
|
|
1473
|
+
var SIMPLE_SET_TOKENS = [
|
|
1474
|
+
"Set",
|
|
1475
|
+
"Set<TOKEN>"
|
|
1476
|
+
];
|
|
1477
|
+
var SIMPLE_CONTAINER_TOKENS = [
|
|
1478
|
+
...SIMPLE_DICT_TOKENS,
|
|
1479
|
+
...SIMPLE_ARRAY_TOKENS,
|
|
1480
|
+
...SIMPLE_MAP_TOKENS,
|
|
1481
|
+
...SIMPLE_SET_TOKENS
|
|
1482
|
+
];
|
|
1483
|
+
var SIMPLE_TOKENS = [
|
|
1484
|
+
...SIMPLE_SCALAR_TOKENS,
|
|
1485
|
+
...SIMPLE_OPT_SCALAR_TOKENS,
|
|
1486
|
+
...SIMPLE_CONTAINER_TOKENS,
|
|
1487
|
+
...SIMPLE_UNION_TOKENS
|
|
1488
|
+
];
|
|
1489
|
+
var TT_Atomics = [
|
|
1490
|
+
"undefined",
|
|
1491
|
+
"null",
|
|
1492
|
+
"boolean",
|
|
1493
|
+
"true",
|
|
1494
|
+
"false"
|
|
1495
|
+
];
|
|
1496
|
+
var TT_Singletons = [
|
|
1497
|
+
"string",
|
|
1498
|
+
"number"
|
|
1499
|
+
];
|
|
1500
|
+
var TT_Sets = [
|
|
1501
|
+
"string-set",
|
|
1502
|
+
"numeric-set",
|
|
1503
|
+
"union-set"
|
|
1504
|
+
];
|
|
1505
|
+
var TT_Functions = [
|
|
1506
|
+
"fn",
|
|
1507
|
+
"gen"
|
|
1508
|
+
];
|
|
1509
|
+
var TT_Containers = [
|
|
1510
|
+
"rec",
|
|
1511
|
+
"arr",
|
|
1512
|
+
"set",
|
|
1513
|
+
"map",
|
|
1514
|
+
"union",
|
|
1515
|
+
"obj",
|
|
1516
|
+
"tuple"
|
|
1517
|
+
];
|
|
1518
|
+
|
|
1519
|
+
// src/boolean-logic/ifChar.ts
|
|
1520
|
+
var def_if = (v) => v;
|
|
1521
|
+
var def_else = () => Never;
|
|
1522
|
+
function ifChar(ch, callback_if_match = def_if, callback_not_match = def_else) {
|
|
1523
|
+
return ch.length === 1 ? callback_if_match(ch) : callback_not_match(ch);
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
// src/boolean-logic/ifContainer.ts
|
|
1527
|
+
function ifContainer(value, ifContainer2, notContainer) {
|
|
1528
|
+
return isObject(value) || isArray(value) ? ifContainer2(value) : notContainer(value);
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
// src/boolean-logic/ifFalse.ts
|
|
1532
|
+
function ifFalse(val, ifVal, elseVal) {
|
|
1533
|
+
return isFalse(val) ? ifVal : elseVal;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
// src/boolean-logic/ifFunction.ts
|
|
1537
|
+
function ifFunction(value, isFnCallback, notFnCallback) {
|
|
1538
|
+
return typeof value === "function" ? isFnCallback(value) : notFnCallback(value);
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
// src/boolean-logic/ifHasKey.ts
|
|
1542
|
+
function ifHasKey(container, key, hasKey, doesNotHaveKey) {
|
|
1543
|
+
return hasIndexOf(container, key) ? hasKey(container) : doesNotHaveKey(container);
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
// src/boolean-logic/ifLength.ts
|
|
1547
|
+
function ifLength(value, length, ifVal, elseVal) {
|
|
1548
|
+
return Array.isArray(value) && value.length === length ? ifVal(value) : elseVal(value);
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
// src/boolean-logic/ifNotNull.ts
|
|
1552
|
+
function ifNotNull(val, ifVal, elseVal) {
|
|
1553
|
+
return isNull(val) ? elseVal() : ifVal(val);
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
// src/boolean-logic/ifNull.ts
|
|
1557
|
+
function ifNull(val, ifVal, elseVal) {
|
|
1558
|
+
return isNull(val) ? ifVal() : elseVal(val);
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
// src/boolean-logic/ifNumber.ts
|
|
1562
|
+
function ifNumber(val, ifVal, elseVal) {
|
|
1563
|
+
return isNumber(val) ? ifVal(val) : elseVal(val);
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
// src/boolean-logic/ifObject.ts
|
|
1567
|
+
function ifObject(val, ifObj, notObj) {
|
|
1568
|
+
return isObject(val) ? ifObj : notObj;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
// src/boolean-logic/ifSameType.ts
|
|
1572
|
+
function ifSameType(value, comparator, same, notSame) {
|
|
1573
|
+
return (
|
|
1574
|
+
// runtime values match
|
|
1575
|
+
typeof value === typeof comparator ? same(value) : notSame(value)
|
|
1576
|
+
);
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
// src/type-guards/isNull.ts
|
|
1580
|
+
function isNull(value) {
|
|
1581
|
+
return value === null;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
// src/type-guards/isNumber.ts
|
|
1585
|
+
function isNumber(value) {
|
|
1586
|
+
return typeof value === "number";
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
// src/type-guards/isString.ts
|
|
1590
|
+
function isString(value) {
|
|
1591
|
+
return typeof value === "string";
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
// src/type-guards/isSymbol.ts
|
|
1595
|
+
function isSymbol(value) {
|
|
1596
|
+
return typeof value === "symbol";
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
// src/type-guards/isScalar.ts
|
|
1600
|
+
function isScalar(value) {
|
|
1601
|
+
return isString(value) || isNumber(value) || isSymbol(value) || isNull(value);
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
// src/boolean-logic/ifScalar.ts
|
|
1605
|
+
function ifScalar(value, ifCallback, notCallback) {
|
|
1606
|
+
const result2 = isScalar(value) ? ifCallback(
|
|
1607
|
+
value
|
|
1608
|
+
) : notCallback(value);
|
|
1609
|
+
return result2;
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
// src/boolean-logic/ifString.ts
|
|
1613
|
+
function ifString(val, ifVal, elseVal) {
|
|
1614
|
+
return typeof val === "string" ? ifVal(val) : elseVal(val);
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
// src/boolean-logic/ifTrue.ts
|
|
1618
|
+
function ifTrue(val, ifVal, elseVal) {
|
|
1619
|
+
return (
|
|
1620
|
+
//
|
|
1621
|
+
isTrue(val) ? ifVal(val) : elseVal(val)
|
|
1622
|
+
);
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
// src/boolean-logic/ifUndefined.ts
|
|
1626
|
+
function ifUndefined(val, ifUndefined2, ifDefined2) {
|
|
1627
|
+
return isUndefined(val) ? ifUndefined2() : ifDefined2(val);
|
|
1628
|
+
}
|
|
1629
|
+
function ifDefined(val, ifVal, elseVal) {
|
|
1630
|
+
return isDefined(val) ? ifVal : elseVal;
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
// src/combinators/and.ts
|
|
1634
|
+
function and(...values) {
|
|
1635
|
+
return values.every((i) => i === true);
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
// src/combinators/or.ts
|
|
1639
|
+
function or(...conditions) {
|
|
1640
|
+
const values = conditions.includes(true);
|
|
1641
|
+
return values;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
// src/css/createCssKeyframe.ts
|
|
1645
|
+
function api(state = []) {
|
|
1646
|
+
return {
|
|
1647
|
+
state,
|
|
1648
|
+
add: (stage, defn) => {
|
|
1649
|
+
return api(
|
|
1650
|
+
[...state, [stage, defn]]
|
|
1651
|
+
);
|
|
1652
|
+
},
|
|
1653
|
+
done() {
|
|
1654
|
+
return state;
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1657
|
+
}
|
|
1658
|
+
function hasDone(val) {
|
|
1659
|
+
return isObject(val) && "done" in val && typeof val.done === "function";
|
|
1660
|
+
}
|
|
1661
|
+
function frameToCss(frames) {
|
|
1662
|
+
const tuples = frames.map(([ts, defn]) => [
|
|
1663
|
+
ts,
|
|
1664
|
+
Object.keys(defn).reduce(
|
|
1665
|
+
(acc, i) => [
|
|
1666
|
+
...acc,
|
|
1667
|
+
`${i}: ${String(defn[i])}`
|
|
1668
|
+
],
|
|
1669
|
+
[]
|
|
1670
|
+
).join("; ")
|
|
1671
|
+
]);
|
|
1672
|
+
return tuples.map(([ts, defn]) => ` ${ts} { ${defn} }`).join("\n");
|
|
1673
|
+
}
|
|
1674
|
+
function createCssKeyframe(name, keyframes) {
|
|
1675
|
+
const surface = api([]);
|
|
1676
|
+
const rtn = keyframes(surface);
|
|
1677
|
+
const frames = hasDone(rtn) ? rtn.done() : rtn;
|
|
1678
|
+
return {
|
|
1679
|
+
name,
|
|
1680
|
+
keyframes: frames,
|
|
1681
|
+
css: `@keyframes ${name} {
|
|
1682
|
+
${frameToCss(frames)}
|
|
1683
|
+
}`
|
|
1684
|
+
};
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
// src/datetime/asDate.ts
|
|
1688
|
+
function asDate(input) {
|
|
1689
|
+
if (isDate(input)) {
|
|
1690
|
+
input.setHours(0, 0, 0, 0);
|
|
1691
|
+
return input;
|
|
1692
|
+
}
|
|
1693
|
+
if (isMoment(input)) {
|
|
1694
|
+
return input.toDate();
|
|
1695
|
+
}
|
|
1696
|
+
if (isLuxonDateTime(input)) {
|
|
1697
|
+
return new Date(input.toMillis());
|
|
1698
|
+
}
|
|
1699
|
+
if (isIsoDateTime(input)) {
|
|
1700
|
+
const [year, month, day] = stripAfter(input, "T").split("-").map(Number);
|
|
1701
|
+
return new Date(year, month - 1, day);
|
|
1702
|
+
}
|
|
1703
|
+
if (isIsoExplicitDate(input)) {
|
|
1704
|
+
const [year, month, day] = input.split("-").map(Number);
|
|
1705
|
+
return new Date(year, month - 1, day);
|
|
1706
|
+
}
|
|
1707
|
+
if (isIsoImplicitDate(input)) {
|
|
1708
|
+
const year = Number(input.slice(0, 4));
|
|
1709
|
+
const month = Number(input.slice(4, 6));
|
|
1710
|
+
const day = Number(input.slice(6, 8));
|
|
1711
|
+
return new Date(year, month - 1, day);
|
|
1712
|
+
}
|
|
1713
|
+
if (isIsoYear(input)) {
|
|
1714
|
+
const d = new Date(Number(input), 0, 1);
|
|
1715
|
+
d.setHours(0, 0, 0, 0);
|
|
1716
|
+
return d;
|
|
1717
|
+
}
|
|
1718
|
+
if (isNumber(input)) {
|
|
1719
|
+
if (`${input}`.length === 4) {
|
|
1720
|
+
return /* @__PURE__ */ new Date(`${input}-01-01`);
|
|
1721
|
+
}
|
|
1722
|
+
if (input >= 0) {
|
|
1723
|
+
return new Date(input * 1e3);
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
return void 0;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
// src/datetime/asIsoDate.ts
|
|
1730
|
+
function strip(str) {
|
|
1731
|
+
return stripAfter(str, "T");
|
|
1732
|
+
}
|
|
1733
|
+
function asIsoDate(input) {
|
|
1734
|
+
return isDate(input) ? strip(input.toISOString()) : isMoment(input) ? strip(input.toISOString()) : isLuxonDateTime(input) ? input.toISODate() : isIsoExplicitDate(input) ? input : isIsoExplicitDate(input) ? `${input.slice(0, 4)}-${input.slice(4, 6)}-${input.slice(6, 8)}` : isString(input) ? strip(input) : "0000-00-00";
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
// src/datetime/getDaysBetween.ts
|
|
1738
|
+
function getDaysBetween(a, b = /* @__PURE__ */ new Date()) {
|
|
1739
|
+
const aDate = asDate(a);
|
|
1740
|
+
const bDate = asDate(b);
|
|
1741
|
+
if (!aDate || !bDate) {
|
|
1742
|
+
throw new Error(`Invalid date passed into getDaysBetween()`);
|
|
1743
|
+
}
|
|
1744
|
+
const aStr = aDate.toISOString().split("T")[0];
|
|
1745
|
+
const bStr = bDate.toISOString().split("T")[0];
|
|
1746
|
+
const dateA = /* @__PURE__ */ new Date(`${aStr}T00:00:00Z`);
|
|
1747
|
+
const dateB = /* @__PURE__ */ new Date(`${bStr}T00:00:00Z`);
|
|
1748
|
+
const msInDay = 24 * 60 * 60 * 1e3;
|
|
1749
|
+
return Math.round(Math.abs((dateB.getTime() - dateA.getTime()) / msInDay));
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
// src/datetime/getToday.ts
|
|
1753
|
+
function getToday() {
|
|
1754
|
+
const today = /* @__PURE__ */ new Date();
|
|
1755
|
+
return today.toISOString().split("T")[0];
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
// src/datetime/getTomorrow.ts
|
|
1759
|
+
function getTomorrow() {
|
|
1760
|
+
const tomorrow = /* @__PURE__ */ new Date();
|
|
1761
|
+
tomorrow.setDate(tomorrow.getDate() + 1);
|
|
1762
|
+
return tomorrow.toISOString().split("T")[0];
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
// src/datetime/getWeekNumber.ts
|
|
1766
|
+
function getWeekNumber(date = /* @__PURE__ */ new Date()) {
|
|
1767
|
+
const d = asDate(date);
|
|
1768
|
+
if (!d) {
|
|
1769
|
+
throw new Error(`invalid date passed into getWeekNumber${String(date)}`);
|
|
1770
|
+
}
|
|
1771
|
+
const daysIntoYear = getDaysBetween(new Date(d.getFullYear(), 0, 1), d);
|
|
1772
|
+
const week = Math.floor(daysIntoYear / 7) + 1;
|
|
1773
|
+
return week;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
// src/datetime/getYesterday.ts
|
|
1777
|
+
function getYesterday() {
|
|
1778
|
+
const yesterday = /* @__PURE__ */ new Date();
|
|
1779
|
+
yesterday.setDate(yesterday.getDate() - 1);
|
|
1780
|
+
return yesterday.toISOString().split("T")[0];
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
// src/datetime/isLeapYear.ts
|
|
1784
|
+
function isLeapYear(val) {
|
|
1785
|
+
const year = asDate(val)?.getUTCFullYear();
|
|
1786
|
+
if (!year) {
|
|
1787
|
+
throw new Error(`Invalid date passed into isLeapYear(${String(val)})`);
|
|
1788
|
+
}
|
|
1789
|
+
return year % 100 === 0 ? year % 400 === 0 : year % 4 === 0;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
// src/dictionary/entries.ts
|
|
1793
|
+
function entries(obj) {
|
|
1794
|
+
const iterable = {
|
|
1795
|
+
*[Symbol.iterator]() {
|
|
1796
|
+
for (const k of keysOf(obj)) {
|
|
1797
|
+
yield { key: k, value: obj[k] };
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
};
|
|
1801
|
+
return iterable;
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
// src/dictionary/get.ts
|
|
1805
|
+
function updatedDotPath(value, dotpath, segment) {
|
|
1806
|
+
return isRef(value) ? dotpath.replace(segment, `Ref(${segment})`) : dotpath;
|
|
1807
|
+
}
|
|
1808
|
+
function getValue(value, dotPath, defaultValue, handleInvalid, fullDotPath) {
|
|
1809
|
+
const pathSegments = isTruthy(dotPath) ? dotPath.split(".") : [];
|
|
1810
|
+
const idx = pathSegments[0];
|
|
1811
|
+
const hasMoreSegments = pathSegments.length > 1;
|
|
1812
|
+
const valueIsIndexable = isContainer(value) && hasIndexOf(value, idx);
|
|
1813
|
+
const hasHandler = !isSpecificConstant("not-defined")(handleInvalid);
|
|
1814
|
+
const invalidDotPath = createErrorCondition(
|
|
1815
|
+
"invalid-dot-path",
|
|
1816
|
+
`The segment "${idx}" in the dotpath "${fullDotPath}" was not indexable and no default value existed on: ${JSON.stringify(value)}`
|
|
1817
|
+
);
|
|
1818
|
+
const current = hasMoreSegments ? isContainer(value) && idx in value ? getValue(
|
|
1819
|
+
indexOf(value, idx),
|
|
1820
|
+
pathSegments.join(".").replace(`${idx}.`, ""),
|
|
1821
|
+
defaultValue,
|
|
1822
|
+
handleInvalid,
|
|
1823
|
+
updatedDotPath(value, fullDotPath, idx)
|
|
1824
|
+
) : hasHandler ? handleInvalid : invalidDotPath : valueIsIndexable ? hasDefaultValue(hasDefaultValue) ? indexOf(value, idx) || defaultValue : indexOf(value, idx) : hasHandler ? handleInvalid : invalidDotPath;
|
|
1825
|
+
return current;
|
|
1826
|
+
}
|
|
1827
|
+
function get(value, dotPath, options = {
|
|
1828
|
+
defaultValue: NO_DEFAULT_VALUE,
|
|
1829
|
+
handleInvalidDotpath: NOT_DEFINED
|
|
1830
|
+
}) {
|
|
1831
|
+
const outcome = dotPath === null || dotPath === "" ? value : getValue(
|
|
1832
|
+
value,
|
|
1833
|
+
dotPath,
|
|
1834
|
+
options?.defaultValue || NO_DEFAULT_VALUE,
|
|
1835
|
+
options?.handleInvalidDotpath || NOT_DEFINED,
|
|
1836
|
+
String(dotPath)
|
|
1837
|
+
);
|
|
1838
|
+
return outcome;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
// src/dictionary/keysOf.ts
|
|
1842
|
+
function keysOf(container) {
|
|
1843
|
+
const keys = Array.isArray(container) ? Object.keys(container).map((i) => Number(i)) : isObject(container) ? isRef(container) ? ["value"] : Object.keys(container) : [];
|
|
1844
|
+
return keys;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
// src/dictionary/omit.ts
|
|
1848
|
+
function omit(obj, ...removeKeys) {
|
|
1849
|
+
const keys = Object.keys(obj);
|
|
1850
|
+
return keys.reduce(
|
|
1851
|
+
(acc, key) => removeKeys.includes(key) ? acc : {
|
|
1852
|
+
...acc,
|
|
1853
|
+
[key]: obj[key]
|
|
1854
|
+
},
|
|
1855
|
+
{}
|
|
1856
|
+
);
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
// src/dictionary/retain.ts
|
|
1860
|
+
function retain(dict, ...keys) {
|
|
1861
|
+
let output = {};
|
|
1862
|
+
for (const k of keys) {
|
|
1863
|
+
output = {
|
|
1864
|
+
...output,
|
|
1865
|
+
[k]: dict[k]
|
|
1866
|
+
};
|
|
1867
|
+
}
|
|
1868
|
+
return output;
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
// src/dictionary/sharedKeys.ts
|
|
1872
|
+
function sharedKeys(a, b) {
|
|
1873
|
+
const ka = Object.keys(a);
|
|
1874
|
+
const kb = Object.keys(b);
|
|
1875
|
+
return ka.filter((k) => kb.includes(k));
|
|
1876
|
+
}
|
|
1877
|
+
|
|
1878
|
+
// src/dictionary/takeProp.ts
|
|
1879
|
+
function takeProp(val, prop, otherwise) {
|
|
1880
|
+
return (isObject(val) || isArray(val)) && prop in val ? val[prop] : otherwise;
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
// src/dictionary/valuesOf.ts
|
|
1884
|
+
function valuesOf(obj) {
|
|
1885
|
+
const values = [];
|
|
1886
|
+
for (const k of Object.keys(obj)) {
|
|
1887
|
+
values.push(obj[k]);
|
|
1888
|
+
}
|
|
1889
|
+
return values;
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
// src/dictionary/withDefaults.ts
|
|
1893
|
+
function withDefaults(with_defaults) {
|
|
1894
|
+
return (obj) => {
|
|
1895
|
+
const merged = {
|
|
1896
|
+
...with_defaults,
|
|
1897
|
+
...obj
|
|
1898
|
+
};
|
|
1899
|
+
return merged;
|
|
1900
|
+
};
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
// src/dictionary/withKeys.ts
|
|
1904
|
+
function withKeys(dict, ...keys) {
|
|
1905
|
+
return retain(dict, ...keys);
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
// src/dictionary/withoutKeys.ts
|
|
1909
|
+
function withoutKeys(dict, ...exclude) {
|
|
1910
|
+
return omit(dict, ...exclude);
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
// src/dictionary/withoutValue.ts
|
|
1914
|
+
function withoutValue(val) {
|
|
1915
|
+
return (obj) => {
|
|
1916
|
+
return Object.keys(obj).reduce(
|
|
1917
|
+
(acc, key) => val === obj[key] ? acc : { ...acc, [key]: obj[key] },
|
|
1918
|
+
{}
|
|
1919
|
+
);
|
|
1920
|
+
};
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
// src/errors/createErrorCondition.ts
|
|
1924
|
+
function createErrorCondition(kind, msg = "", utility = "") {
|
|
1925
|
+
return {
|
|
1926
|
+
__kind: "ErrorCondition",
|
|
1927
|
+
kind,
|
|
1928
|
+
msg,
|
|
1929
|
+
utility
|
|
1930
|
+
};
|
|
1931
|
+
}
|
|
1932
|
+
function errCondition(kind, msg) {
|
|
1933
|
+
return {
|
|
1934
|
+
__kind: "ErrorCondition",
|
|
1935
|
+
kind,
|
|
1936
|
+
msg
|
|
1937
|
+
};
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1940
|
+
// src/functional/result.ts
|
|
1941
|
+
var result = "NOT READY";
|
|
1942
|
+
|
|
1943
|
+
// src/functions/fnMeta.ts
|
|
1944
|
+
function fnMeta(func) {
|
|
1945
|
+
const fn2 = (...args) => func(...args);
|
|
1946
|
+
const props = Object.keys(fn2).reduce(
|
|
1947
|
+
(acc, key) => ({ ...acc, [key]: fn2[key] }),
|
|
1948
|
+
{}
|
|
1949
|
+
);
|
|
1950
|
+
return {
|
|
1951
|
+
fn: fn2,
|
|
1952
|
+
props
|
|
1953
|
+
};
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
// src/functions/wrapFn.ts
|
|
1957
|
+
var wrapFn = "NOT IMPLEMENTED";
|
|
1958
|
+
|
|
1959
|
+
// src/initializers/addFnToProps.ts
|
|
1960
|
+
function addPropsToFn(fn2, clone_fn) {
|
|
1961
|
+
const localFn = clone_fn ? (...args) => fn2(args) : fn2;
|
|
1962
|
+
return (obj) => {
|
|
1963
|
+
for (const k in obj) {
|
|
1964
|
+
localFn[k] = obj[k];
|
|
1965
|
+
}
|
|
1966
|
+
return localFn;
|
|
1967
|
+
};
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
// src/initializers/addPropsToFn.ts
|
|
1971
|
+
function addFnToProps(props, _clone_fn) {
|
|
1972
|
+
return (fn2) => {
|
|
1973
|
+
const localFn = (...args) => fn2(args);
|
|
1974
|
+
for (const k in props) {
|
|
1975
|
+
localFn[k] = props[k];
|
|
1976
|
+
}
|
|
1977
|
+
return localFn;
|
|
1978
|
+
};
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
// src/initializers/createCssSelector.ts
|
|
1982
|
+
function createCssSelector(_opt) {
|
|
1983
|
+
return (...selectors) => {
|
|
1984
|
+
return selectors.join(" ");
|
|
1985
|
+
};
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
// src/initializers/createFnWithProps.ts
|
|
1989
|
+
function createFnWithProps(fn2, props, narrowing = false) {
|
|
1990
|
+
const fnWithProps = fn2;
|
|
1991
|
+
for (const prop of Object.keys(props)) {
|
|
1992
|
+
fnWithProps[prop] = props[prop];
|
|
1993
|
+
}
|
|
1994
|
+
return isTrue(narrowing) ? fnWithProps : fnWithProps;
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
// src/initializers/defineObj.ts
|
|
1998
|
+
function defineObj(literal2 = {}) {
|
|
1999
|
+
return (wide2 = {}) => {
|
|
2000
|
+
const obj = literal2 ? { ...literal2, ...wide2 } : wide2;
|
|
2001
|
+
return obj;
|
|
2002
|
+
};
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
// src/initializers/defineTuple.ts
|
|
2006
|
+
function defineTuple(...values) {
|
|
2007
|
+
return values.map(
|
|
2008
|
+
(i) => isFunction(i) ? handleDoneFn(i(ShapeApiImplementation)) : i
|
|
2009
|
+
);
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2012
|
+
// src/lists/asArray.ts
|
|
2013
|
+
function asArray(thing) {
|
|
2014
|
+
return Array.isArray(thing) === true ? thing : typeof thing === "undefined" ? [] : [thing];
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
// src/lists/createConverter.ts
|
|
2018
|
+
function createConverter(mapper) {
|
|
2019
|
+
return (input) => {
|
|
2020
|
+
let result2;
|
|
2021
|
+
if (isNothing(input)) {
|
|
2022
|
+
result2 = mapper.nothing ? mapper.nothing(input) : Never;
|
|
2023
|
+
} else if (isObject(input)) {
|
|
2024
|
+
result2 = mapper.object ? mapper.object(input) : Never;
|
|
2025
|
+
} else {
|
|
2026
|
+
switch (typeof input) {
|
|
2027
|
+
case "string":
|
|
2028
|
+
result2 = mapper.string ? mapper.string(input) : Never;
|
|
2029
|
+
break;
|
|
2030
|
+
case "number":
|
|
2031
|
+
case "bigint":
|
|
2032
|
+
result2 = mapper.number ? mapper.number(input) : Never;
|
|
2033
|
+
break;
|
|
2034
|
+
case "boolean":
|
|
2035
|
+
result2 = mapper.boolean ? mapper.boolean(input) : Never;
|
|
2036
|
+
break;
|
|
2037
|
+
default:
|
|
2038
|
+
throw new Error(`Unhandled type: ${typeof input}`);
|
|
2039
|
+
}
|
|
2040
|
+
}
|
|
2041
|
+
return result2;
|
|
2042
|
+
};
|
|
2043
|
+
}
|
|
2044
|
+
|
|
2045
|
+
// src/lists/filter.ts
|
|
2046
|
+
var filter = "NOT READY";
|
|
2047
|
+
|
|
2048
|
+
// src/lists/find.ts
|
|
2049
|
+
function find(list2, deref = null) {
|
|
2050
|
+
return (comparator) => {
|
|
2051
|
+
return list2.find((i) => {
|
|
2052
|
+
const val = deref ? isContainer(i) ? deref in i ? i[deref] : void 0 : i : i;
|
|
2053
|
+
return val === comparator;
|
|
2054
|
+
});
|
|
2055
|
+
};
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2058
|
+
// src/lists/getEach.ts
|
|
2059
|
+
function getEach(list2, dotPath) {
|
|
2060
|
+
const result2 = list2.map(
|
|
2061
|
+
(i) => isNull(dotPath) ? i : isContainer(i) ? get(i, dotPath) : Never
|
|
2062
|
+
).filter((i) => !isErrorCondition(i));
|
|
2063
|
+
return result2;
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
// src/lists/indexOf.ts
|
|
2067
|
+
function indexOf(val, index) {
|
|
2068
|
+
const isNegative = isNumber(index) && index < 0;
|
|
2069
|
+
if (isNegative && !Array.isArray(val)) {
|
|
2070
|
+
throw new Error(`The indexOf(val,idx) utility received a negative index value [${index}] but the value being de-references is not an array [${typeof val}]!`);
|
|
2071
|
+
}
|
|
2072
|
+
if (isNegative && Array.isArray(val) && val.length < Math.abs(index)) {
|
|
2073
|
+
throw new Error(`The indexOf(val,idx) utility received a negative index of ${index} but the length of the array passed in is only ${val.length}! This is not allowed.`);
|
|
2074
|
+
}
|
|
2075
|
+
const idx = isNegative && Array.isArray(val) ? val.length + 1 - Math.abs(index) : index;
|
|
2076
|
+
return index === null ? val : isNull(idx) ? val : isArray(val) ? Number(idx) in val ? val[Number(idx)] : errCondition("invalid-index", `attempt to index a numeric array with an invalid index: ${Number(idx)}`) : isObject(val) ? String(idx) in val ? val[String(idx)] : errCondition("invalid-index", `attempt to index a dictionary object with an invalid index: ${String(idx)}`) : errCondition("invalid-container-type", `Attempt to use indexOf() on an invalid container type: ${typeof val}`);
|
|
2077
|
+
}
|
|
2078
|
+
|
|
2079
|
+
// src/lists/intersection.ts
|
|
2080
|
+
function intersectWithOffset(a, b, deref) {
|
|
2081
|
+
const aIndexable = a.every((i) => isIndexable(i));
|
|
2082
|
+
const bIndexable = b.every((i) => isIndexable(i));
|
|
2083
|
+
if (!aIndexable || !bIndexable) {
|
|
2084
|
+
if (!aIndexable) {
|
|
2085
|
+
throw new Error(`The "a" array passed into intersect(a,b) was not fully composed of indexable properties: ${a.map((i) => typeof i).join(", ")}`);
|
|
2086
|
+
} else {
|
|
2087
|
+
throw new Error(`The "b" array passed into intersect(a,b) was not fully composed of indexable properties: ${b.map((i) => typeof i).join(", ")}`);
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
const aMatches = getEach(a, deref);
|
|
2091
|
+
const bMatches = getEach(b, deref);
|
|
2092
|
+
const sharedKeys2 = ifNotNull(
|
|
2093
|
+
deref,
|
|
2094
|
+
(v) => [
|
|
2095
|
+
a.filter((i) => Array.from(bMatches).includes(get(i, v))),
|
|
2096
|
+
b.filter((i) => Array.from(aMatches).includes(get(i, v)))
|
|
2097
|
+
],
|
|
2098
|
+
() => a.filter((k) => b.includes(k))
|
|
2099
|
+
);
|
|
2100
|
+
return sharedKeys2;
|
|
2101
|
+
}
|
|
2102
|
+
function intersectNoOffset(a, b) {
|
|
2103
|
+
return a.length < b.length ? a.filter((val) => b.includes(val)) : b.filter((val) => a.includes(val));
|
|
2104
|
+
}
|
|
2105
|
+
function intersection(a, b, deref = null) {
|
|
2106
|
+
return deref === null ? intersectNoOffset(a, b) : intersectWithOffset(a, b, deref);
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
// src/lists/joinWith.ts
|
|
2110
|
+
function joinWith(joinWith2) {
|
|
2111
|
+
return (...tuple3) => {
|
|
2112
|
+
const tup = tuple3;
|
|
2113
|
+
return tup.join(joinWith2);
|
|
2114
|
+
};
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
// src/lists/last.ts
|
|
2118
|
+
function last(list2) {
|
|
2119
|
+
return [...list2].pop();
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
// src/lists/logicalReturns.ts
|
|
2123
|
+
function logicalReturns(conditions) {
|
|
2124
|
+
return conditions.map(
|
|
2125
|
+
(c) => isBoolean(c) ? c : isFunction(c) ? c() : Never
|
|
2126
|
+
);
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
// src/lists/reverse.ts
|
|
2130
|
+
function reverse(list2) {
|
|
2131
|
+
return [...list2].reverse();
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
// src/lists/shift.ts
|
|
2135
|
+
function shift(list2) {
|
|
2136
|
+
let rtn;
|
|
2137
|
+
if (isDefined(list2)) {
|
|
2138
|
+
rtn = list2.length === 0 ? void 0 : list2[0];
|
|
2139
|
+
try {
|
|
2140
|
+
list2 = list2.slice(1);
|
|
2141
|
+
} catch {
|
|
2142
|
+
}
|
|
2143
|
+
} else {
|
|
2144
|
+
rtn = void 0;
|
|
2145
|
+
}
|
|
2146
|
+
return rtn;
|
|
2147
|
+
}
|
|
2148
|
+
|
|
2149
|
+
// src/lists/slice.ts
|
|
2150
|
+
function slice(list2, start, end) {
|
|
2151
|
+
return list2.slice(start, end);
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2154
|
+
// src/lists/unique.ts
|
|
2155
|
+
function unique(...values) {
|
|
2156
|
+
const u = [];
|
|
2157
|
+
for (const i of values.flat()) {
|
|
2158
|
+
if (!u.includes(i)) {
|
|
2159
|
+
u.push(i);
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
return u;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
// src/literals/box.ts
|
|
2166
|
+
function box(value) {
|
|
2167
|
+
const rtn = {
|
|
2168
|
+
__type: "box",
|
|
2169
|
+
value,
|
|
2170
|
+
unbox: (...p) => {
|
|
2171
|
+
return typeof value === "function" ? value(...p) : value;
|
|
2172
|
+
}
|
|
2173
|
+
};
|
|
2174
|
+
return rtn;
|
|
2175
|
+
}
|
|
2176
|
+
function isBox(thing) {
|
|
2177
|
+
return typeof thing === "object" && "__type" in thing && thing.__type === "box";
|
|
2178
|
+
}
|
|
2179
|
+
function boxDictionaryValues(dict) {
|
|
2180
|
+
const keys = Object.keys(dict);
|
|
2181
|
+
return keys.reduce(
|
|
2182
|
+
(acc, key) => ({ ...acc, [key]: box(dict[key]) }),
|
|
2183
|
+
{}
|
|
2184
|
+
);
|
|
2185
|
+
}
|
|
2186
|
+
function unbox(val) {
|
|
2187
|
+
return isBox(val) ? val.value : val;
|
|
2188
|
+
}
|
|
2189
|
+
|
|
2190
|
+
// src/literals/capitalize.ts
|
|
2191
|
+
function capitalize(str) {
|
|
2192
|
+
return `${str?.slice(0, 1).toUpperCase()}${str?.slice(1)}`;
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
// src/literals/color/cssColor.ts
|
|
2196
|
+
function cssColor(color, v1, v2, v3, opacity) {
|
|
2197
|
+
return `color(${color} ${v1} ${v2} ${v3}${opacity ? ` / ${opacity}` : ""}`;
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
// src/literals/color/twColor.ts
|
|
2201
|
+
function twColor(color, luminosity) {
|
|
2202
|
+
const lum = TW_LUMINOSITY[luminosity];
|
|
2203
|
+
const chroma = TW_CHROMA[luminosity];
|
|
2204
|
+
const hue = TW_HUE[color];
|
|
2205
|
+
return `oklch(${lum} ${chroma} ${hue})`;
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
// src/literals/ensureLeading.ts
|
|
2209
|
+
function ensureLeading(content, ensure) {
|
|
2210
|
+
const output = String(content);
|
|
2211
|
+
return output.startsWith(String(ensure)) ? content : isString(content) ? `${ensure}${content}` : Number(`${ensure}${content}`);
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2214
|
+
// src/literals/ensureSurround.ts
|
|
2215
|
+
function ensureSurround(prefix, postfix) {
|
|
2216
|
+
const fn2 = (input) => {
|
|
2217
|
+
let result2 = input;
|
|
2218
|
+
result2 = ensureLeading(result2, prefix);
|
|
2219
|
+
result2 = ensureTrailing(result2, postfix);
|
|
2220
|
+
return result2;
|
|
2221
|
+
};
|
|
2222
|
+
return fn2;
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
// src/literals/ensureTrailing.ts
|
|
2226
|
+
function ensureTrailing(content, ensure) {
|
|
2227
|
+
return (
|
|
2228
|
+
//
|
|
2229
|
+
content.endsWith(ensure) ? content : `${content}${ensure}`
|
|
2230
|
+
);
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
// src/literals/identity.ts
|
|
2234
|
+
function identity(...values) {
|
|
2235
|
+
return values.length === 1 ? values[0] : values.length === 0 ? void 0 : values;
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
// src/literals/ifLowercase.ts
|
|
2239
|
+
function ifLowercaseChar(ch, callbackForMatch, callbackForNoMatch) {
|
|
2240
|
+
if (ch.length !== 1) {
|
|
2241
|
+
throw new Error(`call to ifUppercaseChar received ${ch.length} characters but is only valid when one character is passed in!`);
|
|
2242
|
+
}
|
|
2243
|
+
return LOWER_ALPHA_CHARS.includes(ch) ? callbackForMatch(ch) : callbackForNoMatch(ch);
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
// src/literals/ifUppercase.ts
|
|
2247
|
+
function ifUppercaseChar(ch, callbackForMatch, callbackForNoMatch) {
|
|
2248
|
+
if (ch.length !== 1) {
|
|
2249
|
+
throw new Error(`Invalid string length passed to ifUppercaseChar(ch); this function requires a single character but ${ch.length} were received`);
|
|
2250
|
+
}
|
|
2251
|
+
return LOWER_ALPHA_CHARS.includes(ch) ? callbackForMatch(ch) : callbackForNoMatch(ch);
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
// src/literals/literal.ts
|
|
2255
|
+
function idLiteral(o) {
|
|
2256
|
+
return { ...o, id: o.id };
|
|
2257
|
+
}
|
|
2258
|
+
function nameLiteral(o) {
|
|
2259
|
+
return o;
|
|
2260
|
+
}
|
|
2261
|
+
function kindLiteral(o) {
|
|
2262
|
+
return o;
|
|
2263
|
+
}
|
|
2264
|
+
function idTypeGuard(_o) {
|
|
2265
|
+
return true;
|
|
2266
|
+
}
|
|
2267
|
+
function literal(obj) {
|
|
2268
|
+
return obj;
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
// src/literals/lowercase.ts
|
|
2272
|
+
function lowercase(str) {
|
|
2273
|
+
return str.toLowerCase();
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2276
|
+
// src/literals/narrow.ts
|
|
2277
|
+
function narrow(...values) {
|
|
2278
|
+
return values.length === 1 ? values[0] : values;
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
// src/literals/pathJoin.ts
|
|
2282
|
+
function pathJoin(...segments) {
|
|
2283
|
+
const clean_path = segments.map((i) => stripTrailing(stripLeading(i, "/"), "/")).join("/");
|
|
2284
|
+
const original_path = segments.join("/");
|
|
2285
|
+
const pre = original_path.startsWith("/") ? "/" : "";
|
|
2286
|
+
const post = original_path.endsWith("/") ? "/" : "";
|
|
2287
|
+
return `${pre}${clean_path}${post}`;
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
// src/literals/phone/asPhoneNumber.ts
|
|
2291
|
+
var asPhoneFormat = () => `NOT IMPLEMENTED`;
|
|
2292
|
+
|
|
2293
|
+
// src/literals/phone/getPhoneCountryCode.ts
|
|
2294
|
+
function getPhoneCountryCode(phone) {
|
|
2295
|
+
return phone.trim().startsWith("+") || phone.trim().startsWith("00") ? retainWhile(
|
|
2296
|
+
stripLeading(stripLeading(phone.trim(), "+"), "00"),
|
|
2297
|
+
...NUMERIC_CHAR
|
|
2298
|
+
) : "";
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
// src/literals/phone/removePhoneCountryCode.ts
|
|
2302
|
+
function removePhoneCountryCode(phone) {
|
|
2303
|
+
const countryCode = getPhoneCountryCode(phone);
|
|
2304
|
+
return countryCode !== "" ? stripLeading(stripLeading(
|
|
2305
|
+
phone.trim(),
|
|
2306
|
+
"+",
|
|
2307
|
+
"00"
|
|
2308
|
+
), countryCode).trim() : phone.trim();
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
// src/literals/pluralize.ts
|
|
2312
|
+
var isException = (word) => Object.keys(PLURAL_EXCEPTIONS).includes(word);
|
|
2313
|
+
function endingIn(word, postfix) {
|
|
2314
|
+
switch (postfix) {
|
|
2315
|
+
case "is":
|
|
2316
|
+
return word.endsWith(postfix) ? `${word}es` : void 0;
|
|
2317
|
+
case "singular-noun":
|
|
2318
|
+
return SINGULAR_NOUN_ENDINGS.some((i) => word.endsWith(i)) ? split(word).every((i) => [...ALPHA_CHARS].includes(i)) ? `${word}es` : void 0 : void 0;
|
|
2319
|
+
case "f":
|
|
2320
|
+
return word.endsWith("f") ? `${stripTrailing(word, "f")}ves` : word.endsWith("fe") ? `${stripTrailing(word, "fe")}ves` : void 0;
|
|
2321
|
+
case "y":
|
|
2322
|
+
return word.endsWith("y") ? `${stripTrailing(word, "y")}ies` : void 0;
|
|
2323
|
+
default:
|
|
2324
|
+
throw new Error(`endingIn received "${postfix}" as a postfix but this ending is not known!`);
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
function pluralize(word) {
|
|
2328
|
+
const right = rightWhitespace(word);
|
|
2329
|
+
const w = word.trimEnd();
|
|
2330
|
+
const result2 = isException(w) ? PLURAL_EXCEPTIONS[w] : endingIn(w, "is") || endingIn(w, "singular-noun") || endingIn(w, "f") || endingIn(w, "y") || `${w}s`;
|
|
2331
|
+
return `${result2}${right}`;
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
// src/literals/retainAfter.ts
|
|
2335
|
+
function retainAfter(content, ...find2) {
|
|
2336
|
+
const idx = Math.min(
|
|
2337
|
+
...find2.map((i) => content.indexOf(i)).filter((i) => i > -1)
|
|
2338
|
+
);
|
|
2339
|
+
const min = Math.min(...find2.map((i) => i.length));
|
|
2340
|
+
let len = Math.max(...find2.map((i) => i.length));
|
|
2341
|
+
if (min !== len) {
|
|
2342
|
+
if (!find2.includes(content.slice(idx, len))) {
|
|
2343
|
+
len = min;
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
return idx && idx > 0 ? content.slice(idx + len) : "";
|
|
2347
|
+
}
|
|
2348
|
+
function retainAfterInclusive(content, ...find2) {
|
|
2349
|
+
const minFound = Math.min(
|
|
2350
|
+
...find2.map((i) => content.indexOf(i)).filter((i) => i > -1)
|
|
2351
|
+
);
|
|
2352
|
+
return minFound > 0 ? content.slice(minFound) : "";
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2355
|
+
// src/type-conversion/asChars.ts
|
|
2356
|
+
function asChars(str) {
|
|
2357
|
+
return str.split("");
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
// src/literals/retainChars.ts
|
|
2361
|
+
function retainChars(content, ...retain2) {
|
|
2362
|
+
const chars = asChars(content);
|
|
2363
|
+
return chars.filter((c) => retain2.includes(c)).join("");
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
// src/type-conversion/asRecord.ts
|
|
2367
|
+
function asRecord(obj) {
|
|
2368
|
+
return obj;
|
|
2369
|
+
}
|
|
2370
|
+
|
|
2371
|
+
// src/type-conversion/asString.ts
|
|
2372
|
+
function asString(value) {
|
|
2373
|
+
return isString(value) ? value : isNumber(value) ? `${value}` : isBoolean(value) ? `${value}` : isArray(value) ? value.join("") : String(value);
|
|
2374
|
+
}
|
|
2375
|
+
|
|
2376
|
+
// src/type-guards/isFunction.ts
|
|
2377
|
+
function isFunction(value) {
|
|
2378
|
+
return typeof value === "function";
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
// src/type-guards/isObject.ts
|
|
2382
|
+
function isObject(value) {
|
|
2383
|
+
return typeof value === "object" && value !== null && Array.isArray(value) === false;
|
|
2384
|
+
}
|
|
2385
|
+
|
|
2386
|
+
// src/type-guards/api-tg.ts
|
|
2387
|
+
function isEscapeFunction(val) {
|
|
2388
|
+
return isFunction(val) && "escape" in val && val.escape === true;
|
|
2389
|
+
}
|
|
2390
|
+
function isOptionalParamFunction(val) {
|
|
2391
|
+
return isFunction(val) && "optionalParams" in val && val.optionalParams === true;
|
|
2392
|
+
}
|
|
2393
|
+
function isApi(api2) {
|
|
2394
|
+
return isObject(api2) && "surface" in api2 && "_kind" in api2 && api2._kind === "api";
|
|
2395
|
+
}
|
|
2396
|
+
function isApiSurface(val) {
|
|
2397
|
+
return isObject(val) && Object.keys(val).some((k) => isEscapeFunction(val[k]));
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
// src/type-guards/date-time/isDate.ts
|
|
2401
|
+
function isDate(val) {
|
|
2402
|
+
return val instanceof Date;
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2405
|
+
// src/type-guards/date-time/isDateTime.ts
|
|
2406
|
+
function isIsoDateTime(val) {
|
|
2407
|
+
if (!isString(val)) {
|
|
2408
|
+
return false;
|
|
2409
|
+
}
|
|
2410
|
+
const ISO_DATETIME_REGEX = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})?$/;
|
|
2411
|
+
if (!ISO_DATETIME_REGEX.test(val)) {
|
|
2412
|
+
return false;
|
|
2413
|
+
}
|
|
2414
|
+
const [_, ...matches] = val.match(ISO_DATETIME_REGEX) || [];
|
|
2415
|
+
const [year, month, day, hours, minutes, seconds] = matches.map(Number);
|
|
2416
|
+
if (hours >= 24 || minutes >= 60 || seconds != null && seconds >= 60) {
|
|
2417
|
+
return false;
|
|
2418
|
+
}
|
|
2419
|
+
if (month < 1 || month > 12) {
|
|
2420
|
+
return false;
|
|
2421
|
+
}
|
|
2422
|
+
const daysInMonth = new Date(year, month, 0).getDate();
|
|
2423
|
+
if (day < 1 || day > daysInMonth) {
|
|
2424
|
+
return false;
|
|
2425
|
+
}
|
|
2426
|
+
const tzMatch = val.match(/([+-])(\d{2}):(\d{2})$/);
|
|
2427
|
+
if (tzMatch) {
|
|
2428
|
+
const [_2, _sign, tzHours, tzMinutes] = tzMatch;
|
|
2429
|
+
const numHours = Number.parseInt(tzHours, 10);
|
|
2430
|
+
const numMinutes = Number.parseInt(tzMinutes, 10);
|
|
2431
|
+
if (numHours > 14 || numMinutes > 59) {
|
|
2432
|
+
return false;
|
|
2433
|
+
}
|
|
2434
|
+
if (numHours === 14 && numMinutes > 0) {
|
|
2435
|
+
return false;
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
return true;
|
|
2439
|
+
}
|
|
2440
|
+
|
|
2441
|
+
// src/type-guards/date-time/isIsoDate.ts
|
|
2442
|
+
function isIsoExplicitDate(val) {
|
|
2443
|
+
if (isString(val)) {
|
|
2444
|
+
const parts = val.split("-").map((i) => Number(i));
|
|
2445
|
+
return val.includes("-") ? val.split("-").every((i) => isNumberLike(i)) ? parts[0] >= 0 && parts[0] <= 9999 && parts[1] >= 1 && parts[1] <= 12 && parts[2] >= 1 && parts[2] <= 31 : false : false;
|
|
2446
|
+
} else {
|
|
2447
|
+
return false;
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
function isIsoImplicitDate(val) {
|
|
2451
|
+
if (isString(val) && val.length === 8 && isNumberLike(val)) {
|
|
2452
|
+
const year = Number(val.slice(0, 4));
|
|
2453
|
+
const month = Number(val.slice(4, 6));
|
|
2454
|
+
const date = Number(val.slice(6, 8));
|
|
2455
|
+
return year >= 0 && year <= 9999 && month >= 1 && month <= 12 && date >= 1 && date <= 31;
|
|
2456
|
+
} else {
|
|
2457
|
+
return false;
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2460
|
+
function isIsoDate(val) {
|
|
2461
|
+
if (isString(val)) {
|
|
2462
|
+
return val.includes("-") ? isIsoExplicitDate(val) : isIsoImplicitDate(val);
|
|
2463
|
+
} else {
|
|
2464
|
+
return false;
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
|
|
2468
|
+
// src/type-guards/date-time/isIsoTime.ts
|
|
2469
|
+
function isIsoExplicitTime(val) {
|
|
2470
|
+
if (isString(val)) {
|
|
2471
|
+
const parts = stripLeading(stripAfter(val, "Z"), "T").split(/[:.]/).map((i) => Number(i));
|
|
2472
|
+
return val.startsWith("T") && val.includes(":") && val.split(":").length === 3 && parts[0] >= 0 && parts[0] <= 23 && parts[1] >= 0 && parts[1] <= 59;
|
|
2473
|
+
} else {
|
|
2474
|
+
return false;
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2477
|
+
function isIsoImplicitTime(val) {
|
|
2478
|
+
if (isString(val)) {
|
|
2479
|
+
const parts = stripAfter(val, "Z").split(/[:.]/).map((i) => Number(i));
|
|
2480
|
+
return val.includes(":") && val.split(":").length === 3 && parts[0] >= 0 && parts[0] <= 23 && parts[1] >= 0 && parts[1] <= 59;
|
|
2481
|
+
} else {
|
|
2482
|
+
return false;
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2485
|
+
function isIsoTime(val) {
|
|
2486
|
+
return isIsoExplicitTime(val) || isIsoImplicitTime(val);
|
|
2487
|
+
}
|
|
2488
|
+
|
|
2489
|
+
// src/type-guards/date-time/isIsoYear.ts
|
|
2490
|
+
function isIsoYear(val) {
|
|
2491
|
+
return !!(isString(val) && val.length === 4 && isNumber(Number(val)) && Number(val) >= 0 && Number(val) <= 9999);
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
// src/type-guards/date-time/isLuxonDateTime.ts
|
|
2495
|
+
function isLuxonDateTime(val) {
|
|
2496
|
+
return isObject(val) && typeof val === "object" && val !== null && "isValid" in val && "invalidReason" in val && "invalidExplanation" in val && "toISO" in val && "toFormat" in val && "toMillis" in val && "year" in val && "month" in val && "day" in val && "hour" in val && "minute" in val && "second" in val && "millisecond" in val && typeof val.isValid === "boolean" && typeof val.toISO === "function";
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2499
|
+
// src/type-guards/date-time/isMoment.ts
|
|
2500
|
+
function isMoment(val) {
|
|
2501
|
+
if (val instanceof Date) {
|
|
2502
|
+
return false;
|
|
2503
|
+
}
|
|
2504
|
+
return isObject(val) && typeof val.format === "function" && typeof val.year === "function" && typeof val.month === "function" && typeof val.date === "function" && "_isAMomentObject" in val && "_isValid" in val && typeof val.add === "function" && typeof val.subtract === "function" && typeof val.toISOString === "function" && typeof val.isValid === "function";
|
|
2505
|
+
}
|
|
2506
|
+
|
|
2507
|
+
// src/type-guards/date-time/isThisMonth.ts
|
|
2508
|
+
function isThisMonth(val) {
|
|
2509
|
+
const now = /* @__PURE__ */ new Date();
|
|
2510
|
+
const currentYear = now.getFullYear();
|
|
2511
|
+
const currentMonth = now.getMonth() + 1;
|
|
2512
|
+
if (val instanceof Date) {
|
|
2513
|
+
return val.getFullYear() === currentYear && val.getMonth() + 1 === currentMonth;
|
|
2514
|
+
}
|
|
2515
|
+
if (isMoment(val)) {
|
|
2516
|
+
const monthValue = val.month();
|
|
2517
|
+
return val.year() === currentYear && (typeof monthValue === "number" ? monthValue + 1 : monthValue) === currentMonth;
|
|
2518
|
+
}
|
|
2519
|
+
if (isLuxonDateTime(val)) {
|
|
2520
|
+
return val.year === currentYear && val.month === currentMonth;
|
|
2521
|
+
}
|
|
2522
|
+
if (typeof val === "string") {
|
|
2523
|
+
const isoDateRegex = /^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])(?:T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[-+][01]\d:[0-5]\d))?$/;
|
|
2524
|
+
if (!isoDateRegex.test(val)) {
|
|
2525
|
+
return false;
|
|
2526
|
+
}
|
|
2527
|
+
const dateMatch = val.match(/^(\d{4})-(\d{2})/);
|
|
2528
|
+
if (dateMatch) {
|
|
2529
|
+
const year = Number.parseInt(dateMatch[1], 10);
|
|
2530
|
+
const month = Number.parseInt(dateMatch[2], 10);
|
|
2531
|
+
return year === currentYear && month === currentMonth;
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
return false;
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2537
|
+
// src/type-guards/date-time/isThisWeek.ts
|
|
2538
|
+
function isThisWeek(date) {
|
|
2539
|
+
const targetDate = asDate(date);
|
|
2540
|
+
if (!targetDate) {
|
|
2541
|
+
return false;
|
|
2542
|
+
}
|
|
2543
|
+
const currentWeek = getWeekNumber();
|
|
2544
|
+
const targetWeek = getWeekNumber(targetDate);
|
|
2545
|
+
return currentWeek === targetWeek;
|
|
2546
|
+
}
|
|
2547
|
+
|
|
2548
|
+
// src/type-guards/date-time/isThisYear.ts
|
|
2549
|
+
function isThisYear(val) {
|
|
2550
|
+
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
2551
|
+
if (isObject(val) || isNumber(val) || isString(val)) {
|
|
2552
|
+
const date = asDate(val);
|
|
2553
|
+
if (date) {
|
|
2554
|
+
return date.getFullYear() === currentYear;
|
|
2555
|
+
} else {
|
|
2556
|
+
return false;
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
return false;
|
|
2560
|
+
}
|
|
2561
|
+
|
|
2562
|
+
// src/type-guards/date-time/isToday.ts
|
|
2563
|
+
function isToday(test) {
|
|
2564
|
+
if (isString(test)) {
|
|
2565
|
+
const justDate = stripAfter(test, "T");
|
|
2566
|
+
return isIsoExplicitDate(justDate) && justDate === getToday();
|
|
2567
|
+
} else if (isMoment(test) || isDate(test)) {
|
|
2568
|
+
return stripAfter(test.toISOString(), "T") === getToday();
|
|
2569
|
+
} else if (isLuxonDateTime(test)) {
|
|
2570
|
+
return stripAfter(test.toISO(), "T") === getToday();
|
|
2571
|
+
}
|
|
2572
|
+
return false;
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2575
|
+
// src/type-guards/date-time/isTomorrow.ts
|
|
2576
|
+
function isTomorrow(test) {
|
|
2577
|
+
if (isString(test)) {
|
|
2578
|
+
const justDate = stripAfter(test, "T");
|
|
2579
|
+
return isIsoExplicitDate(justDate) && justDate === getTomorrow();
|
|
2580
|
+
} else if (isMoment(test) || isDate(test)) {
|
|
2581
|
+
return stripAfter(test.toISOString(), "T") === getTomorrow();
|
|
2582
|
+
} else if (isLuxonDateTime(test)) {
|
|
2583
|
+
return stripAfter(test.toISO(), "T") === getTomorrow();
|
|
2584
|
+
}
|
|
2585
|
+
return false;
|
|
2586
|
+
}
|
|
2587
|
+
|
|
2588
|
+
// src/type-guards/date-time/isYesterday.ts
|
|
2589
|
+
function isYesterday(test) {
|
|
2590
|
+
if (isString(test)) {
|
|
2591
|
+
const justDate = stripAfter(test, "T");
|
|
2592
|
+
return isIsoExplicitDate(justDate) && justDate === getYesterday();
|
|
2593
|
+
} else if (isMoment(test) || isDate(test)) {
|
|
2594
|
+
return stripAfter(test.toISOString(), "T") === getYesterday();
|
|
2595
|
+
} else if (isLuxonDateTime(test)) {
|
|
2596
|
+
return stripAfter(test.toISO(), "T") === getYesterday();
|
|
2597
|
+
}
|
|
2598
|
+
return false;
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2601
|
+
// src/type-guards/geo/isIso3166Alpha2.ts
|
|
2602
|
+
function isIso3166Alpha2(val) {
|
|
2603
|
+
const codes = ISO3166_1.map((i) => i.alpha2);
|
|
2604
|
+
return isString(val) && codes.includes(val);
|
|
2605
|
+
}
|
|
2606
|
+
function isCountryCode2(val) {
|
|
2607
|
+
const codes = ISO3166_1.map((i) => i.alpha2);
|
|
2608
|
+
return isString(val) && codes.includes(val);
|
|
2609
|
+
}
|
|
2610
|
+
function isIso3166Alpha3(val) {
|
|
2611
|
+
const codes = ISO3166_1.map((i) => i.alpha3);
|
|
2612
|
+
return isString(val) && codes.includes(val);
|
|
2613
|
+
}
|
|
2614
|
+
function isCountryCode3(val) {
|
|
2615
|
+
const codes = ISO3166_1.map((i) => i.alpha3);
|
|
2616
|
+
return isString(val) && codes.includes(val);
|
|
2617
|
+
}
|
|
2618
|
+
function isIso3166CountryCode(val) {
|
|
2619
|
+
const codes = ISO3166_1.map((i) => i.countryCode);
|
|
2620
|
+
return isString(val) && codes.includes(val);
|
|
2621
|
+
}
|
|
2622
|
+
function isCountryAbbrev(val) {
|
|
2623
|
+
return isCountryCode2(val) || isCountryCode3(val);
|
|
2624
|
+
}
|
|
2625
|
+
function isIso3166CountryName(val) {
|
|
2626
|
+
const codes = ISO3166_1.map((i) => i.name);
|
|
2627
|
+
return isString(val) && codes.includes(val);
|
|
2628
|
+
}
|
|
2629
|
+
function isCountryName(val) {
|
|
2630
|
+
const codes = ISO3166_1.map((i) => i.name);
|
|
2631
|
+
return isString(val) && codes.includes(val);
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
// src/type-guards/geo/isUsState.ts
|
|
2635
|
+
var ABBREV = US_STATE_LOOKUP.map((i) => i.abbrev);
|
|
2636
|
+
var NAME = US_STATE_LOOKUP.map((i) => i.name);
|
|
2637
|
+
function isUsStateAbbreviation(val) {
|
|
2638
|
+
return isString(val) && ABBREV.includes(val);
|
|
2639
|
+
}
|
|
2640
|
+
function isUsStateName(val) {
|
|
2641
|
+
return isString(val) && NAME.includes(val);
|
|
2642
|
+
}
|
|
2643
|
+
|
|
2644
|
+
// src/literals/split.ts
|
|
2645
|
+
function split(str, sep = "") {
|
|
2646
|
+
return str.split(sep);
|
|
2647
|
+
}
|
|
2648
|
+
|
|
2649
|
+
// src/type-guards/isNumericString.ts
|
|
2650
|
+
function isNumericString(value) {
|
|
2651
|
+
const numericChars = [...NUMERIC_CHAR];
|
|
2652
|
+
return typeof value === "string" && split(value).every((i) => numericChars.includes(i));
|
|
2653
|
+
}
|
|
2654
|
+
function isNumberLike(value) {
|
|
2655
|
+
const numericChars = [...NUMERIC_CHAR];
|
|
2656
|
+
return typeof value === "string" && split(value).every((i) => numericChars.includes(i)) ? true : typeof value === "number";
|
|
2657
|
+
}
|
|
2658
|
+
|
|
2659
|
+
// src/type-guards/geo/isZipCode.ts
|
|
2660
|
+
function isZipCode5(val) {
|
|
2661
|
+
if (isNumber(val)) {
|
|
2662
|
+
return isZipCode5(`${val}`);
|
|
2663
|
+
}
|
|
2664
|
+
return isString(val) && val.trim().length === 5 && isNumberLike(val.trim());
|
|
2665
|
+
}
|
|
2666
|
+
function isZipPlus4(val) {
|
|
2667
|
+
if (isString(val)) {
|
|
2668
|
+
const first = retainWhile(val.trim(), ...NUMERIC_CHAR);
|
|
2669
|
+
const next = stripChars(val.trim().replace(first, "").trim(), "-");
|
|
2670
|
+
return first.length === 5 && next.length === 4 && isNumberLike(next);
|
|
2671
|
+
}
|
|
2672
|
+
return false;
|
|
2673
|
+
}
|
|
2674
|
+
function isZipCode(val) {
|
|
2675
|
+
return isZipCode5(val) || isZipPlus4(val);
|
|
2676
|
+
}
|
|
2677
|
+
|
|
2678
|
+
// src/type-guards/isSpecificConstant.ts
|
|
2679
|
+
function isSpecificConstant(kind) {
|
|
2680
|
+
return (value) => {
|
|
2681
|
+
return !!(isConstant(value) && value.kind === kind);
|
|
2682
|
+
};
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
// src/type-guards/hasDefaultValue.ts
|
|
2686
|
+
function hasDefaultValue(value) {
|
|
2687
|
+
const noDefault = isSpecificConstant("no-default-value");
|
|
2688
|
+
return !noDefault(value);
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2691
|
+
// src/type-guards/hasIndexOf.ts
|
|
2692
|
+
function hasIndexOf(value, idx) {
|
|
2693
|
+
const result2 = isObject(value) ? String(idx) in value : Array.isArray(value) ? Number(idx) in value : false;
|
|
2694
|
+
return isErrorCondition(result2, "invalid-index") ? false : result2;
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2697
|
+
// src/type-guards/hasKeys.ts
|
|
2698
|
+
function hasKeys(...props) {
|
|
2699
|
+
return (val) => {
|
|
2700
|
+
const keys = Array.isArray(props) ? props : Object.keys(props).filter((i) => typeof i === "string");
|
|
2701
|
+
return !!((isFunction(val) || isObject(val)) && keys.every((k) => k in val));
|
|
2702
|
+
};
|
|
2703
|
+
}
|
|
2704
|
+
|
|
2705
|
+
// src/type-guards/hasWhitespace.ts
|
|
2706
|
+
function hasWhiteSpace(val) {
|
|
2707
|
+
return isString(val) && asChars(val).some((c) => WHITESPACE_CHARS.includes(c));
|
|
2708
|
+
}
|
|
2709
|
+
|
|
2710
|
+
// src/type-guards/higher-order/endsWith.ts
|
|
2711
|
+
function endsWith(endingIn2) {
|
|
2712
|
+
return (val) => {
|
|
2713
|
+
return isString(val) ? !!val.endsWith(endingIn2) : isNumber(val) ? !!String(val).endsWith(endingIn2) : false;
|
|
2714
|
+
};
|
|
2715
|
+
}
|
|
2716
|
+
|
|
2717
|
+
// src/type-guards/higher-order/isEqual.ts
|
|
2718
|
+
function isEqual(base) {
|
|
2719
|
+
return (value) => isSameTypeOf(base)(value) ? value === base : false;
|
|
2720
|
+
}
|
|
2721
|
+
|
|
2722
|
+
// src/type-guards/higher-order/isLength.ts
|
|
2723
|
+
function isLength(value, len) {
|
|
2724
|
+
return isArray(value) ? !!isEqual(value.length)(len) : isString(value) ? !!isEqual(value.length)(len) : isObject(value) ? !!isEqual(keysOf(value))(len) : false;
|
|
2725
|
+
}
|
|
2726
|
+
|
|
2727
|
+
// src/type-guards/higher-order/isSameTypeOf.ts
|
|
2728
|
+
function isSameTypeOf(base) {
|
|
2729
|
+
return (compare) => {
|
|
2730
|
+
return typeof base === typeof compare;
|
|
2731
|
+
};
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
// src/type-guards/higher-order/isTuple.ts
|
|
2735
|
+
function isTuple(...tuple3) {
|
|
2736
|
+
const results = tuple3.map((i) => i(ShapeApiImplementation)).map((i) => isDoneFn(i) ? i.done() : i);
|
|
2737
|
+
return (v) => {
|
|
2738
|
+
return isArray(v) && v.length === results.length && results.every(isShape) && v.every((item, idx) => isSameTypeOf(results[idx])(item));
|
|
2739
|
+
};
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
// src/type-guards/higher-order/isTypeOf.ts
|
|
2743
|
+
function isTypeOf(type) {
|
|
2744
|
+
return (value) => {
|
|
2745
|
+
return typeof value === type;
|
|
2746
|
+
};
|
|
2747
|
+
}
|
|
2748
|
+
|
|
2749
|
+
// src/type-guards/higher-order/startsWith.ts
|
|
2750
|
+
function startsWith(startingWith) {
|
|
2751
|
+
return (val) => {
|
|
2752
|
+
return isString(val) ? !!val.startsWith(startingWith) : isNumber(val) ? !!String(val).startsWith(startingWith) : false;
|
|
2753
|
+
};
|
|
2754
|
+
}
|
|
2755
|
+
|
|
2756
|
+
// src/type-guards/html/isHtmlElement.ts
|
|
2757
|
+
function isHtmlElement(val) {
|
|
2758
|
+
return isObject(val) && "attributes" in val && "firstElementChild" in val && "innerHTML" in val;
|
|
2759
|
+
}
|
|
2760
|
+
|
|
2761
|
+
// src/type-guards/isAlpha.ts
|
|
2762
|
+
function isAlpha(value) {
|
|
2763
|
+
return isString(value) && split(value).every((v) => ALPHA_CHARS.includes(v));
|
|
2764
|
+
}
|
|
2765
|
+
|
|
2766
|
+
// src/type-guards/isArray.ts
|
|
2767
|
+
function isArray(value) {
|
|
2768
|
+
return Array.isArray(value) === true;
|
|
2769
|
+
}
|
|
2770
|
+
|
|
2771
|
+
// src/type-guards/isBoolean.ts
|
|
2772
|
+
function isBoolean(value) {
|
|
2773
|
+
return typeof value === "boolean";
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
// src/type-guards/isBooleanLike.ts
|
|
2777
|
+
function isBooleanLike(val) {
|
|
2778
|
+
return isBoolean(val) || isString(val) && ["true", "false", "boolean"].includes(val);
|
|
2779
|
+
}
|
|
2780
|
+
|
|
2781
|
+
// src/type-guards/isConstant.ts
|
|
2782
|
+
function isConstant(value) {
|
|
2783
|
+
return !!(isObject(value) && "_type" in value && "kind" in value && value._type === "Constant");
|
|
2784
|
+
}
|
|
2785
|
+
|
|
2786
|
+
// src/type-guards/isContainer.ts
|
|
2787
|
+
function isContainer(value) {
|
|
2788
|
+
return !!(Array.isArray(value) || isObject(value));
|
|
2789
|
+
}
|
|
2790
|
+
|
|
2791
|
+
// src/type-guards/isCssAspectRatio.ts
|
|
2792
|
+
var tokens = [
|
|
2793
|
+
"1",
|
|
2794
|
+
"inherit",
|
|
2795
|
+
"initial",
|
|
2796
|
+
"revert",
|
|
2797
|
+
"revert-layer",
|
|
2798
|
+
"unset",
|
|
2799
|
+
"auto"
|
|
2800
|
+
];
|
|
2801
|
+
var isRatio = (val) => /\d{1,4}\s*\/\s*\d{1,4}/.test(val);
|
|
2802
|
+
function isCssAspectRatio(val) {
|
|
2803
|
+
return isString(val) && val.split(/\s+/).every((i) => tokens.includes(i) || isRatio(i));
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
// src/type-guards/isDefined.ts
|
|
2807
|
+
function isDefined(value) {
|
|
2808
|
+
return typeof value !== "undefined";
|
|
2809
|
+
}
|
|
2810
|
+
|
|
2811
|
+
// src/type-guards/isDoneFn.ts
|
|
2812
|
+
function isDoneFn(val) {
|
|
2813
|
+
return hasKeys("done")(val) && typeof val.done === "function";
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
// src/type-guards/isEmail.ts
|
|
2817
|
+
function isEmail(val) {
|
|
2818
|
+
if (!isString(val)) {
|
|
2819
|
+
return false;
|
|
2820
|
+
}
|
|
2821
|
+
const parts = val?.split("@");
|
|
2822
|
+
const domain = parts[1]?.split(".");
|
|
2823
|
+
const tld = domain ? domain.pop() : "";
|
|
2824
|
+
const firstChar = val[0].toLowerCase();
|
|
2825
|
+
return isString(val) && (LOWER_ALPHA_CHARS.includes(firstChar) && parts.length === 2 && domain.length >= 1 && tld.length >= 2);
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
// src/type-guards/isErrorCondition.ts
|
|
2829
|
+
function isErrorCondition(value, kind = null) {
|
|
2830
|
+
return isObject(value) && "__kind" in value && value.__kind === "ErrorCondition" && "kind" in value ? kind !== null ? value.kind === kind : true : false;
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2833
|
+
// src/type-guards/isFalse.ts
|
|
2834
|
+
function isFalse(i) {
|
|
2835
|
+
return typeof i === "boolean" && !i;
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
// src/type-guards/isFalsy.ts
|
|
2839
|
+
function isFalsy(val) {
|
|
2840
|
+
return FALSY_VALUES.includes(val);
|
|
2841
|
+
}
|
|
2842
|
+
|
|
2843
|
+
// src/type-guards/isFnWithParams.ts
|
|
2844
|
+
function isFnWithParams(input) {
|
|
2845
|
+
return typeof input === "function" && Object.keys(input)?.length > 0;
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
// src/type-guards/isHexadecimal.ts
|
|
2849
|
+
function isHexadecimal(val) {
|
|
2850
|
+
return isString(val) && asChars(val).every((i) => isNumericString(i) || ["a", "b", "c", "d", "e", "f"].includes(i.toLowerCase()));
|
|
2851
|
+
}
|
|
2852
|
+
|
|
2853
|
+
// src/type-guards/isIndexable.ts
|
|
2854
|
+
function isIndexable(value) {
|
|
2855
|
+
return !!(Array.isArray(value) || typeof value === "object" && keysOf(value).length > 0);
|
|
2856
|
+
}
|
|
2857
|
+
|
|
2858
|
+
// src/type-guards/isInlineSvg.ts
|
|
2859
|
+
function isInlineSvg(v) {
|
|
2860
|
+
return isString(v) && v.trim().startsWith(`<svg`) && v.trim().endsWith(`</svg>`);
|
|
2861
|
+
}
|
|
2862
|
+
|
|
2863
|
+
// src/type-guards/isNever.ts
|
|
2864
|
+
function isNever(val) {
|
|
2865
|
+
return isConstant(val) && val.kind === "never";
|
|
2866
|
+
}
|
|
2867
|
+
|
|
2868
|
+
// src/type-guards/isNothing.ts
|
|
2869
|
+
function isNothing(val) {
|
|
2870
|
+
return !!(val === null || val === void 0);
|
|
2871
|
+
}
|
|
2872
|
+
|
|
2873
|
+
// src/type-guards/isNotNull.ts
|
|
2874
|
+
function isNotNull(value) {
|
|
2875
|
+
return value === null;
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
// src/type-guards/isNumericArray.ts
|
|
2879
|
+
function isNumericArray(val) {
|
|
2880
|
+
return Array.isArray(val) && val.every((i) => isNumber(i));
|
|
2881
|
+
}
|
|
2882
|
+
|
|
2883
|
+
// src/type-guards/isPhoneNumber.ts
|
|
2884
|
+
function isPhoneNumber(val) {
|
|
2885
|
+
const svelte = String(val).trim();
|
|
2886
|
+
const chars = svelte.split("");
|
|
2887
|
+
const numeric = retainChars(svelte, ...NUMERIC_CHAR);
|
|
2888
|
+
const valid = ["+", "(", ...NUMERIC_CHAR];
|
|
2889
|
+
const nothing = stripChars(svelte, ...[
|
|
2890
|
+
...NUMERIC_CHAR,
|
|
2891
|
+
...WHITESPACE_CHARS,
|
|
2892
|
+
"(",
|
|
2893
|
+
")",
|
|
2894
|
+
"+",
|
|
2895
|
+
".",
|
|
2896
|
+
"-"
|
|
2897
|
+
]);
|
|
2898
|
+
return chars.every((i) => valid.includes(i)) && svelte.startsWith(`+`) ? numeric.length >= 8 : svelte.startsWith(`00`) ? numeric.length >= 10 : numeric.length >= 7 && nothing === "";
|
|
2899
|
+
}
|
|
2900
|
+
|
|
2901
|
+
// src/type-guards/isReadonlyArray.ts
|
|
2902
|
+
function isReadonlyArray(value) {
|
|
2903
|
+
return Array.isArray(value) === true;
|
|
2904
|
+
}
|
|
2905
|
+
|
|
2906
|
+
// src/type-guards/isRef.ts
|
|
2907
|
+
function isRef(value) {
|
|
2908
|
+
return isObject(value) && "value" in value && Array.from(Object.keys(value)).includes("_value");
|
|
2909
|
+
}
|
|
2910
|
+
|
|
2911
|
+
// src/type-guards/isRegExp.ts
|
|
2912
|
+
function isRegExp(val) {
|
|
2913
|
+
return val instanceof RegExp;
|
|
2914
|
+
}
|
|
2915
|
+
function isLikeRegExp(val) {
|
|
2916
|
+
if (isRegExp(val)) {
|
|
2917
|
+
return true;
|
|
2918
|
+
}
|
|
2919
|
+
if (isString(val)) {
|
|
2920
|
+
try {
|
|
2921
|
+
const _re = new RegExp(val);
|
|
2922
|
+
return true;
|
|
2923
|
+
} catch {
|
|
2924
|
+
return false;
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
return false;
|
|
2928
|
+
}
|
|
2929
|
+
|
|
2930
|
+
// src/type-guards/isStringArray.ts
|
|
2931
|
+
function isStringArray(val) {
|
|
2932
|
+
return Array.isArray(val) && val.every((i) => isString(i));
|
|
2933
|
+
}
|
|
2934
|
+
|
|
2935
|
+
// src/type-guards/isThenable.ts
|
|
2936
|
+
function isThenable(val) {
|
|
2937
|
+
return isObject(val) && "then" in val && "catch" in val && typeof val.then === "function";
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
// src/type-guards/isTrimmable.ts
|
|
2941
|
+
function isTrimable(val) {
|
|
2942
|
+
return isString(val) && val !== val.trim();
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
// src/type-guards/isTrue.ts
|
|
2946
|
+
function isTrue(value) {
|
|
2947
|
+
return value === true;
|
|
2948
|
+
}
|
|
2949
|
+
|
|
2950
|
+
// src/type-guards/isTruthy.ts
|
|
2951
|
+
function isTruthy(val) {
|
|
2952
|
+
return !FALSY_VALUES.includes(val);
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
// src/type-guards/isTypeToken.ts
|
|
2956
|
+
function isTypeToken(val) {
|
|
2957
|
+
if (isString(val) && startsWith("<<")(val) && endsWith(">>")(val)) {
|
|
2958
|
+
return true;
|
|
2959
|
+
} else {
|
|
2960
|
+
return false;
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
|
|
2964
|
+
// src/type-guards/isTypeTuple.ts
|
|
2965
|
+
function isTypeTuple(value) {
|
|
2966
|
+
return Array.isArray(value) && value.length === 3 && typeof value[1] === "function";
|
|
2967
|
+
}
|
|
2968
|
+
|
|
2969
|
+
// src/type-guards/isUndefined.ts
|
|
2970
|
+
function isUndefined(value) {
|
|
2971
|
+
return typeof value === "undefined";
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2974
|
+
// src/type-guards/isUnset.ts
|
|
2975
|
+
function isUnset(val) {
|
|
2976
|
+
return isObject(val) && val.kind === "Unset";
|
|
2977
|
+
}
|
|
2978
|
+
function isSet(val) {
|
|
2979
|
+
return isObject(val) ? val.kind !== "Unset" : true;
|
|
2980
|
+
}
|
|
2981
|
+
|
|
2982
|
+
// src/type-guards/isUrl.ts
|
|
2983
|
+
function isUri(val, ...protocols) {
|
|
2984
|
+
const p = protocols.length === 0 ? valuesOf(NETWORK_PROTOCOL_LOOKUP).flat().filter((i) => i) : protocols;
|
|
2985
|
+
return isString(val) && p.some((i) => val.startsWith(`${i}://`));
|
|
2986
|
+
}
|
|
2987
|
+
function isUrl(val, ...protocols) {
|
|
2988
|
+
const p = protocols.length === 0 ? ["http", "https"] : protocols;
|
|
2989
|
+
return isString(val) && p.some((i) => val.startsWith(`${i}://`));
|
|
2990
|
+
}
|
|
2991
|
+
|
|
2992
|
+
// src/type-guards/metrics/isMetric.ts
|
|
2993
|
+
function separate(s) {
|
|
2994
|
+
return stripWhile(s.toLowerCase(), ...NUMERIC_CHAR).trim();
|
|
2995
|
+
}
|
|
2996
|
+
function isAreaMetric(val) {
|
|
2997
|
+
return isString(val) && AREA_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
2998
|
+
}
|
|
2999
|
+
function isLuminosityMetric(val) {
|
|
3000
|
+
return isString(val) && LUMINOSITY_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3001
|
+
}
|
|
3002
|
+
function isResistance(val) {
|
|
3003
|
+
return isString(val) && RESISTANCE_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3004
|
+
}
|
|
3005
|
+
function isCurrentMetric(val) {
|
|
3006
|
+
return isString(val) && CURRENT_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3007
|
+
}
|
|
3008
|
+
function isVoltageMetric(val) {
|
|
3009
|
+
return isString(val) && VOLTAGE_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3010
|
+
}
|
|
3011
|
+
function isFrequencyMetric(val) {
|
|
3012
|
+
return isString(val) && FREQUENCY_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3013
|
+
}
|
|
3014
|
+
function isPowerMetric(val) {
|
|
3015
|
+
return isString(val) && POWER_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3016
|
+
}
|
|
3017
|
+
function isTimeMetric(val) {
|
|
3018
|
+
return isString(val) && TIME_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3019
|
+
}
|
|
3020
|
+
function isEnergyMetric(val) {
|
|
3021
|
+
return isString(val) && ENERGY_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3022
|
+
}
|
|
3023
|
+
function isPressureMetric(val) {
|
|
3024
|
+
return isString(val) && PRESSURE_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3025
|
+
}
|
|
3026
|
+
function isTemperatureMetric(val) {
|
|
3027
|
+
return isString(val) && TEMPERATURE_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3028
|
+
}
|
|
3029
|
+
function isVolumeMetric(val) {
|
|
3030
|
+
return isString(val) && VOLUME_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3031
|
+
}
|
|
3032
|
+
function isAccelerationMetric(val) {
|
|
3033
|
+
return isString(val) && ACCELERATION_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3034
|
+
}
|
|
3035
|
+
function isSpeedMetric(val) {
|
|
3036
|
+
const speed = SPEED_METRICS_LOOKUP.map((i) => i.abbrev);
|
|
3037
|
+
return isString(val) && speed.includes(separate(val));
|
|
3038
|
+
}
|
|
3039
|
+
function isMassMetric(val) {
|
|
3040
|
+
return isString(val) && MASS_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3041
|
+
}
|
|
3042
|
+
function isDistanceMetric(val) {
|
|
3043
|
+
return isString(val) && DISTANCE_METRICS_LOOKUP.map((i) => i.abbrev).includes(separate(val));
|
|
3044
|
+
}
|
|
3045
|
+
function isMetric(val) {
|
|
3046
|
+
return isDistanceMetric(val) || isMassMetric(val) || isSpeedMetric(val) || isAccelerationMetric(val) || isVoltageMetric(val) || isTemperatureMetric(val) || isPressureMetric(val) || isEnergyMetric(val) || isTimeMetric(val) || isPowerMetric(val) || isFrequencyMetric(val) || isVoltageMetric(val) || isCurrentMetric(val) || isLuminosityMetric(val) || isAreaMetric(val);
|
|
3047
|
+
}
|
|
3048
|
+
|
|
3049
|
+
// src/type-guards/metrics/isUom.ts
|
|
3050
|
+
function isAreaUom(val) {
|
|
3051
|
+
return isString(val) && AREA_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3052
|
+
}
|
|
3053
|
+
function isLuminosityUom(val) {
|
|
3054
|
+
return isString(val) && LUMINOSITY_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3055
|
+
}
|
|
3056
|
+
function isResistanceUom(val) {
|
|
3057
|
+
return isString(val) && RESISTANCE_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3058
|
+
}
|
|
3059
|
+
function isCurrentUom(val) {
|
|
3060
|
+
return isString(val) && CURRENT_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3061
|
+
}
|
|
3062
|
+
function isVoltageUom(val) {
|
|
3063
|
+
return isString(val) && VOLTAGE_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3064
|
+
}
|
|
3065
|
+
function isFrequencyUom(val) {
|
|
3066
|
+
return isString(val) && FREQUENCY_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3067
|
+
}
|
|
3068
|
+
function isPowerUom(val) {
|
|
3069
|
+
return isString(val) && POWER_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3070
|
+
}
|
|
3071
|
+
function isTimeUom(val) {
|
|
3072
|
+
return isString(val) && TIME_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3073
|
+
}
|
|
3074
|
+
function isEnergyUom(val) {
|
|
3075
|
+
return isString(val) && ENERGY_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3076
|
+
}
|
|
3077
|
+
function isPressureUom(val) {
|
|
3078
|
+
return isString(val) && PRESSURE_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3079
|
+
}
|
|
3080
|
+
function isTemperatureUom(val) {
|
|
3081
|
+
return isString(val) && TEMPERATURE_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3082
|
+
}
|
|
3083
|
+
function isVolumeUom(val) {
|
|
3084
|
+
return isString(val) && VOLUME_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3085
|
+
}
|
|
3086
|
+
function isAccelerationUom(val) {
|
|
3087
|
+
return isString(val) && ACCELERATION_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3088
|
+
}
|
|
3089
|
+
function isSpeedUom(val) {
|
|
3090
|
+
return isString(val) && SPEED_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3091
|
+
}
|
|
3092
|
+
function isMassUom(val) {
|
|
3093
|
+
return isString(val) && MASS_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3094
|
+
}
|
|
3095
|
+
function isDistanceUom(val) {
|
|
3096
|
+
return isString(val) && ENERGY_METRICS_LOOKUP.map((i) => i.abbrev).includes(val);
|
|
3097
|
+
}
|
|
3098
|
+
function isUom(val) {
|
|
3099
|
+
return isDistanceUom(val) || isMassUom(val) || isSpeedUom(val) || isAccelerationUom(val) || isVoltageUom(val) || isTemperatureUom(val) || isPressureUom(val) || isEnergyUom(val) || isTimeUom(val) || isPowerUom(val) || isFrequencyUom(val) || isVoltageUom(val) || isCurrentUom(val) || isLuminosityUom(val) || isAreaUom(val);
|
|
3100
|
+
}
|
|
3101
|
+
|
|
3102
|
+
// src/type-guards/network-tg.ts
|
|
3103
|
+
function isIp4Address(val) {
|
|
3104
|
+
return isString(val) && val.split(".").length === 4 && val.split(".").every((i) => isNumberLike(i)) && val.split(".").every((i) => Number(i) >= 0 && Number(i) <= 255);
|
|
3105
|
+
}
|
|
3106
|
+
function isIp6Address(val) {
|
|
3107
|
+
const expanded = isString(val) ? ip6GroupExpansion(val) : "";
|
|
3108
|
+
return isString(val) && isString(expanded) && expanded.split(":").every((i) => asChars(i).length >= 1 && asChars(i).length <= 4) && expanded.split(":").every((i) => isHexadecimal(i));
|
|
3109
|
+
}
|
|
3110
|
+
function isIpAddress(val) {
|
|
3111
|
+
return isIp4Address(val) || isIp6Address(val);
|
|
3112
|
+
}
|
|
3113
|
+
function hasUrlPort(val) {
|
|
3114
|
+
return isString(val) && asChars(removeUrlProtocol(val)).includes(":");
|
|
3115
|
+
}
|
|
3116
|
+
function isUrlPath(val) {
|
|
3117
|
+
return isString(val) && (val === "" || val.startsWith("/")) && asChars(val).every(
|
|
3118
|
+
(c) => isAlpha(c) || isNumberLike(c) || c === "_" || c === "@" || c === "." || c === "-"
|
|
3119
|
+
);
|
|
3120
|
+
}
|
|
3121
|
+
function isDomainName(val) {
|
|
3122
|
+
return isString(val) && val.split(".").filter((i) => i).length > 1 && isString(val.split(".").filter((i) => i).pop()) && asChars(val.split(".").filter((i) => i).pop()).length > 1 && val.split(".").filter((i) => i).every(
|
|
3123
|
+
(i) => isAlpha(i) || isNumberLike(i) || i === "-" || i === "_"
|
|
3124
|
+
);
|
|
3125
|
+
}
|
|
3126
|
+
function isUrlSource(val) {
|
|
3127
|
+
return isDomainName(val) || isIpAddress(val);
|
|
3128
|
+
}
|
|
3129
|
+
function hasUrlQueryParameter(val, prop) {
|
|
3130
|
+
return isString(getUrlQueryParams(val, prop));
|
|
3131
|
+
}
|
|
3132
|
+
|
|
3133
|
+
// src/type-guards/tokens/isAtomicToken.ts
|
|
3134
|
+
function isAtomicToken(val) {
|
|
3135
|
+
return isString(val) && TT_Atomics.some((v) => val === `<<${v}>>`);
|
|
3136
|
+
}
|
|
3137
|
+
|
|
3138
|
+
// src/type-guards/tokens/isContainerToken.ts
|
|
3139
|
+
function isObjectToken(val) {
|
|
3140
|
+
return isString(val) && val.startsWith("<<obj::");
|
|
3141
|
+
}
|
|
3142
|
+
function isRecordToken(val) {
|
|
3143
|
+
return isString(val) && val.startsWith("<<rec::") && val.endsWith(">>");
|
|
3144
|
+
}
|
|
3145
|
+
function isTupleToken(val) {
|
|
3146
|
+
return isString(val) && val.startsWith("<<tuple::");
|
|
3147
|
+
}
|
|
3148
|
+
function isArrayToken(val) {
|
|
3149
|
+
return isString(val) && val.startsWith("<<arr::");
|
|
3150
|
+
}
|
|
3151
|
+
function isMapToken(val) {
|
|
3152
|
+
return isString(val) && val.startsWith("<<map::");
|
|
3153
|
+
}
|
|
3154
|
+
function isSetToken(val) {
|
|
3155
|
+
return isString(val) && val.startsWith("<<set::");
|
|
3156
|
+
}
|
|
3157
|
+
function isWeakMapToken(val) {
|
|
3158
|
+
return isString(val) && val.startsWith("<<weak::");
|
|
3159
|
+
}
|
|
3160
|
+
function isUnionToken(val) {
|
|
3161
|
+
return isString(val) && val.startsWith("<<union::[ ");
|
|
3162
|
+
}
|
|
3163
|
+
function isUnionSetToken(val) {
|
|
3164
|
+
return isString(val) && val.startsWith("<<union-set::");
|
|
3165
|
+
}
|
|
3166
|
+
function isContainerToken(val) {
|
|
3167
|
+
return isString(val) && (isObjectToken(val) || isRecordToken(val) || isTupleToken(val) || isArrayToken(val) || isMapToken(val) || isSetToken(val) || isWeakMapToken(val) || isUnionSetToken(val) || isUnionToken(val));
|
|
3168
|
+
}
|
|
3169
|
+
|
|
3170
|
+
// src/type-guards/tokens/isShapeCallback.ts
|
|
3171
|
+
function isShapeCallback(val) {
|
|
3172
|
+
return isFunction(val) && val.kind === "shape";
|
|
3173
|
+
}
|
|
3174
|
+
|
|
3175
|
+
// src/type-guards/tokens/isShapeToken.ts
|
|
3176
|
+
var token_types = [
|
|
3177
|
+
...TT_Atomics,
|
|
3178
|
+
...TT_Containers,
|
|
3179
|
+
...TT_Functions,
|
|
3180
|
+
...TT_Sets,
|
|
3181
|
+
...TT_Singletons
|
|
3182
|
+
];
|
|
3183
|
+
function isShapeToken(val) {
|
|
3184
|
+
return isString(val) && val.startsWith("<<") && val.endsWith(">>") && token_types.some((t) => val.startsWith(`<<${t}`));
|
|
3185
|
+
}
|
|
3186
|
+
|
|
3187
|
+
// src/type-guards/tokens/isSimpleToken.ts
|
|
3188
|
+
var split_tokens = SIMPLE_TOKENS.map((i) => i.split("TOKEN"));
|
|
3189
|
+
var scalar_split_tokens = SIMPLE_SCALAR_TOKENS.map((i) => i.split("TOKEN"));
|
|
3190
|
+
function isSimpleToken(val) {
|
|
3191
|
+
return isString(val) && split_tokens.some(
|
|
3192
|
+
(i) => i.length === 1 && val === i[0] || val.startsWith(i[0]) && val.endsWith(i.slice(-1)[0]) && i.every((p) => val.includes(p))
|
|
3193
|
+
);
|
|
3194
|
+
}
|
|
3195
|
+
function isSimpleScalarToken(val) {
|
|
3196
|
+
return isString(val) && scalar_split_tokens.some(
|
|
3197
|
+
(i) => i.length === 1 && val === i[0] || val.startsWith(i[0]) && val.endsWith(i.slice(-1)[0]) && i.every((p) => val.includes(p))
|
|
3198
|
+
);
|
|
3199
|
+
}
|
|
3200
|
+
function isSimpleContainerToken(val) {
|
|
3201
|
+
return isString(val) && scalar_split_tokens.some(
|
|
3202
|
+
(i) => i.length === 1 && val === i[0] || val.startsWith(i[0]) && val.endsWith(i.slice(-1)[0]) && i.every((p) => val.includes(p))
|
|
3203
|
+
);
|
|
3204
|
+
}
|
|
3205
|
+
function isSimpleTokenTuple(val) {
|
|
3206
|
+
return isArray(val) && val.length !== 0 && val.every(isSimpleToken);
|
|
3207
|
+
}
|
|
3208
|
+
function isSimpleScalarTokenTuple(val) {
|
|
3209
|
+
return isArray(val) && val.length !== 0 && val.every(isSimpleScalarToken);
|
|
3210
|
+
}
|
|
3211
|
+
function isSimpleContainerTokenTuple(val) {
|
|
3212
|
+
return isArray(val) && val.length !== 0 && val.every(isSimpleContainerToken);
|
|
3213
|
+
}
|
|
3214
|
+
|
|
3215
|
+
// src/type-guards/tokens/isDefineObject.ts
|
|
3216
|
+
function isDefineObject(val) {
|
|
3217
|
+
return isObject(val) && Object.keys(val).some(
|
|
3218
|
+
(key) => isSimpleToken(val[key]) || isShapeToken(val) || isShapeCallback(val)
|
|
3219
|
+
);
|
|
3220
|
+
}
|
|
3221
|
+
|
|
3222
|
+
// src/type-guards/tokens/isFunctionToken.ts
|
|
3223
|
+
function isFnToken(val) {
|
|
3224
|
+
return isString(val) && val.startsWith("<<fn::");
|
|
3225
|
+
}
|
|
3226
|
+
function isGeneratorToken(val) {
|
|
3227
|
+
return isString(val) && val.startsWith("<<gen::");
|
|
3228
|
+
}
|
|
3229
|
+
|
|
3230
|
+
// src/type-guards/tokens/isSingletonToken.ts
|
|
3231
|
+
function isSingletonToken(val) {
|
|
3232
|
+
return isString(val) && TT_Atomics.some((v) => val === `<<${v}>>`);
|
|
3233
|
+
}
|
|
3234
|
+
|
|
3235
|
+
// src/type-guards/tw/tw-color.ts
|
|
3236
|
+
function isTailwindColorName(val) {
|
|
3237
|
+
return isString(val) && Object.keys(TW_HUE).includes(val);
|
|
3238
|
+
}
|
|
3239
|
+
function isTailwindColorWithLuminosity(val) {
|
|
3240
|
+
return isString(val) && isTailwindColorName(val.split("-")[0]) && (!["white", "black"].includes(val.split("-")[0]) || val.split("-").length === 1) && (!val.includes("-") || Object.keys(TW_LUMINOSITY).includes(retainAfter(val, "-")));
|
|
3241
|
+
}
|
|
3242
|
+
function isTailwindColorWithLuminosityAndOpacity(val) {
|
|
3243
|
+
return isString(val) && val.includes("/") && isTailwindColorWithLuminosity(val.split("/")[0]) && isNumberLike(val.split("/")[1]) && ([1, 2].includes(val.split("/")[1].length) || val.split("/")[1] === "100");
|
|
3244
|
+
}
|
|
3245
|
+
function isTailwindColor(val) {
|
|
3246
|
+
return isTailwindColorWithLuminosity(val) || isTailwindColorWithLuminosityAndOpacity(val);
|
|
3247
|
+
}
|
|
3248
|
+
function isTailwindModifier(val) {
|
|
3249
|
+
return isString(val) && TW_MODIFIERS.includes(val);
|
|
3250
|
+
}
|
|
3251
|
+
function isTailwindColorTarget(val) {
|
|
3252
|
+
return isString(val) && TW_COLOR_TARGETS.includes(val);
|
|
3253
|
+
}
|
|
3254
|
+
function isTailwindColorClass(val, ...allowedModifiers) {
|
|
3255
|
+
if (isString(val)) {
|
|
3256
|
+
const mods = getTailwindModifiers(val);
|
|
3257
|
+
const targetted = removeTailwindModifiers(val);
|
|
3258
|
+
const target = targetted.split("-")[0];
|
|
3259
|
+
const color = targetted.split("-").slice(1).join("-");
|
|
3260
|
+
return isTailwindColorTarget(target) && isTailwindColor(color) && (allowedModifiers[0] === true || mods.every((i) => allowedModifiers.includes(i)));
|
|
3261
|
+
}
|
|
3262
|
+
return false;
|
|
3263
|
+
}
|
|
3264
|
+
|
|
3265
|
+
// src/type-guards/urls/news/australian.ts
|
|
3266
|
+
var URL = AUSTRALIAN_NEWS.flatMap((i) => i.baseUrls);
|
|
3267
|
+
function isAustralianNewsUrl(val) {
|
|
3268
|
+
return isString(val) && val.startsWith("https://") && (URL.includes(val) || URL.some((i) => i.startsWith(`${i}/`)));
|
|
3269
|
+
}
|
|
3270
|
+
|
|
3271
|
+
// src/type-guards/urls/news/belgium.ts
|
|
3272
|
+
var URL2 = BELGIUM_NEWS.flatMap((i) => i.baseUrls);
|
|
3273
|
+
function isBelgiumNewsUrl(val) {
|
|
3274
|
+
return isString(val) && val.startsWith("https://") && (URL2.includes(val) || URL2.some((i) => i.startsWith(`${i}/`)));
|
|
3275
|
+
}
|
|
3276
|
+
|
|
3277
|
+
// src/type-guards/urls/news/canadian.ts
|
|
3278
|
+
var URL3 = CANADIAN_NEWS.flatMap((i) => i.baseUrls);
|
|
3279
|
+
function isCanadianNewsUrl(val) {
|
|
3280
|
+
return isString(val) && val.startsWith("https://") && (URL3.includes(val) || URL3.some((i) => i.startsWith(`${i}/`)));
|
|
3281
|
+
}
|
|
3282
|
+
|
|
3283
|
+
// src/type-guards/urls/news/danish.ts
|
|
3284
|
+
var URL4 = DANISH_NEWS.flatMap((i) => i.baseUrls);
|
|
3285
|
+
function isDanishNewsUrl(val) {
|
|
3286
|
+
return isString(val) && val.startsWith("https://") && (URL4.includes(val) || URL4.some((i) => i.startsWith(`${i}/`)));
|
|
3287
|
+
}
|
|
3288
|
+
|
|
3289
|
+
// src/type-guards/urls/news/dutch.ts
|
|
3290
|
+
var URL5 = DUTCH_NEWS.flatMap((i) => i.baseUrls);
|
|
3291
|
+
function isDutchNewsUrl(val) {
|
|
3292
|
+
return isString(val) && val.startsWith("https://") && (URL5.includes(val) || URL5.some((i) => i.startsWith(`${i}/`)));
|
|
3293
|
+
}
|
|
3294
|
+
|
|
3295
|
+
// src/type-guards/urls/news/french.ts
|
|
3296
|
+
var URL6 = FRENCH_NEWS.flatMap((i) => i.baseUrls);
|
|
3297
|
+
function isFrenchNewsUrl(val) {
|
|
3298
|
+
return isString(val) && val.startsWith("https://") && (URL6.includes(val) || URL6.some((i) => i.startsWith(`${i}/`)));
|
|
3299
|
+
}
|
|
3300
|
+
|
|
3301
|
+
// src/type-guards/urls/news/german.ts
|
|
3302
|
+
var URL7 = GERMAN_NEWS.flatMap((i) => i.baseUrls);
|
|
3303
|
+
function isGermanNewsUrl(val) {
|
|
3304
|
+
return isString(val) && val.startsWith("https://") && (URL7.includes(val) || URL7.some((i) => i.startsWith(`${i}/`)));
|
|
3305
|
+
}
|
|
3306
|
+
|
|
3307
|
+
// src/type-guards/urls/news/indian.ts
|
|
3308
|
+
var URL8 = INDIAN_NEWS.flatMap((i) => i.baseUrls);
|
|
3309
|
+
function isIndianNewsUrl(val) {
|
|
3310
|
+
return isString(val) && val.startsWith("https://") && (URL8.includes(val) || URL8.some((i) => i.startsWith(`${i}/`)));
|
|
3311
|
+
}
|
|
3312
|
+
|
|
3313
|
+
// src/type-guards/urls/news/italian.ts
|
|
3314
|
+
var URL9 = ITALIAN_NEWS.flatMap((i) => i.baseUrls);
|
|
3315
|
+
function isItalianNewsUrl(val) {
|
|
3316
|
+
return isString(val) && val.startsWith("https://") && (URL9.includes(val) || URL9.some((i) => i.startsWith(`${i}/`)));
|
|
3317
|
+
}
|
|
3318
|
+
|
|
3319
|
+
// src/type-guards/urls/news/japanese.ts
|
|
3320
|
+
var URL10 = JAPANESE_NEWS.flatMap((i) => i.baseUrls);
|
|
3321
|
+
function isJapaneseNewsUrl(val) {
|
|
3322
|
+
return isString(val) && val.startsWith("https://") && (URL10.includes(val) || URL10.some((i) => i.startsWith(`${i}/`)));
|
|
3323
|
+
}
|
|
3324
|
+
|
|
3325
|
+
// src/type-guards/urls/news/mexican.ts
|
|
3326
|
+
var URL11 = MEXICAN_NEWS.flatMap((i) => i.baseUrls);
|
|
3327
|
+
function isMexicanNewsUrl(val) {
|
|
3328
|
+
return isString(val) && val.startsWith("https://") && (URL11.includes(val) || URL11.some((i) => i.startsWith(`${i}/`)));
|
|
3329
|
+
}
|
|
3330
|
+
|
|
3331
|
+
// src/type-guards/urls/news/norwegian.ts
|
|
3332
|
+
var URL12 = NORWEGIAN_NEWS.flatMap((i) => i.baseUrls);
|
|
3333
|
+
function isNorwegianNewsUrl(val) {
|
|
3334
|
+
return isString(val) && val.startsWith("https://") && (URL12.includes(val) || URL12.some((i) => i.startsWith(`${i}/`)));
|
|
3335
|
+
}
|
|
3336
|
+
|
|
3337
|
+
// src/type-guards/urls/news/south-korean.ts
|
|
3338
|
+
var URL13 = SOUTH_KOREAN_NEWS.flatMap((i) => i.baseUrls);
|
|
3339
|
+
function isSouthKoreanNewsUrl(val) {
|
|
3340
|
+
return isString(val) && val.startsWith("https://") && (URL13.includes(val) || URL13.some((i) => i.startsWith(`${i}/`)));
|
|
3341
|
+
}
|
|
3342
|
+
|
|
3343
|
+
// src/type-guards/urls/news/spanish.ts
|
|
3344
|
+
var URL14 = SPANISH_NEWS.flatMap((i) => i.baseUrls);
|
|
3345
|
+
function isSpanishNewsUrl(val) {
|
|
3346
|
+
return isString(val) && val.startsWith("https://") && (URL14.includes(val) || URL14.some((i) => i.startsWith(`${i}/`)));
|
|
3347
|
+
}
|
|
3348
|
+
|
|
3349
|
+
// src/type-guards/urls/news/swiss.ts
|
|
3350
|
+
var URL15 = SWISS_NEWS.flatMap((i) => i.baseUrls);
|
|
3351
|
+
function isSwissNewsUrl(val) {
|
|
3352
|
+
return isString(val) && val.startsWith("https://") && (URL15.includes(val) || URL15.some((i) => i.startsWith(`${i}/`)));
|
|
3353
|
+
}
|
|
3354
|
+
|
|
3355
|
+
// src/type-guards/urls/news/turkish.ts
|
|
3356
|
+
var URL16 = TURKISH_NEWS.flatMap((i) => i.baseUrls);
|
|
3357
|
+
function isTurkishNewsUrl(val) {
|
|
3358
|
+
return isString(val) && val.startsWith("https://") && (URL16.includes(val) || URL16.some((i) => i.startsWith(`${i}/`)));
|
|
3359
|
+
}
|
|
3360
|
+
|
|
3361
|
+
// src/type-guards/urls/news/uk.ts
|
|
3362
|
+
var URL17 = UK_NEWS.flatMap((i) => i.baseUrls);
|
|
3363
|
+
function isUkNewsUrl(val) {
|
|
3364
|
+
return isString(val) && val.startsWith("https://") && (URL17.includes(val) || URL17.some((i) => i.startsWith(`${i}/`)));
|
|
3365
|
+
}
|
|
3366
|
+
|
|
3367
|
+
// src/type-guards/urls/news/us.ts
|
|
3368
|
+
var URL18 = US_NEWS.flatMap((i) => i.baseUrls);
|
|
3369
|
+
function isUsNewsUrl(val) {
|
|
3370
|
+
return isString(val) && val.startsWith("https://") && (URL18.includes(val) || URL18.some((i) => i.startsWith(`${i}/`)));
|
|
3371
|
+
}
|
|
3372
|
+
|
|
3373
|
+
// src/type-guards/urls/news/chinese.ts
|
|
3374
|
+
var URL19 = CHINESE_NEWS.flatMap((i) => i.baseUrls);
|
|
3375
|
+
function isChineseNewsUrl(val) {
|
|
3376
|
+
return isString(val) && val.startsWith("https://") && (URL19.includes(val) || URL19.some((i) => i.startsWith(`${i}/`)));
|
|
3377
|
+
}
|
|
3378
|
+
|
|
3379
|
+
// src/type-guards/urls/news/index.ts
|
|
3380
|
+
function isNewsUrl(val) {
|
|
3381
|
+
return isAustralianNewsUrl(val) || isBelgiumNewsUrl(val) || isCanadianNewsUrl(val) || isDanishNewsUrl(val) || isDutchNewsUrl(val) || isFrenchNewsUrl(val) || isGermanNewsUrl(val) || isIndianNewsUrl(val) || isItalianNewsUrl(val) || isJapaneseNewsUrl(val) || isMexicanNewsUrl(val) || isNorwegianNewsUrl(val) || isSouthKoreanNewsUrl(val) || isSpanishNewsUrl(val) || isSwissNewsUrl(val) || isTurkishNewsUrl(val) || isUkNewsUrl(val) || isUsNewsUrl(val);
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3384
|
+
// src/type-guards/urls/repos/bitbucket.ts
|
|
3385
|
+
function isBitbucketUrl(val) {
|
|
3386
|
+
const valid = REPO_SOURCE_LOOKUP.bitbucket;
|
|
3387
|
+
return isString(val) && valid.some(
|
|
3388
|
+
(i) => val === i || val.startsWith(`${i}/`) || val.startsWith(`${i}?`)
|
|
3389
|
+
);
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3392
|
+
// src/type-guards/urls/repos/codeCommit.ts
|
|
3393
|
+
function isCodeCommitUrl(val) {
|
|
3394
|
+
const valid = REPO_SOURCE_LOOKUP.codecommit;
|
|
3395
|
+
return isString(val) && valid.some(
|
|
3396
|
+
(i) => val === i || val.startsWith(`${i}/`) || val.startsWith(`${i}?`)
|
|
3397
|
+
);
|
|
3398
|
+
}
|
|
3399
|
+
|
|
3400
|
+
// src/type-guards/urls/repos/github.ts
|
|
3401
|
+
function isGithubUrl(val) {
|
|
3402
|
+
const valid = [
|
|
3403
|
+
"https://github.com",
|
|
3404
|
+
"https://www.github.com",
|
|
3405
|
+
"https://github.io"
|
|
3406
|
+
];
|
|
3407
|
+
return isString(val) && valid.some(
|
|
3408
|
+
(i) => val === i || val.startsWith(`${i}/`) || val.startsWith(`${i}?`)
|
|
3409
|
+
);
|
|
3410
|
+
}
|
|
3411
|
+
function isGithubOrgUrl(val) {
|
|
3412
|
+
return isString(val) && (val.startsWith("https://github.com/") && stripper(val).length === 2);
|
|
3413
|
+
}
|
|
3414
|
+
function stripper(s) {
|
|
3415
|
+
return stripTrailing(
|
|
3416
|
+
stripLeading(s, "https://github.com/"),
|
|
3417
|
+
"/"
|
|
3418
|
+
);
|
|
3419
|
+
}
|
|
3420
|
+
function isGithubRepoUrl(val) {
|
|
3421
|
+
return !!(isString(val) && (val.startsWith("https://github.com/") && stripper(val).split("/").length === 2));
|
|
3422
|
+
}
|
|
3423
|
+
function isGithubRepoReleasesUrl(val) {
|
|
3424
|
+
return isString(val) && (val.startsWith("https://github.com/") && val.includes("/releases") && stripper(val).split("/").length === 3);
|
|
3425
|
+
}
|
|
3426
|
+
function isGithubRepoReleaseTagUrl(val) {
|
|
3427
|
+
return isString(val) && (val.startsWith("https://github.com/") && val.includes("/releases/tag/") && stripper(val).length === 4);
|
|
3428
|
+
}
|
|
3429
|
+
function isGithubIssuesListUrl(val) {
|
|
3430
|
+
return isString(val) && val.startsWith("https://github.com/") && val.includes("/issues");
|
|
3431
|
+
}
|
|
3432
|
+
function isGithubIssueUrl(val) {
|
|
3433
|
+
return isString(val) && (val.startsWith("https://github.com/") && val.includes("/issues/"));
|
|
3434
|
+
}
|
|
3435
|
+
function isGithubProjectsListUrl(val) {
|
|
3436
|
+
return isString(val) && (val.startsWith("https://github.com/") && (val.includes("/projects?") || val.trim().endsWith("/projects")) && stripper(val).split("/").length === 3);
|
|
3437
|
+
}
|
|
3438
|
+
function isGithubProjectUrl(val) {
|
|
3439
|
+
return isString(val) && (val.startsWith("https://github.com/") && val.includes("/projects/") && stripper(val).split("/").length === 4);
|
|
3440
|
+
}
|
|
3441
|
+
function isGithubReleasesListUrl(val) {
|
|
3442
|
+
return isString(val) && (val.startsWith("https://github.com/") && (val.includes("/releases?") || val.trim().endsWith("/releases")) && stripper(val).split("/").length === 3);
|
|
3443
|
+
}
|
|
3444
|
+
function isGithubReleaseTagUrl(val) {
|
|
3445
|
+
return isString(val) && (val.startsWith("https://github.com/") && val.includes("/releases/tag/") && stripper(val).split("/").length === 5);
|
|
3446
|
+
}
|
|
3447
|
+
|
|
3448
|
+
// src/type-guards/urls/repos/isSemanticVersion.ts
|
|
3449
|
+
function isRepoSource(v) {
|
|
3450
|
+
return isString(v) && REPO_SOURCES.includes(v);
|
|
3451
|
+
}
|
|
3452
|
+
function isSemanticVersion(v, allowPrefix = false) {
|
|
3453
|
+
return isString(v) && v.split(".").length === 3 && !Number.isNaN(Number(v.split(".")[1])) && !Number.isNaN(Number(v.split(".")[2])) && (!Number.isNaN(Number(v.split(".")[0])) || allowPrefix && !Number.isNaN(Number(stripLeading(v.split(".")[0], "v").trim())));
|
|
3454
|
+
}
|
|
3455
|
+
|
|
3456
|
+
// src/type-guards/urls/repos/index.ts
|
|
3457
|
+
function isRepoUrl(val) {
|
|
3458
|
+
return isGithubUrl(val) || isBitbucketUrl(val) || isCodeCommitUrl(val);
|
|
3459
|
+
}
|
|
3460
|
+
|
|
3461
|
+
// src/type-guards/urls/retail.ts
|
|
3462
|
+
function isWholeFoodsUrl(val) {
|
|
3463
|
+
return isString(val) && WHOLE_FOODS_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3464
|
+
}
|
|
3465
|
+
function isCvsUrl(val) {
|
|
3466
|
+
return isString(val) && CVS_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3467
|
+
}
|
|
3468
|
+
function isWalgreensUrl(val) {
|
|
3469
|
+
return isString(val) && WALGREENS_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3470
|
+
}
|
|
3471
|
+
function isKrogersUrl(val) {
|
|
3472
|
+
return isString(val) && KROGER_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3473
|
+
}
|
|
3474
|
+
function isZaraUrl(val) {
|
|
3475
|
+
return isString(val) && ZARA_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3476
|
+
}
|
|
3477
|
+
function isHmUrl(val) {
|
|
3478
|
+
return isString(val) && HM_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3479
|
+
}
|
|
3480
|
+
function isDellUrl(val) {
|
|
3481
|
+
return isString(val) && DELL_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3482
|
+
}
|
|
3483
|
+
function isIkeaUrl(val) {
|
|
3484
|
+
return isString(val) && KROGER_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3485
|
+
}
|
|
3486
|
+
function isLowesUrl(val) {
|
|
3487
|
+
return isString(val) && KROGER_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3488
|
+
}
|
|
3489
|
+
function isNikeUrl(val) {
|
|
3490
|
+
return isString(val) && NIKE_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3491
|
+
}
|
|
3492
|
+
function isWayfairUrl(val) {
|
|
3493
|
+
return isString(val) && WAYFAIR_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3494
|
+
}
|
|
3495
|
+
function isBestBuyUrl(val) {
|
|
3496
|
+
return isString(val) && BEST_BUY_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3497
|
+
}
|
|
3498
|
+
function isCostCoUrl(val) {
|
|
3499
|
+
return isString(val) && COSTCO_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3500
|
+
}
|
|
3501
|
+
function isEtsyUrl(val) {
|
|
3502
|
+
return isString(val) && ETSY_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3503
|
+
}
|
|
3504
|
+
function isTargetUrl(val) {
|
|
3505
|
+
return isString(val) && TARGET_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3506
|
+
}
|
|
3507
|
+
function isEbayUrl(val) {
|
|
3508
|
+
return isString(val) && EBAY_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3509
|
+
}
|
|
3510
|
+
function isHomeDepotUrl(val) {
|
|
3511
|
+
return isString(val) && HOME_DEPOT_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3512
|
+
}
|
|
3513
|
+
function isMacysUrl(val) {
|
|
3514
|
+
return isString(val) && MACYS_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3515
|
+
}
|
|
3516
|
+
function isAppleUrl(val) {
|
|
3517
|
+
return isString(val) && APPLE_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3518
|
+
}
|
|
3519
|
+
function isWalmartUrl(val) {
|
|
3520
|
+
return isString(val) && WALMART_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3521
|
+
}
|
|
3522
|
+
function isAmazonUrl(val) {
|
|
3523
|
+
return isString(val) && AMAZON_DNS.some((i) => val.startsWith(`https://${i}`));
|
|
3524
|
+
}
|
|
3525
|
+
function isRetailUrl(val) {
|
|
3526
|
+
return isAmazonUrl(val) || isWalgreensUrl(val) || isAppleUrl(val) || isMacysUrl(val) || isEbayUrl(val) || isHomeDepotUrl(val) || isTargetUrl(val) || isEtsyUrl(val) || isCostCoUrl(val) || isBestBuyUrl(val) || isWayfairUrl(val) || isNikeUrl(val) || isLowesUrl(val) || isIkeaUrl(val) || isDellUrl(val) || isHmUrl(val) || isZaraUrl(val) || isKrogersUrl(val) || isWalgreensUrl(val) || isCvsUrl(val) || isWholeFoodsUrl(val);
|
|
3527
|
+
}
|
|
3528
|
+
|
|
3529
|
+
// src/type-guards/urls/Social.ts
|
|
3530
|
+
var URL20 = SOCIAL_MEDIA.flatMap((i) => i.baseUrls);
|
|
3531
|
+
var PROFILE = SOCIAL_MEDIA.map((i) => i.profileUrl);
|
|
3532
|
+
function isSocialMediaUrl(val) {
|
|
3533
|
+
return isString(val) && URL20.some((i) => val.startsWith(i));
|
|
3534
|
+
}
|
|
3535
|
+
function isSocialMediaProfileUrl(val) {
|
|
3536
|
+
return isString(val) && PROFILE.some((i) => i.startsWith(`${i}`));
|
|
3537
|
+
}
|
|
3538
|
+
|
|
3539
|
+
// src/type-guards/urls/youtube.ts
|
|
3540
|
+
function isYouTubeUrl(val) {
|
|
3541
|
+
return isString(val) && (val.startsWith("https://www.youtube.com") || val.startsWith("https://youtube.com") || val.startsWith("https://youtu.be"));
|
|
3542
|
+
}
|
|
3543
|
+
function isYouTubeShareUrl(val) {
|
|
3544
|
+
return isString(val) && val.startsWith(`https://youtu.be`);
|
|
3545
|
+
}
|
|
3546
|
+
function isYouTubeVideoUrl(val) {
|
|
3547
|
+
return isString(val) && (val.startsWith("https://www.youtube.com") || val.startsWith("https://youtube.com") || val.startsWith("https://youtu.be"));
|
|
3548
|
+
}
|
|
3549
|
+
function isYouTubePlaylistUrl(val) {
|
|
3550
|
+
return isString(val) && (val === `https://www.youtube.com/feed/playlists` || val === `https://youtube.com/feed/playlists` || val === `https://www.youtube.com/channel/playlists` || val === `https://youtube.com/channel/playlists` || val.startsWith(`https://www.youtube.com/@`) && val.endsWith(`/playlists`) || val.startsWith(`https://youtube.com/@`) && val.endsWith(`/playlists`));
|
|
3551
|
+
}
|
|
3552
|
+
function feed_map(type) {
|
|
3553
|
+
return isUndefined(type) ? `/feed` : type === "liked" ? `/playlist?list=LL` : ["history", "playlists", "trending", "subscriptions"].includes(type) ? `/feed/${type}` : `/feed/`;
|
|
3554
|
+
}
|
|
3555
|
+
function isYouTubeFeedUrl(val, type) {
|
|
3556
|
+
return isString(val) && (val.startsWith(`https://www.youtube.com${feed_map(type)}`) || val.startsWith(`https://youtube.com${feed_map(type)}`));
|
|
3557
|
+
}
|
|
3558
|
+
function isYouTubeFeedHistoryUrl(val) {
|
|
3559
|
+
return isString(val) && (val.startsWith(`https://www.youtube.com/feed/history`) || val.startsWith(`https://youtube.com/feed/history`));
|
|
3560
|
+
}
|
|
3561
|
+
function isYouTubePlaylistsUrl(val) {
|
|
3562
|
+
return isString(val) && (val.startsWith(`https://www.youtube.com/feed/playlists`) || val.startsWith(`https://youtube.com/feed/playlists`));
|
|
3563
|
+
}
|
|
3564
|
+
function isYouTubeTrendingUrl(val) {
|
|
3565
|
+
return isString(val) && (val.startsWith(`https://www.youtube.com/feed/trending`) || val.startsWith(`https://youtube.com/feed/trending`));
|
|
3566
|
+
}
|
|
3567
|
+
function isYouTubeSubscriptionsUrl(val) {
|
|
3568
|
+
return isString(val) && (val.startsWith(`https://www.youtube.com/feed/subscriptions`) || val.startsWith(`https://youtube.com/feed/subscriptions`));
|
|
3569
|
+
}
|
|
3570
|
+
function isYouTubeCreatorUrl(url) {
|
|
3571
|
+
return isString(url) && (url.startsWith(`https://www.youtube.com/@`) || url.startsWith(`https://youtube.com/@`) || url.startsWith(`https://www.youtube.com/channel/`));
|
|
3572
|
+
}
|
|
3573
|
+
function isYouTubeVideosInPlaylist(val) {
|
|
3574
|
+
return isString(val) && (val.startsWith(`https://www.youtube.com/playlist?`) || val.startsWith(`https://youtube.com/playlist?`)) && hasUrlQueryParameter(val, "list");
|
|
3575
|
+
}
|
|
3576
|
+
|
|
3577
|
+
// src/type-conversion/csv.ts
|
|
3578
|
+
function csv(csv2, format = `string-numeric-tuple`) {
|
|
3579
|
+
const tuple3 = [];
|
|
3580
|
+
csv2.split(/,\s?/).forEach((v) => {
|
|
3581
|
+
tuple3.push(
|
|
3582
|
+
format === "string-numeric-tuple" ? isNumberLike(v) ? Number(v) : v : format === "json-tuple" ? isNumberLike(v) ? Number(v) : v === "true" ? true : v === "false" ? false : `"${v}"` : format === "string-tuple" ? `${v}` : Never
|
|
3583
|
+
);
|
|
3584
|
+
});
|
|
3585
|
+
return tuple3;
|
|
3586
|
+
}
|
|
3587
|
+
|
|
3588
|
+
// src/type-conversion/intersect.ts
|
|
3589
|
+
function intersect(value, _intersectedWith) {
|
|
3590
|
+
return value;
|
|
3591
|
+
}
|
|
3592
|
+
|
|
3593
|
+
// src/literals/stripTrailing.ts
|
|
3594
|
+
function stripTrailing(content, ...strip2) {
|
|
3595
|
+
let output = String(content);
|
|
3596
|
+
for (const s of strip2) {
|
|
3597
|
+
if (output.endsWith(String(s))) {
|
|
3598
|
+
output = output.slice(0, -1 * String(s).length);
|
|
3599
|
+
}
|
|
3600
|
+
}
|
|
3601
|
+
return isNumber(content) ? Number(output) : output;
|
|
3602
|
+
}
|
|
3603
|
+
|
|
3604
|
+
// src/type-conversion/ip6GroupExpansion.ts
|
|
3605
|
+
function ip6GroupExpansion(ip) {
|
|
3606
|
+
return stripTrailing(ip.replaceAll("::", ":0000:"), ":");
|
|
3607
|
+
}
|
|
3608
|
+
|
|
3609
|
+
// src/type-conversion/json.ts
|
|
3610
|
+
function jsonValue(val) {
|
|
3611
|
+
return isNumberLike(val) ? Number(val) : val === "true" ? true : val === "false" ? false : `"${val}"`;
|
|
3612
|
+
}
|
|
3613
|
+
function jsonValues(...val) {
|
|
3614
|
+
return val.map((i) => jsonValue(i));
|
|
3615
|
+
}
|
|
3616
|
+
|
|
3617
|
+
// src/type-conversion/lookupCountry.ts
|
|
3618
|
+
function lookupAlpha2Code(code, prop) {
|
|
3619
|
+
const found = ISO3166_1.find((i) => i.alpha2 === code);
|
|
3620
|
+
return found ? found[prop] : void 0;
|
|
3621
|
+
}
|
|
3622
|
+
function lookupAlpha3Code(code, prop) {
|
|
3623
|
+
const found = ISO3166_1.find((i) => i.alpha3 === code);
|
|
3624
|
+
return found ? found[prop] : void 0;
|
|
3625
|
+
}
|
|
3626
|
+
function lookupName(name, prop) {
|
|
3627
|
+
const found = ISO3166_1.find((i) => i.name === name);
|
|
3628
|
+
return found ? found[prop] : void 0;
|
|
3629
|
+
}
|
|
3630
|
+
function lookupNumericCode(code, prop) {
|
|
3631
|
+
let num = isNumber(code) ? `${code}` : code;
|
|
3632
|
+
if (num.length === 1) {
|
|
3633
|
+
num = `00${num}`;
|
|
3634
|
+
} else if (num.length === 2) {
|
|
3635
|
+
num = `0${num}`;
|
|
3636
|
+
}
|
|
3637
|
+
const found = ISO3166_1.find((i) => i.countryCode === num);
|
|
3638
|
+
return found ? found[prop] : void 0;
|
|
3639
|
+
}
|
|
3640
|
+
function lookupCountryName(code) {
|
|
3641
|
+
const uc = uppercase(code);
|
|
3642
|
+
return isNumberLike(code) ? lookupNumericCode(code, "name") : isIso3166Alpha2(uc) ? lookupAlpha2Code(uc, "name") : isIso3166Alpha3(uc) ? lookupAlpha3Code(uc, "name") : void 0;
|
|
3643
|
+
}
|
|
3644
|
+
function lookupCountryAlpha2(code) {
|
|
3645
|
+
const uc = uppercase(code);
|
|
3646
|
+
return isNumberLike(code) ? lookupNumericCode(code, "alpha2") : isIso3166Alpha2(uc) ? lookupAlpha2Code(uc, "alpha2") : isIso3166Alpha3(uc) ? lookupAlpha3Code(uc, "alpha2") : isIso3166CountryName(code) ? lookupName(code, "alpha2") : void 0;
|
|
3647
|
+
}
|
|
3648
|
+
function lookupCountryAlpha3(token) {
|
|
3649
|
+
const uc = uppercase(token);
|
|
3650
|
+
return isNumberLike(token) ? lookupNumericCode(token, "alpha3") : isIso3166Alpha2(uc) ? lookupAlpha2Code(uc, "alpha3") : isIso3166Alpha3(uc) ? lookupAlpha3Code(uc, "alpha3") : isIso3166CountryName(token) ? lookupName(token, "alpha3") : void 0;
|
|
3651
|
+
}
|
|
3652
|
+
function lookupCountryCode(token) {
|
|
3653
|
+
const uc = uppercase(token);
|
|
3654
|
+
return isNumberLike(token) ? lookupNumericCode(token, "countryCode") : isIso3166Alpha2(uc) ? lookupAlpha2Code(uc, "countryCode") : isIso3166Alpha3(uc) ? lookupAlpha3Code(uc, "countryCode") : isIso3166CountryName(token) ? lookupName(token, "countryCode") : void 0;
|
|
3655
|
+
}
|
|
3656
|
+
|
|
3657
|
+
// src/type-conversion/mergeObjects.ts
|
|
3658
|
+
function mergeObjects(defVal, override) {
|
|
3659
|
+
const intersectingKeys = sharedKeys(defVal, override);
|
|
3660
|
+
const defUnique = withoutKeys(defVal, ...intersectingKeys);
|
|
3661
|
+
const overrideUnique = withoutKeys(defVal, ...intersectingKeys);
|
|
3662
|
+
const merged = {
|
|
3663
|
+
...intersectingKeys.reduce(
|
|
3664
|
+
(acc, key) => typeof override[key] === "undefined" ? { ...acc, [key]: defVal[key] } : { ...acc, [key]: override[key] },
|
|
3665
|
+
{}
|
|
3666
|
+
),
|
|
3667
|
+
...defUnique,
|
|
3668
|
+
...overrideUnique
|
|
3669
|
+
};
|
|
3670
|
+
return merged;
|
|
3671
|
+
}
|
|
3672
|
+
|
|
3673
|
+
// src/type-conversion/mergeScalars.ts
|
|
3674
|
+
function mergeScalars(a, b) {
|
|
3675
|
+
return isUndefined(b) ? a : b;
|
|
3676
|
+
}
|
|
3677
|
+
|
|
3678
|
+
// src/type-conversion/mergeTuples.ts
|
|
3679
|
+
function mergeTuples(a, b) {
|
|
3680
|
+
return b.length > a.length ? b.map((v, idx) => v !== void 0 ? v : a[idx]) : [...b, ...a.slice(b.length)].map((v, idx) => v !== void 0 ? v : a[idx]);
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3683
|
+
// src/type-conversion/never.ts
|
|
3684
|
+
function never(val) {
|
|
3685
|
+
return val;
|
|
3686
|
+
}
|
|
3687
|
+
|
|
3688
|
+
// src/type-conversion/optional.ts
|
|
3689
|
+
function optional(value) {
|
|
3690
|
+
return value;
|
|
3691
|
+
}
|
|
3692
|
+
function orNull(value) {
|
|
3693
|
+
return value;
|
|
3694
|
+
}
|
|
3695
|
+
function optionalOrNull(value) {
|
|
3696
|
+
return value;
|
|
3697
|
+
}
|
|
3698
|
+
|
|
3699
|
+
// src/type-conversion/stripParenthesis.ts
|
|
3700
|
+
function stripParenthesis(val) {
|
|
3701
|
+
return stripTrailing(stripLeading(val.trim(), "("), ")").trim();
|
|
3702
|
+
}
|
|
3703
|
+
|
|
3704
|
+
// src/type-conversion/toNumber.ts
|
|
3705
|
+
function convertScalar(val) {
|
|
3706
|
+
switch (typeof val) {
|
|
3707
|
+
case "number":
|
|
3708
|
+
return val;
|
|
3709
|
+
case "string":
|
|
3710
|
+
return Number(val);
|
|
3711
|
+
case "boolean":
|
|
3712
|
+
return val ? 1 : 0;
|
|
3713
|
+
default:
|
|
3714
|
+
throw new Error(`${typeof val} is an invalid scalar type to convert to a number!`);
|
|
3715
|
+
}
|
|
3716
|
+
}
|
|
3717
|
+
var convertList = (val) => val.map((i) => convertScalar(i));
|
|
3718
|
+
function toNumber(value) {
|
|
3719
|
+
return Array.isArray(value) ? convertList(value) : convertScalar(value);
|
|
3720
|
+
}
|
|
3721
|
+
|
|
3722
|
+
// src/type-conversion/tw-conversion.ts
|
|
3723
|
+
var MODS = TW_MODIFIERS.map((i) => `${i}:`);
|
|
3724
|
+
function removeTailwindModifiers(val) {
|
|
3725
|
+
return MODS.some((i) => val.startsWith(i)) ? removeTailwindModifiers(val.replace(MODS.find((i) => val.startsWith(i)), "")) : val;
|
|
3726
|
+
}
|
|
3727
|
+
function getTailwindModifiers(val) {
|
|
3728
|
+
return val.split(":").filter((i) => isTailwindModifier(i));
|
|
3729
|
+
}
|
|
3730
|
+
|
|
3731
|
+
// src/type-conversion/union.ts
|
|
3732
|
+
function union(..._options) {
|
|
3733
|
+
return (value) => value;
|
|
3734
|
+
}
|
|
3735
|
+
|
|
3736
|
+
// src/type-conversion/unionize.ts
|
|
3737
|
+
function unionize(value, _inUnionWith) {
|
|
3738
|
+
return value;
|
|
3739
|
+
}
|
|
3740
|
+
|
|
3741
|
+
// src/literals/retainUntil.ts
|
|
3742
|
+
function retainUntil(content, ...find2) {
|
|
3743
|
+
const chars = asChars(content);
|
|
3744
|
+
let idx = 0;
|
|
3745
|
+
while (!find2.includes(chars[idx]) && idx <= chars.length) {
|
|
3746
|
+
idx = idx + 1;
|
|
3747
|
+
}
|
|
3748
|
+
return idx === 0 ? "" : content.slice(0, idx);
|
|
3749
|
+
}
|
|
3750
|
+
function retainUntilInclusive(content, ...find2) {
|
|
3751
|
+
const chars = asChars(content);
|
|
3752
|
+
let idx = 0;
|
|
3753
|
+
while (!find2.includes(chars[idx]) && idx <= chars.length) {
|
|
3754
|
+
idx = idx + 1;
|
|
3755
|
+
}
|
|
3756
|
+
return idx === 0 ? content.slice(0, 1) : content.slice(0, idx + 1);
|
|
3757
|
+
}
|
|
3758
|
+
|
|
3759
|
+
// src/literals/retainWhile.ts
|
|
3760
|
+
function retainWhile(content, ...retain2) {
|
|
3761
|
+
const stopIdx = asChars(content).findIndex((c) => !retain2.includes(c));
|
|
3762
|
+
return content.slice(0, stopIdx);
|
|
3763
|
+
}
|
|
3764
|
+
|
|
3765
|
+
// src/literals/rightWhitespace.ts
|
|
3766
|
+
function rightWhitespace(content) {
|
|
3767
|
+
const trimmed = content.trimStart();
|
|
3768
|
+
return retainAfterInclusive(
|
|
3769
|
+
trimmed,
|
|
3770
|
+
...WHITESPACE_CHARS
|
|
3771
|
+
);
|
|
3772
|
+
}
|
|
3773
|
+
|
|
3774
|
+
// src/literals/stripAfter.ts
|
|
3775
|
+
function stripAfter(content, find2) {
|
|
3776
|
+
return content.split(find2).shift();
|
|
3777
|
+
}
|
|
3778
|
+
|
|
3779
|
+
// src/literals/stripBefore.ts
|
|
3780
|
+
function stripBefore(content, find2) {
|
|
3781
|
+
return content.split(find2).slice(1).join(find2);
|
|
3782
|
+
}
|
|
3783
|
+
|
|
3784
|
+
// src/literals/stripChars.ts
|
|
3785
|
+
function stripChars(content, ...strip2) {
|
|
3786
|
+
const chars = asChars(content);
|
|
3787
|
+
return chars.filter((c) => !strip2.includes(c)).join("");
|
|
3788
|
+
}
|
|
3789
|
+
|
|
3790
|
+
// src/literals/stripLeading.ts
|
|
3791
|
+
function stripLeading(content, ...strip2) {
|
|
3792
|
+
let output = String(content);
|
|
3793
|
+
for (const s of strip2) {
|
|
3794
|
+
if (output.startsWith(String(s))) {
|
|
3795
|
+
output = output.slice(String(s).length);
|
|
3796
|
+
}
|
|
3797
|
+
}
|
|
3798
|
+
return isNumber(content) ? Number(output) : output;
|
|
3799
|
+
}
|
|
3800
|
+
|
|
3801
|
+
// src/literals/stripSurround.ts
|
|
3802
|
+
function stripSurround(...chars) {
|
|
3803
|
+
return (input) => {
|
|
3804
|
+
let output = String(input);
|
|
3805
|
+
for (const s of chars) {
|
|
3806
|
+
if (output.startsWith(String(s))) {
|
|
3807
|
+
output = output.slice(String(s).length);
|
|
3808
|
+
}
|
|
3809
|
+
if (output.endsWith(String(s))) {
|
|
3810
|
+
output = output.slice(0, -1 * String(s).length);
|
|
3811
|
+
}
|
|
3812
|
+
}
|
|
3813
|
+
return isNumber(input) ? Number(output) : output;
|
|
3814
|
+
};
|
|
3815
|
+
}
|
|
3816
|
+
|
|
3817
|
+
// src/literals/stripUntil.ts
|
|
3818
|
+
function stripUntil(content, ...until) {
|
|
3819
|
+
const stopIdx = asChars(content).findIndex((c) => until.includes(c));
|
|
3820
|
+
return content.slice(stopIdx);
|
|
3821
|
+
}
|
|
3822
|
+
|
|
3823
|
+
// src/literals/stripWhile.ts
|
|
3824
|
+
function stripWhile(content, ...match) {
|
|
3825
|
+
const stopIdx = asChars(content).findIndex((c) => !match.includes(c));
|
|
3826
|
+
return content.slice(stopIdx);
|
|
3827
|
+
}
|
|
3828
|
+
|
|
3829
|
+
// src/literals/surround.ts
|
|
3830
|
+
function surround(prefix, postfix) {
|
|
3831
|
+
return (input) => `${prefix}${input}${postfix}`;
|
|
3832
|
+
}
|
|
3833
|
+
|
|
3834
|
+
// src/literals/takeNumericCharacters.ts
|
|
3835
|
+
function takeNumericCharacters(content) {
|
|
3836
|
+
const nonNumericIdx = asChars(content).findIndex((i) => !NUMERIC_CHAR.includes(i));
|
|
3837
|
+
return content.slice(0, nonNumericIdx);
|
|
3838
|
+
}
|
|
3839
|
+
|
|
3840
|
+
// src/literals/toCamelCase.ts
|
|
3841
|
+
function toCamelCase(input, preserveWhitespace) {
|
|
3842
|
+
const pascal = preserveWhitespace ? toPascalCase(input, preserveWhitespace) : toPascalCase(input);
|
|
3843
|
+
const [_, preWhite, focus, postWhite] = /^(\s*)(.*?)(\s*)$/.exec(
|
|
3844
|
+
pascal
|
|
3845
|
+
);
|
|
3846
|
+
const camel = (preserveWhitespace ? preWhite : "") + focus.replace(/^.*?(\d*[a-z|])/is, (_2, p1) => p1.toLowerCase()) + (preserveWhitespace ? postWhite : "");
|
|
3847
|
+
return camel;
|
|
3848
|
+
}
|
|
3849
|
+
|
|
3850
|
+
// src/literals/toKebabCase.ts
|
|
3851
|
+
function toKebabCase(input, _preserveWhitespace = false) {
|
|
3852
|
+
const [_, preWhite, focus, postWhite] = /^(\s*)(.*?)(\s*)$/.exec(input);
|
|
3853
|
+
const replaceWhitespace = (i) => i.replace(/\s/g, "-");
|
|
3854
|
+
const replaceUppercase = (i) => i.replace(/[A-Z]/g, (c) => `-${c[0].toLowerCase()}`);
|
|
3855
|
+
const replaceLeadingDash = (i) => i.replace(/^-/, "");
|
|
3856
|
+
const replaceTrailingDash = (i) => i.replace(/-$/, "");
|
|
3857
|
+
const replaceUnderscore = (i) => i.replace(/_/g, "-");
|
|
3858
|
+
const removeDupDashes = (i) => i.replace(/-+/g, "-");
|
|
3859
|
+
return removeDupDashes(`${preWhite}${replaceUnderscore(
|
|
3860
|
+
replaceTrailingDash(
|
|
3861
|
+
replaceLeadingDash(removeDupDashes(replaceWhitespace(replaceUppercase(focus))))
|
|
3862
|
+
)
|
|
3863
|
+
)}${postWhite}`);
|
|
3864
|
+
}
|
|
3865
|
+
|
|
3866
|
+
// src/literals/toNumericArray.ts
|
|
3867
|
+
function toNumericArray(arr) {
|
|
3868
|
+
return arr.map((i) => Number(i));
|
|
3869
|
+
}
|
|
3870
|
+
|
|
3871
|
+
// src/literals/toPascalCase.ts
|
|
3872
|
+
function toPascalCase(input, preserveWhitespace = void 0) {
|
|
3873
|
+
const [_, preWhite, focus, postWhite] = /^(\s*)(.*?)(\s*)$/.exec(
|
|
3874
|
+
input
|
|
3875
|
+
);
|
|
3876
|
+
const convertInteriorToCap = (i) => i.replace(/[ |_\-]+(\d*[a-z|])/gi, (_2, p1) => p1.toUpperCase());
|
|
3877
|
+
const startingToCap = (i) => i.replace(/^[_|-]*(\d*[a-z])/g, (_2, p1) => p1.toUpperCase());
|
|
3878
|
+
const replaceLeadingTrash = (i) => i.replace(/^[-_]/, "");
|
|
3879
|
+
const replaceTrailingTrash = (i) => i.replace(/[-_]$/, "");
|
|
3880
|
+
const pascal = `${preserveWhitespace ? preWhite : ""}${capitalize(
|
|
3881
|
+
replaceTrailingTrash(replaceLeadingTrash(convertInteriorToCap(startingToCap(focus))))
|
|
3882
|
+
)}${preserveWhitespace ? postWhite : ""}`;
|
|
3883
|
+
return pascal;
|
|
3884
|
+
}
|
|
3885
|
+
|
|
3886
|
+
// src/literals/toSnakeCase.ts
|
|
3887
|
+
function toSnakeCase(input, preserveWhitespace = false) {
|
|
3888
|
+
const [_, preWhite, focus, postWhite] = /^(\s*)(.*?)(\s*)$/.exec(input);
|
|
3889
|
+
const convertInteriorSpace = (input2) => input2.replace(/\s+/g, "_");
|
|
3890
|
+
const convertDashes = (input2) => input2.replace(/-/g, "_");
|
|
3891
|
+
const injectUnderscoreBeforeCaps = (input2) => input2.replace(/([A-Z])/g, "_$1");
|
|
3892
|
+
const removeLeadingUnderscore = (input2) => input2.startsWith("_") ? input2.slice(1) : input2;
|
|
3893
|
+
return ((preserveWhitespace ? preWhite : "") + removeLeadingUnderscore(
|
|
3894
|
+
injectUnderscoreBeforeCaps(convertDashes(convertInteriorSpace(focus)))
|
|
3895
|
+
).toLowerCase() + (preserveWhitespace ? postWhite : "")).replace(/__/g, "_");
|
|
3896
|
+
}
|
|
3897
|
+
|
|
3898
|
+
// src/literals/toString.ts
|
|
3899
|
+
function toString(val) {
|
|
3900
|
+
return String(val);
|
|
3901
|
+
}
|
|
3902
|
+
|
|
3903
|
+
// src/literals/toUppercase.ts
|
|
3904
|
+
function toUppercase(str) {
|
|
3905
|
+
return str.split("").map((i) => ifLowercaseChar(i, (v) => capitalize(v), (v) => v)).join("");
|
|
3906
|
+
}
|
|
3907
|
+
|
|
3908
|
+
// src/literals/trim.ts
|
|
3909
|
+
function trim(input) {
|
|
3910
|
+
return input.trim();
|
|
3911
|
+
}
|
|
3912
|
+
function trimLeft(input) {
|
|
3913
|
+
return input.trimStart();
|
|
3914
|
+
}
|
|
3915
|
+
function trimStart(input) {
|
|
3916
|
+
return input.trimStart();
|
|
3917
|
+
}
|
|
3918
|
+
function trimRight(input) {
|
|
3919
|
+
return input.trimEnd();
|
|
3920
|
+
}
|
|
3921
|
+
function trimEnd(input) {
|
|
3922
|
+
return input.trimEnd();
|
|
3923
|
+
}
|
|
3924
|
+
|
|
3925
|
+
// src/literals/truncate.ts
|
|
3926
|
+
function truncate(content, maxLength, ellipsis = false) {
|
|
3927
|
+
const overLimit = content.length > maxLength;
|
|
3928
|
+
return overLimit ? ellipsis ? `${content.slice(0, maxLength)}${typeof ellipsis === "string" ? ellipsis : "..."}` : content.slice(0, maxLength) : content;
|
|
3929
|
+
}
|
|
3930
|
+
|
|
3931
|
+
// src/literals/tuple.ts
|
|
3932
|
+
function tuple(...values) {
|
|
3933
|
+
const arr = values.length === 1 ? values[0] : values;
|
|
3934
|
+
return asArray(arr);
|
|
3935
|
+
}
|
|
3936
|
+
|
|
3937
|
+
// src/literals/uncapitalize.ts
|
|
3938
|
+
function uncapitalize(str) {
|
|
3939
|
+
return `${str?.slice(0, 1).toLowerCase()}${str?.slice(1)}`;
|
|
3940
|
+
}
|
|
3941
|
+
|
|
3942
|
+
// src/literals/uppercase.ts
|
|
3943
|
+
function uppercase(str) {
|
|
3944
|
+
return str.toUpperCase();
|
|
3945
|
+
}
|
|
3946
|
+
|
|
3947
|
+
// src/literals/widen.ts
|
|
3948
|
+
function widen(value) {
|
|
3949
|
+
return value;
|
|
3950
|
+
}
|
|
3951
|
+
|
|
3952
|
+
// src/meta/urlMeta.ts
|
|
3953
|
+
var PROTOCOLS = Object.values(NETWORK_PROTOCOL_LOOKUP).flat().filter((i) => i !== "");
|
|
3954
|
+
function getUrlProtocol(url) {
|
|
3955
|
+
const proto = PROTOCOLS.find((p) => url.startsWith(`${p}://`));
|
|
3956
|
+
return proto;
|
|
3957
|
+
}
|
|
3958
|
+
function removeUrlProtocol(url) {
|
|
3959
|
+
return stripBefore(url, "://");
|
|
3960
|
+
}
|
|
3961
|
+
function ensurePath(val) {
|
|
3962
|
+
const val2 = ensureLeading(val, "/");
|
|
3963
|
+
return val === "" ? "" : stripTrailing(val2, "/");
|
|
3964
|
+
}
|
|
3965
|
+
function getUrlPath(url) {
|
|
3966
|
+
return isUrl(url) ? ensurePath(
|
|
3967
|
+
stripAfter(stripBefore(removeUrlProtocol(url), "/"), "?")
|
|
3968
|
+
) : Never;
|
|
3969
|
+
}
|
|
3970
|
+
function getUrlQueryParams(url, specific = void 0) {
|
|
3971
|
+
const qp = stripBefore(url, "?");
|
|
3972
|
+
if (specific) {
|
|
3973
|
+
return qp.includes(`${specific}=`) ? decodeURIComponent(
|
|
3974
|
+
stripAfter(
|
|
3975
|
+
stripBefore(qp, `${specific}=`),
|
|
3976
|
+
"&"
|
|
3977
|
+
).replace(/\+/g, "%20")
|
|
3978
|
+
) : void 0;
|
|
3979
|
+
}
|
|
3980
|
+
return qp === "" ? qp : `?${qp}`;
|
|
3981
|
+
}
|
|
3982
|
+
function getUrlPort(url) {
|
|
3983
|
+
const candidate = takeNumericCharacters(
|
|
3984
|
+
stripBefore(removeUrlProtocol(url), ":")
|
|
3985
|
+
);
|
|
3986
|
+
return candidate === "" ? "default" : Number(candidate);
|
|
3987
|
+
}
|
|
3988
|
+
function getUrlSource(url) {
|
|
3989
|
+
const candidate = stripAfter(stripAfter(stripAfter(removeUrlProtocol(url), "/"), "?"), ":");
|
|
3990
|
+
return isIpAddress(candidate) || isDomainName(candidate) ? candidate : Never;
|
|
3991
|
+
}
|
|
3992
|
+
function urlMeta(url) {
|
|
3993
|
+
return {
|
|
3994
|
+
url,
|
|
3995
|
+
isUrl: isUrl(url),
|
|
3996
|
+
protocol: getUrlProtocol(url),
|
|
3997
|
+
path: getUrlPath(url),
|
|
3998
|
+
queryParameters: getUrlQueryParams(url),
|
|
3999
|
+
port: getUrlPort(url),
|
|
4000
|
+
source: getUrlSource(url),
|
|
4001
|
+
isIpAddress: isIpAddress(getUrlSource(url)),
|
|
4002
|
+
isIp4Address: isIp4Address(getUrlSource(url)),
|
|
4003
|
+
isIp6Address: isIp6Address(getUrlSource(url))
|
|
4004
|
+
};
|
|
4005
|
+
}
|
|
4006
|
+
|
|
4007
|
+
// src/meta/youtube-meta.ts
|
|
4008
|
+
function getYouTubePageType(url) {
|
|
4009
|
+
return isYouTubeUrl(url) ? isYouTubeVideoUrl(url) && (hasUrlQueryParameter(url, "v") || isYouTubeShareUrl(url)) ? hasUrlQueryParameter(url, "list") ? isYouTubeShareUrl(url) ? hasUrlQueryParameter(url, "t") ? `play::video::in-list::share-link::with-timestamp` : `play::video::in-list::share-link` : `play::video::in-list` : isYouTubeShareUrl(url) ? hasUrlQueryParameter(url, "t") ? `play::video::solo::share-link::with-timestamp` : `play::video::solo::share-link` : `play::video::solo` : isYouTubeCreatorUrl(url) ? getUrlPath(url).includes("/videos") ? "creator::videos" : getUrlPath(url).includes("/playlists") ? "creator::playlists" : last(getUrlPath(url).split("/")).startsWith("@") || getUrlPath(url).includes("/featured") ? "creator::featured" : "creator::other" : isYouTubeFeedUrl(url) ? isYouTubeFeedUrl(url, "history") ? "feed::history" : isYouTubeFeedUrl(url, "playlists") ? "feed::playlists" : isYouTubeFeedUrl(url, "liked") ? "feed::liked" : isYouTubeFeedUrl(url, "subscriptions") ? "feed::subscriptions" : isYouTubeFeedUrl(url, "trending") ? "feed::trending" : "feed::other" : isYouTubeVideosInPlaylist(url) ? "playlist::show" : "other" : Never;
|
|
4010
|
+
}
|
|
4011
|
+
function youtubeEmbed(url) {
|
|
4012
|
+
if (hasUrlQueryParameter(url, "v")) {
|
|
4013
|
+
const id = getUrlQueryParams(url, "v");
|
|
4014
|
+
return `https://www.youtube.com/embed/${id}`;
|
|
4015
|
+
} else if (isYouTubeShareUrl(url)) {
|
|
4016
|
+
const id = url.split("/").pop();
|
|
4017
|
+
if (id) {
|
|
4018
|
+
return `https://www.youtube.com/embed/${id}`;
|
|
4019
|
+
} else {
|
|
4020
|
+
throw new Error(`Unexpected problem parsing share URL -- "${url}" -- into a YouTube embed URL`);
|
|
4021
|
+
}
|
|
4022
|
+
} else {
|
|
4023
|
+
throw new Error(`Unexpected URL structure; unable to convert "${url}" to a YouTube embed URL`);
|
|
4024
|
+
}
|
|
4025
|
+
}
|
|
4026
|
+
function youtubeMeta(url) {
|
|
4027
|
+
return isYouTubeUrl(url) ? {
|
|
4028
|
+
url,
|
|
4029
|
+
isYouTubeUrl: true,
|
|
4030
|
+
isShareUrl: isYouTubeShareUrl(url),
|
|
4031
|
+
pageType: getYouTubePageType(url)
|
|
4032
|
+
} : {
|
|
4033
|
+
url,
|
|
4034
|
+
isYouTubeUrl: false
|
|
4035
|
+
};
|
|
4036
|
+
}
|
|
4037
|
+
|
|
4038
|
+
// src/queues/fifo.ts
|
|
4039
|
+
function queue(state) {
|
|
4040
|
+
return {
|
|
4041
|
+
queue: state,
|
|
4042
|
+
size: state.length,
|
|
4043
|
+
isEmpty() {
|
|
4044
|
+
return state.length === 0;
|
|
4045
|
+
},
|
|
4046
|
+
clear() {
|
|
4047
|
+
state.slice(0, 0);
|
|
4048
|
+
},
|
|
4049
|
+
drain() {
|
|
4050
|
+
const old_state = [...state];
|
|
4051
|
+
state.slice(0, 0);
|
|
4052
|
+
return old_state;
|
|
4053
|
+
},
|
|
4054
|
+
push(...add) {
|
|
4055
|
+
state.push(...add);
|
|
4056
|
+
},
|
|
4057
|
+
drop(quantity) {
|
|
4058
|
+
if (quantity && quantity > state.length) {
|
|
4059
|
+
throw new Error("Cannot drop more elements than present in the queue");
|
|
4060
|
+
}
|
|
4061
|
+
state.splice(0, quantity || 1);
|
|
4062
|
+
},
|
|
4063
|
+
take(quantity) {
|
|
4064
|
+
if (quantity && quantity > state.length) {
|
|
4065
|
+
throw new Error("Cannot take more elements than present in the queue");
|
|
4066
|
+
}
|
|
4067
|
+
const result2 = state.slice(0, quantity || 1);
|
|
4068
|
+
state.splice(0, quantity || 1);
|
|
4069
|
+
return result2;
|
|
4070
|
+
},
|
|
4071
|
+
*[Symbol.iterator]() {
|
|
4072
|
+
for (let i = 0; i < state.length; i++) {
|
|
4073
|
+
yield state[i];
|
|
4074
|
+
}
|
|
4075
|
+
}
|
|
4076
|
+
};
|
|
4077
|
+
}
|
|
4078
|
+
function createFifoQueue(...list2) {
|
|
4079
|
+
return queue([...list2]);
|
|
4080
|
+
}
|
|
4081
|
+
|
|
4082
|
+
// src/queues/lifo.ts
|
|
4083
|
+
function queue2(state) {
|
|
4084
|
+
return {
|
|
4085
|
+
queue: state,
|
|
4086
|
+
size: state.length,
|
|
4087
|
+
isEmpty() {
|
|
4088
|
+
return state.length === 0;
|
|
4089
|
+
},
|
|
4090
|
+
push(...add) {
|
|
4091
|
+
state.push(...add);
|
|
4092
|
+
},
|
|
4093
|
+
drop(quantity) {
|
|
4094
|
+
state.splice(-quantity);
|
|
4095
|
+
},
|
|
4096
|
+
clear() {
|
|
4097
|
+
state.slice(0, 0);
|
|
4098
|
+
},
|
|
4099
|
+
drain() {
|
|
4100
|
+
const old_state = [...state];
|
|
4101
|
+
state.slice(0, 0);
|
|
4102
|
+
return old_state;
|
|
4103
|
+
},
|
|
4104
|
+
take(quantity) {
|
|
4105
|
+
const result2 = state.slice(-quantity);
|
|
4106
|
+
state.splice(-quantity);
|
|
4107
|
+
return result2;
|
|
4108
|
+
},
|
|
4109
|
+
*[Symbol.iterator]() {
|
|
4110
|
+
for (let i = state.length - 1; i >= 0; i--) {
|
|
4111
|
+
yield state[i];
|
|
4112
|
+
}
|
|
4113
|
+
}
|
|
4114
|
+
};
|
|
4115
|
+
}
|
|
4116
|
+
function createLifoQueue(...list2) {
|
|
4117
|
+
return queue2([...list2]);
|
|
4118
|
+
}
|
|
4119
|
+
|
|
4120
|
+
// src/runtime-types/asToken.ts
|
|
4121
|
+
var scalarToToken = identity({
|
|
4122
|
+
string: "<<string>>",
|
|
4123
|
+
number: "<<number>>",
|
|
4124
|
+
boolean: "<<boolean>>",
|
|
4125
|
+
true: "<<true>>",
|
|
4126
|
+
false: "<<false>>",
|
|
4127
|
+
null: "<<null>>",
|
|
4128
|
+
undefined: "<<undefined>>",
|
|
4129
|
+
unknown: "<<unknown>>",
|
|
4130
|
+
any: "<<any>>",
|
|
4131
|
+
never: "<<never>>"
|
|
4132
|
+
});
|
|
4133
|
+
function stringLiteral(str) {
|
|
4134
|
+
return stripAfter(stripBefore(str, "string("), ")");
|
|
4135
|
+
}
|
|
4136
|
+
function numericLiteral(str) {
|
|
4137
|
+
return stripAfter(stripBefore(str, "number("), ")");
|
|
4138
|
+
}
|
|
4139
|
+
function handleOptional(token) {
|
|
4140
|
+
const bare = stripTrailing(stripLeading(token, "Opt<"), ">");
|
|
4141
|
+
return bare.startsWith("string") ? `<<union::[ <<string>>, <<undefined>> ]>>` : bare.startsWith("number") ? `<<union::[ <<number>>, <<undefined>> ]>>` : bare.startsWith("boolean") ? `<<union::[ <<boolean>>, <<undefined>> ]>>` : bare.startsWith("unknown") ? `<<union::[ <<unknown>>, <<undefined>> ]>>` : `<<never>>`;
|
|
4142
|
+
}
|
|
4143
|
+
function simpleScalarTokenToTypeToken(val) {
|
|
4144
|
+
return val in scalarToToken ? scalarToToken[val] : val.startsWith("string(") ? stringLiteral(val).includes(",") ? `<<union::[ ${stringLiteral(val).split(/,\s?/).map((i) => `"${i}"`).join(", ")} ]>>` : `<<string::${stringLiteral(val)}>>` : val.startsWith("number(") ? numericLiteral(val).includes(",") ? `<<union::[ ${numericLiteral(val).split(/,\s?/).join(", ")} ]>>` : `<<number::${numericLiteral(val)}>>` : val.startsWith("Opt<") ? handleOptional(val) : `<<never>>`;
|
|
4145
|
+
}
|
|
4146
|
+
function unionNode(node) {
|
|
4147
|
+
return isNumberLike(node) ? `<<number::${node}>>` : isBooleanLike(node) ? `<<${node}>>` : isSimpleContainerToken(node) ? simpleContainerTokenToTypeToken() : isSimpleScalarToken(node) ? simpleScalarToken(node) : `<<string::${node}>>`;
|
|
4148
|
+
}
|
|
4149
|
+
function union2(nodes) {
|
|
4150
|
+
return Array.isArray(nodes) ? nodes.map((n) => unionNode(n)) : nodes.includes(",") ? nodes.split(/,\s?/).map((n) => unionNode(n)).join(", ") : unionNode(nodes);
|
|
4151
|
+
}
|
|
4152
|
+
var stripUnion = stripSurround("Union(", ")");
|
|
4153
|
+
function simpleUnionTokenToTypeToken(val) {
|
|
4154
|
+
return val.startsWith(`Union(`) && val.endsWith(`)`) ? `<<union::[ ${union2(stripUnion(val))} ]>>` : Never;
|
|
4155
|
+
}
|
|
4156
|
+
function simpleContainerTokenToTypeToken(_val) {
|
|
4157
|
+
}
|
|
4158
|
+
function asTypeToken(_val) {
|
|
4159
|
+
return "not ready";
|
|
4160
|
+
}
|
|
4161
|
+
|
|
4162
|
+
// src/runtime-types/shape-helpers/addToken.ts
|
|
4163
|
+
function addToken(token, ...params) {
|
|
4164
|
+
return `<<${token}${params.length > 0 ? `::${params.join("::")}` : ""}>>`;
|
|
4165
|
+
}
|
|
4166
|
+
|
|
4167
|
+
// src/runtime-types/shape-helpers/atomics.ts
|
|
4168
|
+
function boolean(literal2) {
|
|
4169
|
+
return isDefined(literal2) ? isTrue(literal2) ? addToken("true") : isFalse(literal2) ? addToken("false") : addToken("boolean") : addToken("boolean");
|
|
4170
|
+
}
|
|
4171
|
+
var unknown = () => "<<unknown>>";
|
|
4172
|
+
var undefinedType = () => "<<undefined>>";
|
|
4173
|
+
var nullType = () => "<<null>>";
|
|
4174
|
+
|
|
4175
|
+
// src/runtime-types/shape-helpers/functions.ts
|
|
4176
|
+
function fn(..._args) {
|
|
4177
|
+
return {
|
|
4178
|
+
returns: (_rtn) => ({
|
|
4179
|
+
addProperties: (_kv) => {
|
|
4180
|
+
return null;
|
|
4181
|
+
},
|
|
4182
|
+
done: () => {
|
|
4183
|
+
return null;
|
|
4184
|
+
}
|
|
4185
|
+
}),
|
|
4186
|
+
done: () => {
|
|
4187
|
+
const result2 = null;
|
|
4188
|
+
return result2;
|
|
4189
|
+
}
|
|
4190
|
+
};
|
|
4191
|
+
}
|
|
4192
|
+
|
|
4193
|
+
// src/runtime-types/shape-helpers/literal-containers.ts
|
|
4194
|
+
function dictionary(_obj) {
|
|
4195
|
+
return null;
|
|
4196
|
+
}
|
|
4197
|
+
function tuple2(..._elements) {
|
|
4198
|
+
return null;
|
|
4199
|
+
}
|
|
4200
|
+
|
|
4201
|
+
// src/runtime-types/shape-helpers/regexToken.ts
|
|
4202
|
+
function regexToken(re, ...rep) {
|
|
4203
|
+
let exp = "";
|
|
4204
|
+
if (isString(re)) {
|
|
4205
|
+
try {
|
|
4206
|
+
const test = new RegExp(re);
|
|
4207
|
+
if (!isRegExp(test)) {
|
|
4208
|
+
const err = new Error(`Invalid RegEx passed into regexToken(${re}, ${JSON.stringify(rep)})!`);
|
|
4209
|
+
err.name = "InvalidRegEx";
|
|
4210
|
+
throw err;
|
|
4211
|
+
} else {
|
|
4212
|
+
exp = re;
|
|
4213
|
+
}
|
|
4214
|
+
} catch {
|
|
4215
|
+
const err = new Error(`Invalid RegEx passed into regexToken(${re}, ${JSON.stringify(rep)})!`);
|
|
4216
|
+
err.name = "InvalidRegEx";
|
|
4217
|
+
throw err;
|
|
4218
|
+
}
|
|
4219
|
+
} else if (isRegExp(re)) {
|
|
4220
|
+
exp = re.toString();
|
|
4221
|
+
}
|
|
4222
|
+
const token = `<<string-set::regexp::${encodeURIComponent(exp)}>>`;
|
|
4223
|
+
return token;
|
|
4224
|
+
}
|
|
4225
|
+
|
|
4226
|
+
// src/runtime-types/shape-helpers/singletons.ts
|
|
4227
|
+
function addSingleton(token, api2) {
|
|
4228
|
+
return (...literals) => {
|
|
4229
|
+
return literals.length === 0 ? api2 || addToken(token) : literals.length === 1 ? addToken(token, literals[0]) : addToken(
|
|
4230
|
+
"union",
|
|
4231
|
+
literals.map((l) => addToken(token, `${l}`)).join(",")
|
|
4232
|
+
);
|
|
4233
|
+
};
|
|
4234
|
+
}
|
|
4235
|
+
var stringApi = {
|
|
4236
|
+
startsWith: (startsWith2) => addToken(`string-set`, `startsWith::${startsWith2}`),
|
|
4237
|
+
endsWith: (endsWith2) => addToken(`string-set`, `endsWith::${endsWith2}`),
|
|
4238
|
+
zip: () => addToken("string-set", "Zip5"),
|
|
4239
|
+
zipPlus4: () => addToken("string-set", "Zip5_4"),
|
|
4240
|
+
zipCode: () => addToken("string-set", "ZipCode"),
|
|
4241
|
+
militaryTime: (resolution) => {
|
|
4242
|
+
return addToken(
|
|
4243
|
+
"string-set",
|
|
4244
|
+
"militaryTime",
|
|
4245
|
+
resolution || "HH:MM"
|
|
4246
|
+
);
|
|
4247
|
+
},
|
|
4248
|
+
civilianTime: (resolution) => {
|
|
4249
|
+
return addToken(
|
|
4250
|
+
"string-set",
|
|
4251
|
+
"militaryTime",
|
|
4252
|
+
resolution || "HH:MM"
|
|
4253
|
+
);
|
|
4254
|
+
},
|
|
4255
|
+
numericString: () => addToken("string-set", "numeric"),
|
|
4256
|
+
ipv4Address: () => addToken("string-set", "ipv4Address"),
|
|
4257
|
+
ipv6Address: () => addToken("string-set", "ipv6Address"),
|
|
4258
|
+
regex: (exp, ...literalRepresentation) => {
|
|
4259
|
+
const token = regexToken(exp, ...literalRepresentation);
|
|
4260
|
+
return token;
|
|
4261
|
+
},
|
|
4262
|
+
done: () => addToken("string")
|
|
4263
|
+
};
|
|
4264
|
+
var string2 = addSingleton("string", stringApi);
|
|
4265
|
+
var number = addSingleton("number");
|
|
4266
|
+
|
|
4267
|
+
// src/runtime-types/shape-helpers/union.ts
|
|
4268
|
+
function union3(...elements) {
|
|
4269
|
+
const result2 = elements.map((_el) => {
|
|
4270
|
+
});
|
|
4271
|
+
return result2;
|
|
4272
|
+
}
|
|
4273
|
+
|
|
4274
|
+
// src/runtime-types/shape-helpers/wide-containers.ts
|
|
4275
|
+
function record(_key, _value) {
|
|
4276
|
+
return null;
|
|
4277
|
+
}
|
|
4278
|
+
function array(_type) {
|
|
4279
|
+
return null;
|
|
4280
|
+
}
|
|
4281
|
+
function set(_type) {
|
|
4282
|
+
return null;
|
|
4283
|
+
}
|
|
4284
|
+
function map(_key, _value) {
|
|
4285
|
+
return null;
|
|
4286
|
+
}
|
|
4287
|
+
function weakMap(_key, _value) {
|
|
4288
|
+
return null;
|
|
4289
|
+
}
|
|
4290
|
+
|
|
4291
|
+
// src/runtime-types/shape.ts
|
|
4292
|
+
function isAddOrDone(val) {
|
|
4293
|
+
return isObject(val) && hasKeys("add", "done") && typeof val.done === "function" && typeof val.add === "function";
|
|
4294
|
+
}
|
|
4295
|
+
var ShapeApiImplementation = {
|
|
4296
|
+
string: string2,
|
|
4297
|
+
number,
|
|
4298
|
+
boolean,
|
|
4299
|
+
unknown,
|
|
4300
|
+
undefined: undefinedType,
|
|
4301
|
+
null: nullType,
|
|
4302
|
+
union: union3,
|
|
4303
|
+
fn,
|
|
4304
|
+
record,
|
|
4305
|
+
array,
|
|
4306
|
+
set,
|
|
4307
|
+
map,
|
|
4308
|
+
weakMap,
|
|
4309
|
+
dictionary,
|
|
4310
|
+
tuple: tuple2
|
|
4311
|
+
};
|
|
4312
|
+
function shape(cb) {
|
|
4313
|
+
const rtn = cb(ShapeApiImplementation);
|
|
4314
|
+
return handleDoneFn(
|
|
4315
|
+
isAddOrDone(rtn) ? rtn.done() : rtn
|
|
4316
|
+
);
|
|
4317
|
+
}
|
|
4318
|
+
function isShape(v) {
|
|
4319
|
+
return !!(isString(v) && v.startsWith("<<") && v.endsWith(">>") && SHAPE_PREFIXES.some((i) => v.startsWith(`<<${i}`)));
|
|
4320
|
+
}
|
|
4321
|
+
|
|
4322
|
+
// src/runtime-types/asDefineObject.ts
|
|
4323
|
+
function asDefineObject(defn) {
|
|
4324
|
+
const result2 = Object.keys(defn).reduce(
|
|
4325
|
+
(acc, i) => isSimpleToken(defn[i]) ? { ...acc, [i]: asType(defn[i]) } : isDoneFn(defn[i]) ? {
|
|
4326
|
+
...acc,
|
|
4327
|
+
[i]: handleDoneFn(defn[i](ShapeApiImplementation))
|
|
4328
|
+
} : isFunction(defn[i]) ? {
|
|
4329
|
+
...acc,
|
|
4330
|
+
[i]: handleDoneFn(defn[i](ShapeApiImplementation))
|
|
4331
|
+
} : Never,
|
|
4332
|
+
{}
|
|
4333
|
+
);
|
|
4334
|
+
return result2;
|
|
4335
|
+
}
|
|
4336
|
+
|
|
4337
|
+
// src/runtime-types/asType.ts
|
|
4338
|
+
function asType(...token) {
|
|
4339
|
+
return isFunction(token) ? token(ShapeApiImplementation) : token.length === 1 ? isFunction(token[0]) ? handleDoneFn(token[0](ShapeApiImplementation)) : isDefineObject(token[0]) ? asDefineObject(token[0]) : token[0] : token.map((i) => isFunction(i) ? handleDoneFn(i(ShapeApiImplementation)) : i);
|
|
4340
|
+
}
|
|
4341
|
+
function asStringLiteral(...values) {
|
|
4342
|
+
return values.map((i) => i);
|
|
4343
|
+
}
|
|
4344
|
+
|
|
4345
|
+
// src/runtime-types/choices.ts
|
|
4346
|
+
var choices = "NOT READY";
|
|
4347
|
+
|
|
4348
|
+
// src/runtime-types/ip6Prefix.ts
|
|
4349
|
+
function ip6Prefix(...groups) {
|
|
4350
|
+
const empty = addToken("string");
|
|
4351
|
+
const count = 4 - groups.length;
|
|
4352
|
+
const fillIn = [];
|
|
4353
|
+
for (let index = 0; index < count; index++) {
|
|
4354
|
+
fillIn.push(empty);
|
|
4355
|
+
}
|
|
4356
|
+
return [
|
|
4357
|
+
"<<string::",
|
|
4358
|
+
[
|
|
4359
|
+
groups.join(":"),
|
|
4360
|
+
fillIn.join(":")
|
|
4361
|
+
].join(":"),
|
|
4362
|
+
">>"
|
|
4363
|
+
].join("");
|
|
4364
|
+
}
|
|
4365
|
+
|
|
4366
|
+
// src/runtime-types/list.ts
|
|
4367
|
+
function createProxy(...initialize) {
|
|
4368
|
+
const state = initialize;
|
|
4369
|
+
state.id = null;
|
|
4370
|
+
const proxy = new Proxy(state, {});
|
|
4371
|
+
Object.defineProperty(proxy, "id", {
|
|
4372
|
+
enumerable: false
|
|
4373
|
+
});
|
|
4374
|
+
return proxy;
|
|
4375
|
+
}
|
|
4376
|
+
function list(...init) {
|
|
4377
|
+
return init.length === 1 && isArray(init[0]) ? createProxy(...init[0]) : createProxy(...init);
|
|
4378
|
+
}
|
|
4379
|
+
|
|
4380
|
+
// src/runtime-types/tokens/createTypeToken.ts
|
|
4381
|
+
function unionToken(...els) {
|
|
4382
|
+
return `<<union::[${jsonValues(els)}]>>`;
|
|
4383
|
+
}
|
|
4384
|
+
function singletonApi(base) {
|
|
4385
|
+
const handler = (...lits) => {
|
|
4386
|
+
return lits.length === 0 ? base === "string" ? `<<string>>` : `<<number>>` : lits.length === 1 ? base === "string" ? `<<string::${lits[0]}>>` : `<<number::${lits[0]}>>` : base === "string" ? `<<string::${unionToken(...lits)}>>` : `<<number::${unionToken(...lits)}>>`;
|
|
4387
|
+
};
|
|
4388
|
+
return handler;
|
|
4389
|
+
}
|
|
4390
|
+
function createTypeToken(base) {
|
|
4391
|
+
return isAtomicToken(base) ? `<<${base}>>` : isSingletonToken(base) ? singletonApi(base) : "";
|
|
4392
|
+
}
|
|
4393
|
+
|
|
4394
|
+
// src/runtime-types/tokens/simpleToken.ts
|
|
4395
|
+
var simpleToken = (token) => token;
|
|
4396
|
+
var simpleScalarToken = (token) => token;
|
|
4397
|
+
var simpleContainerToken = (token) => token;
|
|
4398
|
+
function simpleScalarType(token) {
|
|
4399
|
+
const value = simpleScalarToken(token);
|
|
4400
|
+
return value;
|
|
4401
|
+
}
|
|
4402
|
+
function simpleContainerType(token) {
|
|
4403
|
+
const value = simpleContainerToken(token);
|
|
4404
|
+
return value;
|
|
4405
|
+
}
|
|
4406
|
+
function simpleType(token) {
|
|
4407
|
+
const value = isSimpleScalarToken(token) ? simpleScalarType(token) : isSimpleContainerToken(token) ? simpleContainerToken(token) : Never;
|
|
4408
|
+
return value;
|
|
4409
|
+
}
|
|
4410
|
+
|
|
4411
|
+
// src/sets/uniqueKeys.ts
|
|
4412
|
+
function uniqueKeys(left, right) {
|
|
4413
|
+
const isNumeric = !!(isArray(left) && isArray(right));
|
|
4414
|
+
if (isArray(left) && !isArray(right) || isArray(right) && !isArray(left)) {
|
|
4415
|
+
throw new Error("uniqueKeys(l,r) given invalid comparison; both left and right values should be an object or an array but not one of each!");
|
|
4416
|
+
}
|
|
4417
|
+
const l = isNumeric ? Object.keys(left).map((i) => Number(i)) : Object.keys(left);
|
|
4418
|
+
const r = isNumeric ? Object.keys(right).map((i) => Number(i)) : Object.keys(right);
|
|
4419
|
+
if (isNumeric) {
|
|
4420
|
+
throw new Error("uniqueKeys does not yet work with tuples");
|
|
4421
|
+
}
|
|
4422
|
+
const leftKeys = l.filter((i) => !r.includes(i));
|
|
4423
|
+
const rightKeys = r.filter((i) => !l.includes(i));
|
|
4424
|
+
return [
|
|
4425
|
+
"LeftRight",
|
|
4426
|
+
leftKeys,
|
|
4427
|
+
rightKeys
|
|
4428
|
+
];
|
|
4429
|
+
}
|
|
4430
|
+
|
|
4431
|
+
// src/vuejs/asVueRef.ts
|
|
4432
|
+
function asVueRef(value) {
|
|
4433
|
+
return {
|
|
4434
|
+
value,
|
|
4435
|
+
_value: null
|
|
4436
|
+
};
|
|
4437
|
+
}
|
|
4438
|
+
|
|
4439
|
+
exports.ShapeApiImplementation = ShapeApiImplementation;
|
|
4440
|
+
exports.addFnToProps = addFnToProps;
|
|
4441
|
+
exports.addPropsToFn = addPropsToFn;
|
|
4442
|
+
exports.and = and;
|
|
4443
|
+
exports.asApi = asApi;
|
|
4444
|
+
exports.asArray = asArray;
|
|
4445
|
+
exports.asChars = asChars;
|
|
4446
|
+
exports.asDate = asDate;
|
|
4447
|
+
exports.asEscapeFunction = asEscapeFunction;
|
|
4448
|
+
exports.asIsoDate = asIsoDate;
|
|
4449
|
+
exports.asOptionalParamFunction = asOptionalParamFunction;
|
|
4450
|
+
exports.asPhoneFormat = asPhoneFormat;
|
|
4451
|
+
exports.asRecord = asRecord;
|
|
4452
|
+
exports.asString = asString;
|
|
4453
|
+
exports.asStringLiteral = asStringLiteral;
|
|
4454
|
+
exports.asType = asType;
|
|
4455
|
+
exports.asTypeToken = asTypeToken;
|
|
4456
|
+
exports.asVueRef = asVueRef;
|
|
4457
|
+
exports.box = box;
|
|
4458
|
+
exports.boxDictionaryValues = boxDictionaryValues;
|
|
4459
|
+
exports.capitalize = capitalize;
|
|
4460
|
+
exports.choices = choices;
|
|
4461
|
+
exports.createConverter = createConverter;
|
|
4462
|
+
exports.createCssKeyframe = createCssKeyframe;
|
|
4463
|
+
exports.createCssSelector = createCssSelector;
|
|
4464
|
+
exports.createErrorCondition = createErrorCondition;
|
|
4465
|
+
exports.createFifoQueue = createFifoQueue;
|
|
4466
|
+
exports.createFnWithProps = createFnWithProps;
|
|
4467
|
+
exports.createLifoQueue = createLifoQueue;
|
|
4468
|
+
exports.createTypeToken = createTypeToken;
|
|
4469
|
+
exports.cssColor = cssColor;
|
|
4470
|
+
exports.csv = csv;
|
|
4471
|
+
exports.defineObj = defineObj;
|
|
4472
|
+
exports.defineTuple = defineTuple;
|
|
4473
|
+
exports.endsWith = endsWith;
|
|
4474
|
+
exports.ensureLeading = ensureLeading;
|
|
4475
|
+
exports.ensureSurround = ensureSurround;
|
|
4476
|
+
exports.ensureTrailing = ensureTrailing;
|
|
4477
|
+
exports.entries = entries;
|
|
4478
|
+
exports.errCondition = errCondition;
|
|
4479
|
+
exports.filter = filter;
|
|
4480
|
+
exports.find = find;
|
|
4481
|
+
exports.fnMeta = fnMeta;
|
|
4482
|
+
exports.get = get;
|
|
4483
|
+
exports.getDaysBetween = getDaysBetween;
|
|
4484
|
+
exports.getEach = getEach;
|
|
4485
|
+
exports.getPhoneCountryCode = getPhoneCountryCode;
|
|
4486
|
+
exports.getTailwindModifiers = getTailwindModifiers;
|
|
4487
|
+
exports.getToday = getToday;
|
|
4488
|
+
exports.getTomorrow = getTomorrow;
|
|
4489
|
+
exports.getUrlPath = getUrlPath;
|
|
4490
|
+
exports.getUrlPort = getUrlPort;
|
|
4491
|
+
exports.getUrlProtocol = getUrlProtocol;
|
|
4492
|
+
exports.getUrlQueryParams = getUrlQueryParams;
|
|
4493
|
+
exports.getUrlSource = getUrlSource;
|
|
4494
|
+
exports.getWeekNumber = getWeekNumber;
|
|
4495
|
+
exports.getYesterday = getYesterday;
|
|
4496
|
+
exports.getYouTubePageType = getYouTubePageType;
|
|
4497
|
+
exports.handleDoneFn = handleDoneFn;
|
|
4498
|
+
exports.hasDefaultValue = hasDefaultValue;
|
|
4499
|
+
exports.hasIndexOf = hasIndexOf;
|
|
4500
|
+
exports.hasKeys = hasKeys;
|
|
4501
|
+
exports.hasUrlPort = hasUrlPort;
|
|
4502
|
+
exports.hasUrlQueryParameter = hasUrlQueryParameter;
|
|
4503
|
+
exports.hasWhiteSpace = hasWhiteSpace;
|
|
4504
|
+
exports.idLiteral = idLiteral;
|
|
4505
|
+
exports.idTypeGuard = idTypeGuard;
|
|
4506
|
+
exports.identity = identity;
|
|
4507
|
+
exports.ifArray = ifArray;
|
|
4508
|
+
exports.ifArrayPartial = ifArrayPartial;
|
|
4509
|
+
exports.ifBoolean = ifBoolean;
|
|
4510
|
+
exports.ifChar = ifChar;
|
|
4511
|
+
exports.ifContainer = ifContainer;
|
|
4512
|
+
exports.ifDefined = ifDefined;
|
|
4513
|
+
exports.ifFalse = ifFalse;
|
|
4514
|
+
exports.ifFunction = ifFunction;
|
|
4515
|
+
exports.ifHasKey = ifHasKey;
|
|
4516
|
+
exports.ifLength = ifLength;
|
|
4517
|
+
exports.ifLowercaseChar = ifLowercaseChar;
|
|
4518
|
+
exports.ifNotNull = ifNotNull;
|
|
4519
|
+
exports.ifNull = ifNull;
|
|
4520
|
+
exports.ifNumber = ifNumber;
|
|
4521
|
+
exports.ifObject = ifObject;
|
|
4522
|
+
exports.ifSameType = ifSameType;
|
|
4523
|
+
exports.ifScalar = ifScalar;
|
|
4524
|
+
exports.ifString = ifString;
|
|
4525
|
+
exports.ifTrue = ifTrue;
|
|
4526
|
+
exports.ifUndefined = ifUndefined;
|
|
4527
|
+
exports.ifUppercaseChar = ifUppercaseChar;
|
|
4528
|
+
exports.indexOf = indexOf;
|
|
4529
|
+
exports.intersect = intersect;
|
|
4530
|
+
exports.intersection = intersection;
|
|
4531
|
+
exports.ip6GroupExpansion = ip6GroupExpansion;
|
|
4532
|
+
exports.ip6Prefix = ip6Prefix;
|
|
4533
|
+
exports.isAccelerationMetric = isAccelerationMetric;
|
|
4534
|
+
exports.isAccelerationUom = isAccelerationUom;
|
|
4535
|
+
exports.isAlpha = isAlpha;
|
|
4536
|
+
exports.isAmazonUrl = isAmazonUrl;
|
|
4537
|
+
exports.isApi = isApi;
|
|
4538
|
+
exports.isApiSurface = isApiSurface;
|
|
4539
|
+
exports.isAppleUrl = isAppleUrl;
|
|
4540
|
+
exports.isAreaMetric = isAreaMetric;
|
|
4541
|
+
exports.isAreaUom = isAreaUom;
|
|
4542
|
+
exports.isArray = isArray;
|
|
4543
|
+
exports.isArrayToken = isArrayToken;
|
|
4544
|
+
exports.isAtomicToken = isAtomicToken;
|
|
4545
|
+
exports.isAustralianNewsUrl = isAustralianNewsUrl;
|
|
4546
|
+
exports.isBelgiumNewsUrl = isBelgiumNewsUrl;
|
|
4547
|
+
exports.isBestBuyUrl = isBestBuyUrl;
|
|
4548
|
+
exports.isBitbucketUrl = isBitbucketUrl;
|
|
4549
|
+
exports.isBoolean = isBoolean;
|
|
4550
|
+
exports.isBooleanLike = isBooleanLike;
|
|
4551
|
+
exports.isBox = isBox;
|
|
4552
|
+
exports.isCanadianNewsUrl = isCanadianNewsUrl;
|
|
4553
|
+
exports.isChineseNewsUrl = isChineseNewsUrl;
|
|
4554
|
+
exports.isCodeCommitUrl = isCodeCommitUrl;
|
|
4555
|
+
exports.isConstant = isConstant;
|
|
4556
|
+
exports.isContainer = isContainer;
|
|
4557
|
+
exports.isContainerToken = isContainerToken;
|
|
4558
|
+
exports.isCostCoUrl = isCostCoUrl;
|
|
4559
|
+
exports.isCountryAbbrev = isCountryAbbrev;
|
|
4560
|
+
exports.isCountryCode2 = isCountryCode2;
|
|
4561
|
+
exports.isCountryCode3 = isCountryCode3;
|
|
4562
|
+
exports.isCountryName = isCountryName;
|
|
4563
|
+
exports.isCssAspectRatio = isCssAspectRatio;
|
|
4564
|
+
exports.isCurrentMetric = isCurrentMetric;
|
|
4565
|
+
exports.isCurrentUom = isCurrentUom;
|
|
4566
|
+
exports.isCvsUrl = isCvsUrl;
|
|
4567
|
+
exports.isDanishNewsUrl = isDanishNewsUrl;
|
|
4568
|
+
exports.isDate = isDate;
|
|
4569
|
+
exports.isDefineObject = isDefineObject;
|
|
4570
|
+
exports.isDefined = isDefined;
|
|
4571
|
+
exports.isDellUrl = isDellUrl;
|
|
4572
|
+
exports.isDistanceMetric = isDistanceMetric;
|
|
4573
|
+
exports.isDistanceUom = isDistanceUom;
|
|
4574
|
+
exports.isDomainName = isDomainName;
|
|
4575
|
+
exports.isDoneFn = isDoneFn;
|
|
4576
|
+
exports.isDutchNewsUrl = isDutchNewsUrl;
|
|
4577
|
+
exports.isEbayUrl = isEbayUrl;
|
|
4578
|
+
exports.isEmail = isEmail;
|
|
4579
|
+
exports.isEnergyMetric = isEnergyMetric;
|
|
4580
|
+
exports.isEnergyUom = isEnergyUom;
|
|
4581
|
+
exports.isEqual = isEqual;
|
|
4582
|
+
exports.isErrorCondition = isErrorCondition;
|
|
4583
|
+
exports.isEscapeFunction = isEscapeFunction;
|
|
4584
|
+
exports.isEtsyUrl = isEtsyUrl;
|
|
4585
|
+
exports.isFalse = isFalse;
|
|
4586
|
+
exports.isFalsy = isFalsy;
|
|
4587
|
+
exports.isFnToken = isFnToken;
|
|
4588
|
+
exports.isFnWithParams = isFnWithParams;
|
|
4589
|
+
exports.isFrenchNewsUrl = isFrenchNewsUrl;
|
|
4590
|
+
exports.isFrequencyMetric = isFrequencyMetric;
|
|
4591
|
+
exports.isFrequencyUom = isFrequencyUom;
|
|
4592
|
+
exports.isFunction = isFunction;
|
|
4593
|
+
exports.isGeneratorToken = isGeneratorToken;
|
|
4594
|
+
exports.isGermanNewsUrl = isGermanNewsUrl;
|
|
4595
|
+
exports.isGithubIssueUrl = isGithubIssueUrl;
|
|
4596
|
+
exports.isGithubIssuesListUrl = isGithubIssuesListUrl;
|
|
4597
|
+
exports.isGithubOrgUrl = isGithubOrgUrl;
|
|
4598
|
+
exports.isGithubProjectUrl = isGithubProjectUrl;
|
|
4599
|
+
exports.isGithubProjectsListUrl = isGithubProjectsListUrl;
|
|
4600
|
+
exports.isGithubReleaseTagUrl = isGithubReleaseTagUrl;
|
|
4601
|
+
exports.isGithubReleasesListUrl = isGithubReleasesListUrl;
|
|
4602
|
+
exports.isGithubRepoReleaseTagUrl = isGithubRepoReleaseTagUrl;
|
|
4603
|
+
exports.isGithubRepoReleasesUrl = isGithubRepoReleasesUrl;
|
|
4604
|
+
exports.isGithubRepoUrl = isGithubRepoUrl;
|
|
4605
|
+
exports.isGithubUrl = isGithubUrl;
|
|
4606
|
+
exports.isHexadecimal = isHexadecimal;
|
|
4607
|
+
exports.isHmUrl = isHmUrl;
|
|
4608
|
+
exports.isHomeDepotUrl = isHomeDepotUrl;
|
|
4609
|
+
exports.isHtmlElement = isHtmlElement;
|
|
4610
|
+
exports.isIkeaUrl = isIkeaUrl;
|
|
4611
|
+
exports.isIndexable = isIndexable;
|
|
4612
|
+
exports.isIndianNewsUrl = isIndianNewsUrl;
|
|
4613
|
+
exports.isInlineSvg = isInlineSvg;
|
|
4614
|
+
exports.isIp4Address = isIp4Address;
|
|
4615
|
+
exports.isIp6Address = isIp6Address;
|
|
4616
|
+
exports.isIpAddress = isIpAddress;
|
|
4617
|
+
exports.isIso3166Alpha2 = isIso3166Alpha2;
|
|
4618
|
+
exports.isIso3166Alpha3 = isIso3166Alpha3;
|
|
4619
|
+
exports.isIso3166CountryCode = isIso3166CountryCode;
|
|
4620
|
+
exports.isIso3166CountryName = isIso3166CountryName;
|
|
4621
|
+
exports.isIsoDate = isIsoDate;
|
|
4622
|
+
exports.isIsoDateTime = isIsoDateTime;
|
|
4623
|
+
exports.isIsoExplicitDate = isIsoExplicitDate;
|
|
4624
|
+
exports.isIsoExplicitTime = isIsoExplicitTime;
|
|
4625
|
+
exports.isIsoImplicitDate = isIsoImplicitDate;
|
|
4626
|
+
exports.isIsoImplicitTime = isIsoImplicitTime;
|
|
4627
|
+
exports.isIsoTime = isIsoTime;
|
|
4628
|
+
exports.isIsoYear = isIsoYear;
|
|
4629
|
+
exports.isItalianNewsUrl = isItalianNewsUrl;
|
|
4630
|
+
exports.isJapaneseNewsUrl = isJapaneseNewsUrl;
|
|
4631
|
+
exports.isKrogersUrl = isKrogersUrl;
|
|
4632
|
+
exports.isLeapYear = isLeapYear;
|
|
4633
|
+
exports.isLength = isLength;
|
|
4634
|
+
exports.isLikeRegExp = isLikeRegExp;
|
|
4635
|
+
exports.isLowesUrl = isLowesUrl;
|
|
4636
|
+
exports.isLuminosityMetric = isLuminosityMetric;
|
|
4637
|
+
exports.isLuminosityUom = isLuminosityUom;
|
|
4638
|
+
exports.isLuxonDateTime = isLuxonDateTime;
|
|
4639
|
+
exports.isMacysUrl = isMacysUrl;
|
|
4640
|
+
exports.isMapToken = isMapToken;
|
|
4641
|
+
exports.isMassMetric = isMassMetric;
|
|
4642
|
+
exports.isMassUom = isMassUom;
|
|
4643
|
+
exports.isMetric = isMetric;
|
|
4644
|
+
exports.isMexicanNewsUrl = isMexicanNewsUrl;
|
|
4645
|
+
exports.isMoment = isMoment;
|
|
4646
|
+
exports.isNever = isNever;
|
|
4647
|
+
exports.isNewsUrl = isNewsUrl;
|
|
4648
|
+
exports.isNikeUrl = isNikeUrl;
|
|
4649
|
+
exports.isNorwegianNewsUrl = isNorwegianNewsUrl;
|
|
4650
|
+
exports.isNotNull = isNotNull;
|
|
4651
|
+
exports.isNothing = isNothing;
|
|
4652
|
+
exports.isNull = isNull;
|
|
4653
|
+
exports.isNumber = isNumber;
|
|
4654
|
+
exports.isNumberLike = isNumberLike;
|
|
4655
|
+
exports.isNumericArray = isNumericArray;
|
|
4656
|
+
exports.isNumericString = isNumericString;
|
|
4657
|
+
exports.isObject = isObject;
|
|
4658
|
+
exports.isObjectToken = isObjectToken;
|
|
4659
|
+
exports.isOptionalParamFunction = isOptionalParamFunction;
|
|
4660
|
+
exports.isPhoneNumber = isPhoneNumber;
|
|
4661
|
+
exports.isPowerMetric = isPowerMetric;
|
|
4662
|
+
exports.isPowerUom = isPowerUom;
|
|
4663
|
+
exports.isPressureMetric = isPressureMetric;
|
|
4664
|
+
exports.isPressureUom = isPressureUom;
|
|
4665
|
+
exports.isReadonlyArray = isReadonlyArray;
|
|
4666
|
+
exports.isRecordToken = isRecordToken;
|
|
4667
|
+
exports.isRef = isRef;
|
|
4668
|
+
exports.isRegExp = isRegExp;
|
|
4669
|
+
exports.isRepoSource = isRepoSource;
|
|
4670
|
+
exports.isRepoUrl = isRepoUrl;
|
|
4671
|
+
exports.isResistance = isResistance;
|
|
4672
|
+
exports.isResistanceUom = isResistanceUom;
|
|
4673
|
+
exports.isRetailUrl = isRetailUrl;
|
|
4674
|
+
exports.isSameTypeOf = isSameTypeOf;
|
|
4675
|
+
exports.isScalar = isScalar;
|
|
4676
|
+
exports.isSemanticVersion = isSemanticVersion;
|
|
4677
|
+
exports.isSet = isSet;
|
|
4678
|
+
exports.isSetToken = isSetToken;
|
|
4679
|
+
exports.isShape = isShape;
|
|
4680
|
+
exports.isShapeCallback = isShapeCallback;
|
|
4681
|
+
exports.isSimpleContainerToken = isSimpleContainerToken;
|
|
4682
|
+
exports.isSimpleContainerTokenTuple = isSimpleContainerTokenTuple;
|
|
4683
|
+
exports.isSimpleScalarToken = isSimpleScalarToken;
|
|
4684
|
+
exports.isSimpleScalarTokenTuple = isSimpleScalarTokenTuple;
|
|
4685
|
+
exports.isSimpleToken = isSimpleToken;
|
|
4686
|
+
exports.isSimpleTokenTuple = isSimpleTokenTuple;
|
|
4687
|
+
exports.isSingletonToken = isSingletonToken;
|
|
4688
|
+
exports.isSocialMediaProfileUrl = isSocialMediaProfileUrl;
|
|
4689
|
+
exports.isSocialMediaUrl = isSocialMediaUrl;
|
|
4690
|
+
exports.isSouthKoreanNewsUrl = isSouthKoreanNewsUrl;
|
|
4691
|
+
exports.isSpanishNewsUrl = isSpanishNewsUrl;
|
|
4692
|
+
exports.isSpecificConstant = isSpecificConstant;
|
|
4693
|
+
exports.isSpeedMetric = isSpeedMetric;
|
|
4694
|
+
exports.isSpeedUom = isSpeedUom;
|
|
4695
|
+
exports.isString = isString;
|
|
4696
|
+
exports.isStringArray = isStringArray;
|
|
4697
|
+
exports.isSwissNewsUrl = isSwissNewsUrl;
|
|
4698
|
+
exports.isSymbol = isSymbol;
|
|
4699
|
+
exports.isTailwindColor = isTailwindColor;
|
|
4700
|
+
exports.isTailwindColorClass = isTailwindColorClass;
|
|
4701
|
+
exports.isTailwindColorName = isTailwindColorName;
|
|
4702
|
+
exports.isTailwindColorTarget = isTailwindColorTarget;
|
|
4703
|
+
exports.isTailwindColorWithLuminosity = isTailwindColorWithLuminosity;
|
|
4704
|
+
exports.isTailwindColorWithLuminosityAndOpacity = isTailwindColorWithLuminosityAndOpacity;
|
|
4705
|
+
exports.isTailwindModifier = isTailwindModifier;
|
|
4706
|
+
exports.isTargetUrl = isTargetUrl;
|
|
4707
|
+
exports.isTemperatureMetric = isTemperatureMetric;
|
|
4708
|
+
exports.isTemperatureUom = isTemperatureUom;
|
|
4709
|
+
exports.isThenable = isThenable;
|
|
4710
|
+
exports.isThisMonth = isThisMonth;
|
|
4711
|
+
exports.isThisWeek = isThisWeek;
|
|
4712
|
+
exports.isThisYear = isThisYear;
|
|
4713
|
+
exports.isTimeMetric = isTimeMetric;
|
|
4714
|
+
exports.isTimeUom = isTimeUom;
|
|
4715
|
+
exports.isToday = isToday;
|
|
4716
|
+
exports.isTomorrow = isTomorrow;
|
|
4717
|
+
exports.isTrimable = isTrimable;
|
|
4718
|
+
exports.isTrue = isTrue;
|
|
4719
|
+
exports.isTruthy = isTruthy;
|
|
4720
|
+
exports.isTuple = isTuple;
|
|
4721
|
+
exports.isTupleToken = isTupleToken;
|
|
4722
|
+
exports.isTurkishNewsUrl = isTurkishNewsUrl;
|
|
4723
|
+
exports.isTypeOf = isTypeOf;
|
|
4724
|
+
exports.isTypeToken = isTypeToken;
|
|
4725
|
+
exports.isTypeTuple = isTypeTuple;
|
|
4726
|
+
exports.isUkNewsUrl = isUkNewsUrl;
|
|
4727
|
+
exports.isUndefined = isUndefined;
|
|
4728
|
+
exports.isUnionSetToken = isUnionSetToken;
|
|
4729
|
+
exports.isUnionToken = isUnionToken;
|
|
4730
|
+
exports.isUnset = isUnset;
|
|
4731
|
+
exports.isUom = isUom;
|
|
4732
|
+
exports.isUri = isUri;
|
|
4733
|
+
exports.isUrl = isUrl;
|
|
4734
|
+
exports.isUrlPath = isUrlPath;
|
|
4735
|
+
exports.isUrlSource = isUrlSource;
|
|
4736
|
+
exports.isUsNewsUrl = isUsNewsUrl;
|
|
4737
|
+
exports.isUsStateAbbreviation = isUsStateAbbreviation;
|
|
4738
|
+
exports.isUsStateName = isUsStateName;
|
|
4739
|
+
exports.isVoltageMetric = isVoltageMetric;
|
|
4740
|
+
exports.isVoltageUom = isVoltageUom;
|
|
4741
|
+
exports.isVolumeMetric = isVolumeMetric;
|
|
4742
|
+
exports.isVolumeUom = isVolumeUom;
|
|
4743
|
+
exports.isWalgreensUrl = isWalgreensUrl;
|
|
4744
|
+
exports.isWalmartUrl = isWalmartUrl;
|
|
4745
|
+
exports.isWayfairUrl = isWayfairUrl;
|
|
4746
|
+
exports.isWeakMapToken = isWeakMapToken;
|
|
4747
|
+
exports.isWholeFoodsUrl = isWholeFoodsUrl;
|
|
4748
|
+
exports.isYesterday = isYesterday;
|
|
4749
|
+
exports.isYouTubeCreatorUrl = isYouTubeCreatorUrl;
|
|
4750
|
+
exports.isYouTubeFeedHistoryUrl = isYouTubeFeedHistoryUrl;
|
|
4751
|
+
exports.isYouTubeFeedUrl = isYouTubeFeedUrl;
|
|
4752
|
+
exports.isYouTubePlaylistUrl = isYouTubePlaylistUrl;
|
|
4753
|
+
exports.isYouTubePlaylistsUrl = isYouTubePlaylistsUrl;
|
|
4754
|
+
exports.isYouTubeShareUrl = isYouTubeShareUrl;
|
|
4755
|
+
exports.isYouTubeSubscriptionsUrl = isYouTubeSubscriptionsUrl;
|
|
4756
|
+
exports.isYouTubeTrendingUrl = isYouTubeTrendingUrl;
|
|
4757
|
+
exports.isYouTubeUrl = isYouTubeUrl;
|
|
4758
|
+
exports.isYouTubeVideoUrl = isYouTubeVideoUrl;
|
|
4759
|
+
exports.isYouTubeVideosInPlaylist = isYouTubeVideosInPlaylist;
|
|
4760
|
+
exports.isZaraUrl = isZaraUrl;
|
|
4761
|
+
exports.isZipCode = isZipCode;
|
|
4762
|
+
exports.isZipCode5 = isZipCode5;
|
|
4763
|
+
exports.isZipPlus4 = isZipPlus4;
|
|
4764
|
+
exports.joinWith = joinWith;
|
|
4765
|
+
exports.jsonValue = jsonValue;
|
|
4766
|
+
exports.jsonValues = jsonValues;
|
|
4767
|
+
exports.keysOf = keysOf;
|
|
4768
|
+
exports.kindLiteral = kindLiteral;
|
|
4769
|
+
exports.last = last;
|
|
4770
|
+
exports.list = list;
|
|
4771
|
+
exports.literal = literal;
|
|
4772
|
+
exports.logicalReturns = logicalReturns;
|
|
4773
|
+
exports.lookupCountryAlpha2 = lookupCountryAlpha2;
|
|
4774
|
+
exports.lookupCountryAlpha3 = lookupCountryAlpha3;
|
|
4775
|
+
exports.lookupCountryCode = lookupCountryCode;
|
|
4776
|
+
exports.lookupCountryName = lookupCountryName;
|
|
4777
|
+
exports.lowercase = lowercase;
|
|
4778
|
+
exports.mergeObjects = mergeObjects;
|
|
4779
|
+
exports.mergeScalars = mergeScalars;
|
|
4780
|
+
exports.mergeTuples = mergeTuples;
|
|
4781
|
+
exports.nameLiteral = nameLiteral;
|
|
4782
|
+
exports.narrow = narrow;
|
|
4783
|
+
exports.never = never;
|
|
4784
|
+
exports.omit = omit;
|
|
4785
|
+
exports.optional = optional;
|
|
4786
|
+
exports.optionalOrNull = optionalOrNull;
|
|
4787
|
+
exports.or = or;
|
|
4788
|
+
exports.orNull = orNull;
|
|
4789
|
+
exports.pathJoin = pathJoin;
|
|
4790
|
+
exports.pluralize = pluralize;
|
|
4791
|
+
exports.removePhoneCountryCode = removePhoneCountryCode;
|
|
4792
|
+
exports.removeTailwindModifiers = removeTailwindModifiers;
|
|
4793
|
+
exports.removeUrlProtocol = removeUrlProtocol;
|
|
4794
|
+
exports.result = result;
|
|
4795
|
+
exports.retain = retain;
|
|
4796
|
+
exports.retainAfter = retainAfter;
|
|
4797
|
+
exports.retainAfterInclusive = retainAfterInclusive;
|
|
4798
|
+
exports.retainChars = retainChars;
|
|
4799
|
+
exports.retainUntil = retainUntil;
|
|
4800
|
+
exports.retainUntilInclusive = retainUntilInclusive;
|
|
4801
|
+
exports.retainWhile = retainWhile;
|
|
4802
|
+
exports.reverse = reverse;
|
|
4803
|
+
exports.rightWhitespace = rightWhitespace;
|
|
4804
|
+
exports.shape = shape;
|
|
4805
|
+
exports.sharedKeys = sharedKeys;
|
|
4806
|
+
exports.shift = shift;
|
|
4807
|
+
exports.simpleContainerToken = simpleContainerToken;
|
|
4808
|
+
exports.simpleContainerTokenToTypeToken = simpleContainerTokenToTypeToken;
|
|
4809
|
+
exports.simpleContainerType = simpleContainerType;
|
|
4810
|
+
exports.simpleScalarToken = simpleScalarToken;
|
|
4811
|
+
exports.simpleScalarTokenToTypeToken = simpleScalarTokenToTypeToken;
|
|
4812
|
+
exports.simpleScalarType = simpleScalarType;
|
|
4813
|
+
exports.simpleToken = simpleToken;
|
|
4814
|
+
exports.simpleType = simpleType;
|
|
4815
|
+
exports.simpleUnionTokenToTypeToken = simpleUnionTokenToTypeToken;
|
|
4816
|
+
exports.slice = slice;
|
|
4817
|
+
exports.split = split;
|
|
4818
|
+
exports.startsWith = startsWith;
|
|
4819
|
+
exports.stripAfter = stripAfter;
|
|
4820
|
+
exports.stripBefore = stripBefore;
|
|
4821
|
+
exports.stripChars = stripChars;
|
|
4822
|
+
exports.stripLeading = stripLeading;
|
|
4823
|
+
exports.stripParenthesis = stripParenthesis;
|
|
4824
|
+
exports.stripSurround = stripSurround;
|
|
4825
|
+
exports.stripTrailing = stripTrailing;
|
|
4826
|
+
exports.stripUntil = stripUntil;
|
|
4827
|
+
exports.stripWhile = stripWhile;
|
|
4828
|
+
exports.surround = surround;
|
|
4829
|
+
exports.takeNumericCharacters = takeNumericCharacters;
|
|
4830
|
+
exports.takeProp = takeProp;
|
|
4831
|
+
exports.toCamelCase = toCamelCase;
|
|
4832
|
+
exports.toKebabCase = toKebabCase;
|
|
4833
|
+
exports.toNumber = toNumber;
|
|
4834
|
+
exports.toNumericArray = toNumericArray;
|
|
4835
|
+
exports.toPascalCase = toPascalCase;
|
|
4836
|
+
exports.toSnakeCase = toSnakeCase;
|
|
4837
|
+
exports.toString = toString;
|
|
4838
|
+
exports.toUppercase = toUppercase;
|
|
4839
|
+
exports.trim = trim;
|
|
4840
|
+
exports.trimEnd = trimEnd;
|
|
4841
|
+
exports.trimLeft = trimLeft;
|
|
4842
|
+
exports.trimRight = trimRight;
|
|
4843
|
+
exports.trimStart = trimStart;
|
|
4844
|
+
exports.truncate = truncate;
|
|
4845
|
+
exports.tuple = tuple;
|
|
4846
|
+
exports.twColor = twColor;
|
|
4847
|
+
exports.unbox = unbox;
|
|
4848
|
+
exports.uncapitalize = uncapitalize;
|
|
4849
|
+
exports.union = union;
|
|
4850
|
+
exports.unionize = unionize;
|
|
4851
|
+
exports.unique = unique;
|
|
4852
|
+
exports.uniqueKeys = uniqueKeys;
|
|
4853
|
+
exports.uppercase = uppercase;
|
|
4854
|
+
exports.urlMeta = urlMeta;
|
|
4855
|
+
exports.valuesOf = valuesOf;
|
|
4856
|
+
exports.widen = widen;
|
|
4857
|
+
exports.withDefaults = withDefaults;
|
|
4858
|
+
exports.withKeys = withKeys;
|
|
4859
|
+
exports.withoutKeys = withoutKeys;
|
|
4860
|
+
exports.withoutValue = withoutValue;
|
|
4861
|
+
exports.wrapFn = wrapFn;
|
|
4862
|
+
exports.youtubeEmbed = youtubeEmbed;
|
|
4863
|
+
exports.youtubeMeta = youtubeMeta;
|
|
4864
|
+
//# sourceMappingURL=index.cjs.map
|
|
4865
|
+
//# sourceMappingURL=index.cjs.map
|