@brillout/json-serializer 0.5.1 → 0.5.3

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.
@@ -48,7 +48,7 @@ function stringify(value, { forbidReactElements, space, valueName = 'value', sor
48
48
  const name = valName ? ' `' + valName + '`' : '';
49
49
  const location = path.length === 0 ? '' : ` ${name ? 'at ' : ''}\`${valueName}[${path.map((p) => `'${p}'`).join('][')}]\``;
50
50
  const fallback = name === '' && location === '' ? ` ${valueName}` : '';
51
- return `Cannot serialize${name}${location}${fallback} because it is a ${valueType} (https://github.com/brillout/json-s)`;
51
+ return `Cannot serialize${name}${location}${fallback} because it is a ${valueType} (https://github.com/brillout/json-serializer)`;
52
52
  }
53
53
  }
54
54
  exports.stringify = stringify;
@@ -46,6 +46,6 @@ function stringify(value, { forbidReactElements, space, valueName = 'value', sor
46
46
  const name = valName ? ' `' + valName + '`' : '';
47
47
  const location = path.length === 0 ? '' : ` ${name ? 'at ' : ''}\`${valueName}[${path.map((p) => `'${p}'`).join('][')}]\``;
48
48
  const fallback = name === '' && location === '' ? ` ${valueName}` : '';
49
- return `Cannot serialize${name}${location}${fallback} because it is a ${valueType} (https://github.com/brillout/json-s)`;
49
+ return `Cannot serialize${name}${location}${fallback} because it is a ${valueType} (https://github.com/brillout/json-serializer)`;
50
50
  }
51
51
  }
package/index.mjs ADDED
@@ -0,0 +1,7 @@
1
+ // This file is `.mjs` to workaround a Vite bug:
2
+ // - Error originating from Vite:
3
+ // ```
4
+ // @brillout/json-s doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.
5
+ // ```
6
+ // - Reproduction: https://github.com/brillout/sveltekit-telefunc-repro
7
+ throw new Error("Module `@brillout/json-serializer` doesn't exist anymore: load `@brillout/json-serializer/parse` and `@brillout/json-serializer/stringify` instead.")
package/package.json CHANGED
@@ -1,17 +1,19 @@
1
1
  {
2
2
  "name": "@brillout/json-serializer",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "description": "Same as JSON but with added support for `Date`, `undefined`, `Map`, `Set`, and more.",
5
- "main": "./index.js",
5
+ "main": "./index.mjs",
6
6
  "exports": {
7
- ".": "./index.js",
7
+ ".": "./index.mjs",
8
8
  "./parse": {
9
- "require": "./dist/cjs/parse.js",
10
- "import": "./dist/esm/parse.js"
9
+ "worker": "./dist/cjs/parse.js",
10
+ "node": "./dist/cjs/parse.js",
11
+ "browser": "./dist/esm/parse.js"
11
12
  },
12
13
  "./stringify": {
13
- "require": "./dist/cjs/stringify.js",
14
- "import": "./dist/esm/stringify.js"
14
+ "worker": "./dist/cjs/stringify.js",
15
+ "node": "./dist/cjs/stringify.js",
16
+ "browser": "./dist/esm/stringify.js"
15
17
  }
16
18
  },
17
19
  "scripts": {
@@ -39,6 +41,7 @@
39
41
  "files": [
40
42
  "dist/",
41
43
  "*.d.ts",
44
+ "*.mjs",
42
45
  "*.js"
43
46
  ],
44
47
  "repository": "github:brillout/json-serializer",
package/index.js DELETED
@@ -1 +0,0 @@
1
- throw new Error("Module `@brillout/json-serializer` doesn't exist anymore: load `@brillout/json-serializer/parse` and `@brillout/json-serializer/stringify` instead.")