@onivoro/isomorphic-common 0.0.17 → 0.1.0
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/index.cjs.js +465 -0
- package/package.json +8 -4
- package/README.md +0 -11
- package/src/index.d.ts +0 -31
- package/src/index.js +0 -35
- package/src/index.js.map +0 -1
- package/src/lib/constants/millis-per-day.constant.d.ts +0 -1
- package/src/lib/constants/millis-per-day.constant.js +0 -6
- package/src/lib/constants/millis-per-day.constant.js.map +0 -1
- package/src/lib/constants/millis-per-hour.constant.d.ts +0 -1
- package/src/lib/constants/millis-per-hour.constant.js +0 -6
- package/src/lib/constants/millis-per-hour.constant.js.map +0 -1
- package/src/lib/constants/millis-per-minute.constant.d.ts +0 -1
- package/src/lib/constants/millis-per-minute.constant.js +0 -5
- package/src/lib/constants/millis-per-minute.constant.js.map +0 -1
- package/src/lib/functions/add-offset.function.d.ts +0 -1
- package/src/lib/functions/add-offset.function.js +0 -15
- package/src/lib/functions/add-offset.function.js.map +0 -1
- package/src/lib/functions/camel-case.function.d.ts +0 -20
- package/src/lib/functions/camel-case.function.js +0 -32
- package/src/lib/functions/camel-case.function.js.map +0 -1
- package/src/lib/functions/convert-object-to-literal.function.d.ts +0 -1
- package/src/lib/functions/convert-object-to-literal.function.js +0 -11
- package/src/lib/functions/convert-object-to-literal.function.js.map +0 -1
- package/src/lib/functions/from-boolean-string.function.d.ts +0 -1
- package/src/lib/functions/from-boolean-string.function.js +0 -8
- package/src/lib/functions/from-boolean-string.function.js.map +0 -1
- package/src/lib/functions/from-calendar-date.function.d.ts +0 -1
- package/src/lib/functions/from-calendar-date.function.js +0 -9
- package/src/lib/functions/from-calendar-date.function.js.map +0 -1
- package/src/lib/functions/from-csv-string.function.d.ts +0 -1
- package/src/lib/functions/from-csv-string.function.js +0 -8
- package/src/lib/functions/from-csv-string.function.js.map +0 -1
- package/src/lib/functions/get-tag.function.d.ts +0 -1
- package/src/lib/functions/get-tag.function.js +0 -13
- package/src/lib/functions/get-tag.function.js.map +0 -1
- package/src/lib/functions/is-symbol.function.d.ts +0 -1
- package/src/lib/functions/is-symbol.function.js +0 -12
- package/src/lib/functions/is-symbol.function.js.map +0 -1
- package/src/lib/functions/kebab-case.function.d.ts +0 -1
- package/src/lib/functions/kebab-case.function.js +0 -9
- package/src/lib/functions/kebab-case.function.js.map +0 -1
- package/src/lib/functions/parse-bool.function.d.ts +0 -1
- package/src/lib/functions/parse-bool.function.js +0 -8
- package/src/lib/functions/parse-bool.function.js.map +0 -1
- package/src/lib/functions/properties-to-array.function.d.ts +0 -1
- package/src/lib/functions/properties-to-array.function.js +0 -20
- package/src/lib/functions/properties-to-array.function.js.map +0 -1
- package/src/lib/functions/sanitize-filename.function.d.ts +0 -1
- package/src/lib/functions/sanitize-filename.function.js +0 -12
- package/src/lib/functions/sanitize-filename.function.js.map +0 -1
- package/src/lib/functions/snake-case.function.d.ts +0 -24
- package/src/lib/functions/snake-case.function.js +0 -33
- package/src/lib/functions/snake-case.function.js.map +0 -1
- package/src/lib/functions/subtract-offset.function.d.ts +0 -1
- package/src/lib/functions/subtract-offset.function.js +0 -15
- package/src/lib/functions/subtract-offset.function.js.map +0 -1
- package/src/lib/functions/to-boolean-string.function.d.ts +0 -1
- package/src/lib/functions/to-boolean-string.function.js +0 -8
- package/src/lib/functions/to-boolean-string.function.js.map +0 -1
- package/src/lib/functions/to-calendar-date.function.d.ts +0 -1
- package/src/lib/functions/to-calendar-date.function.js +0 -13
- package/src/lib/functions/to-calendar-date.function.js.map +0 -1
- package/src/lib/functions/to-csv-string.function.d.ts +0 -1
- package/src/lib/functions/to-csv-string.function.js +0 -8
- package/src/lib/functions/to-csv-string.function.js.map +0 -1
- package/src/lib/functions/to-decimal-base.function.d.ts +0 -1
- package/src/lib/functions/to-decimal-base.function.js +0 -23
- package/src/lib/functions/to-decimal-base.function.js.map +0 -1
- package/src/lib/functions/to-dollars-and-cents.function.d.ts +0 -1
- package/src/lib/functions/to-dollars-and-cents.function.js +0 -16
- package/src/lib/functions/to-dollars-and-cents.function.js.map +0 -1
- package/src/lib/functions/to-locale-date-string.function.d.ts +0 -1
- package/src/lib/functions/to-locale-date-string.function.js +0 -9
- package/src/lib/functions/to-locale-date-string.function.js.map +0 -1
- package/src/lib/functions/to-locale-time-string.function.d.ts +0 -1
- package/src/lib/functions/to-locale-time-string.function.js +0 -11
- package/src/lib/functions/to-locale-time-string.function.js.map +0 -1
- package/src/lib/functions/to-string.function.d.ts +0 -1
- package/src/lib/functions/to-string.function.js +0 -27
- package/src/lib/functions/to-string.function.js.map +0 -1
- package/src/lib/functions/to-unique-array.function.d.ts +0 -1
- package/src/lib/functions/to-unique-array.function.js +0 -8
- package/src/lib/functions/to-unique-array.function.js.map +0 -1
- package/src/lib/functions/to-words.function.d.ts +0 -1
- package/src/lib/functions/to-words.function.js +0 -91
- package/src/lib/functions/to-words.function.js.map +0 -1
- package/src/lib/functions/try-parse-date.function.d.ts +0 -1
- package/src/lib/functions/try-parse-date.function.js +0 -18
- package/src/lib/functions/try-parse-date.function.js.map +0 -1
- package/src/lib/functions/unicode-words.const.d.ts +0 -8
- package/src/lib/functions/unicode-words.const.js +0 -70
- package/src/lib/functions/unicode-words.const.js.map +0 -1
- package/src/lib/functions/upper-first.function.d.ts +0 -1
- package/src/lib/functions/upper-first.function.js +0 -14
- package/src/lib/functions/upper-first.function.js.map +0 -1
- package/src/lib/functions/words.function.d.ts +0 -17
- package/src/lib/functions/words.function.js +0 -36
- package/src/lib/functions/words.function.js.map +0 -1
- package/src/lib/interfaces/axios-wrapped-nest-exception.interface.d.ts +0 -5
- package/src/lib/interfaces/axios-wrapped-nest-exception.interface.js +0 -3
- package/src/lib/interfaces/axios-wrapped-nest-exception.interface.js.map +0 -1
- package/src/lib/interfaces/entity-provider.interface.d.ts +0 -9
- package/src/lib/interfaces/entity-provider.interface.js +0 -3
- package/src/lib/interfaces/entity-provider.interface.js.map +0 -1
- package/src/lib/interfaces/keys-of.type.d.ts +0 -3
- package/src/lib/interfaces/keys-of.type.js +0 -3
- package/src/lib/interfaces/keys-of.type.js.map +0 -1
package/index.cjs.js
ADDED
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
MILLIS_PER_DAY: () => MILLIS_PER_DAY,
|
|
24
|
+
MILLIS_PER_HOUR: () => MILLIS_PER_HOUR,
|
|
25
|
+
MILLIS_PER_MINUTE: () => MILLIS_PER_MINUTE,
|
|
26
|
+
addOffset: () => addOffset,
|
|
27
|
+
camelCase: () => camelCase,
|
|
28
|
+
convertObjectToLiteral: () => convertObjectToLiteral,
|
|
29
|
+
fromBooleanString: () => fromBooleanString,
|
|
30
|
+
fromCalendarDate: () => fromCalendarDate,
|
|
31
|
+
fromCsvString: () => fromCsvString,
|
|
32
|
+
kebabCase: () => kebabCase,
|
|
33
|
+
parseBool: () => parseBool,
|
|
34
|
+
propertiesToArray: () => propertiesToArray,
|
|
35
|
+
sanitizeFilename: () => sanitizeFilename,
|
|
36
|
+
snakeCase: () => snakeCase,
|
|
37
|
+
subtractOffset: () => subtractOffset,
|
|
38
|
+
toBooleanString: () => toBooleanString,
|
|
39
|
+
toCalendarDate: () => toCalendarDate,
|
|
40
|
+
toCsvString: () => toCsvString,
|
|
41
|
+
toDecimalBase: () => toDecimalBase,
|
|
42
|
+
toDollarsAndCents: () => toDollarsAndCents,
|
|
43
|
+
toUniqueArray: () => toUniqueArray,
|
|
44
|
+
toWords: () => toWords,
|
|
45
|
+
tryParseDate: () => tryParseDate,
|
|
46
|
+
unicodeWords: () => unicodeWords,
|
|
47
|
+
upperFirst: () => upperFirst,
|
|
48
|
+
words: () => words
|
|
49
|
+
});
|
|
50
|
+
module.exports = __toCommonJS(src_exports);
|
|
51
|
+
|
|
52
|
+
// src/lib/constants/millis-per-minute.constant.ts
|
|
53
|
+
var MILLIS_PER_MINUTE = 1e3 * 60;
|
|
54
|
+
|
|
55
|
+
// src/lib/constants/millis-per-hour.constant.ts
|
|
56
|
+
var MILLIS_PER_HOUR = MILLIS_PER_MINUTE * 60;
|
|
57
|
+
|
|
58
|
+
// src/lib/constants/millis-per-day.constant.ts
|
|
59
|
+
var MILLIS_PER_DAY = MILLIS_PER_HOUR * 24;
|
|
60
|
+
|
|
61
|
+
// src/lib/functions/try-parse-date.function.ts
|
|
62
|
+
function tryParseDate(input) {
|
|
63
|
+
if (!input) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (input instanceof Date) {
|
|
67
|
+
return input;
|
|
68
|
+
}
|
|
69
|
+
const date = new Date(input);
|
|
70
|
+
if (date == "Invalid Date") {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
return date;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// src/lib/functions/add-offset.function.ts
|
|
77
|
+
function addOffset(input) {
|
|
78
|
+
const parsed = tryParseDate(input);
|
|
79
|
+
if (!parsed) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const offset = parsed.getTimezoneOffset();
|
|
83
|
+
return new Date(parsed.valueOf() + offset * MILLIS_PER_MINUTE);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// src/lib/functions/get-tag.function.ts
|
|
87
|
+
var toString = Object.prototype.toString;
|
|
88
|
+
function getTag(value) {
|
|
89
|
+
if (value == null) {
|
|
90
|
+
return value === void 0 ? "[object Undefined]" : "[object Null]";
|
|
91
|
+
}
|
|
92
|
+
return toString.call(value);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// src/lib/functions/is-symbol.function.ts
|
|
96
|
+
function isSymbol(value) {
|
|
97
|
+
const type = typeof value;
|
|
98
|
+
return type === "symbol" || type === "object" && value != null && getTag(value) === "[object Symbol]";
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// src/lib/functions/to-string.function.ts
|
|
102
|
+
var INFINITY = 1 / 0;
|
|
103
|
+
function toString2(value) {
|
|
104
|
+
if (value == null) {
|
|
105
|
+
return "";
|
|
106
|
+
}
|
|
107
|
+
if (typeof value === "string") {
|
|
108
|
+
return value;
|
|
109
|
+
}
|
|
110
|
+
if (Array.isArray(value)) {
|
|
111
|
+
return `${value.map((other) => other == null ? other : toString2(other))}`;
|
|
112
|
+
}
|
|
113
|
+
if (isSymbol(value)) {
|
|
114
|
+
return value.toString();
|
|
115
|
+
}
|
|
116
|
+
const result = `${value}`;
|
|
117
|
+
return result === "0" && 1 / value === -INFINITY ? "-0" : result;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// src/lib/functions/upper-first.function.ts
|
|
121
|
+
function upperFirst(string) {
|
|
122
|
+
if (!string) {
|
|
123
|
+
return string;
|
|
124
|
+
}
|
|
125
|
+
return string.split("").map((curr, i) => curr[!i ? "toUpperCase" : "toLowerCase"]()).join("");
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// src/lib/functions/unicode-words.const.ts
|
|
129
|
+
var rsAstralRange = "\\ud800-\\udfff";
|
|
130
|
+
var rsComboMarksRange = "\\u0300-\\u036f";
|
|
131
|
+
var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
|
|
132
|
+
var rsComboSymbolsRange = "\\u20d0-\\u20ff";
|
|
133
|
+
var rsComboMarksExtendedRange = "\\u1ab0-\\u1aff";
|
|
134
|
+
var rsComboMarksSupplementRange = "\\u1dc0-\\u1dff";
|
|
135
|
+
var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange + rsComboMarksExtendedRange + rsComboMarksSupplementRange;
|
|
136
|
+
var rsDingbatRange = "\\u2700-\\u27bf";
|
|
137
|
+
var rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff";
|
|
138
|
+
var rsMathOpRange = "\\xac\\xb1\\xd7\\xf7";
|
|
139
|
+
var rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf";
|
|
140
|
+
var rsPunctuationRange = "\\u2000-\\u206f";
|
|
141
|
+
var rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000";
|
|
142
|
+
var rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde";
|
|
143
|
+
var rsVarRange = "\\ufe0e\\ufe0f";
|
|
144
|
+
var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
145
|
+
var rsApos = "['\u2019]";
|
|
146
|
+
var rsBreak = `[${rsBreakRange}]`;
|
|
147
|
+
var rsCombo = `[${rsComboRange}]`;
|
|
148
|
+
var rsDigit = "\\d";
|
|
149
|
+
var rsDingbat = `[${rsDingbatRange}]`;
|
|
150
|
+
var rsLower = `[${rsLowerRange}]`;
|
|
151
|
+
var rsMisc = `[^${rsAstralRange}${rsBreakRange + rsDigit + rsDingbatRange + rsLowerRange + rsUpperRange}]`;
|
|
152
|
+
var rsFitz = "\\ud83c[\\udffb-\\udfff]";
|
|
153
|
+
var rsModifier = `(?:${rsCombo}|${rsFitz})`;
|
|
154
|
+
var rsNonAstral = `[^${rsAstralRange}]`;
|
|
155
|
+
var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
|
|
156
|
+
var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
|
|
157
|
+
var rsUpper = `[${rsUpperRange}]`;
|
|
158
|
+
var rsZWJ = "\\u200d";
|
|
159
|
+
var rsMiscLower = `(?:${rsLower}|${rsMisc})`;
|
|
160
|
+
var rsMiscUpper = `(?:${rsUpper}|${rsMisc})`;
|
|
161
|
+
var rsOptContrLower = `(?:${rsApos}(?:d|ll|m|re|s|t|ve))?`;
|
|
162
|
+
var rsOptContrUpper = `(?:${rsApos}(?:D|LL|M|RE|S|T|VE))?`;
|
|
163
|
+
var reOptMod = `${rsModifier}?`;
|
|
164
|
+
var rsOptVar = `[${rsVarRange}]?`;
|
|
165
|
+
var rsOptJoin = `(?:${rsZWJ}(?:${[rsNonAstral, rsRegional, rsSurrPair].join("|")})${rsOptVar + reOptMod})*`;
|
|
166
|
+
var rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])";
|
|
167
|
+
var rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])";
|
|
168
|
+
var rsSeq = rsOptVar + reOptMod + rsOptJoin;
|
|
169
|
+
var rsEmoji = `(?:${[rsDingbat, rsRegional, rsSurrPair].join("|")})${rsSeq}`;
|
|
170
|
+
var reUnicodeWords = RegExp([
|
|
171
|
+
`${rsUpper}?${rsLower}+${rsOptContrLower}(?=${[rsBreak, rsUpper, "$"].join("|")})`,
|
|
172
|
+
`${rsMiscUpper}+${rsOptContrUpper}(?=${[rsBreak, rsUpper + rsMiscLower, "$"].join("|")})`,
|
|
173
|
+
`${rsUpper}?${rsMiscLower}+${rsOptContrLower}`,
|
|
174
|
+
`${rsUpper}+${rsOptContrUpper}`,
|
|
175
|
+
rsOrdUpper,
|
|
176
|
+
rsOrdLower,
|
|
177
|
+
`${rsDigit}+`,
|
|
178
|
+
rsEmoji
|
|
179
|
+
].join("|"), "g");
|
|
180
|
+
function unicodeWords(string) {
|
|
181
|
+
return string.match(reUnicodeWords);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// src/lib/functions/words.function.ts
|
|
185
|
+
var hasUnicodeWord = RegExp.prototype.test.bind(
|
|
186
|
+
/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/
|
|
187
|
+
);
|
|
188
|
+
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
189
|
+
function asciiWords(string) {
|
|
190
|
+
return string.match(reAsciiWord);
|
|
191
|
+
}
|
|
192
|
+
function words(string, pattern) {
|
|
193
|
+
if (pattern === void 0) {
|
|
194
|
+
const result = hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
|
|
195
|
+
return result || [];
|
|
196
|
+
}
|
|
197
|
+
return string.match(pattern) || [];
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// src/lib/functions/camel-case.function.ts
|
|
201
|
+
var camelCase = (string) => words(toString2(string).replace(/['\u2019]/g, "")).reduce((result, word, index) => {
|
|
202
|
+
word = word.toLowerCase();
|
|
203
|
+
return result + (index ? upperFirst(word) : word);
|
|
204
|
+
}, "");
|
|
205
|
+
|
|
206
|
+
// src/lib/functions/convert-object-to-literal.function.ts
|
|
207
|
+
function convertObjectToLiteral(literalFn, delimiter, keyValuePairs) {
|
|
208
|
+
return Object.entries(keyValuePairs).filter(([, v]) => !!v || v === 0 || v === false).map(([k, v]) => literalFn(k, v?.toString?.())).join(delimiter);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// src/lib/functions/from-boolean-string.function.ts
|
|
212
|
+
function fromBooleanString(value) {
|
|
213
|
+
return value === "true";
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// src/lib/functions/from-calendar-date.function.ts
|
|
217
|
+
function fromCalendarDate(input) {
|
|
218
|
+
return addOffset(input) || null;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// src/lib/functions/from-csv-string.function.ts
|
|
222
|
+
function fromCsvString(value) {
|
|
223
|
+
return value ? value.split(",").map((v) => v.trim()) : [];
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// src/lib/functions/snake-case.function.ts
|
|
227
|
+
function snakeCase(string) {
|
|
228
|
+
return words(string.replace(/['\u2019]/g, "")).reduce((result, word, index) => result + (index ? "_" : "") + word.toLowerCase(), "");
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// src/lib/functions/kebab-case.function.ts
|
|
232
|
+
function kebabCase(string) {
|
|
233
|
+
return snakeCase(string).replace(/_/g, "-");
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// src/lib/functions/parse-bool.function.ts
|
|
237
|
+
function parseBool(asc) {
|
|
238
|
+
return asc ? asc === true || asc === "true" : false;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// src/lib/functions/properties-to-array.function.ts
|
|
242
|
+
function propertiesToArray(obj) {
|
|
243
|
+
const isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
|
|
244
|
+
const addDelimiter = (a, b) => a ? `${a}.${b}` : b;
|
|
245
|
+
const paths = (obj2 = {}, head = "") => {
|
|
246
|
+
return Object.entries(obj2).reduce((product, [key, value]) => {
|
|
247
|
+
let fullPath = addDelimiter(head, key);
|
|
248
|
+
return isObject(value) ? product.concat(paths(value, fullPath)) : product.concat(fullPath);
|
|
249
|
+
}, []);
|
|
250
|
+
};
|
|
251
|
+
return paths(obj);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// src/lib/functions/sanitize-filename.function.ts
|
|
255
|
+
var _ = "_";
|
|
256
|
+
var asciiReplacementRegX = /\/|\?|:|\\|{|\^|'|\}|%|`|]|>|\[|~|<|#|\||"|!|\*/g;
|
|
257
|
+
var unicodeReplacementRegX = /[^\u0000-\u007F]/g;
|
|
258
|
+
function sanitizeFilename(filename) {
|
|
259
|
+
return filename.replace(unicodeReplacementRegX, _).replace(asciiReplacementRegX, _).replace(/_+/g, _).trim();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// src/lib/functions/subtract-offset.function.ts
|
|
263
|
+
function subtractOffset(input) {
|
|
264
|
+
const parsed = tryParseDate(input);
|
|
265
|
+
if (!parsed) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
const offset = parsed.getTimezoneOffset();
|
|
269
|
+
return new Date(parsed.valueOf() - offset * MILLIS_PER_MINUTE);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// src/lib/functions/to-boolean-string.function.ts
|
|
273
|
+
function toBooleanString(val) {
|
|
274
|
+
return (!!(val || false)).toString();
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// src/lib/functions/to-calendar-date.function.ts
|
|
278
|
+
function toCalendarDate(input) {
|
|
279
|
+
const parsed = subtractOffset(input);
|
|
280
|
+
if (!parsed) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
return parsed?.toISOString().split("T")[0];
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// src/lib/functions/to-csv-string.function.ts
|
|
287
|
+
function toCsvString(val) {
|
|
288
|
+
return (val || []).join(",");
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// src/lib/functions/to-decimal-base.function.ts
|
|
292
|
+
function toDecimalBase(n, base = 16) {
|
|
293
|
+
const digits = n.toString().split("");
|
|
294
|
+
let answer = 0;
|
|
295
|
+
digits.reverse().forEach(function(d, i) {
|
|
296
|
+
let actualNumber = Number(d);
|
|
297
|
+
if (!actualNumber && actualNumber !== 0) {
|
|
298
|
+
const codeAt = d.charCodeAt(0);
|
|
299
|
+
if (codeAt >= 97) {
|
|
300
|
+
actualNumber = codeAt - 87;
|
|
301
|
+
} else {
|
|
302
|
+
actualNumber = codeAt - 55;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
answer = answer + actualNumber * Math.pow(base, i);
|
|
306
|
+
});
|
|
307
|
+
return answer;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// src/lib/functions/to-words.function.ts
|
|
311
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
312
|
+
var TEN = 10;
|
|
313
|
+
var ONE_HUNDRED = 100;
|
|
314
|
+
var ONE_THOUSAND = 1e3;
|
|
315
|
+
var ONE_MILLION = 1e6;
|
|
316
|
+
var ONE_BILLION = 1e9;
|
|
317
|
+
var ONE_TRILLION = 1e12;
|
|
318
|
+
var ONE_QUADRILLION = 1e15;
|
|
319
|
+
var MAX = MAX_SAFE_INTEGER + 1;
|
|
320
|
+
var LESS_THAN_TWENTY = [
|
|
321
|
+
"zero",
|
|
322
|
+
"one",
|
|
323
|
+
"two",
|
|
324
|
+
"three",
|
|
325
|
+
"four",
|
|
326
|
+
"five",
|
|
327
|
+
"six",
|
|
328
|
+
"seven",
|
|
329
|
+
"eight",
|
|
330
|
+
"nine",
|
|
331
|
+
"ten",
|
|
332
|
+
"eleven",
|
|
333
|
+
"twelve",
|
|
334
|
+
"thirteen",
|
|
335
|
+
"fourteen",
|
|
336
|
+
"fifteen",
|
|
337
|
+
"sixteen",
|
|
338
|
+
"seventeen",
|
|
339
|
+
"eighteen",
|
|
340
|
+
"nineteen"
|
|
341
|
+
];
|
|
342
|
+
var TENTHS_LESS_THAN_HUNDRED = [
|
|
343
|
+
"zero",
|
|
344
|
+
"ten",
|
|
345
|
+
"twenty",
|
|
346
|
+
"thirty",
|
|
347
|
+
"forty",
|
|
348
|
+
"fifty",
|
|
349
|
+
"sixty",
|
|
350
|
+
"seventy",
|
|
351
|
+
"eighty",
|
|
352
|
+
"ninety"
|
|
353
|
+
];
|
|
354
|
+
function toWords(number) {
|
|
355
|
+
let words2;
|
|
356
|
+
const num = parseInt(number, 10);
|
|
357
|
+
if (!isFinite(num)) {
|
|
358
|
+
throw new TypeError(
|
|
359
|
+
"Not a finite number: " + number + " (" + typeof number + ")"
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
if (!isSafeNumber(num)) {
|
|
363
|
+
throw new RangeError(
|
|
364
|
+
"Input is not a safe number, it's either too large or too small."
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
words2 = generateWords(num);
|
|
368
|
+
return words2;
|
|
369
|
+
}
|
|
370
|
+
function generateWords(number, words2) {
|
|
371
|
+
let remainder, word;
|
|
372
|
+
if (number === 0) {
|
|
373
|
+
return !words2 ? "zero" : words2.join(" ").replace(/,$/, "");
|
|
374
|
+
}
|
|
375
|
+
if (!words2) {
|
|
376
|
+
words2 = [];
|
|
377
|
+
}
|
|
378
|
+
if (number < 0) {
|
|
379
|
+
words2.push("minus");
|
|
380
|
+
number = Math.abs(number);
|
|
381
|
+
}
|
|
382
|
+
if (number < 20) {
|
|
383
|
+
remainder = 0;
|
|
384
|
+
word = LESS_THAN_TWENTY[number];
|
|
385
|
+
} else if (number < ONE_HUNDRED) {
|
|
386
|
+
remainder = number % TEN;
|
|
387
|
+
word = TENTHS_LESS_THAN_HUNDRED[Math.floor(number / TEN)];
|
|
388
|
+
if (remainder) {
|
|
389
|
+
word += "-" + LESS_THAN_TWENTY[remainder];
|
|
390
|
+
remainder = 0;
|
|
391
|
+
}
|
|
392
|
+
} else if (number < ONE_THOUSAND) {
|
|
393
|
+
remainder = number % ONE_HUNDRED;
|
|
394
|
+
word = generateWords(Math.floor(number / ONE_HUNDRED)) + " hundred";
|
|
395
|
+
} else if (number < ONE_MILLION) {
|
|
396
|
+
remainder = number % ONE_THOUSAND;
|
|
397
|
+
word = generateWords(Math.floor(number / ONE_THOUSAND)) + " thousand,";
|
|
398
|
+
} else if (number < ONE_BILLION) {
|
|
399
|
+
remainder = number % ONE_MILLION;
|
|
400
|
+
word = generateWords(Math.floor(number / ONE_MILLION)) + " million,";
|
|
401
|
+
} else if (number < ONE_TRILLION) {
|
|
402
|
+
remainder = number % ONE_BILLION;
|
|
403
|
+
word = generateWords(Math.floor(number / ONE_BILLION)) + " billion,";
|
|
404
|
+
} else if (number < ONE_QUADRILLION) {
|
|
405
|
+
remainder = number % ONE_TRILLION;
|
|
406
|
+
word = generateWords(Math.floor(number / ONE_TRILLION)) + " trillion,";
|
|
407
|
+
} else if (number <= MAX) {
|
|
408
|
+
remainder = number % ONE_QUADRILLION;
|
|
409
|
+
word = generateWords(Math.floor(number / ONE_QUADRILLION)) + " quadrillion,";
|
|
410
|
+
}
|
|
411
|
+
words2.push(word);
|
|
412
|
+
return generateWords(remainder, words2);
|
|
413
|
+
}
|
|
414
|
+
function isFinite(value) {
|
|
415
|
+
return !(typeof value !== "number" || value !== value || value === Infinity || value === -Infinity);
|
|
416
|
+
}
|
|
417
|
+
function isSafeNumber(value) {
|
|
418
|
+
return typeof value === "number" && Math.abs(value) <= MAX_SAFE_INTEGER;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// src/lib/functions/to-dollars-and-cents.function.ts
|
|
422
|
+
function toDollarsAndCents(number) {
|
|
423
|
+
const num = Number(number);
|
|
424
|
+
const decimal = Math.round(num % 1 * 100) / 100;
|
|
425
|
+
const int = num - decimal;
|
|
426
|
+
const dollars = `${toWords(int)} dollars`;
|
|
427
|
+
if (!decimal) {
|
|
428
|
+
return dollars;
|
|
429
|
+
}
|
|
430
|
+
return `${dollars} and ${toWords(decimal * 100)} cents`;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// src/lib/functions/to-unique-array.function.ts
|
|
434
|
+
function toUniqueArray(elements) {
|
|
435
|
+
return Array.from(new Set(elements));
|
|
436
|
+
}
|
|
437
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
438
|
+
0 && (module.exports = {
|
|
439
|
+
MILLIS_PER_DAY,
|
|
440
|
+
MILLIS_PER_HOUR,
|
|
441
|
+
MILLIS_PER_MINUTE,
|
|
442
|
+
addOffset,
|
|
443
|
+
camelCase,
|
|
444
|
+
convertObjectToLiteral,
|
|
445
|
+
fromBooleanString,
|
|
446
|
+
fromCalendarDate,
|
|
447
|
+
fromCsvString,
|
|
448
|
+
kebabCase,
|
|
449
|
+
parseBool,
|
|
450
|
+
propertiesToArray,
|
|
451
|
+
sanitizeFilename,
|
|
452
|
+
snakeCase,
|
|
453
|
+
subtractOffset,
|
|
454
|
+
toBooleanString,
|
|
455
|
+
toCalendarDate,
|
|
456
|
+
toCsvString,
|
|
457
|
+
toDecimalBase,
|
|
458
|
+
toDollarsAndCents,
|
|
459
|
+
toUniqueArray,
|
|
460
|
+
toWords,
|
|
461
|
+
tryParseDate,
|
|
462
|
+
unicodeWords,
|
|
463
|
+
upperFirst,
|
|
464
|
+
words
|
|
465
|
+
});
|
package/package.json
CHANGED
package/README.md
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# isomorphic-common
|
|
2
|
-
|
|
3
|
-
This library was generated with [Nx](https://nx.dev).
|
|
4
|
-
|
|
5
|
-
## Running unit tests
|
|
6
|
-
|
|
7
|
-
Run `nx test isomorphic-common` to execute the unit tests via [Jest](https://jestjs.io).
|
|
8
|
-
|
|
9
|
-
## Running lint
|
|
10
|
-
|
|
11
|
-
Run `nx lint isomorphic-common` to execute the lint via [ESLint](https://eslint.org/).
|
package/src/index.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export * from './lib/constants/millis-per-day.constant';
|
|
2
|
-
export * from './lib/constants/millis-per-hour.constant';
|
|
3
|
-
export * from './lib/constants/millis-per-minute.constant';
|
|
4
|
-
export * from './lib/functions/add-offset.function';
|
|
5
|
-
export * from './lib/functions/camel-case.function';
|
|
6
|
-
export * from './lib/functions/convert-object-to-literal.function';
|
|
7
|
-
export * from './lib/functions/from-boolean-string.function';
|
|
8
|
-
export * from './lib/functions/from-calendar-date.function';
|
|
9
|
-
export * from './lib/functions/from-csv-string.function';
|
|
10
|
-
export * from './lib/functions/kebab-case.function';
|
|
11
|
-
export * from './lib/functions/parse-bool.function';
|
|
12
|
-
export * from './lib/functions/properties-to-array.function';
|
|
13
|
-
export * from './lib/functions/sanitize-filename.function';
|
|
14
|
-
export * from './lib/functions/snake-case.function';
|
|
15
|
-
export * from './lib/functions/subtract-offset.function';
|
|
16
|
-
export * from './lib/functions/to-boolean-string.function';
|
|
17
|
-
export * from './lib/functions/to-calendar-date.function';
|
|
18
|
-
export * from './lib/functions/to-csv-string.function';
|
|
19
|
-
export * from './lib/functions/to-decimal-base.function';
|
|
20
|
-
export * from './lib/functions/to-dollars-and-cents.function';
|
|
21
|
-
export * from './lib/functions/to-locale-date-string.function';
|
|
22
|
-
export * from './lib/functions/to-locale-time-string.function';
|
|
23
|
-
export * from './lib/functions/to-unique-array.function';
|
|
24
|
-
export * from './lib/functions/to-words.function';
|
|
25
|
-
export * from './lib/functions/try-parse-date.function';
|
|
26
|
-
export * from './lib/functions/unicode-words.const';
|
|
27
|
-
export * from './lib/functions/upper-first.function';
|
|
28
|
-
export * from './lib/functions/words.function';
|
|
29
|
-
export * from './lib/interfaces/axios-wrapped-nest-exception.interface';
|
|
30
|
-
export * from './lib/interfaces/entity-provider.interface';
|
|
31
|
-
export * from './lib/interfaces/keys-of.type';
|
package/src/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./lib/constants/millis-per-day.constant"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./lib/constants/millis-per-hour.constant"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./lib/constants/millis-per-minute.constant"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./lib/functions/add-offset.function"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./lib/functions/camel-case.function"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./lib/functions/convert-object-to-literal.function"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./lib/functions/from-boolean-string.function"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./lib/functions/from-calendar-date.function"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./lib/functions/from-csv-string.function"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./lib/functions/kebab-case.function"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./lib/functions/parse-bool.function"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./lib/functions/properties-to-array.function"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./lib/functions/sanitize-filename.function"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./lib/functions/snake-case.function"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./lib/functions/subtract-offset.function"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("./lib/functions/to-boolean-string.function"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("./lib/functions/to-calendar-date.function"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./lib/functions/to-csv-string.function"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./lib/functions/to-decimal-base.function"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./lib/functions/to-dollars-and-cents.function"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("./lib/functions/to-locale-date-string.function"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("./lib/functions/to-locale-time-string.function"), exports);
|
|
26
|
-
tslib_1.__exportStar(require("./lib/functions/to-unique-array.function"), exports);
|
|
27
|
-
tslib_1.__exportStar(require("./lib/functions/to-words.function"), exports);
|
|
28
|
-
tslib_1.__exportStar(require("./lib/functions/try-parse-date.function"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("./lib/functions/unicode-words.const"), exports);
|
|
30
|
-
tslib_1.__exportStar(require("./lib/functions/upper-first.function"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./lib/functions/words.function"), exports);
|
|
32
|
-
tslib_1.__exportStar(require("./lib/interfaces/axios-wrapped-nest-exception.interface"), exports);
|
|
33
|
-
tslib_1.__exportStar(require("./lib/interfaces/entity-provider.interface"), exports);
|
|
34
|
-
tslib_1.__exportStar(require("./lib/interfaces/keys-of.type"), exports);
|
|
35
|
-
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/isomorphic-common/src/index.ts"],"names":[],"mappings":";;;AAAA,kFAAwD;AACxD,mFAAyD;AACzD,qFAA2D;AAE3D,8EAAoD;AACpD,8EAAoD;AACpD,6FAAmE;AACnE,uFAA6D;AAC7D,sFAA4D;AAC5D,mFAAyD;AACzD,8EAAoD;AACpD,8EAAoD;AACpD,uFAA6D;AAC7D,qFAA2D;AAC3D,8EAAoD;AACpD,mFAAyD;AACzD,qFAA2D;AAC3D,oFAA0D;AAC1D,iFAAuD;AACvD,mFAAyD;AACzD,wFAA8D;AAC9D,yFAA+D;AAC/D,yFAA+D;AAC/D,mFAAyD;AACzD,4EAAkD;AAClD,kFAAwD;AACxD,8EAAoD;AACpD,+EAAqD;AACrD,yEAA+C;AAE/C,kGAAwE;AACxE,qFAA2D;AAC3D,wEAA8C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MILLIS_PER_DAY: number;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MILLIS_PER_DAY = void 0;
|
|
4
|
-
const millis_per_hour_constant_1 = require("./millis-per-hour.constant");
|
|
5
|
-
exports.MILLIS_PER_DAY = millis_per_hour_constant_1.MILLIS_PER_HOUR * 24;
|
|
6
|
-
//# sourceMappingURL=millis-per-day.constant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"millis-per-day.constant.js","sourceRoot":"","sources":["../../../../../../libs/isomorphic-common/src/lib/constants/millis-per-day.constant.ts"],"names":[],"mappings":";;;AAAA,yEAA6D;AAEhD,QAAA,cAAc,GAAG,0CAAe,GAAG,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MILLIS_PER_HOUR: number;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MILLIS_PER_HOUR = void 0;
|
|
4
|
-
const millis_per_minute_constant_1 = require("./millis-per-minute.constant");
|
|
5
|
-
exports.MILLIS_PER_HOUR = millis_per_minute_constant_1.MILLIS_PER_MINUTE * 60;
|
|
6
|
-
//# sourceMappingURL=millis-per-hour.constant.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"millis-per-hour.constant.js","sourceRoot":"","sources":["../../../../../../libs/isomorphic-common/src/lib/constants/millis-per-hour.constant.ts"],"names":[],"mappings":";;;AAAA,6EAAiE;AAEpD,QAAA,eAAe,GAAG,8CAAiB,GAAG,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const MILLIS_PER_MINUTE: number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"millis-per-minute.constant.js","sourceRoot":"","sources":["../../../../../../libs/isomorphic-common/src/lib/constants/millis-per-minute.constant.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,IAAI,GAAG,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function addOffset(input: string | Date | undefined | null): Date | undefined;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addOffset = void 0;
|
|
4
|
-
const millis_per_minute_constant_1 = require("../constants/millis-per-minute.constant");
|
|
5
|
-
const try_parse_date_function_1 = require("./try-parse-date.function");
|
|
6
|
-
function addOffset(input) {
|
|
7
|
-
const parsed = (0, try_parse_date_function_1.tryParseDate)(input);
|
|
8
|
-
if (!parsed) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
const offset = (parsed).getTimezoneOffset();
|
|
12
|
-
return new Date(parsed.valueOf() + offset * millis_per_minute_constant_1.MILLIS_PER_MINUTE);
|
|
13
|
-
}
|
|
14
|
-
exports.addOffset = addOffset;
|
|
15
|
-
//# sourceMappingURL=add-offset.function.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-offset.function.js","sourceRoot":"","sources":["../../../../../../libs/isomorphic-common/src/lib/functions/add-offset.function.ts"],"names":[],"mappings":";;;AAAA,wFAA4E;AAC5E,uEAAyD;AAEzD,SAAgB,SAAS,CAAC,KAAuC;IAC7D,MAAM,MAAM,GAAG,IAAA,sCAAY,EAAC,KAAK,CAAC,CAAC;IAEnC,IAAG,CAAC,MAAM,EAAE;QACR,OAAO;KACV;IAED,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,iBAAiB,EAAE,CAAC;IAE5C,OAAO,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,MAAM,GAAG,8CAAiB,CAAC,CAAC;AACnE,CAAC;AAVD,8BAUC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
|
|
3
|
-
*
|
|
4
|
-
* @since 3.0.0
|
|
5
|
-
* @category String
|
|
6
|
-
* @param {string} [string=''] The string to convert.
|
|
7
|
-
* @returns {string} Returns the camel cased string.
|
|
8
|
-
* @see lowerCase, kebabCase, snakeCase, startCase, upperCase, upperFirst
|
|
9
|
-
* @example
|
|
10
|
-
*
|
|
11
|
-
* camelCase('Foo Bar')
|
|
12
|
-
* // => 'fooBar'
|
|
13
|
-
*
|
|
14
|
-
* camelCase('--foo-bar--')
|
|
15
|
-
* // => 'fooBar'
|
|
16
|
-
*
|
|
17
|
-
* camelCase('__FOO_BAR__')
|
|
18
|
-
* // => 'fooBar'
|
|
19
|
-
*/
|
|
20
|
-
export declare const camelCase: (string: string) => string;
|