@dineroregnskab/eslint-plugin-custom-rules 2.0.5 → 2.0.6
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/node_modules/@aashutoshrathi/word-wrap/LICENSE +21 -0
- package/node_modules/@aashutoshrathi/word-wrap/README.md +182 -0
- package/node_modules/@aashutoshrathi/word-wrap/index.d.ts +50 -0
- package/node_modules/@aashutoshrathi/word-wrap/index.js +52 -0
- package/node_modules/@aashutoshrathi/word-wrap/package.json +81 -0
- package/node_modules/@angular-eslint/bundled-angular-compiler/README.md +1 -0
- package/node_modules/@angular-eslint/bundled-angular-compiler/dist/index.d.ts +5 -0
- package/node_modules/@angular-eslint/bundled-angular-compiler/dist/index.js +32004 -0
- package/node_modules/@angular-eslint/bundled-angular-compiler/package.json +19 -0
- package/node_modules/@angular-eslint/template-parser/LICENSE +21 -0
- package/node_modules/@angular-eslint/template-parser/README.md +1 -0
- package/node_modules/@angular-eslint/template-parser/dist/convert-source-span-to-loc.d.ts +6 -0
- package/node_modules/@angular-eslint/template-parser/dist/convert-source-span-to-loc.js +69 -0
- package/node_modules/@angular-eslint/template-parser/dist/index.d.ts +44 -0
- package/node_modules/@angular-eslint/template-parser/dist/index.js +219 -0
- package/node_modules/@angular-eslint/template-parser/package.json +28 -0
- package/node_modules/@eslint/eslintrc/LICENSE +19 -0
- package/node_modules/@eslint/eslintrc/README.md +115 -0
- package/node_modules/@eslint/eslintrc/conf/config-schema.js +79 -0
- package/node_modules/@eslint/eslintrc/conf/environments.js +215 -0
- package/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs +1104 -0
- package/node_modules/@eslint/eslintrc/dist/eslintrc-universal.cjs.map +1 -0
- package/node_modules/@eslint/eslintrc/dist/eslintrc.cjs +4333 -0
- package/node_modules/@eslint/eslintrc/dist/eslintrc.cjs.map +1 -0
- package/node_modules/@eslint/eslintrc/lib/cascading-config-array-factory.js +532 -0
- package/node_modules/@eslint/eslintrc/lib/config-array/config-array.js +523 -0
- package/node_modules/@eslint/eslintrc/lib/config-array/config-dependency.js +115 -0
- package/node_modules/@eslint/eslintrc/lib/config-array/extracted-config.js +145 -0
- package/node_modules/@eslint/eslintrc/lib/config-array/ignore-pattern.js +238 -0
- package/node_modules/@eslint/eslintrc/lib/config-array/index.js +19 -0
- package/node_modules/@eslint/eslintrc/lib/config-array/override-tester.js +225 -0
- package/node_modules/@eslint/eslintrc/lib/config-array-factory.js +1149 -0
- package/node_modules/@eslint/eslintrc/lib/flat-compat.js +318 -0
- package/node_modules/@eslint/eslintrc/lib/index-universal.js +29 -0
- package/node_modules/@eslint/eslintrc/lib/index.js +56 -0
- package/node_modules/@eslint/eslintrc/lib/shared/ajv.js +191 -0
- package/node_modules/@eslint/eslintrc/lib/shared/config-ops.js +135 -0
- package/node_modules/@eslint/eslintrc/lib/shared/config-validator.js +325 -0
- package/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js +63 -0
- package/node_modules/@eslint/eslintrc/lib/shared/naming.js +96 -0
- package/node_modules/@eslint/eslintrc/lib/shared/relative-module-resolver.js +42 -0
- package/node_modules/@eslint/eslintrc/lib/shared/types.js +149 -0
- package/node_modules/@eslint/eslintrc/package.json +82 -0
- package/node_modules/@eslint/eslintrc/universal.js +9 -0
- package/node_modules/@eslint/js/LICENSE +19 -0
- package/node_modules/@eslint/js/README.md +57 -0
- package/node_modules/@eslint/js/package.json +31 -0
- package/node_modules/@eslint/js/src/configs/eslint-all.js +211 -0
- package/node_modules/@eslint/js/src/configs/eslint-recommended.js +76 -0
- package/node_modules/@eslint/js/src/index.js +17 -0
- package/node_modules/@eslint-community/eslint-utils/LICENSE +21 -0
- package/node_modules/@eslint-community/eslint-utils/README.md +37 -0
- package/node_modules/@eslint-community/eslint-utils/index.js +2068 -0
- package/node_modules/@eslint-community/eslint-utils/index.js.map +1 -0
- package/node_modules/@eslint-community/eslint-utils/index.mjs +2027 -0
- package/node_modules/@eslint-community/eslint-utils/index.mjs.map +1 -0
- package/node_modules/@eslint-community/eslint-utils/package.json +73 -0
- package/node_modules/@eslint-community/regexpp/LICENSE +21 -0
- package/node_modules/@eslint-community/regexpp/README.md +177 -0
- package/node_modules/@eslint-community/regexpp/index.d.ts +1065 -0
- package/node_modules/@eslint-community/regexpp/index.js +2747 -0
- package/node_modules/@eslint-community/regexpp/index.js.map +1 -0
- package/node_modules/@eslint-community/regexpp/index.mjs +2737 -0
- package/node_modules/@eslint-community/regexpp/index.mjs.map +1 -0
- package/node_modules/@eslint-community/regexpp/package.json +93 -0
- package/node_modules/@humanwhocodes/config-array/LICENSE +201 -0
- package/node_modules/@humanwhocodes/config-array/README.md +342 -0
- package/node_modules/@humanwhocodes/config-array/api.js +1061 -0
- package/node_modules/@humanwhocodes/config-array/package.json +61 -0
- package/node_modules/@humanwhocodes/module-importer/CHANGELOG.md +15 -0
- package/node_modules/@humanwhocodes/module-importer/LICENSE +201 -0
- package/node_modules/@humanwhocodes/module-importer/README.md +80 -0
- package/node_modules/@humanwhocodes/module-importer/dist/module-importer.cjs +22 -0
- package/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.cts +27 -0
- package/node_modules/@humanwhocodes/module-importer/dist/module-importer.d.ts +2 -0
- package/node_modules/@humanwhocodes/module-importer/dist/module-importer.js +18 -0
- package/node_modules/@humanwhocodes/module-importer/package.json +65 -0
- package/node_modules/@humanwhocodes/module-importer/src/module-importer.cjs +81 -0
- package/node_modules/@humanwhocodes/module-importer/src/module-importer.js +22 -0
- package/node_modules/@humanwhocodes/object-schema/.eslintrc.js +29 -0
- package/node_modules/@humanwhocodes/object-schema/.github/workflows/nodejs-test.yml +27 -0
- package/node_modules/@humanwhocodes/object-schema/.github/workflows/release-please.yml +39 -0
- package/node_modules/@humanwhocodes/object-schema/CHANGELOG.md +26 -0
- package/node_modules/@humanwhocodes/object-schema/LICENSE +29 -0
- package/node_modules/@humanwhocodes/object-schema/README.md +234 -0
- package/node_modules/@humanwhocodes/object-schema/package.json +33 -0
- package/node_modules/@humanwhocodes/object-schema/src/index.js +7 -0
- package/node_modules/@humanwhocodes/object-schema/src/merge-strategy.js +53 -0
- package/node_modules/@humanwhocodes/object-schema/src/object-schema.js +301 -0
- package/node_modules/@humanwhocodes/object-schema/src/validation-strategy.js +102 -0
- package/node_modules/@humanwhocodes/object-schema/tests/merge-strategy.js +66 -0
- package/node_modules/@humanwhocodes/object-schema/tests/object-schema.js +659 -0
- package/node_modules/@humanwhocodes/object-schema/tests/validation-strategy.js +186 -0
- package/node_modules/@nodelib/fs.scandir/LICENSE +21 -0
- package/node_modules/@nodelib/fs.scandir/README.md +171 -0
- package/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
- package/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +19 -0
- package/node_modules/@nodelib/fs.scandir/out/constants.d.ts +4 -0
- package/node_modules/@nodelib/fs.scandir/out/constants.js +17 -0
- package/node_modules/@nodelib/fs.scandir/out/index.d.ts +12 -0
- package/node_modules/@nodelib/fs.scandir/out/index.js +26 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/async.js +104 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +1 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/common.js +13 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +5 -0
- package/node_modules/@nodelib/fs.scandir/out/providers/sync.js +54 -0
- package/node_modules/@nodelib/fs.scandir/out/settings.d.ts +20 -0
- package/node_modules/@nodelib/fs.scandir/out/settings.js +24 -0
- package/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
- package/node_modules/@nodelib/fs.scandir/out/types/index.js +2 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +2 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/fs.js +19 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +2 -0
- package/node_modules/@nodelib/fs.scandir/out/utils/index.js +5 -0
- package/node_modules/@nodelib/fs.scandir/package.json +44 -0
- package/node_modules/@nodelib/fs.stat/LICENSE +21 -0
- package/node_modules/@nodelib/fs.stat/README.md +126 -0
- package/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
- package/node_modules/@nodelib/fs.stat/out/adapters/fs.js +17 -0
- package/node_modules/@nodelib/fs.stat/out/index.d.ts +12 -0
- package/node_modules/@nodelib/fs.stat/out/index.js +26 -0
- package/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
- package/node_modules/@nodelib/fs.stat/out/providers/async.js +36 -0
- package/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +3 -0
- package/node_modules/@nodelib/fs.stat/out/providers/sync.js +23 -0
- package/node_modules/@nodelib/fs.stat/out/settings.d.ts +16 -0
- package/node_modules/@nodelib/fs.stat/out/settings.js +16 -0
- package/node_modules/@nodelib/fs.stat/out/types/index.d.ts +4 -0
- package/node_modules/@nodelib/fs.stat/out/types/index.js +2 -0
- package/node_modules/@nodelib/fs.stat/package.json +37 -0
- package/node_modules/@nodelib/fs.walk/LICENSE +21 -0
- package/node_modules/@nodelib/fs.walk/README.md +215 -0
- package/node_modules/@nodelib/fs.walk/out/index.d.ts +14 -0
- package/node_modules/@nodelib/fs.walk/out/index.js +34 -0
- package/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
- package/node_modules/@nodelib/fs.walk/out/providers/async.js +30 -0
- package/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +4 -0
- package/node_modules/@nodelib/fs.walk/out/providers/index.js +9 -0
- package/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +12 -0
- package/node_modules/@nodelib/fs.walk/out/providers/stream.js +34 -0
- package/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +10 -0
- package/node_modules/@nodelib/fs.walk/out/providers/sync.js +14 -0
- package/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
- package/node_modules/@nodelib/fs.walk/out/readers/async.js +97 -0
- package/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +7 -0
- package/node_modules/@nodelib/fs.walk/out/readers/common.js +31 -0
- package/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
- package/node_modules/@nodelib/fs.walk/out/readers/reader.js +11 -0
- package/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +15 -0
- package/node_modules/@nodelib/fs.walk/out/readers/sync.js +59 -0
- package/node_modules/@nodelib/fs.walk/out/settings.d.ts +30 -0
- package/node_modules/@nodelib/fs.walk/out/settings.js +26 -0
- package/node_modules/@nodelib/fs.walk/out/types/index.d.ts +8 -0
- package/node_modules/@nodelib/fs.walk/out/types/index.js +2 -0
- package/node_modules/@nodelib/fs.walk/package.json +44 -0
- package/node_modules/@ungap/structured-clone/.github/workflows/node.js.yml +31 -0
- package/node_modules/@ungap/structured-clone/LICENSE +15 -0
- package/node_modules/@ungap/structured-clone/README.md +95 -0
- package/node_modules/@ungap/structured-clone/cjs/deserialize.js +78 -0
- package/node_modules/@ungap/structured-clone/cjs/index.js +27 -0
- package/node_modules/@ungap/structured-clone/cjs/json.js +24 -0
- package/node_modules/@ungap/structured-clone/cjs/package.json +1 -0
- package/node_modules/@ungap/structured-clone/cjs/serialize.js +160 -0
- package/node_modules/@ungap/structured-clone/cjs/types.js +22 -0
- package/node_modules/@ungap/structured-clone/esm/deserialize.js +79 -0
- package/node_modules/@ungap/structured-clone/esm/index.js +25 -0
- package/node_modules/@ungap/structured-clone/esm/json.js +21 -0
- package/node_modules/@ungap/structured-clone/esm/serialize.js +161 -0
- package/node_modules/@ungap/structured-clone/esm/types.js +11 -0
- package/node_modules/@ungap/structured-clone/package.json +53 -0
- package/node_modules/@ungap/structured-clone/structured-json.js +1 -0
- package/package.json +1 -1
- package/rules/dayjs-with-timezone.js +29 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*! (c) Andrea Giammarchi - ISC */
|
|
2
|
+
|
|
3
|
+
import {deserialize} from './deserialize.js';
|
|
4
|
+
import {serialize} from './serialize.js';
|
|
5
|
+
|
|
6
|
+
const {parse: $parse, stringify: $stringify} = JSON;
|
|
7
|
+
const options = {json: true, lossy: true};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Revive a previously stringified structured clone.
|
|
11
|
+
* @param {string} str previously stringified data as string.
|
|
12
|
+
* @returns {any} whatever was previously stringified as clone.
|
|
13
|
+
*/
|
|
14
|
+
export const parse = str => deserialize($parse(str));
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Represent a structured clone value as string.
|
|
18
|
+
* @param {any} any some clone-able value to stringify.
|
|
19
|
+
* @returns {string} the value stringified.
|
|
20
|
+
*/
|
|
21
|
+
export const stringify = any => $stringify(serialize(any, options));
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import {
|
|
2
|
+
VOID, PRIMITIVE,
|
|
3
|
+
ARRAY, OBJECT,
|
|
4
|
+
DATE, REGEXP, MAP, SET,
|
|
5
|
+
ERROR, BIGINT
|
|
6
|
+
} from './types.js';
|
|
7
|
+
|
|
8
|
+
const EMPTY = '';
|
|
9
|
+
|
|
10
|
+
const {toString} = {};
|
|
11
|
+
const {keys} = Object;
|
|
12
|
+
|
|
13
|
+
const typeOf = value => {
|
|
14
|
+
const type = typeof value;
|
|
15
|
+
if (type !== 'object' || !value)
|
|
16
|
+
return [PRIMITIVE, type];
|
|
17
|
+
|
|
18
|
+
const asString = toString.call(value).slice(8, -1);
|
|
19
|
+
switch (asString) {
|
|
20
|
+
case 'Array':
|
|
21
|
+
return [ARRAY, EMPTY];
|
|
22
|
+
case 'Object':
|
|
23
|
+
return [OBJECT, EMPTY];
|
|
24
|
+
case 'Date':
|
|
25
|
+
return [DATE, EMPTY];
|
|
26
|
+
case 'RegExp':
|
|
27
|
+
return [REGEXP, EMPTY];
|
|
28
|
+
case 'Map':
|
|
29
|
+
return [MAP, EMPTY];
|
|
30
|
+
case 'Set':
|
|
31
|
+
return [SET, EMPTY];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (asString.includes('Array'))
|
|
35
|
+
return [ARRAY, asString];
|
|
36
|
+
|
|
37
|
+
if (asString.includes('Error'))
|
|
38
|
+
return [ERROR, asString];
|
|
39
|
+
|
|
40
|
+
return [OBJECT, asString];
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const shouldSkip = ([TYPE, type]) => (
|
|
44
|
+
TYPE === PRIMITIVE &&
|
|
45
|
+
(type === 'function' || type === 'symbol')
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const serializer = (strict, json, $, _) => {
|
|
49
|
+
|
|
50
|
+
const as = (out, value) => {
|
|
51
|
+
const index = _.push(out) - 1;
|
|
52
|
+
$.set(value, index);
|
|
53
|
+
return index;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const pair = value => {
|
|
57
|
+
if ($.has(value))
|
|
58
|
+
return $.get(value);
|
|
59
|
+
|
|
60
|
+
let [TYPE, type] = typeOf(value);
|
|
61
|
+
switch (TYPE) {
|
|
62
|
+
case PRIMITIVE: {
|
|
63
|
+
let entry = value;
|
|
64
|
+
switch (type) {
|
|
65
|
+
case 'bigint':
|
|
66
|
+
TYPE = BIGINT;
|
|
67
|
+
entry = value.toString();
|
|
68
|
+
break;
|
|
69
|
+
case 'function':
|
|
70
|
+
case 'symbol':
|
|
71
|
+
if (strict)
|
|
72
|
+
throw new TypeError('unable to serialize ' + type);
|
|
73
|
+
entry = null;
|
|
74
|
+
break;
|
|
75
|
+
case 'undefined':
|
|
76
|
+
return as([VOID], value);
|
|
77
|
+
}
|
|
78
|
+
return as([TYPE, entry], value);
|
|
79
|
+
}
|
|
80
|
+
case ARRAY: {
|
|
81
|
+
if (type)
|
|
82
|
+
return as([type, [...value]], value);
|
|
83
|
+
|
|
84
|
+
const arr = [];
|
|
85
|
+
const index = as([TYPE, arr], value);
|
|
86
|
+
for (const entry of value)
|
|
87
|
+
arr.push(pair(entry));
|
|
88
|
+
return index;
|
|
89
|
+
}
|
|
90
|
+
case OBJECT: {
|
|
91
|
+
if (type) {
|
|
92
|
+
switch (type) {
|
|
93
|
+
case 'BigInt':
|
|
94
|
+
return as([type, value.toString()], value);
|
|
95
|
+
case 'Boolean':
|
|
96
|
+
case 'Number':
|
|
97
|
+
case 'String':
|
|
98
|
+
return as([type, value.valueOf()], value);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (json && ('toJSON' in value))
|
|
103
|
+
return pair(value.toJSON());
|
|
104
|
+
|
|
105
|
+
const entries = [];
|
|
106
|
+
const index = as([TYPE, entries], value);
|
|
107
|
+
for (const key of keys(value)) {
|
|
108
|
+
if (strict || !shouldSkip(typeOf(value[key])))
|
|
109
|
+
entries.push([pair(key), pair(value[key])]);
|
|
110
|
+
}
|
|
111
|
+
return index;
|
|
112
|
+
}
|
|
113
|
+
case DATE:
|
|
114
|
+
return as([TYPE, value.toISOString()], value);
|
|
115
|
+
case REGEXP: {
|
|
116
|
+
const {source, flags} = value;
|
|
117
|
+
return as([TYPE, {source, flags}], value);
|
|
118
|
+
}
|
|
119
|
+
case MAP: {
|
|
120
|
+
const entries = [];
|
|
121
|
+
const index = as([TYPE, entries], value);
|
|
122
|
+
for (const [key, entry] of value) {
|
|
123
|
+
if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry))))
|
|
124
|
+
entries.push([pair(key), pair(entry)]);
|
|
125
|
+
}
|
|
126
|
+
return index;
|
|
127
|
+
}
|
|
128
|
+
case SET: {
|
|
129
|
+
const entries = [];
|
|
130
|
+
const index = as([TYPE, entries], value);
|
|
131
|
+
for (const entry of value) {
|
|
132
|
+
if (strict || !shouldSkip(typeOf(entry)))
|
|
133
|
+
entries.push(pair(entry));
|
|
134
|
+
}
|
|
135
|
+
return index;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const {message} = value;
|
|
140
|
+
return as([TYPE, {name: type, message}], value);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
return pair;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @typedef {Array<string,any>} Record a type representation
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Returns an array of serialized Records.
|
|
152
|
+
* @param {any} value a serializable value.
|
|
153
|
+
* @param {{json?: boolean, lossy?: boolean}?} options an object with a `lossy` or `json` property that,
|
|
154
|
+
* if `true`, will not throw errors on incompatible types, and behave more
|
|
155
|
+
* like JSON stringify would behave. Symbol and Function will be discarded.
|
|
156
|
+
* @returns {Record[]}
|
|
157
|
+
*/
|
|
158
|
+
export const serialize = (value, {json, lossy} = {}) => {
|
|
159
|
+
const _ = [];
|
|
160
|
+
return serializer(!(json || lossy), !!json, new Map, _)(value), _;
|
|
161
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const VOID = -1;
|
|
2
|
+
export const PRIMITIVE = 0;
|
|
3
|
+
export const ARRAY = 1;
|
|
4
|
+
export const OBJECT = 2;
|
|
5
|
+
export const DATE = 3;
|
|
6
|
+
export const REGEXP = 4;
|
|
7
|
+
export const MAP = 5;
|
|
8
|
+
export const SET = 6;
|
|
9
|
+
export const ERROR = 7;
|
|
10
|
+
export const BIGINT = 8;
|
|
11
|
+
// export const SYMBOL = 9;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ungap/structured-clone",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "A structuredClone polyfill",
|
|
5
|
+
"main": "./cjs/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "npm run cjs && npm run rollup:json && npm run test",
|
|
8
|
+
"cjs": "ascjs esm cjs",
|
|
9
|
+
"coverage": "c8 report --reporter=text-lcov > ./coverage/lcov.info",
|
|
10
|
+
"rollup:json": "rollup --config rollup/json.config.js",
|
|
11
|
+
"test": "c8 node test/index.js"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"recursion",
|
|
15
|
+
"structured",
|
|
16
|
+
"clone",
|
|
17
|
+
"algorithm"
|
|
18
|
+
],
|
|
19
|
+
"author": "Andrea Giammarchi",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@rollup/plugin-node-resolve": "^15.0.2",
|
|
23
|
+
"@rollup/plugin-terser": "^0.4.1",
|
|
24
|
+
"ascjs": "^5.0.1",
|
|
25
|
+
"c8": "^7.13.0",
|
|
26
|
+
"coveralls": "^3.1.1",
|
|
27
|
+
"rollup": "^3.21.4"
|
|
28
|
+
},
|
|
29
|
+
"module": "./esm/index.js",
|
|
30
|
+
"type": "module",
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"import": "./esm/index.js",
|
|
34
|
+
"default": "./cjs/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./json": {
|
|
37
|
+
"import": "./esm/json.js",
|
|
38
|
+
"default": "./cjs/json.js"
|
|
39
|
+
},
|
|
40
|
+
"./package.json": "./package.json"
|
|
41
|
+
},
|
|
42
|
+
"directories": {
|
|
43
|
+
"test": "test"
|
|
44
|
+
},
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git+https://github.com/ungap/structured-clone.git"
|
|
48
|
+
},
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/ungap/structured-clone/issues"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://github.com/ungap/structured-clone#readme"
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var StructuredJSON=function(e){"use strict";const r="object"==typeof self?self:globalThis,t=e=>((e,t)=>{const s=(r,t)=>(e.set(t,r),r),n=c=>{if(e.has(c))return e.get(c);const[o,a]=t[c];switch(o){case 0:case-1:return s(a,c);case 1:{const e=s([],c);for(const r of a)e.push(n(r));return e}case 2:{const e=s({},c);for(const[r,t]of a)e[n(r)]=n(t);return e}case 3:return s(new Date(a),c);case 4:{const{source:e,flags:r}=a;return s(new RegExp(e,r),c)}case 5:{const e=s(new Map,c);for(const[r,t]of a)e.set(n(r),n(t));return e}case 6:{const e=s(new Set,c);for(const r of a)e.add(n(r));return e}case 7:{const{name:e,message:t}=a;return s(new r[e](t),c)}case 8:return s(BigInt(a),c);case"BigInt":return s(Object(BigInt(a)),c)}return s(new r[o](a),c)};return n})(new Map,e)(0),s="",{toString:n}={},{keys:c}=Object,o=e=>{const r=typeof e;if("object"!==r||!e)return[0,r];const t=n.call(e).slice(8,-1);switch(t){case"Array":return[1,s];case"Object":return[2,s];case"Date":return[3,s];case"RegExp":return[4,s];case"Map":return[5,s];case"Set":return[6,s]}return t.includes("Array")?[1,t]:t.includes("Error")?[7,t]:[2,t]},a=([e,r])=>0===e&&("function"===r||"symbol"===r),u=(e,{json:r,lossy:t}={})=>{const s=[];return((e,r,t,s)=>{const n=(e,r)=>{const n=s.push(e)-1;return t.set(r,n),n},u=s=>{if(t.has(s))return t.get(s);let[i,f]=o(s);switch(i){case 0:{let r=s;switch(f){case"bigint":i=8,r=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);r=null;break;case"undefined":return n([-1],s)}return n([i,r],s)}case 1:{if(f)return n([f,[...s]],s);const e=[],r=n([i,e],s);for(const r of s)e.push(u(r));return r}case 2:{if(f)switch(f){case"BigInt":return n([f,s.toString()],s);case"Boolean":case"Number":case"String":return n([f,s.valueOf()],s)}if(r&&"toJSON"in s)return u(s.toJSON());const t=[],l=n([i,t],s);for(const r of c(s))!e&&a(o(s[r]))||t.push([u(r),u(s[r])]);return l}case 3:return n([i,s.toISOString()],s);case 4:{const{source:e,flags:r}=s;return n([i,{source:e,flags:r}],s)}case 5:{const r=[],t=n([i,r],s);for(const[t,n]of s)(e||!a(o(t))&&!a(o(n)))&&r.push([u(t),u(n)]);return t}case 6:{const r=[],t=n([i,r],s);for(const t of s)!e&&a(o(t))||r.push(u(t));return t}}const{message:l}=s;return n([i,{name:f,message:l}],s)};return u})(!(r||t),!!r,new Map,s)(e),s},{parse:i,stringify:f}=JSON,l={json:!0,lossy:!0};return e.parse=e=>t(i(e)),e.stringify=e=>f(u(e,l)),e}({});
|
package/package.json
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
meta: {
|
|
3
|
+
type: "suggestion",
|
|
4
|
+
docs: {
|
|
5
|
+
description: "Enforce using dayjs.tz() instead of dayjs()",
|
|
6
|
+
category: "Best Practices",
|
|
7
|
+
recommended: false,
|
|
8
|
+
},
|
|
9
|
+
fixable: null,
|
|
10
|
+
schema: [],
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
create: function (context) {
|
|
14
|
+
return {
|
|
15
|
+
CallExpression(node) {
|
|
16
|
+
if (
|
|
17
|
+
node.callee.type === "Identifier" &&
|
|
18
|
+
node.callee.name === "dayjs"
|
|
19
|
+
) {
|
|
20
|
+
context.report({
|
|
21
|
+
node,
|
|
22
|
+
message:
|
|
23
|
+
"Consider using dayjs.tz() instead of dayjs() for timezone support",
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
};
|