libshv-js 3.16.1 → 3.17.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 +21 -13
- package/.github/workflows/check-version-bump.yml +0 -22
- package/.github/workflows/lint.yml +0 -33
- package/.github/workflows/publish.yml +0 -24
- package/.github/workflows/test.yml +0 -31
- package/eslint.config.js +0 -103
- package/examples/websocketosaurus.html +0 -44
- package/examples/websocketosaurus.js +0 -94
- package/src/access.ts +0 -103
- package/src/chainpack.ts +0 -660
- package/src/cpcontext.ts +0 -87
- package/src/cpon.ts +0 -1000
- package/src/json.ts +0 -136
- package/src/rpcmessage.ts +0 -91
- package/src/rpcvalue.ts +0 -147
- package/src/vue-shv.ts +0 -484
- package/src/ws-client.ts +0 -708
- package/src/zod.ts +0 -95
- package/test.ts +0 -110
- package/test_json.ts +0 -44
- package/test_zod.ts +0 -24
- package/tsconfig.json +0 -108
package/src/zod.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import {z, type ZodType} from 'zod/v4';
|
|
3
|
-
import {Decimal, Double, isIMap, isMetaMap, isShvMap, type MetaMap, RpcValue, type RpcValueType, RpcValueWithMetaData, shvMapType, typeName, UInt} from './rpcvalue';
|
|
4
|
-
|
|
5
|
-
const implMakeMapParser = <MapBrand extends string, ObjectParser extends ZodType<object>>(mapValidator: (val: unknown) => boolean, _mapBrand: MapBrand, mapName: string, objectParser: ObjectParser) => z.custom<z.infer<ObjectParser> & {[shvMapType]: MapBrand}>().check(ctx => {
|
|
6
|
-
if (!mapValidator(ctx.value)) {
|
|
7
|
-
ctx.issues.push({
|
|
8
|
-
expected: 'map',
|
|
9
|
-
code: 'invalid_type',
|
|
10
|
-
input: ctx.value,
|
|
11
|
-
message: `Invalid input: expected ${mapName}, received ${typeName(ctx.value)}`,
|
|
12
|
-
});
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// For record, Zod finds out map brand, and calls the record's value parser with the value. There's no way to detect
|
|
17
|
-
// it, because Zod does not supply the parser with the key. To prevent this, remove the key before passing the value
|
|
18
|
-
// to Zod. This unfortunately means that we need to copy the whole object. :/
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20
|
-
const {[shvMapType]: zodMustNotHaveThis, ...rest} = {...ctx.value};
|
|
21
|
-
const parsedObject = objectParser.safeParse(rest);
|
|
22
|
-
|
|
23
|
-
if (!parsedObject.success) {
|
|
24
|
-
ctx.issues = parsedObject.error.issues;
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
export const map = <T extends Record<string, ZodType<any>>>(schema: T) => implMakeMapParser(isShvMap, 'map', 'ShvMap', z.object(schema));
|
|
29
|
-
export const imap = <T extends Record<number, ZodType<any>>>(schema: T) => implMakeMapParser(isIMap, 'imap', 'IMap', z.object(schema));
|
|
30
|
-
export const metamap = <T extends Record<string | number, ZodType<any>>>(schema: T) => implMakeMapParser(isMetaMap, 'metamap', 'MetaMap', z.object(schema));
|
|
31
|
-
export const recmap = <T extends ZodType<any>>(schema: T) => implMakeMapParser(val => isShvMap(val) || isIMap(val), 'map', 'ShvMap', z.record(z.any(), schema));
|
|
32
|
-
|
|
33
|
-
export const uint = () => z.instanceof(UInt<number>);
|
|
34
|
-
export const double = () => z.instanceof(Double);
|
|
35
|
-
export const decimal = () => z.instanceof(Decimal);
|
|
36
|
-
export const blob = () => z.instanceof(ArrayBuffer);
|
|
37
|
-
export const list: () => z.ZodArray<z.ZodLazy<z.ZodType<RpcValue>>> = () => z.array(z.lazy<z.ZodType<RpcValue>>(rpcvalue));
|
|
38
|
-
|
|
39
|
-
const withMetaInstanceParser = z.instanceof(RpcValueWithMetaData);
|
|
40
|
-
export const rpcvalue: () => ZodType<RpcValue> = () => z.lazy(() => z.union([
|
|
41
|
-
z.undefined(),
|
|
42
|
-
z.boolean(),
|
|
43
|
-
z.number(),
|
|
44
|
-
uint(),
|
|
45
|
-
double(),
|
|
46
|
-
decimal(),
|
|
47
|
-
blob(),
|
|
48
|
-
z.string(),
|
|
49
|
-
z.date(),
|
|
50
|
-
list(),
|
|
51
|
-
recmap(rpcvalue()),
|
|
52
|
-
withMetaInstanceParser,
|
|
53
|
-
]) as z.ZodType<RpcValue>);
|
|
54
|
-
|
|
55
|
-
export const withMeta = <MetaSchema extends MetaMap, ValueSchema extends RpcValueType>(metaParser: ZodType<MetaSchema>, valueParser: ZodType<ValueSchema>) =>
|
|
56
|
-
z.custom<RpcValueWithMetaData<z.infer<typeof metaParser>, z.infer<typeof valueParser>>>().check(ctx => {
|
|
57
|
-
if (!withMetaInstanceParser.safeParse(ctx.value).success) {
|
|
58
|
-
ctx.issues.push({
|
|
59
|
-
expected: 'map',
|
|
60
|
-
code: 'invalid_type',
|
|
61
|
-
input: ctx.value,
|
|
62
|
-
message: 'Invalid input: expected a value with metadata, got a value with no metadata}',
|
|
63
|
-
});
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const parsedMeta = metaParser.safeParse(ctx.value.meta);
|
|
68
|
-
if (!parsedMeta.success) {
|
|
69
|
-
ctx.issues = [
|
|
70
|
-
{
|
|
71
|
-
expected: 'map',
|
|
72
|
-
code: 'invalid_type',
|
|
73
|
-
input: ctx.value,
|
|
74
|
-
message: 'Wrong RpcValueWithMetaData meta',
|
|
75
|
-
},
|
|
76
|
-
...parsedMeta.error.issues,
|
|
77
|
-
];
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const parsedValue = valueParser.safeParse(ctx.value.value);
|
|
82
|
-
if (!parsedValue.success) {
|
|
83
|
-
ctx.issues = [
|
|
84
|
-
{
|
|
85
|
-
expected: 'map',
|
|
86
|
-
code: 'invalid_type',
|
|
87
|
-
input: ctx.value,
|
|
88
|
-
message: 'Wrong RpcValueWithMetaData value',
|
|
89
|
-
},
|
|
90
|
-
...parsedValue.error.issues,
|
|
91
|
-
];
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
export * from 'zod/v4';
|
package/test.ts
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import {toChainPack, fromChainPack} from './src/chainpack';
|
|
2
|
-
import {toCpon, fromCpon} from './src/cpon';
|
|
3
|
-
import {type DateTime} from './src/rpcvalue';
|
|
4
|
-
|
|
5
|
-
const checkEq = (e1: string | number, e2: string | number) => {
|
|
6
|
-
if (e1 !== e2) {
|
|
7
|
-
throw new Error(`test check error: ${e1} === ${e2}`);
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
for (const lst of [
|
|
12
|
-
[((2 ** 31) - 1) + 'u', null],
|
|
13
|
-
[((2 ** 32) - 1) + 'u', null], // too big for JS bitwise operations
|
|
14
|
-
[String((2 ** 31) - 1), null],
|
|
15
|
-
[String(-((2 ** 30) - 1)), null],
|
|
16
|
-
[String((2 ** 53) - 1), null], // Number.MAX_SAFE_INTEGER
|
|
17
|
-
[String(-((2 ** 53) - 1)), null], // Number.MIN_SAFE_INTEGER
|
|
18
|
-
[String((2 ** 32) - 1), null], // too big for JS bitwise operations
|
|
19
|
-
['true', null],
|
|
20
|
-
['false', null],
|
|
21
|
-
['null', null],
|
|
22
|
-
['1u', null],
|
|
23
|
-
['134', null],
|
|
24
|
-
['7', null],
|
|
25
|
-
['-2', null],
|
|
26
|
-
['0xab', '171'],
|
|
27
|
-
['-0xCD', '-205'],
|
|
28
|
-
['0x1a2b3c4d', '439041101'],
|
|
29
|
-
['223.', null],
|
|
30
|
-
['2.30', null],
|
|
31
|
-
['12.3e-10', '123e-11'],
|
|
32
|
-
['-0.00012', '-12e-5'],
|
|
33
|
-
['-1234567890.', '-1234567890.'],
|
|
34
|
-
['"foo"', null],
|
|
35
|
-
['b"a1\\d2"', null],
|
|
36
|
-
['x"6131d2"', 'b"a1\\d2"'],
|
|
37
|
-
['[]', null],
|
|
38
|
-
['[1]', null],
|
|
39
|
-
['[1,]', '[1]'],
|
|
40
|
-
['[1,2,3]', null],
|
|
41
|
-
['[[]]', null],
|
|
42
|
-
['{"foo":"bar"}', null],
|
|
43
|
-
['{"login":{"password":"lautr","type":"PLAIN","user":"revitest"}}', null],
|
|
44
|
-
['i{1:2}', null],
|
|
45
|
-
['i{\n\t1: "bar",\n\t345u : "foo",\n}', 'i{1:"bar",345:"foo"}'],
|
|
46
|
-
['[1u,{"a":1},2.30]', null],
|
|
47
|
-
['<1:2>3', null],
|
|
48
|
-
['[1,<7:8>9]', null],
|
|
49
|
-
['<>1', null],
|
|
50
|
-
['<8:3u>i{2:[[".broker",<1:2>true]]}', null],
|
|
51
|
-
['<1:2,"foo":"bar">i{1:<7:8>9}', null],
|
|
52
|
-
['<1:2,"foo":<5:6>"bar">[1u,{"a":1},2.30]', null],
|
|
53
|
-
['i{1:2 // comment to end of line\n}', 'i{1:2}'],
|
|
54
|
-
[`/*comment 1*/{ /*comment 2*/
|
|
55
|
-
\t"foo"/*comment "3"*/: "bar", //comment to end of line
|
|
56
|
-
\t"baz" : 1,
|
|
57
|
-
/*
|
|
58
|
-
\tmultiline comment
|
|
59
|
-
\t"baz" : 1,
|
|
60
|
-
\t"baz" : 1, // single inside multi
|
|
61
|
-
*/
|
|
62
|
-
}`, '{"foo":"bar","baz":1}'],
|
|
63
|
-
['<1:2>[3,<4:5>6]', null],
|
|
64
|
-
['<4:"svete">i{2:<4:"svete">[0,1]}', null],
|
|
65
|
-
['d"2019-05-03T11:30:00-0700"', 'd"2019-05-03T11:30:00-07"'],
|
|
66
|
-
['d"2018-02-02T00:00:00Z"', null],
|
|
67
|
-
['d"2024-10-30T16:30:57.890Z"', null],
|
|
68
|
-
['d"2027-05-03T11:30:12.345+01"', null],
|
|
69
|
-
]) {
|
|
70
|
-
const cpon1 = lst[0];
|
|
71
|
-
const cpon2 = lst[1] ?? cpon1!;
|
|
72
|
-
|
|
73
|
-
console.log('testing', JSON.stringify(cpon1), '\t-------->\t', cpon2);
|
|
74
|
-
const rv1 = fromCpon(cpon1!);
|
|
75
|
-
const cpn1 = toCpon(rv1);
|
|
76
|
-
checkEq(cpn1, cpon2);
|
|
77
|
-
|
|
78
|
-
const cpk1 = toChainPack(rv1);
|
|
79
|
-
const rv2 = fromChainPack(cpk1);
|
|
80
|
-
const cpn2 = toCpon(rv2);
|
|
81
|
-
checkEq(cpn1, cpn2);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// same points in time
|
|
85
|
-
const v1 = fromCpon('d"2017-05-03T18:30:00Z"') as DateTime;
|
|
86
|
-
const v2 = fromCpon('d"2017-05-03T22:30:00+04"') as DateTime;
|
|
87
|
-
const v3 = fromCpon('d"2017-05-03T11:30:00-0700"') as DateTime;
|
|
88
|
-
const v4 = fromCpon('d"2017-05-03T15:00:00-0330"') as DateTime;
|
|
89
|
-
checkEq(v1.getTime(), v2.getTime());
|
|
90
|
-
checkEq(v2.getTime(), v3.getTime());
|
|
91
|
-
checkEq(v3.getTime(), v4.getTime());
|
|
92
|
-
checkEq(v4.getTime(), v1.getTime());
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
const c1 = '{"1":"a"}';
|
|
96
|
-
const v1 = fromCpon(c1);
|
|
97
|
-
const c2 = toCpon(v1);
|
|
98
|
-
console.log(c1, 'vs.', c2);
|
|
99
|
-
checkEq(c1, c2);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
{
|
|
103
|
-
const c1 = 'i{1:"a"}';
|
|
104
|
-
const v1 = fromCpon(c1);
|
|
105
|
-
const c2 = toCpon(v1);
|
|
106
|
-
console.log(c1, 'vs.', c2);
|
|
107
|
-
checkEq(c1, c2);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
console.log('PASSED');
|
package/test_json.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { toCpon } from "./src/cpon";
|
|
2
|
-
import { fromJson, toJson } from "./src/json";
|
|
3
|
-
import {makeIMap, makeMap, makeMetaMap, RpcValue, RpcValueWithMetaData, withOffset} from "./src/rpcvalue";
|
|
4
|
-
|
|
5
|
-
const testJsonRoundTrip = (json: string, expected: RpcValue) => {
|
|
6
|
-
const parsed = fromJson(json);
|
|
7
|
-
if (parsed instanceof Error) {
|
|
8
|
-
throw parsed;
|
|
9
|
-
}
|
|
10
|
-
const parsedCpon = toCpon(parsed);
|
|
11
|
-
const expectedCpon = toCpon(expected);
|
|
12
|
-
if (parsedCpon !== expectedCpon) {
|
|
13
|
-
throw new Error(`Assertion error:\nExpected: '${expectedCpon}'\nActual: '${parsedCpon}'`);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const serializedJson = toJson(expected);
|
|
17
|
-
if (serializedJson !== json.replaceAll(' ', '')) {
|
|
18
|
-
throw new Error(`Assertion error:\nExpected: '${json}'\nActual: '${serializedJson}'`);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const MINUTE = 1;
|
|
24
|
-
const HOUR = 60 * MINUTE;
|
|
25
|
-
|
|
26
|
-
const tests = [
|
|
27
|
-
['{}', makeMap({})],
|
|
28
|
-
['{"null-field": null}', makeMap({"null-field": undefined})],
|
|
29
|
-
['["!shvType", "Blob", ""]', new Uint8Array().buffer],
|
|
30
|
-
['["!shvType", "Blob", "6162a1"]', new Uint8Array([0x61, 0x62, 0xa1]).buffer],
|
|
31
|
-
['["!shvType", "IMap", {}]', makeIMap({})],
|
|
32
|
-
['["!shvType", "IMap", {"1": 2}]', makeIMap({1: 2})],
|
|
33
|
-
['["!shvType", "IMap", {"1": 2, "2": "foo"}]', makeIMap({1: 2, 2: "foo"})],
|
|
34
|
-
['["!shvType", "DateTime", "2021-11-08T01:02:03+05"]', withOffset(new Date("2021-11-08T01:02:03+05:00"), 5 * HOUR)],
|
|
35
|
-
['["!shvType", "DateTime", "2021-11-08T01:02:03-0815"]', withOffset(new Date("2021-11-08T01:02:03-08:15"), -8 * HOUR - 15 * MINUTE)],
|
|
36
|
-
['["!shvType", "DateTime", "2021-11-08T01:02:03.456-0815"]', withOffset(new Date("2021-11-08T01:02:03.456-08:15"), -8 * HOUR - 15 * MINUTE)],
|
|
37
|
-
['["!shvMeta", {"1":2}, 42]', new RpcValueWithMetaData(makeMetaMap({1: 2}), 42)],
|
|
38
|
-
['["!shvMeta", {"1":2}, "!shvType", "IMap", {"42": 7}]', new RpcValueWithMetaData(makeMetaMap({1: 2}), makeIMap({42: 7}))],
|
|
39
|
-
['["!shvMeta", {"1": 2, "foo": "bar"}, [1,2,3]]', new RpcValueWithMetaData(makeMetaMap({1: 2, "foo": "bar"}), [1, 2, 3])],
|
|
40
|
-
] as const;
|
|
41
|
-
|
|
42
|
-
tests.forEach(([inputJson, expectedRpcValue]) => testJsonRoundTrip(inputJson, expectedRpcValue));
|
|
43
|
-
|
|
44
|
-
console.log('OK');
|
package/test_zod.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { fromCpon } from './src/cpon';
|
|
2
|
-
import { makeIMap, makeMap, makeMetaMap } from './src/rpcvalue';
|
|
3
|
-
import * as z from './src/zod';
|
|
4
|
-
|
|
5
|
-
z.map({ ok: z.boolean(), })
|
|
6
|
-
.parse(makeMap({ok: true}))
|
|
7
|
-
.ok;
|
|
8
|
-
z.imap({ 1: z.boolean(), })
|
|
9
|
-
.parse(makeIMap({1: true}))[1];
|
|
10
|
-
|
|
11
|
-
{
|
|
12
|
-
const x = z.metamap({1: z.boolean(), ok: z.boolean()})
|
|
13
|
-
.parse(makeMetaMap({1: true, ok: true}))
|
|
14
|
-
x.ok;
|
|
15
|
-
x[1];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const SiteInfoZod = z.recmap(z.map({
|
|
19
|
-
optKey: z.map({
|
|
20
|
-
}).optional(),
|
|
21
|
-
}));
|
|
22
|
-
|
|
23
|
-
const lol = fromCpon(`{"key": {}}`);
|
|
24
|
-
SiteInfoZod.parse(lol);
|
package/tsconfig.json
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
-
|
|
5
|
-
/* Projects */
|
|
6
|
-
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
7
|
-
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
-
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
9
|
-
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
10
|
-
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
-
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
-
|
|
13
|
-
/* Language and Environment */
|
|
14
|
-
"target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
15
|
-
"lib": ["es2022", "dom", "dom.iterable"],
|
|
16
|
-
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
|
-
// "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
18
|
-
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
19
|
-
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
20
|
-
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
21
|
-
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
22
|
-
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
23
|
-
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
24
|
-
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
25
|
-
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
26
|
-
|
|
27
|
-
/* Modules */
|
|
28
|
-
"module": "commonjs", /* Specify what module code is generated. */
|
|
29
|
-
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
30
|
-
// "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
31
|
-
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
32
|
-
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
33
|
-
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
34
|
-
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
35
|
-
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
36
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
37
|
-
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
38
|
-
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
|
39
|
-
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
|
40
|
-
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
|
41
|
-
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
42
|
-
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
43
|
-
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
44
|
-
|
|
45
|
-
/* JavaScript Support */
|
|
46
|
-
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
47
|
-
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
48
|
-
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
49
|
-
|
|
50
|
-
/* Emit */
|
|
51
|
-
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
52
|
-
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
53
|
-
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
54
|
-
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
55
|
-
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
56
|
-
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
57
|
-
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
|
58
|
-
// "removeComments": true, /* Disable emitting comments. */
|
|
59
|
-
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
60
|
-
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
61
|
-
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
|
62
|
-
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
63
|
-
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
64
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
65
|
-
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
66
|
-
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
67
|
-
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
68
|
-
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
69
|
-
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
70
|
-
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
71
|
-
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
72
|
-
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
73
|
-
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
74
|
-
|
|
75
|
-
/* Interop Constraints */
|
|
76
|
-
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
77
|
-
// "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
|
|
78
|
-
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
79
|
-
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
80
|
-
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
81
|
-
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
82
|
-
|
|
83
|
-
/* Type Checking */
|
|
84
|
-
"strict": true, /* Enable all strict type-checking options. */
|
|
85
|
-
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
86
|
-
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
87
|
-
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
88
|
-
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
89
|
-
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
90
|
-
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
91
|
-
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
92
|
-
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
93
|
-
"noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
94
|
-
"noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
95
|
-
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
96
|
-
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
97
|
-
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
98
|
-
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
99
|
-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
100
|
-
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
101
|
-
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
102
|
-
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
103
|
-
|
|
104
|
-
/* Completeness */
|
|
105
|
-
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
106
|
-
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
107
|
-
}
|
|
108
|
-
}
|