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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rajt",
3
3
  "description": "A serverless bundler layer, fully typed for AWS Lambda (Node.js and LLRT) and Cloudflare Workers.",
4
- "version": "0.0.33",
4
+ "version": "0.0.35",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "exports": {
@@ -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 {