@inrixia/helpers 1.23.4 → 2.0.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/conv.d.ts +28 -0
- package/conv.d.ts.map +1 -0
- package/conv.js +42 -0
- package/conv.js.map +1 -0
- package/{elastic/index.d.ts → elastic.d.ts} +15 -14
- package/elastic.d.ts.map +1 -0
- package/{elastic/index.js → elastic.js} +24 -31
- package/elastic.js.map +1 -0
- package/{geo/index.d.ts → geo.d.ts} +5 -6
- package/geo.d.ts.map +1 -0
- package/geo.js +32 -0
- package/geo.js.map +1 -0
- package/index.d.ts +9 -7
- package/index.d.ts.map +1 -1
- package/index.js +9 -33
- package/index.js.map +1 -1
- package/{logic/index.d.ts → logic.d.ts} +2 -2
- package/logic.d.ts.map +1 -0
- package/{logic/index.js → logic.js} +16 -18
- package/logic.js.map +1 -0
- package/{math/index.d.ts → math.d.ts} +2 -2
- package/math.d.ts.map +1 -0
- package/{math/index.js → math.js} +6 -13
- package/math.js.map +1 -0
- package/{object/index.d.ts → object.d.ts} +45 -44
- package/object.d.ts.map +1 -0
- package/{object/index.js → object.js} +80 -112
- package/object.js.map +1 -0
- package/package.json +9 -4
- package/{react/index.d.ts → react.d.ts} +1 -1
- package/react.d.ts.map +1 -0
- package/{react/index.js → react.js} +2 -6
- package/react.js.map +1 -0
- package/test/matchers.d.ts +15 -0
- package/test/matchers.d.ts.map +1 -0
- package/test/matchers.js +66 -0
- package/test/matchers.js.map +1 -0
- package/test.d.ts +15 -0
- package/test.d.ts.map +1 -0
- package/test.js +5 -0
- package/test.js.map +1 -0
- package/ts/math.js +1 -2
- package/ts/numRange.d.ts.map +1 -1
- package/ts/numRange.js +1 -2
- package/{ts/index.d.ts → ts.d.ts} +7 -3
- package/ts.d.ts.map +1 -0
- package/ts.js +6 -0
- package/ts.js.map +1 -0
- package/conv/index.d.ts +0 -28
- package/conv/index.d.ts.map +0 -1
- package/conv/index.js +0 -48
- package/conv/index.js.map +0 -1
- package/elastic/index.d.ts.map +0 -1
- package/elastic/index.js.map +0 -1
- package/geo/index.d.ts.map +0 -1
- package/geo/index.js +0 -39
- package/geo/index.js.map +0 -1
- package/jest/index.d.ts +0 -24
- package/jest/index.d.ts.map +0 -1
- package/jest/index.js +0 -47
- package/jest/index.js.map +0 -1
- package/logic/index.d.ts.map +0 -1
- package/logic/index.js.map +0 -1
- package/math/index.d.ts.map +0 -1
- package/math/index.js.map +0 -1
- package/object/index.d.ts.map +0 -1
- package/object/index.js.map +0 -1
- package/react/index.d.ts.map +0 -1
- package/react/index.js.map +0 -1
- package/ts/index.d.ts.map +0 -1
- package/ts/index.js +0 -11
- package/ts/index.js.map +0 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
import { UnknownRecord } from "./ts.js";
|
|
1
2
|
export declare const isDuplicate: (key: unknown) => boolean;
|
|
2
3
|
/**
|
|
3
4
|
* Simple object check.
|
|
4
5
|
* @param item
|
|
5
6
|
* @returns {boolean}
|
|
6
7
|
*/
|
|
7
|
-
export declare const isObject: (item: unknown) =>
|
|
8
|
+
export declare const isObject: (item: unknown) => item is UnknownRecord;
|
|
8
9
|
/**
|
|
9
10
|
* Deep merge objects into target. Without modifying target.
|
|
10
11
|
* @param target
|
|
11
12
|
* @param source
|
|
12
13
|
*/
|
|
13
|
-
export declare const deepMerge: <T extends S, S extends
|
|
14
|
+
export declare const deepMerge: <T extends S, S extends UnknownRecord = Partial<T>>(target: T, source: S) => T & S;
|
|
14
15
|
export declare type Types = {
|
|
15
16
|
[key: string]: string | string[] | Types | Types[];
|
|
16
17
|
};
|
|
@@ -21,35 +22,35 @@ export declare type TypeCompareResult = boolean | {
|
|
|
21
22
|
};
|
|
22
23
|
/**
|
|
23
24
|
* Take in a target `object` and a `types` object with identical keys but values as array of types those keys should be.
|
|
24
|
-
* @param
|
|
25
|
-
* @param
|
|
26
|
-
* @returns
|
|
25
|
+
* @param target Object
|
|
26
|
+
* @param types Object identical to `target` but values are types
|
|
27
|
+
* @returns `object` if the types dont match. `True` if they do.
|
|
27
28
|
*/
|
|
28
|
-
export declare const deepTypeCompare: (target:
|
|
29
|
+
export declare const deepTypeCompare: (target: UnknownRecord, types: Types, location?: string) => TypeCompareResult;
|
|
29
30
|
/**
|
|
30
31
|
* Helper function for `deepTypeCompare` to compare a item to a type or set of types.
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
32
|
+
* @param expectedTypes Expected type/types
|
|
33
|
+
* @param receivedValue Object given
|
|
34
|
+
* @param location Location of `got` given
|
|
34
35
|
*/
|
|
35
|
-
export declare const compareTwo: (expectedTypes: string |
|
|
36
|
+
export declare const compareTwo: (expectedTypes: string | string[], receivedValue: unknown, location: string) => TypeCompareResult;
|
|
36
37
|
/**
|
|
37
38
|
* Returns the type of `item` respecting `Array`, `null` and `undefined` unlike typeof.
|
|
38
|
-
* @param
|
|
39
|
-
* @returns
|
|
39
|
+
* @param item
|
|
40
|
+
* @returns Type of item
|
|
40
41
|
*/
|
|
41
42
|
export declare const type: (item: unknown) => string;
|
|
42
43
|
/**
|
|
43
44
|
* Breaks `array` into smaller chunks based on `chunkSize`
|
|
44
|
-
* @param
|
|
45
|
-
* @param
|
|
45
|
+
* @param array Array to break up.
|
|
46
|
+
* @param chunkSize Maximum size of array chunks.
|
|
46
47
|
*
|
|
47
|
-
* @returns
|
|
48
|
+
* @returns Array containing array chunks.
|
|
48
49
|
*/
|
|
49
50
|
export declare const chunkArray: <T extends string | unknown[]>(array: T, chunkSize: number) => T[];
|
|
50
51
|
/**
|
|
51
52
|
* stringifies and then parses a object to convert it to a JSON supported object.
|
|
52
|
-
* @param
|
|
53
|
+
* @param obj Object to convert.
|
|
53
54
|
* @example
|
|
54
55
|
* const obj = {
|
|
55
56
|
* a: 1,
|
|
@@ -59,35 +60,32 @@ export declare const chunkArray: <T extends string | unknown[]>(array: T, chunkS
|
|
|
59
60
|
* const b = JSON.parse(JSON.stringify(obj))
|
|
60
61
|
* console.log(a == b) -> true
|
|
61
62
|
*/
|
|
62
|
-
export declare const objectify: (obj:
|
|
63
|
+
export declare const objectify: (obj: UnknownRecord) => UnknownRecord;
|
|
63
64
|
/**
|
|
64
65
|
* Logs a inspected object to console
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
67
|
-
* @param
|
|
68
|
-
* @param
|
|
69
|
-
* @returns {void}
|
|
66
|
+
* @param obj Object to inspect
|
|
67
|
+
* @param options.showHidden Show hidden properties of object
|
|
68
|
+
* @param options.depth Depth to inspect object
|
|
69
|
+
* @param options.color Color resulting output
|
|
70
70
|
*/
|
|
71
71
|
export declare const lObj: (obj: unknown, showHidden?: boolean | undefined, depth?: number | undefined, color?: boolean | undefined) => void;
|
|
72
72
|
/**
|
|
73
73
|
* Inspects a object
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
77
|
-
* @param
|
|
78
|
-
* @returns {string}
|
|
74
|
+
* @param obj Object to inspect
|
|
75
|
+
* @param options.showHidden Show hidden properties of object
|
|
76
|
+
* @param options.depth Depth to inspect object
|
|
77
|
+
* @param options.color Color resulting output
|
|
79
78
|
*/
|
|
80
79
|
export declare const iObj: (obj: unknown, showHidden?: boolean | undefined, depth?: number | undefined, color?: boolean | undefined) => string;
|
|
81
80
|
/**
|
|
82
81
|
* Single line inspect object.
|
|
83
|
-
* @param
|
|
84
|
-
* @param
|
|
85
|
-
* @param
|
|
86
|
-
* @param
|
|
87
|
-
* @returns {string} Inspected object in a single line, spaces aligned
|
|
82
|
+
* @param obj Object to inspect
|
|
83
|
+
* @param options.showHidden Show hidden properties of object
|
|
84
|
+
* @param options.depth Depth to inspect object
|
|
85
|
+
* @param options.color Color resulting output
|
|
88
86
|
*/
|
|
89
87
|
export declare const sliObj: (obj: unknown, showHidden?: boolean | undefined, depth?: number | undefined, color?: boolean | undefined) => string;
|
|
90
|
-
declare type
|
|
88
|
+
declare type AsyncFunction = (...args: unknown[]) => Promise<unknown>;
|
|
91
89
|
declare type ErrorHandler = (err: Error) => Promise<void>;
|
|
92
90
|
/**
|
|
93
91
|
* Recursively runs `func` and handles errors with `errorHandler` until `func` successfully finishes.
|
|
@@ -95,15 +93,15 @@ declare type ErrorHandler = (err: Error) => Promise<void>;
|
|
|
95
93
|
* @param errorHandler Function to execute when a error occours
|
|
96
94
|
* @returns Return value of `func` on success
|
|
97
95
|
*/
|
|
98
|
-
export declare const loopError: <F extends
|
|
96
|
+
export declare const loopError: <F extends AsyncFunction>(func: F, errorHandler?: ErrorHandler) => ReturnType<F>;
|
|
99
97
|
/**
|
|
100
|
-
* @param
|
|
101
|
-
* @returns
|
|
98
|
+
* @param array
|
|
99
|
+
* @returns string containing ranges of numbers.
|
|
102
100
|
* @example
|
|
103
101
|
* const range = toRange([1, 2, 3, 12, 6,7, 5, 27, 28, 29, 40, 41, 25, 42, 12])
|
|
104
102
|
* // range = "1-3 & 5-7 & 12 & 25 & 27-29 & 40-42"
|
|
105
103
|
*/
|
|
106
|
-
export declare const toRange: (array:
|
|
104
|
+
export declare const toRange: (array: number[]) => string;
|
|
107
105
|
/**
|
|
108
106
|
* Returns the `property` requested from `obj`
|
|
109
107
|
* @param obj
|
|
@@ -118,14 +116,14 @@ export declare const toRange: (array: Array<number>) => string;
|
|
|
118
116
|
* const wantedProperty = "a.child"
|
|
119
117
|
* console.log(deepGet(object, wantedProperty)) // -> "Hello World"
|
|
120
118
|
*/
|
|
121
|
-
export declare const deepGet: <T = unknown>(obj:
|
|
119
|
+
export declare const deepGet: <T = unknown>(obj: UnknownRecord, property: string, delimiter?: string) => T | undefined;
|
|
122
120
|
declare type ContentTemplate = {
|
|
123
121
|
[key: string]: string | ContentTemplate;
|
|
124
122
|
};
|
|
125
123
|
/**
|
|
126
124
|
* Replaces values in a given `templatestring` with contentKeys from a given `contentKeys` object.
|
|
127
|
-
* @param
|
|
128
|
-
* @param
|
|
125
|
+
* @param contentKeys Object containing key value pairs of contentKeys to fill template string with
|
|
126
|
+
* @param templatestring string containing templates to fill
|
|
129
127
|
* @example
|
|
130
128
|
* const contentKeys = {
|
|
131
129
|
* "title": "This is a title",
|
|
@@ -138,12 +136,15 @@ declare type ContentTemplate = {
|
|
|
138
136
|
* fillTemplate(contentKeys, template) // => Wow! This is a title... Here is some info: This is some info!"
|
|
139
137
|
*/
|
|
140
138
|
export declare const fillTemplate: (contentKeys: ContentTemplate, templatestring: string, parent?: string) => string;
|
|
139
|
+
declare type EnvDict = {
|
|
140
|
+
[key: string]: string | EnvDict;
|
|
141
|
+
};
|
|
141
142
|
/**
|
|
142
143
|
* Converts process.env variables into a object
|
|
143
144
|
* @example process.env["some_subproperty"] = "hello"
|
|
144
145
|
* returns { some: { subProperty: "hello" } }
|
|
145
146
|
*/
|
|
146
|
-
export declare const getEnv: () =>
|
|
147
|
+
export declare const getEnv: () => EnvDict;
|
|
147
148
|
declare type RecursiveUpdateOptions = {
|
|
148
149
|
setUndefined?: boolean;
|
|
149
150
|
setDefined?: boolean;
|
|
@@ -155,14 +156,14 @@ declare type RecursiveUpdateOptions = {
|
|
|
155
156
|
* @param options.setUndefined Defaults to `true` Set properties that are undefined on `targetObject`.
|
|
156
157
|
* @param options.setDefined Defaults to `false`. Overwrite properties that are not undefined on `targetObject`.
|
|
157
158
|
*/
|
|
158
|
-
export declare const recursiveUpdate: (targetObject:
|
|
159
|
+
export declare const recursiveUpdate: (targetObject: UnknownRecord, newObject: UnknownRecord, options?: RecursiveUpdateOptions) => void;
|
|
159
160
|
/**
|
|
160
161
|
* Set the types of a given `object` based on the types of an identical `types` object. Usful in conjunction with `getEnv` to convert a object only containing strings/objects to actual types.
|
|
161
162
|
*/
|
|
162
|
-
export declare const rebuildTypes:
|
|
163
|
+
export declare const rebuildTypes: (object: UnknownRecord, types: UnknownRecord) => void;
|
|
163
164
|
/**
|
|
164
165
|
* Fetch process.env[envName] or throw if its undefined
|
|
165
166
|
*/
|
|
166
167
|
export declare const envOrThrow: (envName: string) => string;
|
|
167
168
|
export {};
|
|
168
|
-
//# sourceMappingURL=
|
|
169
|
+
//# sourceMappingURL=object.d.ts.map
|
package/object.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../src/object.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAMxC,eAAO,MAAM,WAAW,QAAS,OAAO,KAAG,OAI1C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,QAAQ,SAAU,OAAO,0BAAkG,CAAC;AAEzI;;;;GAIG;AACH,eAAO,MAAM,SAAS,oFAWrB,CAAC;AAEF,oBAAY,KAAK,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,KAAK,GAAG,KAAK,EAAE,CAAA;CAAE,CAAC;AAC3E,oBAAY,iBAAiB,GAAG,OAAO,GAAG;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvG;;;;;GAKG;AACH,eAAO,MAAM,eAAe,WAAY,aAAa,SAAS,KAAK,wBAAwB,iBA0B1F,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,kBAAmB,MAAM,GAAG,MAAM,EAAE,iBAAiB,OAAO,YAAY,MAAM,KAAG,iBAOvG,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,IAAI,SAAU,OAAO,KAAG,MAKpC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,sDAAuD,MAAM,QAMnF,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,SAAS,QAAS,aAAa,KAAG,aAAgD,CAAC;AAIhG;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,QAAS,OAAO,gGAA+B,IAA0C,CAAC;AAE3G;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,QAAS,OAAO,gGAA+B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44 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.envOrThrow = exports.rebuildTypes = exports.recursiveUpdate = exports.getEnv = exports.fillTemplate = exports.deepGet = exports.toRange = exports.loopError = exports.sliObj = exports.iObj = exports.lObj = exports.objectify = exports.chunkArray = exports.type = exports.compareTwo = exports.deepTypeCompare = exports.deepMerge = exports.isObject = exports.isDuplicate = void 0;
|
|
7
|
-
const util_1 = __importDefault(require("util"));
|
|
1
|
+
import util from "util";
|
|
8
2
|
/**
|
|
9
3
|
* Checks if `key` has been seen before.
|
|
10
4
|
*/
|
|
11
5
|
const hash = new Map();
|
|
12
|
-
const isDuplicate = (key) => {
|
|
6
|
+
export const isDuplicate = (key) => {
|
|
13
7
|
if (!hash.has(key))
|
|
14
8
|
hash.set(key, true);
|
|
15
9
|
else
|
|
16
10
|
return true;
|
|
17
11
|
return false;
|
|
18
12
|
};
|
|
19
|
-
exports.isDuplicate = isDuplicate;
|
|
20
13
|
/**
|
|
21
14
|
* Simple object check.
|
|
22
15
|
* @param item
|
|
23
16
|
* @returns {boolean}
|
|
24
17
|
*/
|
|
25
|
-
const isObject = (item) => item !== undefined && typeof item === "object" && !Array.isArray(item);
|
|
26
|
-
exports.isObject = isObject;
|
|
18
|
+
export const isObject = (item) => item !== undefined && typeof item === "object" && !Array.isArray(item);
|
|
27
19
|
/**
|
|
28
20
|
* Deep merge objects into target. Without modifying target.
|
|
29
21
|
* @param target
|
|
30
22
|
* @param source
|
|
31
23
|
*/
|
|
32
|
-
|
|
33
|
-
const deepMerge = (target, source) => {
|
|
24
|
+
export const deepMerge = (target, source) => {
|
|
34
25
|
const output = Object.assign({}, target);
|
|
35
|
-
if (
|
|
26
|
+
if (isObject(target) && isObject(source)) {
|
|
36
27
|
Object.keys(source).forEach((key) => {
|
|
37
|
-
if (
|
|
28
|
+
if (isObject(source[key])) {
|
|
38
29
|
if (!(key in target))
|
|
39
30
|
Object.assign(output, { [key]: source[key] });
|
|
40
31
|
else
|
|
41
|
-
output[key] =
|
|
32
|
+
output[key] = deepMerge(target[key], source[key]);
|
|
42
33
|
}
|
|
43
34
|
else
|
|
44
35
|
Object.assign(output, { [key]: source[key] });
|
|
@@ -46,40 +37,39 @@ const deepMerge = (target, source) => {
|
|
|
46
37
|
}
|
|
47
38
|
return output;
|
|
48
39
|
};
|
|
49
|
-
exports.deepMerge = deepMerge;
|
|
50
40
|
/**
|
|
51
41
|
* Take in a target `object` and a `types` object with identical keys but values as array of types those keys should be.
|
|
52
|
-
* @param
|
|
53
|
-
* @param
|
|
54
|
-
* @returns
|
|
42
|
+
* @param target Object
|
|
43
|
+
* @param types Object identical to `target` but values are types
|
|
44
|
+
* @returns `object` if the types dont match. `True` if they do.
|
|
55
45
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return { location, expectedType: "object", received: `${target}:${(0, exports.type)(target)}` };
|
|
46
|
+
export const deepTypeCompare = (target, types, location = "target") => {
|
|
47
|
+
if (!(isObject(target) && isObject(types)))
|
|
48
|
+
return { location, expectedType: "object", received: `${target}:${type(target)}` };
|
|
60
49
|
for (const key in target) {
|
|
61
|
-
|
|
50
|
+
const targetValue = target[key];
|
|
51
|
+
if (isObject(targetValue)) {
|
|
62
52
|
// If target.property is a object then check its child properties
|
|
63
|
-
const same =
|
|
53
|
+
const same = deepTypeCompare(targetValue, types[key], `${location}.${key}`);
|
|
64
54
|
if (same !== true)
|
|
65
55
|
return same;
|
|
66
56
|
}
|
|
67
57
|
else {
|
|
68
|
-
if (Array.isArray(
|
|
58
|
+
if (Array.isArray(targetValue) && Array.isArray(types[key])) {
|
|
69
59
|
// target.property and types.property are arrays
|
|
70
60
|
// Check each item in target.property against types.property[0]
|
|
71
61
|
const childCheckType = types[key];
|
|
72
|
-
for (const targetItem of
|
|
73
|
-
const targetType =
|
|
62
|
+
for (const targetItem of targetValue) {
|
|
63
|
+
const targetType = type(targetItem);
|
|
74
64
|
// If the array entry is a object then check it
|
|
75
65
|
if (targetType === "object")
|
|
76
|
-
return
|
|
66
|
+
return deepTypeCompare(targetItem, childCheckType, `${location}.${key}`);
|
|
77
67
|
else
|
|
78
|
-
return
|
|
68
|
+
return compareTwo(childCheckType, targetItem, `${location}.${key}`);
|
|
79
69
|
}
|
|
80
70
|
}
|
|
81
71
|
else {
|
|
82
|
-
const same =
|
|
72
|
+
const same = compareTwo(types[key], target[key], `${location}.${key}`);
|
|
83
73
|
if (same !== true)
|
|
84
74
|
return same;
|
|
85
75
|
}
|
|
@@ -87,30 +77,28 @@ const deepTypeCompare = (target, types, location = "target") => {
|
|
|
87
77
|
}
|
|
88
78
|
return true;
|
|
89
79
|
};
|
|
90
|
-
exports.deepTypeCompare = deepTypeCompare;
|
|
91
80
|
/**
|
|
92
81
|
* Helper function for `deepTypeCompare` to compare a item to a type or set of types.
|
|
93
|
-
* @param
|
|
94
|
-
* @param
|
|
95
|
-
* @param
|
|
82
|
+
* @param expectedTypes Expected type/types
|
|
83
|
+
* @param receivedValue Object given
|
|
84
|
+
* @param location Location of `got` given
|
|
96
85
|
*/
|
|
97
|
-
const compareTwo = (expectedTypes, receivedValue, location) => {
|
|
86
|
+
export const compareTwo = (expectedTypes, receivedValue, location) => {
|
|
98
87
|
if (!Array.isArray(expectedTypes))
|
|
99
88
|
expectedTypes = [expectedTypes];
|
|
100
|
-
const gotType =
|
|
89
|
+
const gotType = type(receivedValue);
|
|
101
90
|
for (const expectedType of expectedTypes) {
|
|
102
91
|
if (gotType !== expectedType)
|
|
103
92
|
return { location, expectedType, received: `${receivedValue}:${gotType}` };
|
|
104
93
|
}
|
|
105
94
|
return true;
|
|
106
95
|
};
|
|
107
|
-
exports.compareTwo = compareTwo;
|
|
108
96
|
/**
|
|
109
97
|
* Returns the type of `item` respecting `Array`, `null` and `undefined` unlike typeof.
|
|
110
|
-
* @param
|
|
111
|
-
* @returns
|
|
98
|
+
* @param item
|
|
99
|
+
* @returns Type of item
|
|
112
100
|
*/
|
|
113
|
-
const type = (item) => {
|
|
101
|
+
export const type = (item) => {
|
|
114
102
|
if (Array.isArray(item))
|
|
115
103
|
return "array";
|
|
116
104
|
if (item === null)
|
|
@@ -119,15 +107,14 @@ const type = (item) => {
|
|
|
119
107
|
return "undefined";
|
|
120
108
|
return typeof item;
|
|
121
109
|
};
|
|
122
|
-
exports.type = type;
|
|
123
110
|
/**
|
|
124
111
|
* Breaks `array` into smaller chunks based on `chunkSize`
|
|
125
|
-
* @param
|
|
126
|
-
* @param
|
|
112
|
+
* @param array Array to break up.
|
|
113
|
+
* @param chunkSize Maximum size of array chunks.
|
|
127
114
|
*
|
|
128
|
-
* @returns
|
|
115
|
+
* @returns Array containing array chunks.
|
|
129
116
|
*/
|
|
130
|
-
const chunkArray = (array, chunkSize) => {
|
|
117
|
+
export const chunkArray = (array, chunkSize) => {
|
|
131
118
|
if (array.length < chunkSize)
|
|
132
119
|
return [array];
|
|
133
120
|
let i, j;
|
|
@@ -136,10 +123,9 @@ const chunkArray = (array, chunkSize) => {
|
|
|
136
123
|
returnArray.push(array.slice(i, i + chunkSize));
|
|
137
124
|
return returnArray;
|
|
138
125
|
};
|
|
139
|
-
exports.chunkArray = chunkArray;
|
|
140
126
|
/**
|
|
141
127
|
* stringifies and then parses a object to convert it to a JSON supported object.
|
|
142
|
-
* @param
|
|
128
|
+
* @param obj Object to convert.
|
|
143
129
|
* @example
|
|
144
130
|
* const obj = {
|
|
145
131
|
* a: 1,
|
|
@@ -149,70 +135,62 @@ exports.chunkArray = chunkArray;
|
|
|
149
135
|
* const b = JSON.parse(JSON.stringify(obj))
|
|
150
136
|
* console.log(a == b) -> true
|
|
151
137
|
*/
|
|
152
|
-
const objectify = (obj) => JSON.parse(JSON.stringify(obj));
|
|
153
|
-
exports.objectify = objectify;
|
|
138
|
+
export const objectify = (obj) => JSON.parse(JSON.stringify(obj));
|
|
154
139
|
/**
|
|
155
140
|
* Logs a inspected object to console
|
|
156
|
-
* @param
|
|
157
|
-
* @param
|
|
158
|
-
* @param
|
|
159
|
-
* @param
|
|
160
|
-
* @returns {void}
|
|
141
|
+
* @param obj Object to inspect
|
|
142
|
+
* @param options.showHidden Show hidden properties of object
|
|
143
|
+
* @param options.depth Depth to inspect object
|
|
144
|
+
* @param options.color Color resulting output
|
|
161
145
|
*/
|
|
162
|
-
const lObj = (obj, ...options) => console.log(
|
|
163
|
-
exports.lObj = lObj;
|
|
146
|
+
export const lObj = (obj, ...options) => console.log(iObj(obj, ...options));
|
|
164
147
|
/**
|
|
165
148
|
* Inspects a object
|
|
166
|
-
* @param
|
|
167
|
-
* @param
|
|
168
|
-
* @param
|
|
169
|
-
* @param
|
|
170
|
-
* @returns {string}
|
|
149
|
+
* @param obj Object to inspect
|
|
150
|
+
* @param options.showHidden Show hidden properties of object
|
|
151
|
+
* @param options.depth Depth to inspect object
|
|
152
|
+
* @param options.color Color resulting output
|
|
171
153
|
*/
|
|
172
|
-
const iObj = (obj, ...options) => {
|
|
154
|
+
export const iObj = (obj, ...options) => {
|
|
173
155
|
if (options[0] === undefined || options[0] === null)
|
|
174
156
|
options[0] = false;
|
|
175
157
|
if (options[1] === undefined || options[1] === null)
|
|
176
158
|
options[1] = 5;
|
|
177
159
|
if (options[2] === undefined || options[2] === null)
|
|
178
160
|
options[2] = true;
|
|
179
|
-
return
|
|
161
|
+
return util.inspect(obj, ...options);
|
|
180
162
|
};
|
|
181
|
-
exports.iObj = iObj;
|
|
182
163
|
/**
|
|
183
164
|
* Single line inspect object.
|
|
184
|
-
* @param
|
|
185
|
-
* @param
|
|
186
|
-
* @param
|
|
187
|
-
* @param
|
|
188
|
-
* @returns {string} Inspected object in a single line, spaces aligned
|
|
165
|
+
* @param obj Object to inspect
|
|
166
|
+
* @param options.showHidden Show hidden properties of object
|
|
167
|
+
* @param options.depth Depth to inspect object
|
|
168
|
+
* @param options.color Color resulting output
|
|
189
169
|
*/
|
|
190
|
-
const sliObj = (obj, ...options) =>
|
|
170
|
+
export const sliObj = (obj, ...options) => iObj(obj, ...options)
|
|
191
171
|
.replace(/\r?\n/g, " ")
|
|
192
172
|
.replace(/ +/g, " ");
|
|
193
|
-
exports.sliObj = sliObj;
|
|
194
173
|
/**
|
|
195
174
|
* Recursively runs `func` and handles errors with `errorHandler` until `func` successfully finishes.
|
|
196
175
|
* @param func Function to execute
|
|
197
176
|
* @param errorHandler Function to execute when a error occours
|
|
198
177
|
* @returns Return value of `func` on success
|
|
199
178
|
*/
|
|
200
|
-
const loopError = (func, errorHandler = (err) => new Promise((_res, r) => r(err))) => new Promise((resolve) => {
|
|
179
|
+
export const loopError = (func, errorHandler = (err) => new Promise((_res, r) => r(err))) => new Promise((resolve) => {
|
|
201
180
|
func()
|
|
202
181
|
.then(resolve)
|
|
203
182
|
.catch(async (err) => {
|
|
204
|
-
errorHandler(err).then(() => resolve(
|
|
183
|
+
errorHandler(err).then(() => resolve(loopError(func, errorHandler)));
|
|
205
184
|
});
|
|
206
185
|
});
|
|
207
|
-
exports.loopError = loopError;
|
|
208
186
|
/**
|
|
209
|
-
* @param
|
|
210
|
-
* @returns
|
|
187
|
+
* @param array
|
|
188
|
+
* @returns string containing ranges of numbers.
|
|
211
189
|
* @example
|
|
212
190
|
* const range = toRange([1, 2, 3, 12, 6,7, 5, 27, 28, 29, 40, 41, 25, 42, 12])
|
|
213
191
|
* // range = "1-3 & 5-7 & 12 & 25 & 27-29 & 40-42"
|
|
214
192
|
*/
|
|
215
|
-
const toRange = (array) => {
|
|
193
|
+
export const toRange = (array) => {
|
|
216
194
|
array = array
|
|
217
195
|
.filter((a, pos) => array.indexOf(a) === pos)
|
|
218
196
|
.sort((a, b) => a - b)
|
|
@@ -230,7 +208,6 @@ const toRange = (array) => {
|
|
|
230
208
|
}
|
|
231
209
|
return sum;
|
|
232
210
|
};
|
|
233
|
-
exports.toRange = toRange;
|
|
234
211
|
/**
|
|
235
212
|
* Returns the `property` requested from `obj`
|
|
236
213
|
* @param obj
|
|
@@ -245,17 +222,16 @@ exports.toRange = toRange;
|
|
|
245
222
|
* const wantedProperty = "a.child"
|
|
246
223
|
* console.log(deepGet(object, wantedProperty)) // -> "Hello World"
|
|
247
224
|
*/
|
|
248
|
-
const deepGet = (obj, property, delimiter = ".") => {
|
|
225
|
+
export const deepGet = (obj, property, delimiter = ".") => {
|
|
249
226
|
const arr = property.split(delimiter);
|
|
250
227
|
while (arr.length && (obj = obj[arr.shift()]))
|
|
251
228
|
;
|
|
252
229
|
return obj;
|
|
253
230
|
};
|
|
254
|
-
exports.deepGet = deepGet;
|
|
255
231
|
/**
|
|
256
232
|
* Replaces values in a given `templatestring` with contentKeys from a given `contentKeys` object.
|
|
257
|
-
* @param
|
|
258
|
-
* @param
|
|
233
|
+
* @param contentKeys Object containing key value pairs of contentKeys to fill template string with
|
|
234
|
+
* @param templatestring string containing templates to fill
|
|
259
235
|
* @example
|
|
260
236
|
* const contentKeys = {
|
|
261
237
|
* "title": "This is a title",
|
|
@@ -267,26 +243,22 @@ exports.deepGet = deepGet;
|
|
|
267
243
|
*
|
|
268
244
|
* fillTemplate(contentKeys, template) // => Wow! This is a title... Here is some info: This is some info!"
|
|
269
245
|
*/
|
|
270
|
-
const fillTemplate = (contentKeys, templatestring, parent = "") => {
|
|
246
|
+
export const fillTemplate = (contentKeys, templatestring, parent = "") => {
|
|
271
247
|
for (const key in contentKeys) {
|
|
272
|
-
if (
|
|
273
|
-
templatestring =
|
|
248
|
+
if (isObject(contentKeys[key]))
|
|
249
|
+
templatestring = fillTemplate(contentKeys[key], templatestring, `${parent}${key}.`);
|
|
274
250
|
else
|
|
275
251
|
templatestring = templatestring.replace(new RegExp(`{${parent}${key}}`, "g"), contentKeys[key]);
|
|
276
252
|
}
|
|
277
253
|
return templatestring;
|
|
278
254
|
};
|
|
279
|
-
exports.fillTemplate = fillTemplate;
|
|
280
255
|
/**
|
|
281
256
|
* Converts process.env variables into a object
|
|
282
257
|
* @example process.env["some_subproperty"] = "hello"
|
|
283
258
|
* returns { some: { subProperty: "hello" } }
|
|
284
259
|
*/
|
|
285
|
-
|
|
286
|
-
const getEnv = () => {
|
|
287
|
-
var _a;
|
|
260
|
+
export const getEnv = () => {
|
|
288
261
|
// Define our return object env variables are applied to.
|
|
289
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
290
262
|
const envObject = {};
|
|
291
263
|
// Iterate over env keys
|
|
292
264
|
for (const envKey in process.env) {
|
|
@@ -300,7 +272,7 @@ const getEnv = () => {
|
|
|
300
272
|
// For every key except the last...
|
|
301
273
|
for (let i = 0; i < keys.length - 1; i++) {
|
|
302
274
|
// Set the key on the objRef to a empty object if its undefined.
|
|
303
|
-
if (!
|
|
275
|
+
if (!isObject(objRef)) {
|
|
304
276
|
// If objRef is not a object. Use the parent object to set it to a object containing itself as _.
|
|
305
277
|
if (pObjRef !== undefined)
|
|
306
278
|
objRef = pObjRef[0][pObjRef[1]] = { _: objRef };
|
|
@@ -308,18 +280,19 @@ const getEnv = () => {
|
|
|
308
280
|
}
|
|
309
281
|
else {
|
|
310
282
|
pObjRef = [objRef, keys[i]];
|
|
311
|
-
objRef = objRef[
|
|
283
|
+
objRef = (objRef[keys[i]] ??= {});
|
|
312
284
|
}
|
|
313
285
|
}
|
|
314
286
|
// Set the last key to equal the original value
|
|
315
287
|
// If objRef is not a object. Use the parent object to set it to a object containing itself as _.
|
|
316
|
-
if (!
|
|
288
|
+
if (!isObject(objRef) && pObjRef !== undefined)
|
|
317
289
|
objRef = pObjRef[0][pObjRef[1]] = { _: objRef };
|
|
318
|
-
|
|
290
|
+
const envValue = process.env[envKey];
|
|
291
|
+
if (envValue !== undefined)
|
|
292
|
+
objRef[keys[keys.length - 1]] = envValue;
|
|
319
293
|
}
|
|
320
294
|
return envObject;
|
|
321
295
|
};
|
|
322
|
-
exports.getEnv = getEnv;
|
|
323
296
|
/**
|
|
324
297
|
* Recursively update properties of a object with another.
|
|
325
298
|
* @param targetObject Object to update.
|
|
@@ -327,27 +300,24 @@ exports.getEnv = getEnv;
|
|
|
327
300
|
* @param options.setUndefined Defaults to `true` Set properties that are undefined on `targetObject`.
|
|
328
301
|
* @param options.setDefined Defaults to `false`. Overwrite properties that are not undefined on `targetObject`.
|
|
329
302
|
*/
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
if (!(0, exports.isObject)(targetObject))
|
|
303
|
+
export const recursiveUpdate = (targetObject, newObject, options = { setUndefined: true, setDefined: false }) => {
|
|
304
|
+
if (!isObject(targetObject))
|
|
333
305
|
throw new Error("targetObject is not an object!");
|
|
334
|
-
if (!
|
|
306
|
+
if (!isObject(newObject))
|
|
335
307
|
throw new Error("newObject is not an object!");
|
|
336
308
|
for (const key in newObject) {
|
|
337
|
-
if (
|
|
338
|
-
|
|
309
|
+
if (isObject(targetObject[key]) && isObject(newObject[key]))
|
|
310
|
+
recursiveUpdate(targetObject[key], newObject[key], options);
|
|
339
311
|
else if (options.setUndefined && targetObject[key] === undefined)
|
|
340
312
|
targetObject[key] = newObject[key];
|
|
341
313
|
else if (options.setDefined && targetObject[key] !== undefined)
|
|
342
314
|
targetObject[key] = newObject[key];
|
|
343
315
|
}
|
|
344
316
|
};
|
|
345
|
-
exports.recursiveUpdate = recursiveUpdate;
|
|
346
317
|
/**
|
|
347
318
|
* Set the types of a given `object` based on the types of an identical `types` object. Usful in conjunction with `getEnv` to convert a object only containing strings/objects to actual types.
|
|
348
319
|
*/
|
|
349
|
-
|
|
350
|
-
const rebuildTypes = (object, types) => {
|
|
320
|
+
export const rebuildTypes = (object, types) => {
|
|
351
321
|
for (const key in object) {
|
|
352
322
|
if (types[key] === undefined)
|
|
353
323
|
continue;
|
|
@@ -356,26 +326,24 @@ const rebuildTypes = (object, types) => {
|
|
|
356
326
|
object[key] = +object[key];
|
|
357
327
|
break;
|
|
358
328
|
case "string":
|
|
359
|
-
object[key] = object[key]
|
|
329
|
+
object[key] = String(object[key]);
|
|
360
330
|
break;
|
|
361
331
|
case "boolean":
|
|
362
332
|
object[key] = object[key] === true || object[key] === "true";
|
|
363
333
|
break;
|
|
364
334
|
default:
|
|
365
|
-
|
|
335
|
+
rebuildTypes(object[key], types[key]);
|
|
366
336
|
break;
|
|
367
337
|
}
|
|
368
338
|
}
|
|
369
339
|
};
|
|
370
|
-
exports.rebuildTypes = rebuildTypes;
|
|
371
340
|
/**
|
|
372
341
|
* Fetch process.env[envName] or throw if its undefined
|
|
373
342
|
*/
|
|
374
|
-
const envOrThrow = (envName) => {
|
|
343
|
+
export const envOrThrow = (envName) => {
|
|
375
344
|
const envValue = process.env[envName];
|
|
376
345
|
if (envValue === undefined)
|
|
377
346
|
throw new Error(`Enviroment variable "${envName}" is undefined!`);
|
|
378
347
|
return envValue;
|
|
379
348
|
};
|
|
380
|
-
|
|
381
|
-
//# sourceMappingURL=index.js.map
|
|
349
|
+
//# sourceMappingURL=object.js.map
|
package/object.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.js","sourceRoot":"","sources":["../src/object.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB;;GAEG;AACH,MAAM,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;AACvB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,GAAY,EAAW,EAAE;IACpD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;;QACnC,OAAO,IAAI,CAAC;IACjB,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAa,EAAyB,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CA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