exact-mirror 0.1.5 → 0.1.6

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/dist/cjs/index.js CHANGED
@@ -306,7 +306,7 @@ var mirror = (schema, property, instruction) => {
306
306
  v += `if(${key}===undefined`;
307
307
  if (instruction.unionKeys[key]) v += `||x${prop}===undefined`;
308
308
  const shouldQuestion = prop.charCodeAt(0) !== 63 && schema.type !== "array";
309
- v += `)delete x${shouldQuestion ? "?" : ""}${prop}
309
+ v += `)delete x${shouldQuestion ? prop.charCodeAt(0) === 91 ? "?." : "?" : ""}${prop}
310
310
  `;
311
311
  }
312
312
  return `${v}return x`;
package/dist/index.mjs CHANGED
@@ -279,7 +279,7 @@ var mirror = (schema, property, instruction) => {
279
279
  v += `if(${key}===undefined`;
280
280
  if (instruction.unionKeys[key]) v += `||x${prop}===undefined`;
281
281
  const shouldQuestion = prop.charCodeAt(0) !== 63 && schema.type !== "array";
282
- v += `)delete x${shouldQuestion ? "?" : ""}${prop}
282
+ v += `)delete x${shouldQuestion ? prop.charCodeAt(0) === 91 ? "?." : "?" : ""}${prop}
283
283
  `;
284
284
  }
285
285
  return `${v}return x`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "exact-mirror",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Mirror exact value to TypeBox/OpenAPI model",
5
5
  "license": "MIT",
6
6
  "scripts": {