@bobfrankston/miscassists 1.0.24 → 1.0.26
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/README.md +21 -0
- package/index.js +6 -1
- package/index.js.map +1 -1
- package/package.json +13 -5
- package/ports.js +1 -0
- package/ports.js.map +1 -1
- package/.vscode/launch.json +0 -18
- package/.vscode/settings.json +0 -23
- package/.vscode/tasks.json +0 -23
- package/checkaddress.ts +0 -158
- package/dnsassist.ts +0 -113
- package/index.ts +0 -21
- package/jserve.ts +0 -25
- package/maker.ts +0 -14
- package/ports.ts +0 -102
- package/tsconfig.json +0 -109
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# @bobfrankston/miscassists
|
|
2
|
+
|
|
3
|
+
<!-- Reminder: See c:\users\bob\onedrive\documents\ai\programming.md -->
|
|
4
|
+
|
|
5
|
+
Miscellaneous Node.js utilities including DNS helpers, port definitions, and server utilities.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @bobfrankston/miscassists
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
import { resolve4, isLocalIP, ports, jprivs, values} from '@bobfrankston/miscassists';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## License
|
|
20
|
+
|
|
21
|
+
ISC
|
package/index.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { resolve4, resolveLocal4, isLocalIP, isThisMachine, default_fqdn } from './dnsassist.js';
|
|
2
2
|
import { ports, mqtt } from './ports.js';
|
|
3
3
|
import { jprivs } from './jserve.js';
|
|
4
|
+
// Misc values
|
|
5
|
+
export const values = {
|
|
6
|
+
exitRunit: 99
|
|
7
|
+
};
|
|
4
8
|
export { resolve4, resolveLocal4, isLocalIP, isThisMachine, default_fqdn, ports, mqtt, jprivs };
|
|
5
9
|
export default {
|
|
6
10
|
resolve4,
|
|
@@ -10,6 +14,7 @@ export default {
|
|
|
10
14
|
default_fqdn,
|
|
11
15
|
ports,
|
|
12
16
|
mqtt,
|
|
13
|
-
jprivs
|
|
17
|
+
jprivs,
|
|
18
|
+
values
|
|
14
19
|
};
|
|
15
20
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAChG,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAExC,OAAO,EAAuB,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,EACH,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAC/D,KAAK,EAAE,IAAI,EAAE,MAAM,EACtB,CAAC;AAGF,eAAe;IACX,QAAQ;IACR,aAAa;IACb,SAAS;IACT,aAAa;IACb,YAAY;IACZ,KAAK;IACL,IAAI;IACJ,MAAM;CACT,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAChG,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAExC,OAAO,EAAuB,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1D,cAAc;AAEd,MAAM,CAAC,MAAM,MAAM,GAAG;IAClB,SAAS,EAAE,EAAE;CAChB,CAAA;AAED,OAAO,EACH,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAC/D,KAAK,EAAE,IAAI,EAAE,MAAM,EACtB,CAAC;AAGF,eAAe;IACX,QAAQ;IACR,aAAa;IACb,SAAS;IACT,aAAa;IACb,YAAY;IACZ,KAAK;IACL,IAAI;IACJ,MAAM;IACN,MAAM;CACT,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobfrankston/miscassists",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.0.26",
|
|
4
|
+
"description": "Miscellaneous Node.js utilities",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "main.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
+
"preversion": "git add -A && git commit -m \"Pre-release commit\" --allow-empty",
|
|
10
|
+
"release": "git add -A && git commit -m \"Pre-release commit\" --allow-empty && npm version patch && git push && git push --tags && npm publish"
|
|
9
11
|
},
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"misc",
|
|
17
|
+
"constants"
|
|
18
|
+
],
|
|
19
|
+
"author": "Bob Frankston",
|
|
12
20
|
"license": "ISC",
|
|
13
21
|
"type": "module",
|
|
14
22
|
"dependencies": {
|
package/ports.js
CHANGED
package/ports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ports.js","sourceRoot":"","sources":["ports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB,OAAO,EAAG,KAAK;IACf,QAAQ,EAAE,KAAK,EAAS,mDAAmD;IAE3E,SAAS,EAAE,IAAI,EAAS,+BAA+B;IACvD,QAAQ,EAAE,IAAI,EAAU,sCAAsC;IAE9D,OAAO,EAAE,IAAI,EAAW,+CAA+C;IACvE,QAAQ,EAAE,IAAI,EAAU,oDAAoD;IAE5E,OAAO,EAAE,IAAI,EAAW,oDAAoD;IAC5E,OAAO,EAAE,IAAI,EAAW,8CAA8C;IACtE,QAAQ,EAAE,IAAI,EAAU,uCAAuC;IAE/D,IAAI,EAAE,IAAI,EAAc,0CAA0C;IAClE,KAAK,EAAE,IAAI,EAAa,GAAG;IAE3B,MAAM,EAAE,IAAI,EAAY,2BAA2B;IACnD,OAAO,EAAE,IAAI;IAEb,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI,EAAW,UAAU;IAElC,SAAS,EAAE,IAAI,EAAS,mDAAmD;IAE3E,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IAEf,KAAK,EAAE,IAAI,EAAa,sGAAsG;IAE9H,QAAQ,EAAE,IAAI,EAAU,uEAAuE;IAC/F,QAAQ,EAAE,IAAI;IAEd,MAAM,EAAE,IAAI,EAAY,mEAAmE;IAE3F,MAAM,EAAE,IAAI,EAAY,eAAe;IACvC,MAAM,EAAE,IAAI,EAAY,wBAAwB;IAChD,SAAS,EAAE,IAAI;IAEf,GAAG,EAAE,IAAI,EAAe,0BAA0B;IAClD,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;IAEf,MAAM,EAAE,IAAI;IAEZ,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,IAAI;IAEX,SAAS,EAAE,IAAI,EAAS,qCAAqC;IAC7D,OAAO,EAAE,IAAI;IACW,0BAA0B;IAClD,OAAO,EAAE,IAAI,EAAW,kCAAkC;IAE1D,SAAS,EAAE,IAAI,EAAS,qCAAqC;
|
|
1
|
+
{"version":3,"file":"ports.js","sourceRoot":"","sources":["ports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB,OAAO,EAAG,KAAK;IACf,QAAQ,EAAE,KAAK,EAAS,mDAAmD;IAE3E,SAAS,EAAE,IAAI,EAAS,+BAA+B;IACvD,QAAQ,EAAE,IAAI,EAAU,sCAAsC;IAE9D,OAAO,EAAE,IAAI,EAAW,+CAA+C;IACvE,QAAQ,EAAE,IAAI,EAAU,oDAAoD;IAE5E,OAAO,EAAE,IAAI,EAAW,oDAAoD;IAC5E,OAAO,EAAE,IAAI,EAAW,8CAA8C;IACtE,QAAQ,EAAE,IAAI,EAAU,uCAAuC;IAE/D,IAAI,EAAE,IAAI,EAAc,0CAA0C;IAClE,KAAK,EAAE,IAAI,EAAa,GAAG;IAE3B,MAAM,EAAE,IAAI,EAAY,2BAA2B;IACnD,OAAO,EAAE,IAAI;IAEb,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI,EAAW,UAAU;IAElC,SAAS,EAAE,IAAI,EAAS,mDAAmD;IAE3E,QAAQ,EAAE,IAAI;IACd,SAAS,EAAE,IAAI;IAEf,KAAK,EAAE,IAAI,EAAa,sGAAsG;IAE9H,QAAQ,EAAE,IAAI,EAAU,uEAAuE;IAC/F,QAAQ,EAAE,IAAI;IAEd,MAAM,EAAE,IAAI,EAAY,mEAAmE;IAE3F,MAAM,EAAE,IAAI,EAAY,eAAe;IACvC,MAAM,EAAE,IAAI,EAAY,wBAAwB;IAChD,SAAS,EAAE,IAAI;IAEf,GAAG,EAAE,IAAI,EAAe,0BAA0B;IAClD,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;IAEf,MAAM,EAAE,IAAI;IAEZ,MAAM,EAAE,IAAI;IACZ,KAAK,EAAE,IAAI;IAEX,SAAS,EAAE,IAAI,EAAS,qCAAqC;IAC7D,OAAO,EAAE,IAAI;IACW,0BAA0B;IAClD,OAAO,EAAE,IAAI,EAAW,kCAAkC;IAE1D,SAAS,EAAE,IAAI,EAAS,qCAAqC;IAE7D,MAAM,EAAE,IAAI;CACf,CAAA;AAED,MAAM,QAAQ,GAAG,MAAM,CAAC;AACxB,MAAM,QAAQ,GAAG,IAAI,CAAC;AAEtB,MAAM,CAAC,MAAM,IAAI,GAAG;IAChB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE;QACH,GAAG,EAAE,KAAK;QACV,SAAS,EAAE;YACP,OAAO,EAAE,SAAS;SACrB;QACD,MAAM,EAAE;YACJ,GAAG,EAAE,KAAK;YACV,GAAG,EAAE,QAAQ;SAChB;KACJ;IACD,GAAG,EAAE,UAAU,QAAQ,IAAI,YAAY,IAAI,QAAQ,EAAE;CACxD,CAAA;AAED,iEAAiE;AACjE,2CAA2C;AAC3C,+DAA+D;AAC/D,uEAAuE;AACvE,4DAA4D;AAC5D,4CAA4C;AAC5C,2DAA2D;AAC3D,uCAAuC;AACvC,qDAAqD;AACrD,oDAAoD;AACpD,2DAA2D;AAC3D,6CAA6C;AAC7C,sCAAsC;AACtC,wDAAwD;AACxD,oDAAoD;AACpD,6DAA6D;AAC7D,uCAAuC;AACvC,yCAAyC;AACzC,uCAAuC;AACvC,8CAA8C;AAC9C,gDAAgD;AAChD,EAAE"}
|
package/.vscode/launch.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Use IntelliSense to learn about possible attributes.
|
|
3
|
-
// Hover to view descriptions of existing attributes.
|
|
4
|
-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
-
"version": "0.2.0",
|
|
6
|
-
"configurations": [
|
|
7
|
-
{
|
|
8
|
-
"type": "node",
|
|
9
|
-
"request": "launch",
|
|
10
|
-
"name": "Launch Program",
|
|
11
|
-
"program": "${workspaceFolder}/index.js",
|
|
12
|
-
"skipFiles": [ "<node_internals>/**" ],
|
|
13
|
-
"outFiles": [
|
|
14
|
-
"${workspaceFolder}/**/*.js"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
}
|
package/.vscode/settings.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"workbench.colorTheme": "Visual Studio 2019 Dark",
|
|
3
|
-
"workbench.colorCustomizations": {
|
|
4
|
-
"activityBar.activeBackground": "#77a8ff",
|
|
5
|
-
"activityBar.background": "#77a8ff",
|
|
6
|
-
"activityBar.foreground": "#15202b",
|
|
7
|
-
"activityBar.inactiveForeground": "#15202b99",
|
|
8
|
-
"activityBarBadge.background": "#df0050",
|
|
9
|
-
"activityBarBadge.foreground": "#e7e7e7",
|
|
10
|
-
"commandCenter.border": "#15202b99",
|
|
11
|
-
"sash.hoverBorder": "#77a8ff",
|
|
12
|
-
"statusBar.background": "#4488ff",
|
|
13
|
-
"statusBar.foreground": "#15202b",
|
|
14
|
-
"statusBarItem.hoverBackground": "#1168ff",
|
|
15
|
-
"statusBarItem.remoteBackground": "#4488ff",
|
|
16
|
-
"statusBarItem.remoteForeground": "#15202b",
|
|
17
|
-
"titleBar.activeBackground": "#4488ff",
|
|
18
|
-
"titleBar.activeForeground": "#15202b",
|
|
19
|
-
"titleBar.inactiveBackground": "#4488ff99",
|
|
20
|
-
"titleBar.inactiveForeground": "#15202b99"
|
|
21
|
-
},
|
|
22
|
-
"peacock.color": "4488ff"
|
|
23
|
-
}
|
package/.vscode/tasks.json
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Template 1.0 y:\x\bin\MakeCodeTemplates\vscode\
|
|
3
|
-
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
|
4
|
-
// for the documentation about the tasks.json format
|
|
5
|
-
"version": "2.0.0",
|
|
6
|
-
"tasks": [
|
|
7
|
-
{
|
|
8
|
-
"type": "typescript",
|
|
9
|
-
"tsconfig": "tsconfig.json",
|
|
10
|
-
"option": "watch",
|
|
11
|
-
"runOptions": {
|
|
12
|
-
"runOn": "folderOpen"
|
|
13
|
-
},
|
|
14
|
-
"problemMatcher": [
|
|
15
|
-
"$tsc-watch"
|
|
16
|
-
],
|
|
17
|
-
"group": {
|
|
18
|
-
"kind": "build",
|
|
19
|
-
"isDefault": true
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
package/checkaddress.ts
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
// From y:\dev\homecontrol\Others\LifX\Apps\lzlan\lants-address.ts
|
|
2
|
-
|
|
3
|
-
// import { isIPv6 } from 'net';
|
|
4
|
-
import os, { networkInterfaces } from 'os';
|
|
5
|
-
|
|
6
|
-
// Quck hack - using namespace to hid this until we debug and integrate it for v6 support
|
|
7
|
-
// namespace hidden {
|
|
8
|
-
// type netinfo = os.NetworkInterfaceInfo & { ints: { address: number, mask: number } }
|
|
9
|
-
|
|
10
|
-
// const NetworkInterfaces: netinfo[] = []; // Need to fix this signature
|
|
11
|
-
|
|
12
|
-
// export function assureNetworkInterfaces() {
|
|
13
|
-
// // Note we don't detect changes to the interfaces
|
|
14
|
-
// if (networkInterfaces.length > 0) return;
|
|
15
|
-
|
|
16
|
-
// const netifs = os.networkInterfaces();
|
|
17
|
-
// for (const dev in netifs) {
|
|
18
|
-
// netifs[dev].forEach((info) => {
|
|
19
|
-
|
|
20
|
-
// let family = info.family;
|
|
21
|
-
|
|
22
|
-
// if (typeof family == "number")
|
|
23
|
-
// family = `IPv${family}`; // Strange change work-around
|
|
24
|
-
|
|
25
|
-
// if (family !== 'IPv4' || info.internal === true) {
|
|
26
|
-
// return;
|
|
27
|
-
// }
|
|
28
|
-
// // let info4 = info as os.NetworkInterfaceInfoIPv4;
|
|
29
|
-
// // (<any>info)['broadcast'] = _getBroadcastAddress(info4);
|
|
30
|
-
|
|
31
|
-
// const mask = ipToUnsignedInt(info.netmask);
|
|
32
|
-
// const address = ipToUnsignedInt(info.address) & mask;
|
|
33
|
-
// const ni = { ...info, ints: { mask, address } };
|
|
34
|
-
// NetworkInterfaces.push(ni);
|
|
35
|
-
// })
|
|
36
|
-
// }
|
|
37
|
-
// return NetworkInterfaces;
|
|
38
|
-
// };
|
|
39
|
-
|
|
40
|
-
// export function isLocalIp4Address(ip4Address: string) {
|
|
41
|
-
// if (ip4Address == '127.0.0.1')
|
|
42
|
-
// return true;
|
|
43
|
-
// const ipa = ipToUnsignedInt(ip4Address);
|
|
44
|
-
// assureNetworkInterfaces();
|
|
45
|
-
// return NetworkInterfaces.some((ni) => (ni.ints.address & ni.ints.mask) === (ipa & ni.ints.mask));
|
|
46
|
-
// }
|
|
47
|
-
|
|
48
|
-
// function ipToUnsignedInt(ipAddress: string): number {
|
|
49
|
-
// const parts = ipAddress.split('.');
|
|
50
|
-
// if (parts.length !== 4) {
|
|
51
|
-
// throw new Error('Invalid IP address format');
|
|
52
|
-
// }
|
|
53
|
-
|
|
54
|
-
// const num = parts.map((part) => parseInt(part, 10));
|
|
55
|
-
// if (num.some((part) => isNaN(part) || part < 0 || part > 255)) {
|
|
56
|
-
// throw new Error(`Invalid IP address ${ipAddress}`);
|
|
57
|
-
// }
|
|
58
|
-
|
|
59
|
-
// const signed = (num[0] << 24) + (num[1] << 16) + (num[2] << 8) + num[3];
|
|
60
|
-
// const unsigned = signed >>> 0;
|
|
61
|
-
// return unsigned;
|
|
62
|
-
// }
|
|
63
|
-
|
|
64
|
-
// let pretendRemote = false;
|
|
65
|
-
|
|
66
|
-
// export function isLocalIpAddress(ipAddress: string) {
|
|
67
|
-
// // '::ffff:172.20.3.39'
|
|
68
|
-
// if (pretendRemote) return false;
|
|
69
|
-
// ipAddress = ipAddress.toLowerCase(); // Safety
|
|
70
|
-
// if (ipAddress.startsWith('fe80:'))
|
|
71
|
-
// return true; // Link local
|
|
72
|
-
// if (ipAddress == "::1")
|
|
73
|
-
// return true;
|
|
74
|
-
// ipAddress = ipAddress.replace(/^::ffff:/, ''); // If it's like V5
|
|
75
|
-
|
|
76
|
-
// if (/^[0-9.]+$/.test(ipAddress))
|
|
77
|
-
// return isLocalIp4Address(ipAddress)
|
|
78
|
-
// return isIPv6LocalAddress(ipAddress);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
// // const localIps = getLocalAddresses();
|
|
82
|
-
|
|
83
|
-
// // for (const localIp of localIps) {
|
|
84
|
-
// // const range = new AddressInfo(localIp);
|
|
85
|
-
|
|
86
|
-
// // if (range.family === 'IPv4' && net.isIPv4(ipAddress)) {
|
|
87
|
-
// // if (range.address === ipAddress) {
|
|
88
|
-
// // return true;
|
|
89
|
-
// // }
|
|
90
|
-
// // } else if (range.family === 'IPv6' && net.isIPv6(ipAddress)) {
|
|
91
|
-
// // if (range.address === ipAddress) {
|
|
92
|
-
// // return true;
|
|
93
|
-
// // }
|
|
94
|
-
// // }
|
|
95
|
-
// // }
|
|
96
|
-
|
|
97
|
-
// return false;
|
|
98
|
-
// }
|
|
99
|
-
|
|
100
|
-
// // function isIPv6LocalAddress(ipv6Address: string): boolean {
|
|
101
|
-
// // const interfaces = networkInterfaces();
|
|
102
|
-
// // for (const interfaceName of Object.keys(interfaces)) {
|
|
103
|
-
// // const addresses = interfaces[interfaceName].filter(
|
|
104
|
-
// // (iface) => iface.family === 'IPv6'
|
|
105
|
-
// // );
|
|
106
|
-
// // for (const iface of addresses) {
|
|
107
|
-
// // if (iface.address === ipv6Address) {
|
|
108
|
-
// // return true;
|
|
109
|
-
// // }
|
|
110
|
-
// // }
|
|
111
|
-
// // }
|
|
112
|
-
// // return false;
|
|
113
|
-
// // }
|
|
114
|
-
|
|
115
|
-
// function isIPv6LocalAddress(ipv6Address: string): boolean {
|
|
116
|
-
// const interfaces = networkInterfaces();
|
|
117
|
-
// for (const interfaceName of Object.keys(interfaces)) {
|
|
118
|
-
// const addresses = interfaces[interfaceName].filter((iface) => iface.family === 'IPv6');
|
|
119
|
-
// for (const iface of addresses) {
|
|
120
|
-
// if (iface.cidr) {
|
|
121
|
-
// const [ifaceAddress, networkMask] = iface.cidr.split('/');
|
|
122
|
-
// if (isSameNetwork(ipv6Address, networkMask, ifaceAddress)) {
|
|
123
|
-
// return true;
|
|
124
|
-
// }
|
|
125
|
-
// }
|
|
126
|
-
// }
|
|
127
|
-
// }
|
|
128
|
-
// return false;
|
|
129
|
-
// }
|
|
130
|
-
|
|
131
|
-
// function isSameNetwork(ipv6Address: string, networkMaskLength: string, ifaceAddress: string): boolean {
|
|
132
|
-
// const maskLength = parseInt(networkMaskLength, 10);
|
|
133
|
-
// const bufferLength = Math.ceil(maskLength / 8);
|
|
134
|
-
// const addressBuffer = Buffer.from(ipv6Address.split(':').map((part) => parseInt(part, 16)));
|
|
135
|
-
// const ifaceBuffer = Buffer.from(ifaceAddress.split(':').map((part) => parseInt(part, 16)));
|
|
136
|
-
|
|
137
|
-
// for (let i = 0; i < bufferLength; i++) {
|
|
138
|
-
// const maskBits = Math.min(maskLength - i * 8, 8);
|
|
139
|
-
// const mask = (0xff00 >> maskBits) & 0xff;
|
|
140
|
-
// if ((addressBuffer[i] & mask) !== ifaceBuffer[i]) {
|
|
141
|
-
// return false;
|
|
142
|
-
// }
|
|
143
|
-
// }
|
|
144
|
-
// return true;
|
|
145
|
-
// }
|
|
146
|
-
|
|
147
|
-
// // Example usage
|
|
148
|
-
// // const ipv6AddressToCheck = 'fdb7:3df3:9615:193e:3743:1a24:69e8:127a';
|
|
149
|
-
// // const isLocalAddress = isIPv6LocalAddress(ipv6AddressToCheck);
|
|
150
|
-
// // console.log(`Is IPv6 Address ${ipv6AddressToCheck} on the same local network? ${isLocalAddress}`);
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
// // // Example usage
|
|
154
|
-
// // const ipv6AddressToCheck = 'fdb7:3df3:9615:193e:3743:1a24:69e8:127a';
|
|
155
|
-
// // const networkMask = 'ffff:ffff:ffff:ffff::'; // Replace with the actual subnet mask
|
|
156
|
-
// // const isLocalAddress = isIPv6LocalAddress(ipv6AddressToCheck, networkMask);
|
|
157
|
-
// // console.log(`Is IPv6 Address ${ipv6AddressToCheck} on the same local network? ${isLocalAddress}`);
|
|
158
|
-
// }
|
package/dnsassist.ts
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import dns from 'dns';
|
|
2
|
-
import os from 'os'
|
|
3
|
-
|
|
4
|
-
/***
|
|
5
|
-
* return IPv4 address giving local addresses priority
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export const default_fqdn = 'aaz.lt'; // For now
|
|
9
|
-
|
|
10
|
-
export async function resolve4(name: string, local?: boolean): Promise<string> {
|
|
11
|
-
if (!name?.includes('.')) name += '.' + default_fqdn; // FQDN Hack
|
|
12
|
-
|
|
13
|
-
return new Promise((resolve, reject) => dns.resolve4(name,
|
|
14
|
-
(err: any, ips) => {
|
|
15
|
-
if (err)
|
|
16
|
-
return resolve(null);
|
|
17
|
-
|
|
18
|
-
const locals = ips.filter(ip => isLocalIP(ip));
|
|
19
|
-
if (locals.length > 0)
|
|
20
|
-
return resolve(locals[0]);
|
|
21
|
-
if (local)
|
|
22
|
-
return resolve(null);
|
|
23
|
-
|
|
24
|
-
resolve(ips[0]);
|
|
25
|
-
}
|
|
26
|
-
));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export async function resolveLocal4(name: string): Promise<string> {
|
|
30
|
-
return await resolve4(name, true);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// #region Local IP address
|
|
34
|
-
|
|
35
|
-
interface localIPAndMask { ipn: number, mask: number, s: { ip: string, mask: string } };
|
|
36
|
-
export let localIPAndMasks: localIPAndMask[] = null;
|
|
37
|
-
|
|
38
|
-
function ipv4ToInt(ip: string): number {
|
|
39
|
-
ip = ip.replace('::ffff:', ''); // Convert IPv4-mapped IPv6 addresses to their IPv4 representation
|
|
40
|
-
const octets = ip.split(".").map(o => parseInt(o));
|
|
41
|
-
// let z8 = octets.reduce((acc, octet) => (acc << 8) + octet);
|
|
42
|
-
let x8 = arrayToUint32(octets.reverse());
|
|
43
|
-
return x8;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function arrayToUint32(arr: number[]): number {
|
|
47
|
-
const uint8Arr = Uint8Array.from(arr);
|
|
48
|
-
const uint32Arr = new Uint32Array(uint8Arr.buffer);
|
|
49
|
-
return uint32Arr[0];
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function assureLocalV4Address() {
|
|
53
|
-
// 2023-12-18 removed caching so we can change it on the fly
|
|
54
|
-
// if (localIPAndMasks)
|
|
55
|
-
// return localIPAndMasks;
|
|
56
|
-
localIPAndMasks = [];
|
|
57
|
-
const interfaces = os.networkInterfaces();
|
|
58
|
-
|
|
59
|
-
for (const name of Object.keys(interfaces)) {
|
|
60
|
-
for (const netinterface of interfaces[name]) {
|
|
61
|
-
if (netinterface.family !== 'IPv4') continue;
|
|
62
|
-
if (netinterface.internal) continue;
|
|
63
|
-
const mask = ipv4ToInt(netinterface.netmask);
|
|
64
|
-
const ipn = ipv4ToInt(netinterface.address) & mask;
|
|
65
|
-
localIPAndMasks.push({ ipn, mask, s: { ip: netinterface.address, mask: netinterface.netmask } });
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return localIPAndMasks;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export function isLocalIP(ip: string) {
|
|
72
|
-
if (isThisMachine(ip))
|
|
73
|
-
return true; // It handles special cases better
|
|
74
|
-
const ipn = ipv4ToInt(ip);
|
|
75
|
-
for (var ipm of assureLocalV4Address()) {
|
|
76
|
-
if ((ipn & ipm.mask) === ipm.ipn) return true;
|
|
77
|
-
}
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// // Function to get all IP addresses of the local machine, both IPv4 and IPv6
|
|
82
|
-
// const getLocalIPs = (): string[] => {
|
|
83
|
-
// const interfaces = os.networkInterfaces();
|
|
84
|
-
// const ips: string[] = [];
|
|
85
|
-
|
|
86
|
-
// for (const interfaceName in interfaces) {
|
|
87
|
-
// const iface = interfaces[interfaceName];
|
|
88
|
-
// if (iface) {P
|
|
89
|
-
// for (const alias of iface) {
|
|
90
|
-
// if ((alias.family === 'IPv4' || alias.family === 'IPv6') && !alias.internal) {
|
|
91
|
-
// // Store IPv4 addresses directly and IPv6 addresses in their full representation
|
|
92
|
-
// ips.push(alias.family === 'IPv4' ? alias.address : `::ffff:${alias.address}`);
|
|
93
|
-
// }
|
|
94
|
-
// }
|
|
95
|
-
// }
|
|
96
|
-
// }
|
|
97
|
-
|
|
98
|
-
// return ips;
|
|
99
|
-
// };
|
|
100
|
-
|
|
101
|
-
// Function to check if the IP address is from this machine
|
|
102
|
-
export function isThisMachine(ip: string) {
|
|
103
|
-
// Convert IPv4-mapped IPv6 addresses to their IPv4 representation
|
|
104
|
-
ip = ip.replace('::ffff:', '');
|
|
105
|
-
|
|
106
|
-
// Handling the case where IP is ::1 (localhost in IPv6)
|
|
107
|
-
if (ip === '::1' || ip == '127.0.0.1') {
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const localIPs = assureLocalV4Address().map(ipm => ipm.s.ip);
|
|
112
|
-
return localIPs.includes(ip);
|
|
113
|
-
};
|
package/index.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { resolve4, resolveLocal4, isLocalIP, isThisMachine, default_fqdn } from './dnsassist.js'
|
|
2
|
-
import { ports, mqtt } from './ports.js'
|
|
3
|
-
import { makerPayload } from './maker.js';
|
|
4
|
-
import { jSubSiteInfo, jpriv, jprivs } from './jserve.js';
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
resolve4, resolveLocal4, isLocalIP, isThisMachine, default_fqdn,
|
|
8
|
-
ports, mqtt, jprivs
|
|
9
|
-
};
|
|
10
|
-
export type { makerPayload, jSubSiteInfo, jpriv };
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
resolve4,
|
|
14
|
-
resolveLocal4,
|
|
15
|
-
isLocalIP,
|
|
16
|
-
isThisMachine,
|
|
17
|
-
default_fqdn,
|
|
18
|
-
ports,
|
|
19
|
-
mqtt,
|
|
20
|
-
jprivs
|
|
21
|
-
}
|
package/jserve.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Support for connecting with jserve
|
|
2
|
-
|
|
3
|
-
// This can be passed via the default value or, better, via the JExport
|
|
4
|
-
|
|
5
|
-
// Note that a client entry is
|
|
6
|
-
// name or pfx:name so you can say "ui:useful"
|
|
7
|
-
// * means deafult so you can /subpapp rather than /subapp/name
|
|
8
|
-
|
|
9
|
-
export const jprivs = [
|
|
10
|
-
"admin", // Uber privilege
|
|
11
|
-
"user", // Normal user
|
|
12
|
-
"guest", // Low privilege guest
|
|
13
|
-
"home", // Home control
|
|
14
|
-
"bbs"]; // bbs (bbt) app
|
|
15
|
-
export type jpriv = typeof jprivs[number];
|
|
16
|
-
|
|
17
|
-
// export type jpriv = "admin" | "user" | "guest";
|
|
18
|
-
|
|
19
|
-
export interface jSubSiteInfo {
|
|
20
|
-
app: object; // Express -- so we don't nee the Express definition in miscassists
|
|
21
|
-
AppInit?: () => Promise<void>
|
|
22
|
-
subClients?: string[]; // Dirname or path to html file
|
|
23
|
-
privs?: jpriv[];
|
|
24
|
-
localLogin?: boolean; // If true, use local login. Allow remember?
|
|
25
|
-
}
|
package/maker.ts
DELETED
package/ports.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { default_fqdn } from "./dnsassist.js";
|
|
2
|
-
|
|
3
|
-
export const ports = {
|
|
4
|
-
jserve2: 10080,
|
|
5
|
-
jserve2s: 10443, // For now, we use the same port for http and https
|
|
6
|
-
|
|
7
|
-
devlisten: 9070, // Hubitat MakerAPI http server
|
|
8
|
-
halisten: 9071, // Home Assistant MakerAPI http server
|
|
9
|
-
|
|
10
|
-
rmfsite: 9081, // These will be phased out for the new version
|
|
11
|
-
rmfsites: 9082, // used to be for SSL but now any port is ssl or not
|
|
12
|
-
|
|
13
|
-
rmfprod: 9081, // Secondary port for production version (debugging)
|
|
14
|
-
rmfbeta: 9082, // Secondary port for beta version (debugging)
|
|
15
|
-
rmfalpha: 9083, // Secondary port for the alpha version
|
|
16
|
-
|
|
17
|
-
shim: 9084, // Warming -- these are current forwarded!
|
|
18
|
-
shims: 9085, //
|
|
19
|
-
|
|
20
|
-
jvport: 9180, // These are copied in hlib
|
|
21
|
-
jvports: 9143,
|
|
22
|
-
|
|
23
|
-
sqltcp: 9098,
|
|
24
|
-
sqldbg: 9096,
|
|
25
|
-
sqlhttp: 9099, // For now
|
|
26
|
-
|
|
27
|
-
sqlproxy2: 9097, // Replace sqlproxy and share a port for http/https
|
|
28
|
-
|
|
29
|
-
sqlproxy: 9080,
|
|
30
|
-
sqlproxys: 9043,
|
|
31
|
-
|
|
32
|
-
pinst: 9299, // Used for my pings server [currently it has a local value because --install-links isn't cooperating]
|
|
33
|
-
|
|
34
|
-
mlplanel: 9300, // Note: This must jibe with mlpanel since we copy it to another system
|
|
35
|
-
mlpanels: 9301,
|
|
36
|
-
|
|
37
|
-
wizzer: 9310, // Work in progress Wiz control. Internal only so not https for now
|
|
38
|
-
|
|
39
|
-
pserve: 9311, // Photo server
|
|
40
|
-
vserve: 9312, // Video server from IIS
|
|
41
|
-
checkmake: 9313,
|
|
42
|
-
|
|
43
|
-
bbt: 9314, // Bulletin board test
|
|
44
|
-
backts: 9315,
|
|
45
|
-
backserve: 9316,
|
|
46
|
-
|
|
47
|
-
syncer: 9317,
|
|
48
|
-
|
|
49
|
-
lifxer: 9318,
|
|
50
|
-
itemw: 9319,
|
|
51
|
-
|
|
52
|
-
stephanie: 9320, // For testing stephanie site locally
|
|
53
|
-
asyncer: 9321,
|
|
54
|
-
// 9322 is used by Windows
|
|
55
|
-
psyncer: 9324, // Used for the powershell version
|
|
56
|
-
|
|
57
|
-
rmfAlpha2: 9325, // So we can try alternative clients.
|
|
58
|
-
|
|
59
|
-
carder: 9326
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const mqttHost = "pi4c";
|
|
63
|
-
const mqttPort = 1883;
|
|
64
|
-
|
|
65
|
-
export const mqtt = {
|
|
66
|
-
host: mqttHost,
|
|
67
|
-
port: mqttPort,
|
|
68
|
-
topic: { // Default for our own use
|
|
69
|
-
rmf: "rmf",
|
|
70
|
-
subtopics: {
|
|
71
|
-
restart: "restart",
|
|
72
|
-
},
|
|
73
|
-
devqtt: {
|
|
74
|
-
top: "rmf",
|
|
75
|
-
sub: "devqtt"
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
URL: `mstt://${mqttHost}.${default_fqdn}:${mqttPort}`
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// <port port="9070" name="Listen for Hubitat (experimental)" />
|
|
82
|
-
// <port port="9080" name="birdbox1:80" />
|
|
83
|
-
// <port port="9081" name="Home port for home.rmf.vc et al" />
|
|
84
|
-
// <port port="9082" name="Home port for home.rmf.vc et al for SSL" />
|
|
85
|
-
// <port port="9083" name="Web Sockets for home control" />
|
|
86
|
-
// <port port="9084" name="Insteon Shim" />
|
|
87
|
-
// <port port="9085" name="Insteon Shim SSL (reserved)" />
|
|
88
|
-
// <port port="9086" name="shimmer" />
|
|
89
|
-
// <port port="9087" name="shimmer SSL (not yet)" />
|
|
90
|
-
// <port port="9088" name="TCP For NodeSQLAssit" />
|
|
91
|
-
// <port port="9089" name="TCP Shelly Listener (HTLog)" />
|
|
92
|
-
// <port port="9389" name="Birdbox1:3389" />
|
|
93
|
-
// <port port="9920" name="HC XML" />
|
|
94
|
-
// <!-- <port port="9994" name="HC TCP Listener" /> -->
|
|
95
|
-
// <port port="9800-9899" name="HC TCP Listener" />
|
|
96
|
-
// <!-- <port port="9960-9969" name="HC TCP Listener" /> -->
|
|
97
|
-
// <port port="9995" name="HC xcmd" />
|
|
98
|
-
// <port port="9996" name="HC Manual" />
|
|
99
|
-
// <port port="9997" name="HC HTTP" />
|
|
100
|
-
// <port port="9970-9979" name="HC Telnet" />
|
|
101
|
-
// <port port="9901" name="Lightify Client1" />
|
|
102
|
-
//
|
package/tsconfig.json
DELETED
|
@@ -1,109 +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": "esnext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
15
|
-
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
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": "esnext", /* Specify what module code is generated. */
|
|
29
|
-
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
30
|
-
"moduleResolution": "node", /* 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
|
-
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
|
39
|
-
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
|
40
|
-
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
|
41
|
-
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
|
42
|
-
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
43
|
-
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
44
|
-
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
45
|
-
|
|
46
|
-
/* JavaScript Support */
|
|
47
|
-
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
48
|
-
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
49
|
-
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
50
|
-
|
|
51
|
-
/* Emit */
|
|
52
|
-
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
53
|
-
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
54
|
-
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
55
|
-
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
56
|
-
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
57
|
-
// "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. */
|
|
58
|
-
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
|
59
|
-
// "removeComments": true, /* Disable emitting comments. */
|
|
60
|
-
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
61
|
-
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
62
|
-
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
|
63
|
-
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
64
|
-
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
65
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
66
|
-
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
67
|
-
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
68
|
-
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
69
|
-
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
70
|
-
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
71
|
-
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
72
|
-
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
73
|
-
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
74
|
-
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
75
|
-
|
|
76
|
-
/* Interop Constraints */
|
|
77
|
-
"isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
78
|
-
// "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. */
|
|
79
|
-
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
80
|
-
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
81
|
-
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
82
|
-
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
83
|
-
|
|
84
|
-
/* Type Checking */
|
|
85
|
-
"strict": true, /* Enable all strict type-checking options. */
|
|
86
|
-
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
87
|
-
"strictNullChecks": false, /* When type checking, take into account 'null' and 'undefined'. */
|
|
88
|
-
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
89
|
-
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
90
|
-
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
91
|
-
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
92
|
-
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
93
|
-
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
94
|
-
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
95
|
-
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
96
|
-
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
97
|
-
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
98
|
-
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
99
|
-
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
100
|
-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
101
|
-
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
102
|
-
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
103
|
-
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
104
|
-
|
|
105
|
-
/* Completeness */
|
|
106
|
-
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
107
|
-
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
108
|
-
}
|
|
109
|
-
}
|