oltc-selector 2.3.0 → 2.3.2
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 +32 -3
- package/bin/oltc.js +39 -24
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ The type is a starting point. Get engineering confirmation before an order.
|
|
|
6
6
|
|
|
7
7
|
## CLI
|
|
8
8
|
|
|
9
|
-
You do not need to clone this repository.
|
|
9
|
+
You do not need to clone this repository. Node.js 20 or later is needed.
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npm i -g oltc-selector
|
|
@@ -15,8 +15,14 @@ oltc --iu 350 --um 40.5 --conn D --reg W --pm 8
|
|
|
15
15
|
# CV2III-350D/40.5-10193W
|
|
16
16
|
|
|
17
17
|
oltc --octc --iu 800 --um 72.5 --conn D --series II --contact 6x5
|
|
18
|
+
# WSLII-800D/72.5-6x5A
|
|
19
|
+
|
|
18
20
|
oltc --iu 600 --um 72.5 --conn Y --reg W --pm 8 --structure combined
|
|
21
|
+
# CM2III-600Y/72.5B-10193W
|
|
22
|
+
|
|
19
23
|
oltc --mva 25 --kv 110 --tap neutral --reg W --pm 8
|
|
24
|
+
# CV2III-350Y/72.5-10193W
|
|
25
|
+
|
|
20
26
|
oltc --mva 16 --kv 22 --tap line --winding star
|
|
21
27
|
# CV2III-600D/40.5-10193W
|
|
22
28
|
|
|
@@ -29,6 +35,13 @@ oltc --line "220/110/35kV-125MVA 225±8x1,25%/115/35kV YNa0d11"
|
|
|
29
35
|
# 3xCM2I-500/252D-10193W, plus the type at Um 126 / 170 / 252
|
|
30
36
|
```
|
|
31
37
|
|
|
38
|
+
Output is in Chinese by default; `--lang en` gives English. Every run asks npm for a newer version and prints a notice when there is one. Nothing is installed for you.
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><b>All flags</b></summary>
|
|
42
|
+
|
|
43
|
+
<br>
|
|
44
|
+
|
|
32
45
|
| Flag | Meaning | Default |
|
|
33
46
|
|------|---------|---------|
|
|
34
47
|
| `--line "text"` | Tender line: MVA, kV ratio with ±N×x%, vector group. Flags given beside it win. | |
|
|
@@ -38,7 +51,7 @@ oltc --line "220/110/35kV-125MVA 225±8x1,25%/115/35kV YNa0d11"
|
|
|
38
51
|
| `--step-pct` | Step as a percent (1.25 means 1.25 %), capacity path only | 1.25 |
|
|
39
52
|
| `--os-imax` | Capacity path: the Imax the OS or maker states at the lowest tap (`--imax` beside `--mva` means this) | |
|
|
40
53
|
| `--kind two\|auto` | Transformer kind (`--auto` = `--kind auto`) | two-winding |
|
|
41
|
-
| `--tap` | Where the OLTC sits: `neutral` / `line` (two-winding), `junction` / `mv-line` (autotransformer). Sets current, Ust and Um. | neutral |
|
|
54
|
+
| `--tap` | Where the OLTC sits: `neutral` / `line` (two-winding), `junction` / `mv-line` (autotransformer). Sets current, Ust and Um. | neutral; junction with `--kind auto` |
|
|
42
55
|
| `--winding star\|delta` | Tapped winding connection (two-winding) | star |
|
|
43
56
|
| `--hv` `--mv` | Autotransformer HV / MV rated kV | |
|
|
44
57
|
| `--earth-um` | OLTC insulation to earth from the OS; overrides the rule | |
|
|
@@ -64,7 +77,7 @@ oltc --line "220/110/35kV-125MVA 225±8x1,25%/115/35kV YNa0d11"
|
|
|
64
77
|
| `--lang en\|zh` | Output language. `OLTC_LANG=en` also works | zh |
|
|
65
78
|
| `--version` / `-v` | Print the version | |
|
|
66
79
|
| `--help` / `-h` | The flag list. Also shown when no flag is given | |
|
|
67
|
-
| `--no-update-check` | Skip the
|
|
80
|
+
| `--no-update-check` | Skip the npm check made on every run. A newer version only prints a notice on stderr; nothing is installed. `OLTC_NO_UPDATE_CHECK=1` or `CI=1` also skip it. | check on |
|
|
68
81
|
|
|
69
82
|
`--structure auto` and omitting `--octc` match the web first paint: on-load, in-tank vacuum, minimum-adequate ranking.
|
|
70
83
|
|
|
@@ -72,6 +85,13 @@ Every flag with a value also takes `--flag=value`. A flag that cannot take effec
|
|
|
72
85
|
|
|
73
86
|
**Exit code:** `0` a type was found (or help / version); `1` no type, or bad input.
|
|
74
87
|
|
|
88
|
+
</details>
|
|
89
|
+
|
|
90
|
+
<details>
|
|
91
|
+
<summary><b><code>--json</code> keys</b></summary>
|
|
92
|
+
|
|
93
|
+
<br>
|
|
94
|
+
|
|
75
95
|
**`--json`** prints one object. For bad input (a flag that cannot be read) the object holds only `ok`, `version`, `model` and `errors`.
|
|
76
96
|
|
|
77
97
|
| Key | Holds |
|
|
@@ -87,8 +107,15 @@ Every flag with a value also takes `--flag=value`. A flag that cannot take effec
|
|
|
87
107
|
| `assumptions` | Every default that was applied, as text |
|
|
88
108
|
| `errors` | Why there is no type |
|
|
89
109
|
|
|
110
|
+
</details>
|
|
111
|
+
|
|
90
112
|
## Selection rules
|
|
91
113
|
|
|
114
|
+
<details>
|
|
115
|
+
<summary><b>The eleven rules the engine follows</b></summary>
|
|
116
|
+
|
|
117
|
+
<br>
|
|
118
|
+
|
|
92
119
|
1. **Minimum-adequate, not SHZV-by-default.** Rank **CV2 → CM2 → SHZV → SDZV → SHZVG**. SDZV (dual-break, Ust 6000 V) only when SHZV step voltage or step capacity is short. Prefer one three-phase unit over `3×` singles when a brochure III type exists.
|
|
93
120
|
2. **OLTC existence comes from brochure / catalogue axes** (`lib/catalog.ts`), **not price-list Y/D twins**. A 2025 list row that prices `CM2III-…D` the same as Y does **not** make `CM2III-…D` a type.
|
|
94
121
|
3. **No CV2-500.** CV2 III currents are 350 and 600 only.
|
|
@@ -100,3 +127,5 @@ Every flag with a value also takes `--flag=value`. A flag that cannot take effec
|
|
|
100
127
|
9. **Um is set where the tap changer sits** (`lib/transformer.ts`). Line end: the winding system's class (132 kV → 145, 220 kV → 252). Neutral: the full class up to 72.5; above that 72.5 is assumed and flagged. Autotransformer: the HV system's class, combined types only (no CV / CV2 / SV).
|
|
101
128
|
10. **Tapped windings on 220 kV class and above take combined types only.** 2025–2026 OS: 67 of 67 were CM / CM2 / SHZV.
|
|
102
129
|
11. **An open Um is shown as a choice.** Star points above 72.5 and autotransformers list the type at each Um class; the tender's insulation picks one (`--earth-um`, or a row on the card).
|
|
130
|
+
|
|
131
|
+
</details>
|
package/bin/oltc.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// lib/appVersion.ts
|
|
4
|
-
var APP_VERSION = "2.3.
|
|
4
|
+
var APP_VERSION = "2.3.2";
|
|
5
5
|
|
|
6
6
|
// lib/decimal.ts
|
|
7
7
|
var GROUPED = /^\d{1,3}([,,]\d{3})+$/;
|
|
@@ -2869,21 +2869,21 @@ function deriveDuty(spec) {
|
|
|
2869
2869
|
);
|
|
2870
2870
|
}
|
|
2871
2871
|
if (umRule === "neutral_full" && umAssumed) {
|
|
2872
|
-
cautionsZh.push("35 kV \u7EA7\u4E2D\u6027\u70B9\u5148\u6309 Um 40.5 kV \u9009\uFF1B\u4E0D\u5C11\u9879\u76EE\u8981\u6C42 72.5\uFF0C\u4EE5\u8BA2\u8D27\u89C4\u8303\
|
|
2872
|
+
cautionsZh.push("35 kV \u7EA7\u4E2D\u6027\u70B9\u5148\u6309 Um 40.5 kV \u9009\uFF1B\u4E0D\u5C11\u9879\u76EE\u8981\u6C42 72.5\uFF0C\u4EE5\u8BA2\u8D27\u89C4\u8303\u4E3A\u51C6\u3002CM/CM2/SHZV \u6700\u4F4E\u5C31\u662F 72.5\u3002");
|
|
2873
2873
|
cautionsEn.push("35 kV-class neutral sized at Um 40.5 kV; many projects specify 72.5; the order specification (OS) decides. CM/CM2/SHZV start at 72.5.");
|
|
2874
2874
|
}
|
|
2875
2875
|
if (umRule === "neutral_assumed") {
|
|
2876
2876
|
if (neutralMarket === "IT") {
|
|
2877
|
-
cautionsZh.push(`\u610F\u5927\u5229\u4E2D\u6027\u70B9\u5148\u6309\u7EBF\u7AEF\u7B49\u7EA7 Um ${umKv} kV \u9009\uFF08\u90E8\u5206\u9879\u76EE\u7528 72.5\uFF09\uFF0C\u4EE5\u8BA2\u8D27\u89C4\u8303\
|
|
2877
|
+
cautionsZh.push(`\u610F\u5927\u5229\u4E2D\u6027\u70B9\u5148\u6309\u7EBF\u7AEF\u7B49\u7EA7 Um ${umKv} kV \u9009\uFF08\u90E8\u5206\u9879\u76EE\u7528 72.5\uFF09\uFF0C\u4EE5\u8BA2\u8D27\u89C4\u8303\u4E3A\u51C6\u3002`);
|
|
2878
2878
|
cautionsEn.push(`Italy: neutral sized at the line class, Um ${umKv} kV (some projects use 72.5); the order specification (OS) decides.`);
|
|
2879
2879
|
} else if (neutralMarket === "TR") {
|
|
2880
|
-
cautionsZh.push(`\u571F\u8033\u5176 220 kV \u7EA7\u53CA\u4EE5\u4E0A\u4E2D\u6027\u70B9\u5148\u6309 Um ${umKv} kV \u9009\uFF08\u901A\u5E38 126 \u6216 170\uFF0C\u4E0D\u7528 72.5\uFF09\uFF0C\u4EE5\u8BA2\u8D27\u89C4\u8303\
|
|
2880
|
+
cautionsZh.push(`\u571F\u8033\u5176 220 kV \u7EA7\u53CA\u4EE5\u4E0A\u4E2D\u6027\u70B9\u5148\u6309 Um ${umKv} kV \u9009\uFF08\u901A\u5E38 126 \u6216 170\uFF0C\u4E0D\u7528 72.5\uFF09\uFF0C\u4EE5\u8BA2\u8D27\u89C4\u8303\u4E3A\u51C6\u3002`);
|
|
2881
2881
|
cautionsEn.push(`Turkey: 220 kV-class and above neutral sized at Um ${umKv} kV (126 or 170 is usual, not 72.5); the order specification (OS) decides.`);
|
|
2882
2882
|
} else if (umKv === NEUTRAL_400KV_UM) {
|
|
2883
|
-
cautionsZh.push(`400 kV \u7EA7\u7ED5\u7EC4\u4E2D\u6027\u70B9\u5148\u6309 Um ${umKv} kV \u9009\uFF08\u571F\u8033\u5176\u3001\u8461\u8404\u7259\u5E38\u7528 126\uFF1B\u5DF4\u897F 440/500 kV \u5E38\u7528 72.5\uFF09\uFF0C\u4EE5\u8BA2\u8D27\u89C4\u8303\
|
|
2883
|
+
cautionsZh.push(`400 kV \u7EA7\u7ED5\u7EC4\u4E2D\u6027\u70B9\u5148\u6309 Um ${umKv} kV \u9009\uFF08\u571F\u8033\u5176\u3001\u8461\u8404\u7259\u5E38\u7528 126\uFF1B\u5DF4\u897F 440/500 kV \u5E38\u7528 72.5\uFF09\uFF0C\u4EE5\u8BA2\u8D27\u89C4\u8303\u4E3A\u51C6\u3002`);
|
|
2884
2884
|
cautionsEn.push(`Neutral of a 400 kV-class winding sized at Um ${umKv} kV (126 is usual in Turkey and Portugal; 72.5 in Brazil at 440/500 kV); the order specification (OS) decides.`);
|
|
2885
2885
|
} else {
|
|
2886
|
-
cautionsZh.push(`\u4E2D\u6027\u70B9\u7EDD\u7F18\u672A\u7ED9\uFF0C\u5148\u6309 Um ${umKv} kV \u9009\uFF0C\u4EE5\u8BA2\u8D27\u89C4\u8303\
|
|
2886
|
+
cautionsZh.push(`\u4E2D\u6027\u70B9\u7EDD\u7F18\u672A\u7ED9\uFF0C\u5148\u6309 Um ${umKv} kV \u9009\uFF0C\u4EE5\u8BA2\u8D27\u89C4\u8303\u4E3A\u51C6\u3002`);
|
|
2887
2887
|
cautionsEn.push(`Neutral insulation not given: sized at Um ${umKv} kV; the order specification (OS) decides.`);
|
|
2888
2888
|
}
|
|
2889
2889
|
}
|
|
@@ -2898,19 +2898,19 @@ function deriveDuty(spec) {
|
|
|
2898
2898
|
cautionsZh.push("230/121 kV \u81EA\u8026\u53D8\u4E2D\u538B\u51FA\u7EBF\u901A\u5E38\u7528 Um 170 kV\uFF0C\u8BF7\u6309\u5382\u5BB6\u6570\u636E\u6838\u5BF9\u3002");
|
|
2899
2899
|
cautionsEn.push("230/121 kV autotransformer MV line lead: Um 170 kV is usual; check the maker's data.");
|
|
2900
2900
|
} else {
|
|
2901
|
-
cautionsZh.push(`\
|
|
2901
|
+
cautionsZh.push(`\u5F00\u5173\u5BF9\u5730\u7EDD\u7F18\u6682\u6309 ${umKv} kV \u9009\uFF0C\u8BA2\u8D27\u524D\u8BF7\u6309\u8BA2\u8D27\u89C4\u8303\u786E\u8BA4\u3002`);
|
|
2902
2902
|
cautionsEn.push(`MV line lead sized at the MV class, Um ${umKv} kV; the order specification (OS) decides.`);
|
|
2903
2903
|
}
|
|
2904
2904
|
} else if (spec.tapPoint === "auto_junction" && umRule === "auto_hv") {
|
|
2905
|
-
cautionsZh.push(`\
|
|
2905
|
+
cautionsZh.push(`\u5F00\u5173\u5BF9\u5730\u7EDD\u7F18\u6682\u6309 ${umKv} kV \u9009\uFF0C\u8BA2\u8D27\u524D\u8BF7\u6309\u8BA2\u8D27\u89C4\u8303\u786E\u8BA4\u3002`);
|
|
2906
2906
|
cautionsEn.push(`Autotransformer junction sized at the HV class, Um ${umKv} kV; the order specification (OS) decides.`);
|
|
2907
2907
|
}
|
|
2908
|
-
cautionsZh.push("\u81EA\u8026\u53D8\u53EA\u7528\u7EC4\u5408\u5F0F\
|
|
2908
|
+
cautionsZh.push("\u81EA\u8026\u53D8\u53EA\u80FD\u7528\u7EC4\u5408\u5F0F\u5F00\u5173\u3002");
|
|
2909
2909
|
cautionsEn.push("Autotransformer: combined types only (compound types stop at 200 kV across the tap winding).");
|
|
2910
|
-
cautionsZh.push("\
|
|
2910
|
+
cautionsZh.push("\u8C03\u538B\u7ED5\u7EC4\u4E24\u7AEF\u7684\u51B2\u51FB\u7535\u538B\u3001\u8981\u4E0D\u8981\u52A0\u7535\u4F4D\u7535\u963B\uFF0C\u8FD9\u91CC\u6CA1\u6709\u7B97\uFF0C\u8BF7\u5411\u53D8\u538B\u5668\u5382\u786E\u8BA4\u3002");
|
|
2911
2911
|
cautionsEn.push("Not checked: impulse across the tap winding (a), tie-in resistor.");
|
|
2912
2912
|
if (!(statedStepV > 0 && statedStepV >= (derivedStepV ?? 0) - 0.5)) {
|
|
2913
|
-
cautionsZh.push("\
|
|
2913
|
+
cautionsZh.push("\u5404\u6863\u7684\u7EA7\u7535\u538B\u548C\u7535\u6D41\u4E0D\u4E00\u6837\uFF0C\u8FD9\u91CC\u53EA\u6309\u989D\u5B9A\u6863\u7B97\u3002\u8BF7\u5411\u53D8\u538B\u5668\u5382\u8981\u5206\u63A5\u8868\u518D\u6838\u5BF9\u3002");
|
|
2914
2914
|
cautionsEn.push("Variable flux: Ust and current differ per tap; Ust at the extreme tap is not checked. Get the maker's per-tap table.");
|
|
2915
2915
|
}
|
|
2916
2916
|
}
|
|
@@ -4116,17 +4116,20 @@ function parseCliArgs(rawArgv) {
|
|
|
4116
4116
|
continue;
|
|
4117
4117
|
}
|
|
4118
4118
|
if (a === "--octc") {
|
|
4119
|
+
if (out.given.has("octc") && !out.octc) throw new CliError("--octc conflicts with --duty oltc. Drop one.");
|
|
4119
4120
|
out.given.add("octc");
|
|
4120
4121
|
out.octc = true;
|
|
4121
4122
|
continue;
|
|
4122
4123
|
}
|
|
4123
4124
|
if (a === "--oil") {
|
|
4125
|
+
if (out.given.has("medium") && out.vacuum) throw new CliError("Give --oil or --vacuum, not both");
|
|
4124
4126
|
out.given.add("medium");
|
|
4125
4127
|
out.oil = true;
|
|
4126
4128
|
out.vacuum = false;
|
|
4127
4129
|
continue;
|
|
4128
4130
|
}
|
|
4129
4131
|
if (a === "--vacuum") {
|
|
4132
|
+
if (out.given.has("medium") && out.oil) throw new CliError("Give --oil or --vacuum, not both");
|
|
4130
4133
|
out.given.add("medium");
|
|
4131
4134
|
out.vacuum = true;
|
|
4132
4135
|
out.oil = false;
|
|
@@ -4404,9 +4407,11 @@ function parseCliArgs(rawArgv) {
|
|
|
4404
4407
|
out.given.add("octc");
|
|
4405
4408
|
const [v, n] = take(i, a);
|
|
4406
4409
|
const d = v.toLowerCase();
|
|
4410
|
+
const had = out.octc;
|
|
4407
4411
|
if (d === "octc" || d === "off" || d === "detc") out.octc = true;
|
|
4408
4412
|
else if (d === "oltc" || d === "on") out.octc = false;
|
|
4409
4413
|
else throw new CliError(`--duty must be oltc or octc`);
|
|
4414
|
+
if (had && !out.octc) throw new CliError("--octc conflicts with --duty oltc. Drop one.");
|
|
4410
4415
|
i = n;
|
|
4411
4416
|
continue;
|
|
4412
4417
|
}
|
|
@@ -4538,7 +4543,8 @@ Flags:
|
|
|
4538
4543
|
--kind two|auto Transformer kind (--auto = --kind auto). Default two-winding.
|
|
4539
4544
|
--tap P Where the OLTC sits: neutral|line (two-winding),
|
|
4540
4545
|
junction|mv-line (autotransformer, series/common junction
|
|
4541
|
-
or MV line lead).
|
|
4546
|
+
or MV line lead). Default neutral; junction with
|
|
4547
|
+
--kind auto. With --mva it replaces --conn.
|
|
4542
4548
|
--winding star|delta Tapped winding connection (two-winding). Sets the current
|
|
4543
4549
|
formula: star I = S/(\u221A3U), delta I = S/(3U).
|
|
4544
4550
|
--hv kV --mv kV Autotransformer HV / MV rated voltage (with --kind auto).
|
|
@@ -4577,7 +4583,7 @@ Flags:
|
|
|
4577
4583
|
line, basis, umChoices, assumptions, errors. Errors are JSON too.
|
|
4578
4584
|
--lang en|zh Output language (default zh; OLTC_LANG=en also works).
|
|
4579
4585
|
--version, -v Print the version.
|
|
4580
|
-
--no-update-check Skip the
|
|
4586
|
+
--no-update-check Skip the check for a newer version on each run. The check only
|
|
4581
4587
|
prints a notice on stderr; it never installs anything.
|
|
4582
4588
|
OLTC_NO_UPDATE_CHECK=1 or CI=1 also turn it off.
|
|
4583
4589
|
-h, --help This text. Also shown when no flag is given.
|
|
@@ -4710,6 +4716,22 @@ function checkConflicts(args) {
|
|
|
4710
4716
|
if (args.typed?.has("--conn") && args.typed.has("--tap") && args.conn === "D" && args.tap === "neutral") {
|
|
4711
4717
|
throw new CliError("--conn D conflicts with --tap neutral: a neutral tap point is star (Y). Drop one.");
|
|
4712
4718
|
}
|
|
4719
|
+
const typed = (...flags) => flags.some((f) => args.typed?.has(f));
|
|
4720
|
+
if (typed("--conn", "--connection") && typed("--tap") && args.conn === "Y" && args.tap === "line_end") {
|
|
4721
|
+
throw new CliError("--conn Y conflicts with --tap line: a line-end tap point is delta (D). Drop one.");
|
|
4722
|
+
}
|
|
4723
|
+
if (args.kind !== "auto" && (typed("--hv") || typed("--mv"))) {
|
|
4724
|
+
throw new CliError("--hv and --mv are autotransformer voltages: add --kind auto (a two-winding transformer takes --kv)");
|
|
4725
|
+
}
|
|
4726
|
+
if (typed("--minus") && args.mva == null) {
|
|
4727
|
+
throw new CliError("--minus sets the lowest-tap current on the --mva path; with --iu give the current itself");
|
|
4728
|
+
}
|
|
4729
|
+
if (typed("--um") && typed("--earth-um") && args.um != null && args.earthUm != null && args.um !== args.earthUm) {
|
|
4730
|
+
throw new CliError(`Give --um or --earth-um, not both: ${args.um} and ${args.earthUm} disagree.`);
|
|
4731
|
+
}
|
|
4732
|
+
if (args.stepPct != null && args.stepPct < 0.1) {
|
|
4733
|
+
throw new CliError(`--step-pct is a percent: 1.25 means 1.25 %. ${args.stepPct} is too small.`);
|
|
4734
|
+
}
|
|
4713
4735
|
if (g("pm") && g("positions") && args.pm != null && args.positions != null) {
|
|
4714
4736
|
const wg = () => plusMinusFromPositions(args.positions, args.reg) === args.pm || [1, 3].some(
|
|
4715
4737
|
(mid) => resolveTapFields({ regulation: args.reg, plusMinusSteps: args.pm, midPositions: mid }).positions === args.positions
|
|
@@ -5020,7 +5042,7 @@ function cliNotes(args, input, primaryUmKv, en, engineNotes = []) {
|
|
|
5020
5042
|
const already = duty.cautionsEn.some((c) => c.startsWith("Stated Um"));
|
|
5021
5043
|
if (!already) {
|
|
5022
5044
|
notes.push(
|
|
5023
|
-
en ? `Stated insulation to earth, Um ${duty.umKv} kV, is below the ${duty.ruleUmKv} kV the winding voltage gives. Check the order specification (OS).` : `\u6307\u5B9A\u5BF9\u5730\u7EDD\u7F18 Um ${duty.umKv} kV \u4F4E\u4E8E\u6309\u7ED5\u7EC4\u7535\u538B\u5F97\u51FA\u7684 ${duty.ruleUmKv} kV\uFF0C\u8BF7\u6838\u5BF9\u8BA2\u8D27\u89C4\u8303\
|
|
5045
|
+
en ? `Stated insulation to earth, Um ${duty.umKv} kV, is below the ${duty.ruleUmKv} kV the winding voltage gives. Check the order specification (OS).` : `\u6307\u5B9A\u5BF9\u5730\u7EDD\u7F18 Um ${duty.umKv} kV \u4F4E\u4E8E\u6309\u7ED5\u7EC4\u7535\u538B\u5F97\u51FA\u7684 ${duty.ruleUmKv} kV\uFF0C\u8BF7\u6838\u5BF9\u8BA2\u8D27\u89C4\u8303\u3002`
|
|
5024
5046
|
);
|
|
5025
5047
|
}
|
|
5026
5048
|
}
|
|
@@ -5244,7 +5266,6 @@ function runCli(argv2, io = {
|
|
|
5244
5266
|
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5245
5267
|
import { homedir } from "node:os";
|
|
5246
5268
|
import path from "node:path";
|
|
5247
|
-
var UPDATE_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
5248
5269
|
var REGISTRY_LATEST = "https://registry.npmjs.org/oltc-selector/latest";
|
|
5249
5270
|
function isNewer(latest, current) {
|
|
5250
5271
|
const parse = (v) => {
|
|
@@ -5303,16 +5324,10 @@ function writeCache(file2, c) {
|
|
|
5303
5324
|
async function checkForUpdate(opts) {
|
|
5304
5325
|
const now = opts.now ?? Date.now();
|
|
5305
5326
|
try {
|
|
5306
|
-
let latest;
|
|
5307
5327
|
const cached = readCache(opts.cacheFile);
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
latest = await (opts.fetchLatest ?? fetchLatest)(opts.timeoutMs ?? 1500).catch(
|
|
5312
|
-
() => cached?.latest ?? null
|
|
5313
|
-
);
|
|
5314
|
-
writeCache(opts.cacheFile, { checkedAt: now, latest });
|
|
5315
|
-
}
|
|
5328
|
+
const asked = await (opts.fetchLatest ?? fetchLatest)(opts.timeoutMs ?? 1500).catch(() => null);
|
|
5329
|
+
const latest = asked ?? cached?.latest ?? null;
|
|
5330
|
+
if (asked) writeCache(opts.cacheFile, { checkedAt: now, latest: asked });
|
|
5316
5331
|
return latest && isNewer(latest, opts.current) ? updateNotice(latest, opts.current) : null;
|
|
5317
5332
|
} catch {
|
|
5318
5333
|
return null;
|