shinkansen-relay 1.0.326 → 1.0.327
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/index.d.mts +2 -2
- package/package.json +5 -2
- package/src/index.cjs +1 -1
- package/src/relay/index.mjs +2 -2
- package/src/relay/initiate/index.mjs +8 -3
- package/src/relay/regulate/index.mjs +5 -3
- package/tsconfig.json +6 -2
package/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
declare global {
|
|
2
2
|
namespace RelayTypes {
|
|
3
|
-
export interface
|
|
3
|
+
export interface RegulateType {
|
|
4
4
|
SIGNAL: string
|
|
5
5
|
SERVICE: string
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export type
|
|
8
|
+
export type InitiateType = Record<PropertyKey, boolean>
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shinkansen-relay",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.327",
|
|
4
4
|
"description": "Shinkansen Relay",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Shinkansen",
|
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
"@babel/register": "^7.25.9",
|
|
45
45
|
"@sequencemedia/eslint-config-standard": "^0.2.18",
|
|
46
46
|
"@sequencemedia/eslint-config-typescript": "^0.1.27",
|
|
47
|
+
"@types/babel__register": "^7.17.3",
|
|
48
|
+
"@types/debug": "^4.1.12",
|
|
47
49
|
"@typescript-eslint/eslint-plugin": "^8.23.0",
|
|
48
50
|
"@typescript-eslint/parser": "^8.23.0",
|
|
49
51
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
@@ -55,7 +57,8 @@
|
|
|
55
57
|
"globals": "^15.14.0",
|
|
56
58
|
"husky": "^9.1.7",
|
|
57
59
|
"mocha": "^11.1.0",
|
|
58
|
-
"shinkansen-signals": "1.1.187"
|
|
60
|
+
"shinkansen-signals": "1.1.187",
|
|
61
|
+
"typescript": "^5.7.3"
|
|
59
62
|
},
|
|
60
63
|
"imports": {
|
|
61
64
|
"#relay": "./src/index.mjs",
|
package/src/index.cjs
CHANGED
package/src/relay/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {
|
|
2
|
+
* @typedef {RelayTypes.InitiateType} InitiateType
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import debug from 'debug'
|
|
@@ -13,10 +13,15 @@ const log = debug('shinkansen-relay')
|
|
|
13
13
|
log('`shinkansen` is awake')
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
* @param {{
|
|
17
|
-
*
|
|
16
|
+
* @param {{
|
|
17
|
+
* was?: Record<PropertyKey, string> | Record<PropertyKey, never>,
|
|
18
|
+
* now?: Record<PropertyKey, string> | Record<PropertyKey, never>
|
|
19
|
+
* }} relay
|
|
20
|
+
* @returns {InitiateType}
|
|
18
21
|
*/
|
|
19
22
|
export default function initiate ({ now = {}, was = {} } = {}) {
|
|
23
|
+
log('initiate')
|
|
24
|
+
|
|
20
25
|
const {
|
|
21
26
|
ALPHA,
|
|
22
27
|
OMEGA
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {
|
|
2
|
+
* @typedef {RelayTypes.InitiateType} InitiateType
|
|
3
|
+
* @typedef {RelayTypes.RegulateType} RegulateType
|
|
3
4
|
*/
|
|
4
5
|
|
|
5
6
|
import debug from 'debug'
|
|
@@ -13,8 +14,8 @@ const log = debug('shinkansen-relay')
|
|
|
13
14
|
log('`shinkansen` is awake')
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
|
-
* @param {
|
|
17
|
-
* @returns {
|
|
17
|
+
* @param {InitiateType | Record<PropertyKey, never>} state
|
|
18
|
+
* @returns {RegulateType}
|
|
18
19
|
*/
|
|
19
20
|
export default function regulate ({
|
|
20
21
|
HAS_ALPHA = false,
|
|
@@ -24,6 +25,7 @@ export default function regulate ({
|
|
|
24
25
|
WAS_ALPHA_DEFINED = false,
|
|
25
26
|
WAS_OMEGA_DEFINED = false
|
|
26
27
|
} = {}) {
|
|
28
|
+
log('regulate')
|
|
27
29
|
if (
|
|
28
30
|
HAS_ALPHA
|
|
29
31
|
) {
|
package/tsconfig.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"module": "
|
|
3
|
+
"module": "NodeNext",
|
|
4
4
|
"target": "ESNext",
|
|
5
5
|
"allowJs": true,
|
|
6
|
-
"checkJs":
|
|
6
|
+
"checkJs": true,
|
|
7
7
|
"allowSyntheticDefaultImports": true,
|
|
8
8
|
"noEmit": true,
|
|
9
9
|
"strict": true,
|
|
10
|
+
"strictNullChecks": true,
|
|
10
11
|
"isolatedModules": true,
|
|
11
12
|
"baseUrl": ".",
|
|
12
13
|
"paths": {
|
|
@@ -27,5 +28,8 @@
|
|
|
27
28
|
"include": [
|
|
28
29
|
".",
|
|
29
30
|
"src/**/*"
|
|
31
|
+
],
|
|
32
|
+
"exclude": [
|
|
33
|
+
"test"
|
|
30
34
|
]
|
|
31
35
|
}
|