@onivoro/isomorphic-common 0.0.9 → 0.0.11
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/package.json +1 -1
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/lib/functions/properties-to-array.function.d.ts +1 -0
- package/src/lib/functions/properties-to-array.function.js +20 -0
- package/src/lib/functions/properties-to-array.function.js.map +1 -0
- package/src/lib/interfaces/axios-wrapped-nest-exception.interface.d.ts +5 -0
- package/src/lib/interfaces/axios-wrapped-nest-exception.interface.js +3 -0
- package/src/lib/interfaces/axios-wrapped-nest-exception.interface.js.map +1 -0
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './lib/functions/from-boolean-string.function';
|
|
|
8
8
|
export * from './lib/functions/from-calendar-date.function';
|
|
9
9
|
export * from './lib/functions/from-csv-string.function';
|
|
10
10
|
export * from './lib/functions/parse-bool.function';
|
|
11
|
+
export * from './lib/functions/properties-to-array.function';
|
|
11
12
|
export * from './lib/functions/sanitize-filename.function';
|
|
12
13
|
export * from './lib/functions/snake-case.function';
|
|
13
14
|
export * from './lib/functions/subtract-offset.function';
|
|
@@ -21,5 +22,6 @@ export * from './lib/functions/try-parse-date.function';
|
|
|
21
22
|
export * from './lib/functions/unicode-words.const';
|
|
22
23
|
export * from './lib/functions/upper-first.function';
|
|
23
24
|
export * from './lib/functions/words.function';
|
|
25
|
+
export * from './lib/interfaces/axios-wrapped-nest-exception.interface';
|
|
24
26
|
export * from './lib/interfaces/entity-provider.interface';
|
|
25
27
|
export * from './lib/interfaces/keys-of.type';
|
package/src/index.js
CHANGED
|
@@ -11,6 +11,7 @@ tslib_1.__exportStar(require("./lib/functions/from-boolean-string.function"), ex
|
|
|
11
11
|
tslib_1.__exportStar(require("./lib/functions/from-calendar-date.function"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./lib/functions/from-csv-string.function"), exports);
|
|
13
13
|
tslib_1.__exportStar(require("./lib/functions/parse-bool.function"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./lib/functions/properties-to-array.function"), exports);
|
|
14
15
|
tslib_1.__exportStar(require("./lib/functions/sanitize-filename.function"), exports);
|
|
15
16
|
tslib_1.__exportStar(require("./lib/functions/snake-case.function"), exports);
|
|
16
17
|
tslib_1.__exportStar(require("./lib/functions/subtract-offset.function"), exports);
|
|
@@ -24,6 +25,7 @@ tslib_1.__exportStar(require("./lib/functions/try-parse-date.function"), exports
|
|
|
24
25
|
tslib_1.__exportStar(require("./lib/functions/unicode-words.const"), exports);
|
|
25
26
|
tslib_1.__exportStar(require("./lib/functions/upper-first.function"), exports);
|
|
26
27
|
tslib_1.__exportStar(require("./lib/functions/words.function"), exports);
|
|
28
|
+
tslib_1.__exportStar(require("./lib/interfaces/axios-wrapped-nest-exception.interface"), exports);
|
|
27
29
|
tslib_1.__exportStar(require("./lib/interfaces/entity-provider.interface"), exports);
|
|
28
30
|
tslib_1.__exportStar(require("./lib/interfaces/keys-of.type"), exports);
|
|
29
31
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,qFAA2D;AAC3D,8EAAoD;AACpD,mFAAyD;AACzD,qFAA2D;AAC3D,oFAA0D;AAC1D,iFAAuD;AACvD,yFAA+D;AAC/D,yFAA+D;AAC/D,mFAAyD;AACzD,kFAAwD;AACxD,8EAAoD;AACpD,+EAAqD;AACrD,yEAA+C;AAE/C,qFAA2D;AAC3D,wEAA8C"}
|
|
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,uFAA6D;AAC7D,qFAA2D;AAC3D,8EAAoD;AACpD,mFAAyD;AACzD,qFAA2D;AAC3D,oFAA0D;AAC1D,iFAAuD;AACvD,yFAA+D;AAC/D,yFAA+D;AAC/D,mFAAyD;AACzD,kFAAwD;AACxD,8EAAoD;AACpD,+EAAqD;AACrD,yEAA+C;AAE/C,kGAAwE;AACxE,qFAA2D;AAC3D,wEAA8C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function propertiesToArray(obj: any): any;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// credit https://stackoverflow.com/questions/15690706/recursively-looping-through-an-object-to-build-a-property-list/53620876#53620876
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.propertiesToArray = void 0;
|
|
5
|
+
function propertiesToArray(obj) {
|
|
6
|
+
const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
|
|
7
|
+
const addDelimiter = (a, b) => a ? `${a}.${b}` : b;
|
|
8
|
+
const paths = (obj = {}, head = '') => {
|
|
9
|
+
return Object.entries(obj)
|
|
10
|
+
.reduce((product, [key, value]) => {
|
|
11
|
+
let fullPath = addDelimiter(head, key);
|
|
12
|
+
return isObject(value) ?
|
|
13
|
+
product.concat(paths(value, fullPath))
|
|
14
|
+
: product.concat(fullPath);
|
|
15
|
+
}, []);
|
|
16
|
+
};
|
|
17
|
+
return paths(obj);
|
|
18
|
+
}
|
|
19
|
+
exports.propertiesToArray = propertiesToArray;
|
|
20
|
+
//# sourceMappingURL=properties-to-array.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"properties-to-array.function.js","sourceRoot":"","sources":["../../../../../../libs/isomorphic-common/src/lib/functions/properties-to-array.function.ts"],"names":[],"mappings":";AAAA,uIAAuI;;;AAEvI,SAAgB,iBAAiB,CAAC,GAAG;IACjC,MAAM,QAAQ,GAAG,GAAG,CAAC,EAAE,CACnB,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAE1D,MAAM,YAAY,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAC1B,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAExB,MAAM,KAAK,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,EAAE,EAAE;QAClC,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;aACrB,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;YAC9B,IAAI,QAAQ,GAAG,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;YACtC,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;gBACpB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;gBACtC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QAClC,CAAC,EAAE,EAAE,CAAC,CAAC;IACf,CAAC,CAAA;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;AACtB,CAAC;AAlBD,8CAkBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axios-wrapped-nest-exception.interface.js","sourceRoot":"","sources":["../../../../../../libs/isomorphic-common/src/lib/interfaces/axios-wrapped-nest-exception.interface.ts"],"names":[],"mappings":""}
|