socket-function 0.95.0 → 0.97.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socket-function",
3
- "version": "0.95.0",
3
+ "version": "0.97.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -84,6 +84,8 @@ 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
+ // Empty string should parse to SOMETHING
88
+ if (text.trim() === "") return undefined as T;
87
89
  let obj: unknown;
88
90
 
89
91
  let extendedParsing = config?.extended ?? JSONLACKS.EXTENDED_PARSER;
@@ -480,4 +482,4 @@ b"
480
482
  `);
481
483
  verify(`undefined`);
482
484
  }
483
- generateAndVerifyParser().catch(console.error).finally(() => process.exit());
485
+ //generateAndVerifyParser().catch(console.error).finally(() => process.exit());