magicrealmsshared 0.3.15 → 0.3.16

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": "magicrealmsshared",
3
- "version": "0.3.15",
3
+ "version": "0.3.16",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -27,10 +27,6 @@
27
27
  "./types": {
28
28
  "types": "./dist/types/types.d.ts",
29
29
  "default": "./dist/types/types.js"
30
- },
31
- "./util/JSON": {
32
- "types": "./dist/util/JSON.d.ts",
33
- "default": "./dist/util/JSON.js"
34
30
  }
35
31
  }
36
32
  }
@@ -1,2 +0,0 @@
1
- export declare function parse(s: string): any;
2
- export declare function stringify(value: any): string;
package/dist/util/JSON.js DELETED
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parse = parse;
4
- exports.stringify = stringify;
5
- const SERIAL_PREFIX = "魔";
6
- function parse(s) {
7
- return JSON.parse(s, reviver);
8
- }
9
- function reviver(_key, value) {
10
- if (typeof value == "string" && value.startsWith(SERIAL_PREFIX)) {
11
- if (value.startsWith(SERIAL_PREFIX + "DATE:")) {
12
- return new Date(parseInt(value.substring((SERIAL_PREFIX + "DATE:").length)));
13
- }
14
- }
15
- return value;
16
- }
17
- function stringify(value) {
18
- return JSON.stringify(value, (key, val) => {
19
- if (val instanceof Date) {
20
- return `${SERIAL_PREFIX}DATE:${val.getTime()}`;
21
- }
22
- return val;
23
- });
24
- }