@things-factory/shell 8.0.0-beta.5 → 8.0.0-beta.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.
@@ -10,7 +10,7 @@ exports.json5Transformer = {
|
|
10
10
|
* @returns {string} - The stringified JSON5 representation of the entityValue.
|
11
11
|
*/
|
12
12
|
to(entityValue) {
|
13
|
-
return json5_1.default.stringify(entityValue);
|
13
|
+
return entityValue === null || entityValue === undefined ? null : json5_1.default.stringify(entityValue);
|
14
14
|
},
|
15
15
|
/**
|
16
16
|
* Converts a JSON5 string from the database back into its original type when retrieving it.
|
@@ -19,7 +19,7 @@ exports.json5Transformer = {
|
|
19
19
|
*/
|
20
20
|
from(databaseValue) {
|
21
21
|
try {
|
22
|
-
return json5_1.default.parse(databaseValue);
|
22
|
+
return databaseValue === null ? null : json5_1.default.parse(databaseValue);
|
23
23
|
}
|
24
24
|
finally {
|
25
25
|
return databaseValue;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"json5-transform.js","sourceRoot":"","sources":["../../server/typeorm/json5-transform.ts"],"names":[],"mappings":";;;;AACA,0DAAyB;AAEZ,QAAA,gBAAgB,GAAqB;IAChD;;;;OAIG;IACH,EAAE,CAAC,WAAgB;QACjB,OAAO,eAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;
|
1
|
+
{"version":3,"file":"json5-transform.js","sourceRoot":"","sources":["../../server/typeorm/json5-transform.ts"],"names":[],"mappings":";;;;AACA,0DAAyB;AAEZ,QAAA,gBAAgB,GAAqB;IAChD;;;;OAIG;IACH,EAAE,CAAC,WAAgB;QACjB,OAAO,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;IAChG,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAC,aAAqB;QACxB,IAAI,CAAC;YACH,OAAO,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAK,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QACnE,CAAC;gBAAS,CAAC;YACT,OAAO,aAAa,CAAA;QACtB,CAAC;IACH,CAAC;CACF,CAAA","sourcesContent":["import { ValueTransformer } from 'typeorm'\nimport json5 from 'json5'\n\nexport const json5Transformer: ValueTransformer = {\n /**\n * Converts the entity's value to a JSON5 string before storing it in the database.\n * @param {any} entityValue - The unencrypted entity field value.\n * @returns {string} - The stringified JSON5 representation of the entityValue.\n */\n to(entityValue: any) {\n return entityValue === null || entityValue === undefined ? null : json5.stringify(entityValue)\n },\n\n /**\n * Converts a JSON5 string from the database back into its original type when retrieving it.\n * @param {string} databaseValue - The JSON5 string stored in the database.\n * @returns {any} - The original type of the entityValue, parsed from the JSON5 string.\n */\n from(databaseValue: string) {\n try {\n return databaseValue === null ? null : json5.parse(databaseValue)\n } finally {\n return databaseValue\n }\n }\n}\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/shell",
|
3
|
-
"version": "8.0.0-beta.
|
3
|
+
"version": "8.0.0-beta.9",
|
4
4
|
"description": "Core module for framework",
|
5
5
|
"bin": {
|
6
6
|
"things-factory": "bin/things-factory",
|
@@ -133,5 +133,5 @@
|
|
133
133
|
"pg": "^8.7.3",
|
134
134
|
"sqlite3": "^5.0.8"
|
135
135
|
},
|
136
|
-
"gitHead": "
|
136
|
+
"gitHead": "86b1dfa26292926a2d5447fdc23bfa5a9e983245"
|
137
137
|
}
|