@sprucelabs/data-stores 26.2.8 → 26.2.9
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.
|
@@ -46,7 +46,7 @@ export default class AbstractStore extends AbstractMutexer {
|
|
|
46
46
|
return this.collectionName;
|
|
47
47
|
}
|
|
48
48
|
prepareAndNormalizeRecord(record, options = {}) {
|
|
49
|
-
var _a, _b;
|
|
49
|
+
var _a, _b, _c;
|
|
50
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
51
|
let preparedRecord = this.prepareRecord
|
|
52
52
|
? yield this.prepareRecord(record, options)
|
|
@@ -62,7 +62,7 @@ export default class AbstractStore extends AbstractMutexer {
|
|
|
62
62
|
if (this.shouldMapLowerCaseToCamelCase) {
|
|
63
63
|
this.mapCasing(preparedRecord);
|
|
64
64
|
}
|
|
65
|
-
return normalizeSchemaValues(this.fullSchema, preparedRecord, Object.assign(Object.assign({}, options), { fields: options.includeFields, shouldIncludePrivateFields: options.shouldIncludePrivateFields === true, shouldCreateEntityInstances: false, shouldIncludeNullAndUndefinedFields:
|
|
65
|
+
return normalizeSchemaValues(this.fullSchema, preparedRecord, Object.assign(Object.assign({}, options), { fields: options.includeFields, shouldIncludePrivateFields: options.shouldIncludePrivateFields === true, shouldCreateEntityInstances: false, shouldIncludeNullAndUndefinedFields: !((_c = options.shouldStripUndefinedAndNullValues) !== null && _c !== void 0 ? _c : true) }));
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
mapCasing(preparedRecord) {
|
|
@@ -241,7 +241,10 @@ export default class AbstractStore extends AbstractMutexer {
|
|
|
241
241
|
primaryFieldNames: this.primaryFieldNames,
|
|
242
242
|
});
|
|
243
243
|
if (results) {
|
|
244
|
-
const all = results.map((result) =>
|
|
244
|
+
const all = results.map((result) => {
|
|
245
|
+
var _a;
|
|
246
|
+
return this.prepareAndNormalizeRecord(result, Object.assign(Object.assign({}, options), { shouldStripUndefinedAndNullValues: (_a = options === null || options === void 0 ? void 0 : options.shouldStripUndefinedAndNullValues) !== null && _a !== void 0 ? _a : true }));
|
|
247
|
+
});
|
|
245
248
|
const records = yield Promise.all(all);
|
|
246
249
|
return records;
|
|
247
250
|
}
|
|
@@ -65,7 +65,7 @@ class AbstractStore extends AbstractMutexer_1.default {
|
|
|
65
65
|
return this.collectionName;
|
|
66
66
|
}
|
|
67
67
|
async prepareAndNormalizeRecord(record, options = {}) {
|
|
68
|
-
var _a, _b;
|
|
68
|
+
var _a, _b, _c;
|
|
69
69
|
let preparedRecord = this.prepareRecord
|
|
70
70
|
? await this.prepareRecord(record, options)
|
|
71
71
|
: record;
|
|
@@ -80,7 +80,7 @@ class AbstractStore extends AbstractMutexer_1.default {
|
|
|
80
80
|
if (this.shouldMapLowerCaseToCamelCase) {
|
|
81
81
|
this.mapCasing(preparedRecord);
|
|
82
82
|
}
|
|
83
|
-
return (0, schema_1.normalizeSchemaValues)(this.fullSchema, preparedRecord, Object.assign(Object.assign({}, options), { fields: options.includeFields, shouldIncludePrivateFields: options.shouldIncludePrivateFields === true, shouldCreateEntityInstances: false, shouldIncludeNullAndUndefinedFields:
|
|
83
|
+
return (0, schema_1.normalizeSchemaValues)(this.fullSchema, preparedRecord, Object.assign(Object.assign({}, options), { fields: options.includeFields, shouldIncludePrivateFields: options.shouldIncludePrivateFields === true, shouldCreateEntityInstances: false, shouldIncludeNullAndUndefinedFields: !((_c = options.shouldStripUndefinedAndNullValues) !== null && _c !== void 0 ? _c : true) }));
|
|
84
84
|
}
|
|
85
85
|
mapCasing(preparedRecord) {
|
|
86
86
|
var _a;
|
|
@@ -239,7 +239,10 @@ class AbstractStore extends AbstractMutexer_1.default {
|
|
|
239
239
|
primaryFieldNames: this.primaryFieldNames,
|
|
240
240
|
});
|
|
241
241
|
if (results) {
|
|
242
|
-
const all = results.map((result) =>
|
|
242
|
+
const all = results.map((result) => {
|
|
243
|
+
var _a;
|
|
244
|
+
return this.prepareAndNormalizeRecord(result, Object.assign(Object.assign({}, options), { shouldStripUndefinedAndNullValues: (_a = options === null || options === void 0 ? void 0 : options.shouldStripUndefinedAndNullValues) !== null && _a !== void 0 ? _a : true }));
|
|
245
|
+
});
|
|
243
246
|
const records = await Promise.all(all);
|
|
244
247
|
return records;
|
|
245
248
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "26.2.
|
|
6
|
+
"version": "26.2.9",
|
|
7
7
|
"files": [
|
|
8
8
|
"build/**/*",
|
|
9
9
|
"!build/__tests__",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"upgrade.packages.test": "yarn upgrade.packages.all && yarn lint && yarn build.dev && yarn test"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@sprucelabs/error": "^5.1.
|
|
71
|
+
"@sprucelabs/error": "^5.1.53",
|
|
72
72
|
"@sprucelabs/globby": "^1.0.3",
|
|
73
73
|
"@sprucelabs/schema": "^29.3.0",
|
|
74
74
|
"@sprucelabs/spruce-skill-utils": "^30.1.44",
|
|
@@ -78,10 +78,10 @@
|
|
|
78
78
|
"nedb": "^1.8.0"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@sprucelabs/esm-postbuild": "^5.0.
|
|
82
|
-
"@sprucelabs/jest-json-reporter": "^7.0.
|
|
81
|
+
"@sprucelabs/esm-postbuild": "^5.0.109",
|
|
82
|
+
"@sprucelabs/jest-json-reporter": "^7.0.134",
|
|
83
83
|
"@sprucelabs/jest-sheets-reporter": "^3.0.26",
|
|
84
|
-
"@sprucelabs/resolve-path-aliases": "^1.1.
|
|
84
|
+
"@sprucelabs/resolve-path-aliases": "^1.1.271",
|
|
85
85
|
"@sprucelabs/semantic-release": "^4.0.8",
|
|
86
86
|
"@sprucelabs/test": "^8.0.35",
|
|
87
87
|
"@sprucelabs/test-utils": "^4.0.86",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"eslint-config-spruce": "^10.13.6",
|
|
96
96
|
"jest": "^29.7.0",
|
|
97
97
|
"jest-circus": "^29.7.0",
|
|
98
|
-
"prettier": "^3.1.
|
|
98
|
+
"prettier": "^3.1.1",
|
|
99
99
|
"ts-node": "^10.9.2",
|
|
100
100
|
"tsc-watch": "^6.0.4",
|
|
101
101
|
"tsconfig-paths": "^4.2.0",
|