@rebasepro/utils 0.0.1-canary.eae7889 → 0.0.1-canary.eb08332
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/LICENSE +21 -6
- package/README.md +108 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +504 -528
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +631 -588
- package/dist/index.umd.js.map +1 -1
- package/dist/objects.d.ts +7 -1
- package/dist/strings.d.ts +2 -2
- package/package.json +17 -20
- package/src/fields.ts +0 -1
- package/src/flatten_object.ts +5 -1
- package/src/index.ts +0 -1
- package/src/objects.ts +73 -30
- package/src/strings.ts +7 -5
package/dist/index.es.js
CHANGED
|
@@ -1,588 +1,564 @@
|
|
|
1
1
|
import hash from "object-hash";
|
|
2
2
|
import { GeoPoint } from "@rebasepro/types";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
//#region src/strings.ts
|
|
4
|
+
var tokenizeRegex = /[A-Z]{2,}(?=[A-Z][a-z]|\b)|[A-Z]?[a-z]+|[0-9]+(?:[a-z](?![a-z]))?|[A-Z]/g;
|
|
5
|
+
var toKebabCase = (str) => {
|
|
6
|
+
if (!str || typeof str !== "string") return "";
|
|
7
|
+
const regExpMatchArray = str.match(tokenizeRegex);
|
|
8
|
+
if (!regExpMatchArray) return "";
|
|
9
|
+
return regExpMatchArray.map((x) => x.toLowerCase()).join("-");
|
|
8
10
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
var snakeCaseRegex = tokenizeRegex;
|
|
12
|
+
var toSnakeCase = (str) => {
|
|
13
|
+
if (!str || typeof str !== "string") return "";
|
|
14
|
+
const regExpMatchArray = str.match(snakeCaseRegex);
|
|
15
|
+
if (!regExpMatchArray) return "";
|
|
16
|
+
return regExpMatchArray.map((x) => x.toLowerCase()).join("_");
|
|
14
17
|
};
|
|
15
18
|
function camelCase(str) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
parts.slice(1).map((part) => part.charAt(0).toUpperCase() + part.substring(1).toLowerCase()).join("");
|
|
19
|
+
if (!str) return "";
|
|
20
|
+
if (str.length === 1) return str.toLowerCase();
|
|
21
|
+
const parts = str.split(/[-_ ]+/).filter(Boolean);
|
|
22
|
+
if (parts.length === 0) return "";
|
|
23
|
+
return parts[0].toLowerCase() + parts.slice(1).map((part) => part.charAt(0).toUpperCase() + part.substring(1).toLowerCase()).join("");
|
|
22
24
|
}
|
|
23
25
|
function randomString(strLength = 5) {
|
|
24
|
-
|
|
26
|
+
return Math.random().toString(36).slice(2, 2 + strLength);
|
|
25
27
|
}
|
|
26
28
|
function randomColor() {
|
|
27
|
-
|
|
29
|
+
return Math.floor(Math.random() * 16777215).toString(16);
|
|
28
30
|
}
|
|
29
31
|
function slugify(text, separator = "_", lowercase = true) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
text = text.toString().trim().replace(/^\s+|\s+$/g, "").replace(/\s+/g, separator).replace(/&/g, separator).replace(/[^\w\\-]+/g, "").replace(new RegExp("\\" + separator + "\\" + separator + "+", "g"), separator);
|
|
37
|
-
return lowercase ? text.toLowerCase() : text;
|
|
32
|
+
if (!text) return "";
|
|
33
|
+
const from = "ãàáäâẽèéëêìíïîõòóöôùúüûñç·/_,:;-";
|
|
34
|
+
const to = `aaaaaeeeeeiiiiooooouuuunc${separator}${separator}${separator}${separator}${separator}${separator}${separator}`;
|
|
35
|
+
for (let i = 0, l = 32; i < l; i++) text = text.replace(new RegExp(from.charAt(i), "g"), to.charAt(i));
|
|
36
|
+
text = text.toString().trim().replace(/^\s+|\s+$/g, "").replace(/\s+/g, separator).replace(/&/g, separator).replace(/[^\w\\-]+/g, "").replace(new RegExp("\\" + separator + "\\" + separator + "+", "g"), separator);
|
|
37
|
+
return lowercase ? text.toLowerCase() : text;
|
|
38
38
|
}
|
|
39
39
|
function unslugify(slug) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}).trim();
|
|
46
|
-
} else {
|
|
47
|
-
return slug.trim();
|
|
48
|
-
}
|
|
40
|
+
if (!slug) return "";
|
|
41
|
+
if (slug.includes("-") || slug.includes("_") || !slug.includes(" ")) return slug.replace(/[-_]/g, " ").replace(/\w\S*/g, function(txt) {
|
|
42
|
+
return txt.charAt(0).toUpperCase() + txt.substring(1);
|
|
43
|
+
}).trim();
|
|
44
|
+
else return slug.trim();
|
|
49
45
|
}
|
|
50
46
|
function prettifyIdentifier(input) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
47
|
+
if (!input) return "";
|
|
48
|
+
let text = input;
|
|
49
|
+
text = text.replace(/([a-z])([A-Z])|([A-Z])([A-Z][a-z])/g, "$1$3 $2$4");
|
|
50
|
+
text = text.replace(/[_-]+/g, " ");
|
|
51
|
+
return text.trim().replace(/\b\w/g, (char) => char.toUpperCase());
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/objects.ts
|
|
55
|
+
/** @private is the value an empty array? */
|
|
56
|
+
var isEmptyArray = (value) => Array.isArray(value) && value.length === 0;
|
|
57
|
+
/** @private is the given object a Function? */
|
|
58
|
+
var isFunction = (obj) => typeof obj === "function";
|
|
59
|
+
/** @private is the given object an integer? */
|
|
60
|
+
var isInteger = (obj) => String(Math.floor(Number(obj))) === String(obj);
|
|
61
|
+
/** @private is the given object a NaN? */
|
|
62
|
+
var isNaN = (obj) => obj !== obj;
|
|
63
|
+
/**
|
|
64
|
+
* Deeply get a value from an object via its path.
|
|
65
|
+
*/
|
|
62
66
|
function getIn(obj, key, def, p = 0) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (p !== path.length && !obj) {
|
|
68
|
-
return def;
|
|
69
|
-
}
|
|
70
|
-
return obj === void 0 ? def : obj;
|
|
67
|
+
const path = toPath(key);
|
|
68
|
+
while (obj && p < path.length) obj = obj[path[p++]];
|
|
69
|
+
if (p !== path.length && !obj) return def;
|
|
70
|
+
return obj === void 0 ? def : obj;
|
|
71
71
|
}
|
|
72
72
|
function setIn(obj, path, value) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
delete resVal[pathArray[i]];
|
|
92
|
-
} else {
|
|
93
|
-
resVal[pathArray[i]] = value;
|
|
94
|
-
}
|
|
95
|
-
if (i === 0 && value === void 0) {
|
|
96
|
-
delete res[pathArray[i]];
|
|
97
|
-
}
|
|
98
|
-
return res;
|
|
73
|
+
const res = clone(obj);
|
|
74
|
+
let resVal = res;
|
|
75
|
+
let i = 0;
|
|
76
|
+
const pathArray = toPath(path);
|
|
77
|
+
for (; i < pathArray.length - 1; i++) {
|
|
78
|
+
const currentPath = pathArray[i];
|
|
79
|
+
const currentObj = getIn(obj, pathArray.slice(0, i + 1));
|
|
80
|
+
if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) resVal = resVal[currentPath] = clone(currentObj);
|
|
81
|
+
else {
|
|
82
|
+
const nextPath = pathArray[i + 1];
|
|
83
|
+
resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if ((i === 0 ? obj : resVal)[pathArray[i]] === value) return obj;
|
|
87
|
+
if (value === void 0) delete resVal[pathArray[i]];
|
|
88
|
+
else resVal[pathArray[i]] = value;
|
|
89
|
+
if (i === 0 && value === void 0) delete res[pathArray[i]];
|
|
90
|
+
return res;
|
|
99
91
|
}
|
|
100
92
|
function clone(value) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
93
|
+
if (Array.isArray(value)) return [...value];
|
|
94
|
+
else if (typeof value === "object" && value !== null) return { ...value };
|
|
95
|
+
else return value;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Deep clone a value, preserving function references and class instances.
|
|
99
|
+
* Unlike structuredClone, this handles objects that contain functions
|
|
100
|
+
* (e.g. CollectionConfig with target(), childCollections(), callbacks).
|
|
101
|
+
*/
|
|
102
|
+
function deepClone(value) {
|
|
103
|
+
if (value === null || value === void 0) return value;
|
|
104
|
+
if (typeof value === "function") return value;
|
|
105
|
+
if (typeof value !== "object") return value;
|
|
106
|
+
if (Array.isArray(value)) return value.map((item) => deepClone(item));
|
|
107
|
+
if (Object.getPrototypeOf(value) !== Object.prototype) return value;
|
|
108
|
+
const result = {};
|
|
109
|
+
for (const key of Object.keys(value)) result[key] = deepClone(value[key]);
|
|
110
|
+
return result;
|
|
110
111
|
}
|
|
111
112
|
function toPath(value) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}), {})
|
|
120
|
-
});
|
|
113
|
+
if (Array.isArray(value)) return value;
|
|
114
|
+
return value.replace(/\[(\d+)]/g, ".$1").replace(/^\./, "").replace(/\.$/, "").split(".");
|
|
115
|
+
}
|
|
116
|
+
var pick = (obj, ...args) => ({ ...args.reduce((res, key) => ({
|
|
117
|
+
...res,
|
|
118
|
+
[key]: obj[key]
|
|
119
|
+
}), {}) });
|
|
121
120
|
function isObject(item) {
|
|
122
|
-
|
|
121
|
+
return !!item && typeof item === "object" && !Array.isArray(item);
|
|
123
122
|
}
|
|
124
123
|
function isPlainObject(obj) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
const proto = Object.getPrototypeOf(obj);
|
|
129
|
-
return proto === Object.prototype;
|
|
124
|
+
if (typeof obj !== "object" || obj === null || Array.isArray(obj)) return false;
|
|
125
|
+
return Object.getPrototypeOf(obj) === Object.prototype;
|
|
130
126
|
}
|
|
131
127
|
function mergeDeep(target, source, ignoreUndefined = false) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
} else {
|
|
166
|
-
newArray[i] = sourceItem;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
output[key] = newArray;
|
|
170
|
-
} else {
|
|
171
|
-
output[key] = [...sourceValue];
|
|
172
|
-
}
|
|
173
|
-
} else if (isPlainObject(sourceValue)) {
|
|
174
|
-
if (isPlainObject(outputValue)) {
|
|
175
|
-
output[key] = mergeDeep(outputValue, sourceValue, ignoreUndefined);
|
|
176
|
-
} else {
|
|
177
|
-
output[key] = sourceValue;
|
|
178
|
-
}
|
|
179
|
-
} else if (isObject(sourceValue)) {
|
|
180
|
-
output[key] = sourceValue;
|
|
181
|
-
} else {
|
|
182
|
-
output[key] = sourceValue;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
return output;
|
|
128
|
+
if (!isObject(target)) return target;
|
|
129
|
+
const output = { ...target };
|
|
130
|
+
if (!isObject(source)) return output;
|
|
131
|
+
for (const key in source) {
|
|
132
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype") continue;
|
|
133
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
134
|
+
const sourceValue = source[key];
|
|
135
|
+
const outputValue = output[key];
|
|
136
|
+
if (ignoreUndefined && sourceValue === void 0) continue;
|
|
137
|
+
if (sourceValue instanceof Date) output[key] = new Date(sourceValue.getTime());
|
|
138
|
+
else if (Array.isArray(sourceValue)) if (Array.isArray(outputValue)) if (!(sourceValue.some(isPlainObject) || outputValue.some(isPlainObject))) output[key] = [...sourceValue];
|
|
139
|
+
else {
|
|
140
|
+
const newArray = [];
|
|
141
|
+
const maxLength = Math.max(outputValue.length, sourceValue.length);
|
|
142
|
+
for (let i = 0; i < maxLength; i++) {
|
|
143
|
+
const sourceItem = sourceValue[i];
|
|
144
|
+
const targetItem = outputValue[i];
|
|
145
|
+
if (i >= sourceValue.length) newArray[i] = targetItem;
|
|
146
|
+
else if (i >= outputValue.length) newArray[i] = sourceItem;
|
|
147
|
+
else if (sourceItem === null) newArray[i] = targetItem;
|
|
148
|
+
else if (isPlainObject(sourceItem) && isPlainObject(targetItem)) newArray[i] = mergeDeep(targetItem, sourceItem, ignoreUndefined);
|
|
149
|
+
else newArray[i] = sourceItem;
|
|
150
|
+
}
|
|
151
|
+
output[key] = newArray;
|
|
152
|
+
}
|
|
153
|
+
else output[key] = [...sourceValue];
|
|
154
|
+
else if (isPlainObject(sourceValue)) if (isPlainObject(outputValue)) output[key] = mergeDeep(outputValue, sourceValue, ignoreUndefined);
|
|
155
|
+
else output[key] = sourceValue;
|
|
156
|
+
else if (isObject(sourceValue)) output[key] = sourceValue;
|
|
157
|
+
else output[key] = sourceValue;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return output;
|
|
187
161
|
}
|
|
188
162
|
function getValueInPath(o, path) {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
if (nextPath === "") return nextObject;
|
|
204
|
-
return getValueInPath(nextObject, nextPath);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return void 0;
|
|
163
|
+
if (!o) return void 0;
|
|
164
|
+
if (typeof o === "object") {
|
|
165
|
+
if (path in o) return o[path];
|
|
166
|
+
if (path.includes(".") || path.includes("[")) {
|
|
167
|
+
let pathSegments = path.split(/[.[]/);
|
|
168
|
+
if (path.includes("[")) pathSegments = pathSegments.map((segment) => segment.replace("]", ""));
|
|
169
|
+
const firstSegment = pathSegments[0];
|
|
170
|
+
const isArrayAndIndexExists = Array.isArray(o[firstSegment]) && !isNaN(parseInt(pathSegments[1]));
|
|
171
|
+
const nextObject = isArrayAndIndexExists ? o[firstSegment][parseInt(pathSegments[1])] : o[firstSegment];
|
|
172
|
+
const nextPath = pathSegments.slice(isArrayAndIndexExists ? 2 : 1).join(".");
|
|
173
|
+
if (nextPath === "") return nextObject;
|
|
174
|
+
return getValueInPath(nextObject, nextPath);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
208
177
|
}
|
|
209
178
|
function removeInPath(o, path) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
179
|
+
const res = clone(o);
|
|
180
|
+
let current = res;
|
|
181
|
+
const parts = path.split(".");
|
|
182
|
+
const last = parts.pop();
|
|
183
|
+
for (const part of parts) if (part in current && current[part] !== null && typeof current[part] === "object") {
|
|
184
|
+
current[part] = clone(current[part]);
|
|
185
|
+
current = current[part];
|
|
186
|
+
} else return res;
|
|
187
|
+
if (last && current && typeof current === "object") delete current[last];
|
|
188
|
+
return res;
|
|
220
189
|
}
|
|
221
190
|
function removeFunctions(o) {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
return {
|
|
238
|
-
[key]: removeFunctions(value)
|
|
239
|
-
};
|
|
240
|
-
} else return {
|
|
241
|
-
[key]: value
|
|
242
|
-
};
|
|
243
|
-
}).reduce((a, b) => ({
|
|
244
|
-
...a,
|
|
245
|
-
...b
|
|
246
|
-
}), {});
|
|
247
|
-
}
|
|
248
|
-
return o;
|
|
191
|
+
if (o === void 0) return void 0;
|
|
192
|
+
if (o === null) return null;
|
|
193
|
+
if (typeof o === "object") {
|
|
194
|
+
if (Array.isArray(o)) return o.map((v) => removeFunctions(v));
|
|
195
|
+
if (!isPlainObject(o)) return o;
|
|
196
|
+
return Object.entries(o).filter(([_, value]) => typeof value !== "function").map(([key, value]) => {
|
|
197
|
+
if (Array.isArray(value)) return { [key]: value.map((v) => removeFunctions(v)) };
|
|
198
|
+
else if (typeof value === "object") return { [key]: removeFunctions(value) };
|
|
199
|
+
else return { [key]: value };
|
|
200
|
+
}).reduce((a, b) => ({
|
|
201
|
+
...a,
|
|
202
|
+
...b
|
|
203
|
+
}), {});
|
|
204
|
+
}
|
|
205
|
+
return o;
|
|
249
206
|
}
|
|
250
207
|
function getHashValue(v) {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
ignoreUnknown: true
|
|
259
|
-
});
|
|
208
|
+
if (!v) return null;
|
|
209
|
+
if (typeof v === "object" && v !== null) {
|
|
210
|
+
if ("id" in v) return String(v.id);
|
|
211
|
+
else if (v instanceof Date) return v.toLocaleString();
|
|
212
|
+
else if (v instanceof GeoPoint) return hash(v);
|
|
213
|
+
}
|
|
214
|
+
return hash(v, { ignoreUnknown: true });
|
|
260
215
|
}
|
|
261
216
|
function removeUndefined(value, removeEmptyStrings) {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
if (childRes !== void 0 && !isEmptyObject(childRes) && shouldKeepIfString) res[key] = childRes;
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
return res;
|
|
283
|
-
}
|
|
284
|
-
return value;
|
|
217
|
+
if (typeof value === "function") return value;
|
|
218
|
+
if (Array.isArray(value)) return value.map((v) => removeUndefined(v, removeEmptyStrings));
|
|
219
|
+
if (typeof value === "object") {
|
|
220
|
+
if (value === null) return value;
|
|
221
|
+
if (!isPlainObject(value)) return value;
|
|
222
|
+
const res = {};
|
|
223
|
+
Object.keys(value).forEach((key) => {
|
|
224
|
+
if (!isEmptyObject(value)) {
|
|
225
|
+
const childRes = removeUndefined(value[key], removeEmptyStrings);
|
|
226
|
+
const isString = typeof childRes === "string";
|
|
227
|
+
const shouldKeepIfString = !removeEmptyStrings || removeEmptyStrings && !isString || removeEmptyStrings && isString && childRes !== "";
|
|
228
|
+
if (childRes !== void 0 && !isEmptyObject(childRes) && shouldKeepIfString) res[key] = childRes;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
return res;
|
|
232
|
+
}
|
|
233
|
+
return value;
|
|
285
234
|
}
|
|
286
235
|
function removeNulls(value) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
Object.keys(obj).forEach((key) => {
|
|
301
|
-
if (obj[key] !== null) res[key] = removeNulls(obj[key]);
|
|
302
|
-
});
|
|
303
|
-
return res;
|
|
304
|
-
}
|
|
305
|
-
return value;
|
|
236
|
+
if (typeof value === "function") return value;
|
|
237
|
+
if (Array.isArray(value)) return value.map((v) => removeNulls(v));
|
|
238
|
+
if (typeof value === "object") {
|
|
239
|
+
if (value === null) return value;
|
|
240
|
+
if (!isPlainObject(value)) return value;
|
|
241
|
+
const res = {};
|
|
242
|
+
const obj = value;
|
|
243
|
+
Object.keys(obj).forEach((key) => {
|
|
244
|
+
if (obj[key] !== null) res[key] = removeNulls(obj[key]);
|
|
245
|
+
});
|
|
246
|
+
return res;
|
|
247
|
+
}
|
|
248
|
+
return value;
|
|
306
249
|
}
|
|
307
250
|
function isEmptyObject(obj) {
|
|
308
|
-
|
|
251
|
+
return obj && Object.getPrototypeOf(obj) === Object.prototype && Object.keys(obj).length === 0;
|
|
309
252
|
}
|
|
310
253
|
function removePropsIfExisting(source, comparison) {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
Object.keys(comparison).forEach((key) => {
|
|
329
|
-
if (key in res) {
|
|
330
|
-
if (isObject2(res[key]) && isObject2(comparison[key])) {
|
|
331
|
-
res[key] = removePropsIfExisting(res[key], comparison[key]);
|
|
332
|
-
} else if (res[key] === comparison[key]) {
|
|
333
|
-
delete res[key];
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
return res;
|
|
339
|
-
}
|
|
254
|
+
const isObject = (val) => typeof val === "object" && val !== null;
|
|
255
|
+
const isArray = (val) => Array.isArray(val);
|
|
256
|
+
if (!isObject(source) || !isObject(comparison)) return source;
|
|
257
|
+
const res = isArray(source) ? [...source] : { ...source };
|
|
258
|
+
if (isArray(res)) {
|
|
259
|
+
for (let i = res.length - 1; i >= 0; i--) if (res[i] === comparison[i]) res.splice(i, 1);
|
|
260
|
+
else if (isObject(res[i]) && isObject(comparison[i])) res[i] = removePropsIfExisting(res[i], comparison[i]);
|
|
261
|
+
} else Object.keys(comparison).forEach((key) => {
|
|
262
|
+
if (key in res) {
|
|
263
|
+
if (isObject(res[key]) && isObject(comparison[key])) res[key] = removePropsIfExisting(res[key], comparison[key]);
|
|
264
|
+
else if (res[key] === comparison[key]) delete res[key];
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
return res;
|
|
268
|
+
}
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/arrays.ts
|
|
340
271
|
function toArray(input) {
|
|
341
|
-
|
|
272
|
+
return Array.isArray(input) ? input : input ? [input] : [];
|
|
342
273
|
}
|
|
343
|
-
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region src/dates.ts
|
|
276
|
+
var defaultDateFormat = "MMMM dd, yyyy, HH:mm:ss";
|
|
277
|
+
//#endregion
|
|
278
|
+
//#region src/hash.ts
|
|
344
279
|
function hashString(str) {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}
|
|
280
|
+
if (!str) return 0;
|
|
281
|
+
let hash = 0;
|
|
282
|
+
let i;
|
|
283
|
+
let chr;
|
|
284
|
+
for (i = 0; i < str.length; i++) {
|
|
285
|
+
chr = str.charCodeAt(i);
|
|
286
|
+
hash = (hash << 5) - hash + chr;
|
|
287
|
+
hash |= 0;
|
|
288
|
+
}
|
|
289
|
+
return Math.abs(hash);
|
|
290
|
+
}
|
|
291
|
+
//#endregion
|
|
292
|
+
//#region src/regexp.ts
|
|
356
293
|
function serializeRegExp(input) {
|
|
357
|
-
|
|
358
|
-
|
|
294
|
+
if (!input) return "";
|
|
295
|
+
return input.toString();
|
|
359
296
|
}
|
|
297
|
+
/**
|
|
298
|
+
* Get a RegExp out of a serialized string
|
|
299
|
+
* @param input
|
|
300
|
+
*/
|
|
360
301
|
function hydrateRegExp(input) {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
} else {
|
|
366
|
-
return new RegExp(input, "");
|
|
367
|
-
}
|
|
302
|
+
if (!input) return void 0;
|
|
303
|
+
const fragments = input.match(/\/(.*?)\/([a-z]*)?$/i);
|
|
304
|
+
if (fragments) return new RegExp(fragments[1], fragments[2] || "");
|
|
305
|
+
else return new RegExp(input, "");
|
|
368
306
|
}
|
|
369
307
|
function isValidRegExp(input) {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
const simpleRegexp = input.match(/((?![*+?])(?:[^\r\n[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*])+)/);
|
|
373
|
-
return !!simpleRegexp;
|
|
308
|
+
if (input.match(/\/((?![*+?])(?:[^\r\n[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*])+)\/((?:g(?:im?|mi?)?|i(?:gm?|mg?)?|m(?:gi?|ig?)?)?)/)) return true;
|
|
309
|
+
return !!input.match(/((?![*+?])(?:[^\r\n[/\\]|\\.|\[(?:[^\r\n\]\\]|\\.)*])+)/);
|
|
374
310
|
}
|
|
311
|
+
//#endregion
|
|
312
|
+
//#region src/flatten_object.ts
|
|
375
313
|
function flattenObject(obj, parentKey = "") {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
} else {
|
|
388
|
-
flatObj[newKey] = obj[key];
|
|
389
|
-
}
|
|
390
|
-
return flatObj;
|
|
391
|
-
}, {});
|
|
314
|
+
if (!obj) return obj;
|
|
315
|
+
return Object.keys(obj).reduce((flatObj, key) => {
|
|
316
|
+
const newKey = parentKey ? `${parentKey}.${key}` : key;
|
|
317
|
+
if (typeof obj[key] === "object" && obj[key] !== null) if (Array.isArray(obj[key])) obj[key].forEach((item, index) => {
|
|
318
|
+
if (typeof item === "object" && item !== null) Object.assign(flatObj, flattenObject(item, `${newKey}[${index}]`));
|
|
319
|
+
else flatObj[`${newKey}[${index}]`] = item;
|
|
320
|
+
});
|
|
321
|
+
else Object.assign(flatObj, flattenObject(obj[key], newKey));
|
|
322
|
+
else flatObj[newKey] = obj[key];
|
|
323
|
+
return flatObj;
|
|
324
|
+
}, {});
|
|
392
325
|
}
|
|
393
326
|
function getArrayValuesCount(array) {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
327
|
+
return array.reduce((acc, obj) => {
|
|
328
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
329
|
+
if (Array.isArray(value)) acc[key] = Math.max(acc[key] || 0, value.length);
|
|
330
|
+
if (typeof value === "object" && value !== null) {
|
|
331
|
+
const nested = getArrayValuesCount([value]);
|
|
332
|
+
Object.entries(nested).forEach(([nestedKey, nestedCount]) => {
|
|
333
|
+
const compoundKey = `${key}.${nestedKey}`;
|
|
334
|
+
acc[compoundKey] = Math.max(acc[compoundKey] || 0, nestedCount);
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
return acc;
|
|
339
|
+
}, {});
|
|
340
|
+
}
|
|
341
|
+
//#endregion
|
|
342
|
+
//#region src/plurals.ts
|
|
343
|
+
/**
|
|
344
|
+
* Returns the plural of an English word.
|
|
345
|
+
*
|
|
346
|
+
* @param {string} word
|
|
347
|
+
* @param {number} [amount]
|
|
348
|
+
* @returns {string}
|
|
349
|
+
*/
|
|
410
350
|
function plural(word, amount) {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
351
|
+
if (amount !== void 0 && amount === 1) return word;
|
|
352
|
+
const plurals = {
|
|
353
|
+
"(quiz)$": "$1zes",
|
|
354
|
+
"^(ox)$": "$1en",
|
|
355
|
+
"([m|l])ouse$": "$1ice",
|
|
356
|
+
"(matr|vert|ind)ix|ex$": "$1ices",
|
|
357
|
+
"(x|ch|ss|sh)$": "$1es",
|
|
358
|
+
"([^aeiouy]|qu)y$": "$1ies",
|
|
359
|
+
"(hive)$": "$1s",
|
|
360
|
+
"(?:([^f])fe|([lr])f)$": "$1$2ves",
|
|
361
|
+
"(shea|lea|loa|thie)f$": "$1ves",
|
|
362
|
+
sis$: "ses",
|
|
363
|
+
"([ti])um$": "$1a",
|
|
364
|
+
"(tomat|potat|ech|her|vet)o$": "$1oes",
|
|
365
|
+
"(bu)s$": "$1ses",
|
|
366
|
+
"(alias)$": "$1es",
|
|
367
|
+
"(octop)us$": "$1i",
|
|
368
|
+
"(ax|test)is$": "$1es",
|
|
369
|
+
"(us)$": "$1es",
|
|
370
|
+
"([^s]+)$": "$1s"
|
|
371
|
+
};
|
|
372
|
+
const irregular = {
|
|
373
|
+
move: "moves",
|
|
374
|
+
foot: "feet",
|
|
375
|
+
goose: "geese",
|
|
376
|
+
sex: "sexes",
|
|
377
|
+
child: "children",
|
|
378
|
+
man: "men",
|
|
379
|
+
tooth: "teeth",
|
|
380
|
+
person: "people"
|
|
381
|
+
};
|
|
382
|
+
if ([
|
|
383
|
+
"sheep",
|
|
384
|
+
"fish",
|
|
385
|
+
"deer",
|
|
386
|
+
"moose",
|
|
387
|
+
"series",
|
|
388
|
+
"species",
|
|
389
|
+
"money",
|
|
390
|
+
"rice",
|
|
391
|
+
"information",
|
|
392
|
+
"equipment",
|
|
393
|
+
"bison",
|
|
394
|
+
"cod",
|
|
395
|
+
"offspring",
|
|
396
|
+
"pike",
|
|
397
|
+
"salmon",
|
|
398
|
+
"shrimp",
|
|
399
|
+
"swine",
|
|
400
|
+
"trout",
|
|
401
|
+
"aircraft",
|
|
402
|
+
"hovercraft",
|
|
403
|
+
"spacecraft",
|
|
404
|
+
"sugar",
|
|
405
|
+
"tuna",
|
|
406
|
+
"you",
|
|
407
|
+
"wood"
|
|
408
|
+
].indexOf(word.toLowerCase()) >= 0) return word;
|
|
409
|
+
for (const w in irregular) {
|
|
410
|
+
const pattern = new RegExp(`${w}$`, "i");
|
|
411
|
+
const replace = irregular[w];
|
|
412
|
+
if (pattern.test(word)) return word.replace(pattern, replace);
|
|
413
|
+
}
|
|
414
|
+
for (const reg in plurals) {
|
|
415
|
+
const pattern = new RegExp(reg, "i");
|
|
416
|
+
if (pattern.test(word)) return word.replace(pattern, plurals[reg]);
|
|
417
|
+
}
|
|
418
|
+
return word;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Returns the singular of an English word.
|
|
422
|
+
*
|
|
423
|
+
* @param {string} word
|
|
424
|
+
* @param {number} [amount]
|
|
425
|
+
* @returns {string}
|
|
426
|
+
*/
|
|
463
427
|
function singular(word, amount) {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
428
|
+
if (amount !== void 0 && amount !== 1) return word;
|
|
429
|
+
const singulars = {
|
|
430
|
+
"(quiz)zes$": "$1",
|
|
431
|
+
"(matr)ices$": "$1ix",
|
|
432
|
+
"(vert|ind)ices$": "$1ex",
|
|
433
|
+
"^(ox)en$": "$1",
|
|
434
|
+
"(alias)es$": "$1",
|
|
435
|
+
"(octop|vir)i$": "$1us",
|
|
436
|
+
"(cris|ax|test)es$": "$1is",
|
|
437
|
+
"(shoe)s$": "$1",
|
|
438
|
+
"(o)es$": "$1",
|
|
439
|
+
"(bus)es$": "$1",
|
|
440
|
+
"([m|l])ice$": "$1ouse",
|
|
441
|
+
"(x|ch|ss|sh)es$": "$1",
|
|
442
|
+
"(m)ovies$": "$1ovie",
|
|
443
|
+
"(s)eries$": "$1eries",
|
|
444
|
+
"([^aeiouy]|qu)ies$": "$1y",
|
|
445
|
+
"([lr])ves$": "$1f",
|
|
446
|
+
"(tive)s$": "$1",
|
|
447
|
+
"(hive)s$": "$1",
|
|
448
|
+
"(li|wi|kni)ves$": "$1fe",
|
|
449
|
+
"(shea|loa|lea|thie)ves$": "$1f",
|
|
450
|
+
"(^analy)ses$": "$1sis",
|
|
451
|
+
"((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$": "$1$2sis",
|
|
452
|
+
"([ti])a$": "$1um",
|
|
453
|
+
"(n)ews$": "$1ews",
|
|
454
|
+
"(h|bl)ouses$": "$1ouse",
|
|
455
|
+
"(corpse)s$": "$1",
|
|
456
|
+
"(us)es$": "$1",
|
|
457
|
+
s$: ""
|
|
458
|
+
};
|
|
459
|
+
const irregular = {
|
|
460
|
+
move: "moves",
|
|
461
|
+
foot: "feet",
|
|
462
|
+
goose: "geese",
|
|
463
|
+
sex: "sexes",
|
|
464
|
+
child: "children",
|
|
465
|
+
man: "men",
|
|
466
|
+
tooth: "teeth",
|
|
467
|
+
person: "people"
|
|
468
|
+
};
|
|
469
|
+
if ([
|
|
470
|
+
"sheep",
|
|
471
|
+
"fish",
|
|
472
|
+
"deer",
|
|
473
|
+
"moose",
|
|
474
|
+
"series",
|
|
475
|
+
"species",
|
|
476
|
+
"money",
|
|
477
|
+
"rice",
|
|
478
|
+
"information",
|
|
479
|
+
"equipment",
|
|
480
|
+
"bison",
|
|
481
|
+
"cod",
|
|
482
|
+
"offspring",
|
|
483
|
+
"pike",
|
|
484
|
+
"salmon",
|
|
485
|
+
"shrimp",
|
|
486
|
+
"swine",
|
|
487
|
+
"trout",
|
|
488
|
+
"aircraft",
|
|
489
|
+
"hovercraft",
|
|
490
|
+
"spacecraft",
|
|
491
|
+
"sugar",
|
|
492
|
+
"tuna",
|
|
493
|
+
"you",
|
|
494
|
+
"wood"
|
|
495
|
+
].indexOf(word.toLowerCase()) >= 0) return word;
|
|
496
|
+
for (const w in irregular) {
|
|
497
|
+
const pattern = new RegExp(`${irregular[w]}$`, "i");
|
|
498
|
+
if (pattern.test(word)) return word.replace(pattern, w);
|
|
499
|
+
}
|
|
500
|
+
for (const reg in singulars) {
|
|
501
|
+
const pattern = new RegExp(reg, "i");
|
|
502
|
+
if (pattern.test(word)) return word.replace(pattern, singulars[reg]);
|
|
503
|
+
}
|
|
504
|
+
return word;
|
|
505
|
+
}
|
|
506
|
+
//#endregion
|
|
507
|
+
//#region src/names.ts
|
|
508
|
+
/**
|
|
509
|
+
* Generates a foreign key column name from a given string, typically a collection slug or name.
|
|
510
|
+
* It converts the name to snake_case, attempts to singularize it by removing a trailing 's'
|
|
511
|
+
* (a common convention for collection names), and appends '_id'.
|
|
512
|
+
*
|
|
513
|
+
* @param name The base name to convert to a foreign key.
|
|
514
|
+
* @returns A foreign key name in the format 'singular_name_id'.
|
|
515
|
+
*
|
|
516
|
+
* @example
|
|
517
|
+
* // returns "user_id"
|
|
518
|
+
* generateForeignKeyName("users")
|
|
519
|
+
*
|
|
520
|
+
* @example
|
|
521
|
+
* // returns "post_id"
|
|
522
|
+
* generateForeignKeyName("posts")
|
|
523
|
+
*
|
|
524
|
+
* @example
|
|
525
|
+
* // returns "product_id"
|
|
526
|
+
* generateForeignKeyName("Product")
|
|
527
|
+
*
|
|
528
|
+
*/
|
|
537
529
|
function generateForeignKeyName(name) {
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
return `${singularName}_id`;
|
|
530
|
+
const snakeCaseName = toSnakeCase(name);
|
|
531
|
+
return `${snakeCaseName.endsWith("s") ? snakeCaseName.slice(0, -1) : snakeCaseName}_id`;
|
|
541
532
|
}
|
|
533
|
+
//#endregion
|
|
534
|
+
//#region src/fields.ts
|
|
542
535
|
function isDefaultFieldConfigId(id) {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
randomColor,
|
|
573
|
-
randomString,
|
|
574
|
-
removeFunctions,
|
|
575
|
-
removeInPath,
|
|
576
|
-
removeNulls,
|
|
577
|
-
removePropsIfExisting,
|
|
578
|
-
removeUndefined,
|
|
579
|
-
serializeRegExp,
|
|
580
|
-
setIn,
|
|
581
|
-
singular,
|
|
582
|
-
slugify,
|
|
583
|
-
toArray,
|
|
584
|
-
toKebabCase,
|
|
585
|
-
toSnakeCase,
|
|
586
|
-
unslugify
|
|
587
|
-
};
|
|
588
|
-
//# sourceMappingURL=index.es.js.map
|
|
536
|
+
return [
|
|
537
|
+
"text_field",
|
|
538
|
+
"multiline",
|
|
539
|
+
"markdown",
|
|
540
|
+
"url",
|
|
541
|
+
"email",
|
|
542
|
+
"switch",
|
|
543
|
+
"select",
|
|
544
|
+
"multi_select",
|
|
545
|
+
"number_input",
|
|
546
|
+
"number_select",
|
|
547
|
+
"multi_number_select",
|
|
548
|
+
"file_upload",
|
|
549
|
+
"multi_file_upload",
|
|
550
|
+
"reference",
|
|
551
|
+
"multi_references",
|
|
552
|
+
"relation",
|
|
553
|
+
"date_time",
|
|
554
|
+
"group",
|
|
555
|
+
"key_value",
|
|
556
|
+
"repeat",
|
|
557
|
+
"custom_array",
|
|
558
|
+
"block"
|
|
559
|
+
].includes(id);
|
|
560
|
+
}
|
|
561
|
+
//#endregion
|
|
562
|
+
export { camelCase, clone, deepClone, defaultDateFormat, flattenObject, generateForeignKeyName, getArrayValuesCount, getHashValue, getIn, getValueInPath, hashString, hydrateRegExp, isDefaultFieldConfigId, isEmptyArray, isEmptyObject, isFunction, isInteger, isNaN, isObject, isPlainObject, isValidRegExp, mergeDeep, pick, plural, prettifyIdentifier, randomColor, randomString, removeFunctions, removeInPath, removeNulls, removePropsIfExisting, removeUndefined, serializeRegExp, setIn, singular, slugify, toArray, toKebabCase, toSnakeCase, unslugify };
|
|
563
|
+
|
|
564
|
+
//# sourceMappingURL=index.es.js.map
|