socket-function 0.94.0 → 0.96.0

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.
@@ -1,3 +1,6 @@
1
+ // IMPORTANT! If you update this, also run `yarn typenode src\JSONLACKS\JSONLACKS.ts`
2
+ // (after uncommenting the generateAndVerifyParser line)
3
+
1
4
  // JSON Grammar
2
5
  // ============
3
6
  //
@@ -60,10 +63,12 @@ value
60
63
  / array
61
64
  / number
62
65
  / string
66
+ / undefined
63
67
 
64
68
  false = "false" { return false; }
65
69
  null = "null" { return null; }
66
70
  true = "true" { return true; }
71
+ undefined = "undefined" { return undefined; }
67
72
 
68
73
  // ----- 4. Objects -----
69
74
 
@@ -84,7 +84,6 @@ export class JSONLACKS {
84
84
  // then it is about 2X slower (although it depends on the size and complexity of the objects!)
85
85
  @measureFnc
86
86
  public static parse<T>(text: string, config?: JSONLACKS_ParseConfig, hydrateState?: HydrateState): T {
87
- if (text.trim() === "undefined") return undefined as T;
88
87
  let obj: unknown;
89
88
 
90
89
  let extendedParsing = config?.extended ?? JSONLACKS.EXTENDED_PARSER;
@@ -479,5 +478,6 @@ b"
479
478
  value: 'a'
480
479
  }
481
480
  `);
481
+ verify(`undefined`);
482
482
  }
483
483
  //generateAndVerifyParser().catch(console.error).finally(() => process.exit());