rajt 0.0.33 → 0.0.35
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/dynamodb/compact.ts +4 -2
package/package.json
CHANGED
package/src/dynamodb/compact.ts
CHANGED
|
@@ -65,6 +65,8 @@ export default class Compact {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
static zip(obj: any, schema: SchemaStructure, seen: any[]): any[] {
|
|
68
|
+
if (!obj || [null, true, false].includes(obj)) return obj
|
|
69
|
+
|
|
68
70
|
return schema.map(key => {
|
|
69
71
|
if (typeof key === 'string')
|
|
70
72
|
return this.memo(obj[key], seen)
|
|
@@ -119,7 +121,7 @@ export default class Compact {
|
|
|
119
121
|
if (!key) return undefined
|
|
120
122
|
|
|
121
123
|
if (typeof key == 'string')
|
|
122
|
-
return [key, value]
|
|
124
|
+
return [key, value || null]
|
|
123
125
|
|
|
124
126
|
const mainKey = Object.keys(key)[0]
|
|
125
127
|
const subKeys = key[mainKey]
|
|
@@ -133,7 +135,7 @@ export default class Compact {
|
|
|
133
135
|
: [mainKey, this.withSchema(value, subKeys)]
|
|
134
136
|
}
|
|
135
137
|
|
|
136
|
-
return [mainKey, value]
|
|
138
|
+
return [mainKey, value || null]
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
static memo(val: any, seen: any[]): any {
|