sql-typechecker 0.0.53 → 0.0.54

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/out/cli.js CHANGED
@@ -241354,7 +241354,14 @@ var builtinoperatorsFromSchema = [
241354
241354
  var builtinoperators = builtinoperatorsFromSyntax.concat(builtinoperatorsFromSchema);
241355
241355
 
241356
241356
  // src/builtinunaryoperators.ts
241357
- var builtinunaryoperatorsFromSyntax = [];
241357
+ var builtinunaryoperatorsFromSyntax = [
241358
+ {
241359
+ name: {name: "NOT"},
241360
+ operand: {kind: "scalar", name: {name: "boolean"}},
241361
+ result: {kind: "scalar", name: {name: "boolean"}},
241362
+ description: ""
241363
+ }
241364
+ ];
241358
241365
  var builtinunaryoperatorsFromSchema = [
241359
241366
  {
241360
241367
  name: {name: "!"},
@@ -243251,7 +243258,7 @@ function elabExpr(g, c, e) {
243251
243258
  function inferNullability(c, e) {
243252
243259
  if (e.type === "unary") {
243253
243260
  if (e.op === "NOT") {
243254
- return inferNullability(c, e).map((judg) => ({
243261
+ return inferNullability(c, e.operand).map((judg) => ({
243255
243262
  ...judg,
243256
243263
  isNull: !judg.isNull
243257
243264
  }));
@@ -243413,7 +243420,7 @@ function showTypeAsTypescriptType(t) {
243413
243420
  }
243414
243421
  function genDeserializeSimpleT(t, literalVar) {
243415
243422
  if (t.kind === "array") {
243416
- return `parseArray(${literalVar}, (el: any) => ${genDeserializeSimpleT(t.typevar, "el")})`;
243423
+ return `${literalVar} === null ? [] : (Array.isArray(${literalVar}) ? ${literalVar} : parseArray(${literalVar})).map((el: any) => ${genDeserializeSimpleT(t.typevar, "el")})`;
243417
243424
  } else if (t.kind === "nullable") {
243418
243425
  const inner = genDeserializeSimpleT(t.typevar, literalVar);
243419
243426
  if (inner === literalVar) {