puzzle-lib 1.6.0 → 1.7.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/build/src/Braille/BrailleCharacter.d.ts +15 -15
- package/build/src/Braille/BrailleCharacter.js +39 -38
- package/build/src/Braille/BrailleCharacter.js.map +1 -1
- package/build/src/Braille/BrailleData.d.ts +6 -6
- package/build/src/Braille/BrailleData.js +65 -65
- package/build/src/Braille/BrailleData.js.map +1 -1
- package/build/src/Braille/BrailleDot.d.ts +9 -9
- package/build/src/Braille/BrailleDot.js +13 -13
- package/build/src/Braille/BrailleDot.js.map +1 -1
- package/build/src/Braille/BrailleEncoding.d.ts +54 -54
- package/build/src/Braille/BrailleEncoding.js +66 -65
- package/build/src/Braille/BrailleEncoding.js.map +1 -1
- package/build/src/Braille/BrailleStream.d.ts +18 -18
- package/build/src/Braille/BrailleStream.js +75 -75
- package/build/src/Braille/BrailleStream.js.map +1 -1
- package/build/src/Cipher/AutoKeyString.d.ts +4 -4
- package/build/src/Cipher/AutoKeyString.js +34 -34
- package/build/src/Cipher/CaesarString.d.ts +8 -8
- package/build/src/Cipher/CaesarString.js +32 -31
- package/build/src/Cipher/CaesarString.js.map +1 -1
- package/build/src/Cipher/CaesarUtils.d.ts +13 -13
- package/build/src/Cipher/CaesarUtils.js +57 -57
- package/build/src/Cipher/CaesarUtils.js.map +1 -1
- package/build/src/Cipher/KeyedCipherStringBase.d.ts +12 -12
- package/build/src/Cipher/KeyedCipherStringBase.js +30 -28
- package/build/src/Cipher/KeyedCipherStringBase.js.map +1 -1
- package/build/src/Cipher/VigenereString.d.ts +4 -4
- package/build/src/Cipher/VigenereString.js +21 -21
- package/build/src/Common/CharacterImage.d.ts +6 -6
- package/build/src/Common/CharacterImage.js +12 -10
- package/build/src/Common/CharacterImage.js.map +1 -1
- package/build/src/Common/EncodingCategory.d.ts +8 -8
- package/build/src/Common/EncodingCategory.js +12 -12
- package/build/src/Common/EncodingCategory.js.map +1 -1
- package/build/src/Common/EncodingCharacterBase.d.ts +23 -23
- package/build/src/Common/EncodingCharacterBase.js +54 -52
- package/build/src/Common/EncodingCharacterBase.js.map +1 -1
- package/build/src/Common/EncodingDataBase.d.ts +7 -7
- package/build/src/Common/EncodingDataBase.js +27 -29
- package/build/src/Common/EncodingDataBase.js.map +1 -1
- package/build/src/Common/EncodingEntry.d.ts +8 -8
- package/build/src/Common/EncodingEntry.js +17 -14
- package/build/src/Common/EncodingEntry.js.map +1 -1
- package/build/src/Common/EncodingLookupResult.d.ts +6 -6
- package/build/src/Common/EncodingLookupResult.js +11 -13
- package/build/src/Common/EncodingLookupResult.js.map +1 -1
- package/build/src/Common/Helpers.d.ts +4 -4
- package/build/src/Common/Helpers.js +16 -16
- package/build/src/Common/InlineSvg.d.ts +7 -7
- package/build/src/Common/InlineSvg.js +17 -14
- package/build/src/Common/InlineSvg.js.map +1 -1
- package/build/src/Conversion/CharacterAutoConvert.d.ts +10 -10
- package/build/src/Conversion/CharacterAutoConvert.js +88 -88
- package/build/src/Conversion/CharacterAutoConvert.js.map +1 -1
- package/build/src/Conversion/CharacterConversion.d.ts +8 -8
- package/build/src/Conversion/CharacterConversion.js +50 -50
- package/build/src/Conversion/CharacterEncoding.d.ts +9 -9
- package/build/src/Conversion/CharacterEncoding.js +13 -13
- package/build/src/Conversion/CharacterEncoding.js.map +1 -1
- package/build/src/Conversion/CharacterTableEntry.d.ts +10 -10
- package/build/src/Conversion/CharacterTableEntry.js +25 -19
- package/build/src/Conversion/CharacterTableEntry.js.map +1 -1
- package/build/src/Conversion/SignificantFigures.d.ts +7 -7
- package/build/src/Conversion/SignificantFigures.js +50 -50
- package/build/src/Conversion/StringAutoConvert.d.ts +6 -6
- package/build/src/Conversion/StringAutoConvert.js +46 -46
- package/build/src/Morse/MorseCharacter.d.ts +22 -22
- package/build/src/Morse/MorseCharacter.js +97 -96
- package/build/src/Morse/MorseCharacter.js.map +1 -1
- package/build/src/Morse/MorseData.d.ts +6 -6
- package/build/src/Morse/MorseData.js +70 -70
- package/build/src/Morse/MorseData.js.map +1 -1
- package/build/src/Morse/MorseEncoding.d.ts +59 -59
- package/build/src/Morse/MorseEncoding.js +94 -94
- package/build/src/Morse/MorseEncoding.js.map +1 -1
- package/build/src/Morse/MorseString.d.ts +10 -10
- package/build/src/Morse/MorseString.js +67 -66
- package/build/src/Morse/MorseString.js.map +1 -1
- package/build/src/Nato/NatoCharacter.d.ts +5 -5
- package/build/src/Nato/NatoCharacter.js +12 -10
- package/build/src/Nato/NatoCharacter.js.map +1 -1
- package/build/src/Nato/NatoData.d.ts +7 -7
- package/build/src/Nato/NatoData.js +49 -51
- package/build/src/Nato/NatoData.js.map +1 -1
- package/build/src/NavalFlags/NavalFlags.d.ts +7 -7
- package/build/src/NavalFlags/NavalFlags.js +75 -77
- package/build/src/NavalFlags/NavalFlags.js.map +1 -1
- package/build/src/Resistor/Resistor.d.ts +24 -24
- package/build/src/Resistor/Resistor.js +86 -86
- package/build/src/Resistor/Resistor.js.map +1 -1
- package/build/src/Resistor/ResistorColorEntry.d.ts +12 -12
- package/build/src/Resistor/ResistorColorEntry.js +36 -31
- package/build/src/Resistor/ResistorColorEntry.js.map +1 -1
- package/build/src/Semaphore/SemaphoreCharacter.d.ts +20 -20
- package/build/src/Semaphore/SemaphoreCharacter.js +75 -75
- package/build/src/Semaphore/SemaphoreCharacter.js.map +1 -1
- package/build/src/Semaphore/SemaphoreData.d.ts +6 -6
- package/build/src/Semaphore/SemaphoreData.js +53 -53
- package/build/src/Semaphore/SemaphoreData.js.map +1 -1
- package/build/src/Semaphore/SemaphoreDegrees.d.ts +5 -5
- package/build/src/Semaphore/SemaphoreDegrees.js +26 -26
- package/build/src/Semaphore/SemaphoreDirection.d.ts +11 -11
- package/build/src/Semaphore/SemaphoreDirection.js +15 -15
- package/build/src/Semaphore/SemaphoreDirection.js.map +1 -1
- package/build/src/Semaphore/SemaphoreEncoding.d.ts +40 -40
- package/build/src/Semaphore/SemaphoreEncoding.js +48 -47
- package/build/src/Semaphore/SemaphoreEncoding.js.map +1 -1
- package/build/src/Semaphore/SemaphoreStream.d.ts +17 -17
- package/build/src/Semaphore/SemaphoreStream.js +73 -72
- package/build/src/Semaphore/SemaphoreStream.js.map +1 -1
- package/build/src/WordSearch/Point.d.ts +4 -4
- package/build/src/WordSearch/Point.js +2 -2
- package/build/src/WordSearch/Result.d.ts +6 -6
- package/build/src/WordSearch/Result.js +12 -10
- package/build/src/WordSearch/Result.js.map +1 -1
- package/build/src/WordSearch/WordSearchDirection.d.ts +6 -6
- package/build/src/WordSearch/WordSearchDirection.js +10 -10
- package/build/src/WordSearch/WordSearchDirection.js.map +1 -1
- package/build/src/WordSearch/WordSearchSolver.d.ts +27 -27
- package/build/src/WordSearch/WordSearchSolver.js +232 -222
- package/build/src/WordSearch/WordSearchSolver.js.map +1 -1
- package/build/src/index.d.ts +35 -35
- package/build/src/index.js +72 -72
- package/package.json +5 -5
- package/src/Braille/BrailleCharacter.ts +1 -1
- package/src/Braille/BrailleData.ts +16 -16
- package/src/Cipher/AutoKeyString.ts +1 -1
- package/src/Cipher/CaesarUtils.ts +1 -1
- package/src/Cipher/VigenereString.ts +1 -1
- package/src/Common/EncodingDataBase.ts +1 -1
- package/src/Conversion/CharacterAutoConvert.ts +1 -1
- package/src/Conversion/CharacterConversion.ts +5 -5
- package/src/Conversion/SignificantFigures.ts +1 -1
- package/src/Conversion/StringAutoConvert.ts +2 -2
- package/src/Morse/MorseData.ts +18 -18
- package/src/Morse/MorseString.ts +12 -12
- package/src/Nato/NatoData.ts +1 -1
- package/src/NavalFlags/NavalFlags.ts +52 -52
- package/src/Resistor/Resistor.ts +9 -9
- package/src/Resistor/ResistorColorEntry.ts +1 -1
- package/src/Semaphore/SemaphoreCharacter.ts +5 -5
- package/src/Semaphore/SemaphoreData.ts +1 -1
- package/src/WordSearch/WordSearchSolver.ts +1 -1
|
@@ -1,52 +1,50 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NatoData = void 0;
|
|
4
|
-
const NatoCharacter_1 = require("./NatoCharacter");
|
|
5
|
-
// There's no concept of a 'partial match' for a NATO letter, so there's no
|
|
6
|
-
// reason to derive from EncodingDataBase.
|
|
7
|
-
class NatoData {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
exports.NatoData = NatoData;
|
|
51
|
-
NatoData.instance = new NatoData();
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NatoData = void 0;
|
|
4
|
+
const NatoCharacter_1 = require("./NatoCharacter");
|
|
5
|
+
// There's no concept of a 'partial match' for a NATO letter, so there's no
|
|
6
|
+
// reason to derive from EncodingDataBase.
|
|
7
|
+
class NatoData {
|
|
8
|
+
static instance = new NatoData();
|
|
9
|
+
_entries = [
|
|
10
|
+
new NatoCharacter_1.NatoCharacter('A', 'Alfa'),
|
|
11
|
+
new NatoCharacter_1.NatoCharacter('B', 'Bravo'),
|
|
12
|
+
new NatoCharacter_1.NatoCharacter('C', 'Charlie'),
|
|
13
|
+
new NatoCharacter_1.NatoCharacter('D', 'Delta'),
|
|
14
|
+
new NatoCharacter_1.NatoCharacter('E', 'Echo'),
|
|
15
|
+
new NatoCharacter_1.NatoCharacter('F', 'Foxtrot'),
|
|
16
|
+
new NatoCharacter_1.NatoCharacter('G', 'Golf'),
|
|
17
|
+
new NatoCharacter_1.NatoCharacter('H', 'Hotel'),
|
|
18
|
+
new NatoCharacter_1.NatoCharacter('I', 'India'),
|
|
19
|
+
new NatoCharacter_1.NatoCharacter('J', 'Juliett'),
|
|
20
|
+
new NatoCharacter_1.NatoCharacter('K', 'Kilo'),
|
|
21
|
+
new NatoCharacter_1.NatoCharacter('L', 'Lima'),
|
|
22
|
+
new NatoCharacter_1.NatoCharacter('M', 'Mike'),
|
|
23
|
+
new NatoCharacter_1.NatoCharacter('N', 'November'),
|
|
24
|
+
new NatoCharacter_1.NatoCharacter('O', 'Oscar'),
|
|
25
|
+
new NatoCharacter_1.NatoCharacter('P', 'Papa'),
|
|
26
|
+
new NatoCharacter_1.NatoCharacter('Q', 'Quebec'),
|
|
27
|
+
new NatoCharacter_1.NatoCharacter('R', 'Romeo'),
|
|
28
|
+
new NatoCharacter_1.NatoCharacter('S', 'Sierra'),
|
|
29
|
+
new NatoCharacter_1.NatoCharacter('T', 'Tango'),
|
|
30
|
+
new NatoCharacter_1.NatoCharacter('U', 'Uniform'),
|
|
31
|
+
new NatoCharacter_1.NatoCharacter('V', 'Victor'),
|
|
32
|
+
new NatoCharacter_1.NatoCharacter('W', 'Whiskey'),
|
|
33
|
+
new NatoCharacter_1.NatoCharacter('X', 'X-ray'),
|
|
34
|
+
new NatoCharacter_1.NatoCharacter('Y', 'Yankee'),
|
|
35
|
+
new NatoCharacter_1.NatoCharacter('Z', 'Zulu'),
|
|
36
|
+
];
|
|
37
|
+
get entries() {
|
|
38
|
+
return this._entries;
|
|
39
|
+
}
|
|
40
|
+
lookup(letter) {
|
|
41
|
+
for (const ch of this._entries) {
|
|
42
|
+
if (ch.character.toUpperCase() === letter.toUpperCase()) {
|
|
43
|
+
return ch;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.NatoData = NatoData;
|
|
52
50
|
//# sourceMappingURL=NatoData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NatoData.js","sourceRoot":"","sources":["../../../src/Nato/NatoData.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAE9C,2EAA2E;AAC3E,0CAA0C;AAC1C,MAAa,QAAQ;
|
|
1
|
+
{"version":3,"file":"NatoData.js","sourceRoot":"","sources":["../../../src/Nato/NatoData.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAE9C,2EAA2E;AAC3E,0CAA0C;AAC1C,MAAa,QAAQ;IACnB,MAAM,CAAU,QAAQ,GAAa,IAAI,QAAQ,EAAE,CAAC;IAEnC,QAAQ,GAAoB;QAC3C,IAAI,6BAAa,CAAC,GAAG,EAAE,MAAM,CAAC;QAC9B,IAAI,6BAAa,CAAC,GAAG,EAAE,OAAO,CAAC;QAC/B,IAAI,6BAAa,CAAC,GAAG,EAAE,SAAS,CAAC;QACjC,IAAI,6BAAa,CAAC,GAAG,EAAE,OAAO,CAAC;QAC/B,IAAI,6BAAa,CAAC,GAAG,EAAE,MAAM,CAAC;QAC9B,IAAI,6BAAa,CAAC,GAAG,EAAE,SAAS,CAAC;QACjC,IAAI,6BAAa,CAAC,GAAG,EAAE,MAAM,CAAC;QAC9B,IAAI,6BAAa,CAAC,GAAG,EAAE,OAAO,CAAC;QAC/B,IAAI,6BAAa,CAAC,GAAG,EAAE,OAAO,CAAC;QAC/B,IAAI,6BAAa,CAAC,GAAG,EAAE,SAAS,CAAC;QACjC,IAAI,6BAAa,CAAC,GAAG,EAAE,MAAM,CAAC;QAC9B,IAAI,6BAAa,CAAC,GAAG,EAAE,MAAM,CAAC;QAC9B,IAAI,6BAAa,CAAC,GAAG,EAAE,MAAM,CAAC;QAC9B,IAAI,6BAAa,CAAC,GAAG,EAAE,UAAU,CAAC;QAClC,IAAI,6BAAa,CAAC,GAAG,EAAE,OAAO,CAAC;QAC/B,IAAI,6BAAa,CAAC,GAAG,EAAE,MAAM,CAAC;QAC9B,IAAI,6BAAa,CAAC,GAAG,EAAE,QAAQ,CAAC;QAChC,IAAI,6BAAa,CAAC,GAAG,EAAE,OAAO,CAAC;QAC/B,IAAI,6BAAa,CAAC,GAAG,EAAE,QAAQ,CAAC;QAChC,IAAI,6BAAa,CAAC,GAAG,EAAE,OAAO,CAAC;QAC/B,IAAI,6BAAa,CAAC,GAAG,EAAE,SAAS,CAAC;QACjC,IAAI,6BAAa,CAAC,GAAG,EAAE,QAAQ,CAAC;QAChC,IAAI,6BAAa,CAAC,GAAG,EAAE,SAAS,CAAC;QACjC,IAAI,6BAAa,CAAC,GAAG,EAAE,OAAO,CAAC;QAC/B,IAAI,6BAAa,CAAC,GAAG,EAAE,QAAQ,CAAC;QAChC,IAAI,6BAAa,CAAC,GAAG,EAAE,MAAM,CAAC;KAC/B,CAAC;IAEF,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,MAAc;QACnB,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE;YAC9B,IAAI,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,WAAW,EAAE,EAAE;gBACvD,OAAO,EAAE,CAAC;aACX;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;;AA3CH,4BA4CC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CharacterImage } from '../Common/CharacterImage';
|
|
2
|
-
export declare class NavalFlags {
|
|
3
|
-
static readonly instance: NavalFlags;
|
|
4
|
-
private readonly _entries;
|
|
5
|
-
get entries(): CharacterImage[];
|
|
6
|
-
lookup(letter: string): CharacterImage | null;
|
|
7
|
-
}
|
|
1
|
+
import { CharacterImage } from '../Common/CharacterImage';
|
|
2
|
+
export declare class NavalFlags {
|
|
3
|
+
static readonly instance: NavalFlags;
|
|
4
|
+
private readonly _entries;
|
|
5
|
+
get entries(): CharacterImage[];
|
|
6
|
+
lookup(letter: string): CharacterImage | null;
|
|
7
|
+
}
|
|
@@ -1,114 +1,112 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NavalFlags = void 0;
|
|
4
|
-
const CharacterImage_1 = require("../Common/CharacterImage");
|
|
5
|
-
const InlineSvg_1 = require("../Common/InlineSvg");
|
|
6
|
-
class NavalFlags {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavalFlags = void 0;
|
|
4
|
+
const CharacterImage_1 = require("../Common/CharacterImage");
|
|
5
|
+
const InlineSvg_1 = require("../Common/InlineSvg");
|
|
6
|
+
class NavalFlags {
|
|
7
|
+
static instance = new NavalFlags();
|
|
8
|
+
_entries = [
|
|
9
|
+
// tslint:disable:max-line-length (SVG images are messy)
|
|
10
|
+
new CharacterImage_1.CharacterImage('A', new InlineSvg_1.InlineSvg(`<path d="M 18,18 H 162 L 126,90 L 162,162 H 18 z" fill="#000094"/>
|
|
11
11
|
<rect x="18" y="18" width="72" height="144" fill="#fff"/>
|
|
12
|
-
<path d="M 18,18 H 162 L 126,90 L 162,162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
<path d="M 18,18 H 162 L 126,90 L 162,162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
13
|
+
new CharacterImage_1.CharacterImage('B', new InlineSvg_1.InlineSvg('<path d="M 18,18 H 162 L 126,90 L 162,162 H 18 z" fill="#f00" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>', 180, 180)),
|
|
14
|
+
new CharacterImage_1.CharacterImage('C', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#000094"/>
|
|
15
15
|
<rect x="18" y="46.8" width="144" height="86.4" fill="#fff"/>
|
|
16
16
|
<rect x="18" y="75.6" width="144" height="28.8" fill="#f00"/>
|
|
17
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
18
|
-
|
|
17
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
18
|
+
new CharacterImage_1.CharacterImage('D', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fc0"/>
|
|
19
19
|
<rect x="18" y="54" width="144" height="72" fill="#000094"/>
|
|
20
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
21
|
-
|
|
20
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
21
|
+
new CharacterImage_1.CharacterImage('E', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#000094"/>
|
|
22
22
|
<rect x="18" y="90" width="144" height="72" fill="#f00"/>
|
|
23
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
24
|
-
|
|
23
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
24
|
+
new CharacterImage_1.CharacterImage('F', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fff"/>
|
|
25
25
|
<path d="M 90,18 l 72,72 l -72,72 l -72,-72 z" fill="#f00"/>
|
|
26
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
27
|
-
|
|
26
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
27
|
+
new CharacterImage_1.CharacterImage('G', new InlineSvg_1.InlineSvg(`<path fill="#000094" d="m18,18h144v144H18"/>
|
|
28
28
|
<path stroke="#FC0" stroke-width="24" d="m30,18v144m48,0V18m48,0v144"/>
|
|
29
|
-
<path d="M18,18H162V162H18z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
30
|
-
|
|
29
|
+
<path d="M18,18H162V162H18z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
30
|
+
new CharacterImage_1.CharacterImage('H', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#f00"/>
|
|
31
31
|
<rect x="18" y="18" width="72" height="144" fill="#fff"/>
|
|
32
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
33
|
-
|
|
32
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
33
|
+
new CharacterImage_1.CharacterImage('I', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fc0"/>
|
|
34
34
|
<circle cx="90" cy="90" r="36" fill="#000"/>
|
|
35
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
36
|
-
|
|
35
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
36
|
+
new CharacterImage_1.CharacterImage('J', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#000094"/>
|
|
37
37
|
<rect x="18" y="66" width="144" height="48" fill="#fff"/>
|
|
38
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
39
|
-
|
|
38
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
39
|
+
new CharacterImage_1.CharacterImage('K', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#000094"/>
|
|
40
40
|
<rect x="18" y="18" width="72" height="144" fill="#fc0"/>
|
|
41
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
42
|
-
|
|
43
|
-
<path fill="#FC0" d="m20,20h70v140h70V90H20"/>`, 180, 180)),
|
|
44
|
-
|
|
41
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
42
|
+
new CharacterImage_1.CharacterImage('L', new InlineSvg_1.InlineSvg(`<rect x="16" y="16" width="148" height="148" rx="2"/>
|
|
43
|
+
<path fill="#FC0" d="m20,20h70v140h70V90H20"/>`, 180, 180)),
|
|
44
|
+
new CharacterImage_1.CharacterImage('M', new InlineSvg_1.InlineSvg(`<clipPath id="c">
|
|
45
45
|
<path d="M 18,18 H 162 V 162 H 18 z"/>
|
|
46
46
|
</clipPath>
|
|
47
47
|
<rect x="18" y="18" width="144" height="144" fill="#000094"/>
|
|
48
48
|
<path d="M 18,18 L 162,162 M 162,18 L 18,162" clip-path="url(#c)" stroke="#fff" stroke-width="28.8"/>
|
|
49
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
50
|
-
|
|
49
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
50
|
+
new CharacterImage_1.CharacterImage('N', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fff"/>
|
|
51
51
|
<path d="M 18,18 H 54 V 162 H 90 V 18 H 126 V 162 H 162 V 126 H 18 V 90 H 162 V 54 H 18 z" fill="#000094"/>
|
|
52
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
53
|
-
|
|
52
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
53
|
+
new CharacterImage_1.CharacterImage('O', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fc0"/>
|
|
54
54
|
<path d="M 18,18 H 162 V 162 z" fill="#f00"/>
|
|
55
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
56
|
-
|
|
55
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
56
|
+
new CharacterImage_1.CharacterImage('P', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#000094"/>
|
|
57
57
|
<rect x="54" y="54" width="72" height="72" fill="#fff"/>
|
|
58
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
59
|
-
|
|
60
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
61
|
-
|
|
58
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
59
|
+
new CharacterImage_1.CharacterImage('Q', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fc0"/>
|
|
60
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
61
|
+
new CharacterImage_1.CharacterImage('R', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#f00"/>
|
|
62
62
|
<path d="M 90,18 V 162 M 18,90 H 162" stroke="#fc0" stroke-width="36"/>
|
|
63
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
64
|
-
|
|
63
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
64
|
+
new CharacterImage_1.CharacterImage('S', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fff"/>
|
|
65
65
|
<rect x="54" y="54" width="72" height="72" fill="#000094"/>
|
|
66
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
67
|
-
|
|
66
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
67
|
+
new CharacterImage_1.CharacterImage('T', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#000094"/>
|
|
68
68
|
<rect x="18" y="18" width="96" height="144" fill="#fff"/>
|
|
69
69
|
<rect x="18" y="18" width="48" height="144" fill="#f00"/>
|
|
70
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
71
|
-
|
|
70
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
71
|
+
new CharacterImage_1.CharacterImage('U', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#ffffff"/>
|
|
72
72
|
<path d="M 18,18 H 90 V 90 H 18 z" fill="#ff0000"/>
|
|
73
73
|
<path d="M 162,91 H 91 V 162 H 162 z" fill="#ff0000"/>
|
|
74
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
75
|
-
|
|
74
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
75
|
+
new CharacterImage_1.CharacterImage('V', new InlineSvg_1.InlineSvg(`<clipPath id="c">
|
|
76
76
|
<path d="M 18,18 H 162 V 162 H 18 z"/>
|
|
77
77
|
</clipPath>
|
|
78
78
|
<rect x="18" y="18" width="144" height="144" fill="#fff"/>
|
|
79
79
|
<path d="M 18,18 L 162,162 M 162,18 L 18,162" clip-path="url(#c)" stroke="#f00" stroke-width="28.8"/>
|
|
80
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
81
|
-
|
|
80
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
81
|
+
new CharacterImage_1.CharacterImage('W', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#000094"/>
|
|
82
82
|
<rect x="42" y="42" width="96" height="96" fill="#fff"/>
|
|
83
83
|
<rect x="66" y="66" width="48" height="48" fill="#f00"/>
|
|
84
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
85
|
-
|
|
84
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
85
|
+
new CharacterImage_1.CharacterImage('X', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fff"/>
|
|
86
86
|
<path d="M 90,18 V 162 M 18,90 H 162" stroke="#000094" stroke-width="36"/>
|
|
87
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
88
|
-
|
|
87
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
88
|
+
new CharacterImage_1.CharacterImage('Y', new InlineSvg_1.InlineSvg(`<clipPath id="c"><path d="m18,18h144v144H18"/></clipPath>
|
|
89
89
|
<path fill="#FC0" d="m18,18h144v144H18"/>
|
|
90
90
|
<path stroke="#F00" stroke-dasharray="18.8" stroke-width="250" clip-path="url(#c)" d="m4,4 160,160"/>
|
|
91
|
-
<path fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round" d="M18,18H162V162H18z"/>`, 180, 180)),
|
|
92
|
-
|
|
91
|
+
<path fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round" d="M18,18H162V162H18z"/>`, 180, 180)),
|
|
92
|
+
new CharacterImage_1.CharacterImage('Z', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fc0"/>
|
|
93
93
|
<path d="M 18,18 V 162 H 162 z" fill="#000"/>
|
|
94
94
|
<path d="M 162,18 V 162 H 18 z" fill="#000094"/>
|
|
95
95
|
<path d="M 90,90 L 162,162 H 18 z" fill="#f00"/>
|
|
96
|
-
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
exports.NavalFlags = NavalFlags;
|
|
113
|
-
NavalFlags.instance = new NavalFlags();
|
|
96
|
+
<path d="M 18,18 H 162 V 162 H 18 z" fill="none" stroke="#000" stroke-width="3.75" stroke-linejoin="round"/>`, 180, 180)),
|
|
97
|
+
// tslint:enable:max-line-length
|
|
98
|
+
];
|
|
99
|
+
get entries() {
|
|
100
|
+
return this._entries;
|
|
101
|
+
}
|
|
102
|
+
lookup(letter) {
|
|
103
|
+
for (const ch of this._entries) {
|
|
104
|
+
if (ch.character.toUpperCase() === letter.toUpperCase()) {
|
|
105
|
+
return ch;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
exports.NavalFlags = NavalFlags;
|
|
114
112
|
//# sourceMappingURL=NavalFlags.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavalFlags.js","sourceRoot":"","sources":["../../../src/NavalFlags/NavalFlags.ts"],"names":[],"mappings":";;;AAAA,6DAAwD;AACxD,mDAA8C;AAE9C,MAAa,UAAU;
|
|
1
|
+
{"version":3,"file":"NavalFlags.js","sourceRoot":"","sources":["../../../src/NavalFlags/NavalFlags.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { ResistorColorEntry } from './ResistorColorEntry';
|
|
2
|
-
export declare class Resistor {
|
|
3
|
-
static readonly BLACK: ResistorColorEntry;
|
|
4
|
-
static readonly BROWN: ResistorColorEntry;
|
|
5
|
-
static readonly RED: ResistorColorEntry;
|
|
6
|
-
static readonly ORANGE: ResistorColorEntry;
|
|
7
|
-
static readonly YELLOW: ResistorColorEntry;
|
|
8
|
-
static readonly GREEN: ResistorColorEntry;
|
|
9
|
-
static readonly BLUE: ResistorColorEntry;
|
|
10
|
-
static readonly VIOLET: ResistorColorEntry;
|
|
11
|
-
static readonly GREY: ResistorColorEntry;
|
|
12
|
-
static readonly WHITE: ResistorColorEntry;
|
|
13
|
-
static readonly GOLD: ResistorColorEntry;
|
|
14
|
-
static readonly SILVER: ResistorColorEntry;
|
|
15
|
-
static readonly colorTable: ResistorColorEntry[];
|
|
16
|
-
static readonly INVALID_RESISTOR = -1;
|
|
17
|
-
/**
|
|
18
|
-
* getValue assumes there is no tolerance band, as tolerance is not part of
|
|
19
|
-
* the value calculation
|
|
20
|
-
*/
|
|
21
|
-
static getValue(colors: ResistorColorEntry[]): number;
|
|
22
|
-
static getDisplayValue(value: number): string;
|
|
23
|
-
private static applyMultiplier;
|
|
24
|
-
}
|
|
1
|
+
import { ResistorColorEntry } from './ResistorColorEntry';
|
|
2
|
+
export declare class Resistor {
|
|
3
|
+
static readonly BLACK: ResistorColorEntry;
|
|
4
|
+
static readonly BROWN: ResistorColorEntry;
|
|
5
|
+
static readonly RED: ResistorColorEntry;
|
|
6
|
+
static readonly ORANGE: ResistorColorEntry;
|
|
7
|
+
static readonly YELLOW: ResistorColorEntry;
|
|
8
|
+
static readonly GREEN: ResistorColorEntry;
|
|
9
|
+
static readonly BLUE: ResistorColorEntry;
|
|
10
|
+
static readonly VIOLET: ResistorColorEntry;
|
|
11
|
+
static readonly GREY: ResistorColorEntry;
|
|
12
|
+
static readonly WHITE: ResistorColorEntry;
|
|
13
|
+
static readonly GOLD: ResistorColorEntry;
|
|
14
|
+
static readonly SILVER: ResistorColorEntry;
|
|
15
|
+
static readonly colorTable: ResistorColorEntry[];
|
|
16
|
+
static readonly INVALID_RESISTOR = -1;
|
|
17
|
+
/**
|
|
18
|
+
* getValue assumes there is no tolerance band, as tolerance is not part of
|
|
19
|
+
* the value calculation
|
|
20
|
+
*/
|
|
21
|
+
static getValue(colors: ResistorColorEntry[]): number;
|
|
22
|
+
static getDisplayValue(value: number): string;
|
|
23
|
+
private static applyMultiplier;
|
|
24
|
+
}
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Resistor = void 0;
|
|
4
|
-
const ResistorColorEntry_1 = require("./ResistorColorEntry");
|
|
5
|
-
class Resistor {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
static
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
Resistor
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Resistor = void 0;
|
|
4
|
+
const ResistorColorEntry_1 = require("./ResistorColorEntry");
|
|
5
|
+
class Resistor {
|
|
6
|
+
// Name, Color, Multiplier, Value, Tolerance
|
|
7
|
+
static BLACK = new ResistorColorEntry_1.ResistorColorEntry('Black', '#000000', 1, 0);
|
|
8
|
+
static BROWN = new ResistorColorEntry_1.ResistorColorEntry('Brown', '#8B4513', 10, 1, 1);
|
|
9
|
+
static RED = new ResistorColorEntry_1.ResistorColorEntry('Red', '#FF0000', 100, 2, 2);
|
|
10
|
+
static ORANGE = new ResistorColorEntry_1.ResistorColorEntry('Orange', '#EE7420', 1000, 3);
|
|
11
|
+
static YELLOW = new ResistorColorEntry_1.ResistorColorEntry('Yellow', '#FFFF00', 10000, 4);
|
|
12
|
+
static GREEN = new ResistorColorEntry_1.ResistorColorEntry('Green', '#008000', 100000, 5, 0.5);
|
|
13
|
+
static BLUE = new ResistorColorEntry_1.ResistorColorEntry('Blue', '#0000FF', 1000000, 6, 0.25);
|
|
14
|
+
static VIOLET = new ResistorColorEntry_1.ResistorColorEntry('Violet', '#800080', 10000000, 7, 0.1);
|
|
15
|
+
static GREY = new ResistorColorEntry_1.ResistorColorEntry('Grey', '#808080', 100000000, 8);
|
|
16
|
+
static WHITE = new ResistorColorEntry_1.ResistorColorEntry('White', '#FFFFFF', 1000000000, 9);
|
|
17
|
+
static GOLD = new ResistorColorEntry_1.ResistorColorEntry('Gold', '#AB8D3F', 0.1, undefined, 5);
|
|
18
|
+
static SILVER = new ResistorColorEntry_1.ResistorColorEntry('Silver', '#C0C0C0', 0.01, undefined, 10);
|
|
19
|
+
static colorTable = [
|
|
20
|
+
Resistor.BLACK,
|
|
21
|
+
Resistor.BROWN,
|
|
22
|
+
Resistor.RED,
|
|
23
|
+
Resistor.ORANGE,
|
|
24
|
+
Resistor.YELLOW,
|
|
25
|
+
Resistor.GREEN,
|
|
26
|
+
Resistor.BLUE,
|
|
27
|
+
Resistor.VIOLET,
|
|
28
|
+
Resistor.GREY,
|
|
29
|
+
Resistor.WHITE,
|
|
30
|
+
Resistor.GOLD,
|
|
31
|
+
Resistor.SILVER,
|
|
32
|
+
];
|
|
33
|
+
static INVALID_RESISTOR = -1;
|
|
34
|
+
/**
|
|
35
|
+
* getValue assumes there is no tolerance band, as tolerance is not part of
|
|
36
|
+
* the value calculation
|
|
37
|
+
*/
|
|
38
|
+
static getValue(colors) {
|
|
39
|
+
if (colors.length < 3 || colors.length > 4) {
|
|
40
|
+
throw new RangeError('Invalid resistor size');
|
|
41
|
+
}
|
|
42
|
+
// Should we throw an error if the first color is black? In resistors, it's
|
|
43
|
+
// technically not allowed, but in puzzle events who knows what they'll do.
|
|
44
|
+
// The math works out fine (it's just a leading zero), so for now it's
|
|
45
|
+
// allowed.
|
|
46
|
+
// Iterate through all but the final band (the multipler) and extract the
|
|
47
|
+
// values
|
|
48
|
+
let value = 0;
|
|
49
|
+
for (let i = 0; i < colors.length - 1; ++i) {
|
|
50
|
+
const currentColor = colors[i];
|
|
51
|
+
if (currentColor.value === undefined) {
|
|
52
|
+
return Resistor.INVALID_RESISTOR;
|
|
53
|
+
}
|
|
54
|
+
value *= 10;
|
|
55
|
+
value += currentColor.value;
|
|
56
|
+
}
|
|
57
|
+
return Resistor.applyMultiplier(value, colors[colors.length - 1].multiplier);
|
|
58
|
+
}
|
|
59
|
+
static getDisplayValue(value) {
|
|
60
|
+
if (value >= 1000000000) {
|
|
61
|
+
return `${value / 1000000000}G`;
|
|
62
|
+
}
|
|
63
|
+
else if (value >= 1000000) {
|
|
64
|
+
return `${value / 1000000}M`;
|
|
65
|
+
}
|
|
66
|
+
else if (value >= 1000) {
|
|
67
|
+
return `${value / 1000}k`;
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
return value.toString();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
static applyMultiplier(value, multipler) {
|
|
74
|
+
if (multipler >= 1) {
|
|
75
|
+
return value * multipler;
|
|
76
|
+
}
|
|
77
|
+
else if (multipler > 0) {
|
|
78
|
+
// Avoid floating point multiplication issues
|
|
79
|
+
return value / (1 / multipler);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
throw new RangeError('Invalid multiplier');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.Resistor = Resistor;
|
|
87
87
|
//# sourceMappingURL=Resistor.js.map
|