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.
Files changed (143) hide show
  1. package/build/src/Braille/BrailleCharacter.d.ts +15 -15
  2. package/build/src/Braille/BrailleCharacter.js +39 -38
  3. package/build/src/Braille/BrailleCharacter.js.map +1 -1
  4. package/build/src/Braille/BrailleData.d.ts +6 -6
  5. package/build/src/Braille/BrailleData.js +65 -65
  6. package/build/src/Braille/BrailleData.js.map +1 -1
  7. package/build/src/Braille/BrailleDot.d.ts +9 -9
  8. package/build/src/Braille/BrailleDot.js +13 -13
  9. package/build/src/Braille/BrailleDot.js.map +1 -1
  10. package/build/src/Braille/BrailleEncoding.d.ts +54 -54
  11. package/build/src/Braille/BrailleEncoding.js +66 -65
  12. package/build/src/Braille/BrailleEncoding.js.map +1 -1
  13. package/build/src/Braille/BrailleStream.d.ts +18 -18
  14. package/build/src/Braille/BrailleStream.js +75 -75
  15. package/build/src/Braille/BrailleStream.js.map +1 -1
  16. package/build/src/Cipher/AutoKeyString.d.ts +4 -4
  17. package/build/src/Cipher/AutoKeyString.js +34 -34
  18. package/build/src/Cipher/CaesarString.d.ts +8 -8
  19. package/build/src/Cipher/CaesarString.js +32 -31
  20. package/build/src/Cipher/CaesarString.js.map +1 -1
  21. package/build/src/Cipher/CaesarUtils.d.ts +13 -13
  22. package/build/src/Cipher/CaesarUtils.js +57 -57
  23. package/build/src/Cipher/CaesarUtils.js.map +1 -1
  24. package/build/src/Cipher/KeyedCipherStringBase.d.ts +12 -12
  25. package/build/src/Cipher/KeyedCipherStringBase.js +30 -28
  26. package/build/src/Cipher/KeyedCipherStringBase.js.map +1 -1
  27. package/build/src/Cipher/VigenereString.d.ts +4 -4
  28. package/build/src/Cipher/VigenereString.js +21 -21
  29. package/build/src/Common/CharacterImage.d.ts +6 -6
  30. package/build/src/Common/CharacterImage.js +12 -10
  31. package/build/src/Common/CharacterImage.js.map +1 -1
  32. package/build/src/Common/EncodingCategory.d.ts +8 -8
  33. package/build/src/Common/EncodingCategory.js +12 -12
  34. package/build/src/Common/EncodingCategory.js.map +1 -1
  35. package/build/src/Common/EncodingCharacterBase.d.ts +23 -23
  36. package/build/src/Common/EncodingCharacterBase.js +54 -52
  37. package/build/src/Common/EncodingCharacterBase.js.map +1 -1
  38. package/build/src/Common/EncodingDataBase.d.ts +7 -7
  39. package/build/src/Common/EncodingDataBase.js +27 -29
  40. package/build/src/Common/EncodingDataBase.js.map +1 -1
  41. package/build/src/Common/EncodingEntry.d.ts +8 -8
  42. package/build/src/Common/EncodingEntry.js +17 -14
  43. package/build/src/Common/EncodingEntry.js.map +1 -1
  44. package/build/src/Common/EncodingLookupResult.d.ts +6 -6
  45. package/build/src/Common/EncodingLookupResult.js +11 -13
  46. package/build/src/Common/EncodingLookupResult.js.map +1 -1
  47. package/build/src/Common/Helpers.d.ts +4 -4
  48. package/build/src/Common/Helpers.js +16 -16
  49. package/build/src/Common/InlineSvg.d.ts +7 -7
  50. package/build/src/Common/InlineSvg.js +17 -14
  51. package/build/src/Common/InlineSvg.js.map +1 -1
  52. package/build/src/Conversion/CharacterAutoConvert.d.ts +10 -10
  53. package/build/src/Conversion/CharacterAutoConvert.js +88 -88
  54. package/build/src/Conversion/CharacterAutoConvert.js.map +1 -1
  55. package/build/src/Conversion/CharacterConversion.d.ts +8 -8
  56. package/build/src/Conversion/CharacterConversion.js +50 -50
  57. package/build/src/Conversion/CharacterEncoding.d.ts +9 -9
  58. package/build/src/Conversion/CharacterEncoding.js +13 -13
  59. package/build/src/Conversion/CharacterEncoding.js.map +1 -1
  60. package/build/src/Conversion/CharacterTableEntry.d.ts +10 -10
  61. package/build/src/Conversion/CharacterTableEntry.js +25 -19
  62. package/build/src/Conversion/CharacterTableEntry.js.map +1 -1
  63. package/build/src/Conversion/SignificantFigures.d.ts +7 -7
  64. package/build/src/Conversion/SignificantFigures.js +50 -50
  65. package/build/src/Conversion/StringAutoConvert.d.ts +6 -6
  66. package/build/src/Conversion/StringAutoConvert.js +46 -46
  67. package/build/src/Morse/MorseCharacter.d.ts +22 -22
  68. package/build/src/Morse/MorseCharacter.js +97 -96
  69. package/build/src/Morse/MorseCharacter.js.map +1 -1
  70. package/build/src/Morse/MorseData.d.ts +6 -6
  71. package/build/src/Morse/MorseData.js +70 -70
  72. package/build/src/Morse/MorseData.js.map +1 -1
  73. package/build/src/Morse/MorseEncoding.d.ts +59 -59
  74. package/build/src/Morse/MorseEncoding.js +94 -94
  75. package/build/src/Morse/MorseEncoding.js.map +1 -1
  76. package/build/src/Morse/MorseString.d.ts +10 -10
  77. package/build/src/Morse/MorseString.js +67 -66
  78. package/build/src/Morse/MorseString.js.map +1 -1
  79. package/build/src/Nato/NatoCharacter.d.ts +5 -5
  80. package/build/src/Nato/NatoCharacter.js +12 -10
  81. package/build/src/Nato/NatoCharacter.js.map +1 -1
  82. package/build/src/Nato/NatoData.d.ts +7 -7
  83. package/build/src/Nato/NatoData.js +49 -51
  84. package/build/src/Nato/NatoData.js.map +1 -1
  85. package/build/src/NavalFlags/NavalFlags.d.ts +7 -7
  86. package/build/src/NavalFlags/NavalFlags.js +75 -77
  87. package/build/src/NavalFlags/NavalFlags.js.map +1 -1
  88. package/build/src/Resistor/Resistor.d.ts +24 -24
  89. package/build/src/Resistor/Resistor.js +86 -86
  90. package/build/src/Resistor/Resistor.js.map +1 -1
  91. package/build/src/Resistor/ResistorColorEntry.d.ts +12 -12
  92. package/build/src/Resistor/ResistorColorEntry.js +36 -31
  93. package/build/src/Resistor/ResistorColorEntry.js.map +1 -1
  94. package/build/src/Semaphore/SemaphoreCharacter.d.ts +20 -20
  95. package/build/src/Semaphore/SemaphoreCharacter.js +75 -75
  96. package/build/src/Semaphore/SemaphoreCharacter.js.map +1 -1
  97. package/build/src/Semaphore/SemaphoreData.d.ts +6 -6
  98. package/build/src/Semaphore/SemaphoreData.js +53 -53
  99. package/build/src/Semaphore/SemaphoreData.js.map +1 -1
  100. package/build/src/Semaphore/SemaphoreDegrees.d.ts +5 -5
  101. package/build/src/Semaphore/SemaphoreDegrees.js +26 -26
  102. package/build/src/Semaphore/SemaphoreDirection.d.ts +11 -11
  103. package/build/src/Semaphore/SemaphoreDirection.js +15 -15
  104. package/build/src/Semaphore/SemaphoreDirection.js.map +1 -1
  105. package/build/src/Semaphore/SemaphoreEncoding.d.ts +40 -40
  106. package/build/src/Semaphore/SemaphoreEncoding.js +48 -47
  107. package/build/src/Semaphore/SemaphoreEncoding.js.map +1 -1
  108. package/build/src/Semaphore/SemaphoreStream.d.ts +17 -17
  109. package/build/src/Semaphore/SemaphoreStream.js +73 -72
  110. package/build/src/Semaphore/SemaphoreStream.js.map +1 -1
  111. package/build/src/WordSearch/Point.d.ts +4 -4
  112. package/build/src/WordSearch/Point.js +2 -2
  113. package/build/src/WordSearch/Result.d.ts +6 -6
  114. package/build/src/WordSearch/Result.js +12 -10
  115. package/build/src/WordSearch/Result.js.map +1 -1
  116. package/build/src/WordSearch/WordSearchDirection.d.ts +6 -6
  117. package/build/src/WordSearch/WordSearchDirection.js +10 -10
  118. package/build/src/WordSearch/WordSearchDirection.js.map +1 -1
  119. package/build/src/WordSearch/WordSearchSolver.d.ts +27 -27
  120. package/build/src/WordSearch/WordSearchSolver.js +232 -222
  121. package/build/src/WordSearch/WordSearchSolver.js.map +1 -1
  122. package/build/src/index.d.ts +35 -35
  123. package/build/src/index.js +72 -72
  124. package/package.json +5 -5
  125. package/src/Braille/BrailleCharacter.ts +1 -1
  126. package/src/Braille/BrailleData.ts +16 -16
  127. package/src/Cipher/AutoKeyString.ts +1 -1
  128. package/src/Cipher/CaesarUtils.ts +1 -1
  129. package/src/Cipher/VigenereString.ts +1 -1
  130. package/src/Common/EncodingDataBase.ts +1 -1
  131. package/src/Conversion/CharacterAutoConvert.ts +1 -1
  132. package/src/Conversion/CharacterConversion.ts +5 -5
  133. package/src/Conversion/SignificantFigures.ts +1 -1
  134. package/src/Conversion/StringAutoConvert.ts +2 -2
  135. package/src/Morse/MorseData.ts +18 -18
  136. package/src/Morse/MorseString.ts +12 -12
  137. package/src/Nato/NatoData.ts +1 -1
  138. package/src/NavalFlags/NavalFlags.ts +52 -52
  139. package/src/Resistor/Resistor.ts +9 -9
  140. package/src/Resistor/ResistorColorEntry.ts +1 -1
  141. package/src/Semaphore/SemaphoreCharacter.ts +5 -5
  142. package/src/Semaphore/SemaphoreData.ts +1 -1
  143. 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
- constructor() {
9
- this._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', 'Juliet'),
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
- }
38
- get entries() {
39
- return this._entries;
40
- }
41
- lookup(letter) {
42
- for (const ch of this._entries) {
43
- if (ch.character.toUpperCase() === letter.toUpperCase()) {
44
- return ch;
45
- }
46
- }
47
- return null;
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;IAArB;QAGmB,aAAQ,GAAoB;YAC3C,IAAI,6BAAa,CAAC,GAAG,EAAE,MAAM,CAAC;YAC9B,IAAI,6BAAa,CAAC,GAAG,EAAE,OAAO,CAAC;YAC/B,IAAI,6BAAa,CAAC,GAAG,EAAE,SAAS,CAAC;YACjC,IAAI,6BAAa,CAAC,GAAG,EAAE,OAAO,CAAC;YAC/B,IAAI,6BAAa,CAAC,GAAG,EAAE,MAAM,CAAC;YAC9B,IAAI,6BAAa,CAAC,GAAG,EAAE,SAAS,CAAC;YAC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Q,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
- constructor() {
8
- this._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"/>
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
- 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"/>
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
- new CharacterImage_1.CharacterImage('D', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fc0"/>
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
- new CharacterImage_1.CharacterImage('E', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" 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
+ 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
- new CharacterImage_1.CharacterImage('F', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fff"/>
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
- new CharacterImage_1.CharacterImage('G', new InlineSvg_1.InlineSvg(`<path fill="#000094" d="m18,18h144v144H18"/>
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
- new CharacterImage_1.CharacterImage('H', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#f00"/>
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
- new CharacterImage_1.CharacterImage('I', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fc0"/>
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
- new CharacterImage_1.CharacterImage('J', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#000094"/>
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
- new CharacterImage_1.CharacterImage('K', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#000094"/>
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
- 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">
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
- new CharacterImage_1.CharacterImage('N', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fff"/>
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
- new CharacterImage_1.CharacterImage('O', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fc0"/>
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
- new CharacterImage_1.CharacterImage('P', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#000094"/>
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
- 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"/>
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
- new CharacterImage_1.CharacterImage('S', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fff"/>
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
- new CharacterImage_1.CharacterImage('T', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" 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
+ 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
- new CharacterImage_1.CharacterImage('U', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#ffffff"/>
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
- new CharacterImage_1.CharacterImage('V', new InlineSvg_1.InlineSvg(`<clipPath id="c">
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
- new CharacterImage_1.CharacterImage('W', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#000094"/>
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
- new CharacterImage_1.CharacterImage('X', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fff"/>
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
- new CharacterImage_1.CharacterImage('Y', new InlineSvg_1.InlineSvg(`<clipPath id="c"><path d="m18,18h144v144H18"/></clipPath>
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
- new CharacterImage_1.CharacterImage('Z', new InlineSvg_1.InlineSvg(`<rect x="18" y="18" width="144" height="144" fill="#fc0"/>
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
- // tslint:enable:max-line-length
98
- ];
99
- }
100
- get entries() {
101
- return this._entries;
102
- }
103
- lookup(letter) {
104
- for (const ch of this._entries) {
105
- if (ch.character.toUpperCase() === letter.toUpperCase()) {
106
- return ch;
107
- }
108
- }
109
- return null;
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;IAAvB;QAGmB,aAAQ,GAAqB;YAC5C,wDAAwD;YACxD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX;;gIAEwH,EACxH,GAAG,EACH,GAAG,CACJ,CACF;YACD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX,2HAA2H,EAC3H,GAAG,EACH,GAAG,CACJ,CACF;YACD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX;;;mHAG2G,EAC3G,GAAG,EACH,GAAG,CACJ,CACF;YACD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX;;mHAE2G,EAC3G,GAAG,EACH,GAAG,CACJ,CACF;YACD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX;;mHAE2G,EAC3G,GAAG,EACH,GAAG,CACJ,CACF;YACD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX;;mHAE2G,EAC3G,GAAG,EACH,GAAG,CACJ,CACF;YACD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX;;2GAEmG,EACnG,GAAG,EACH,GAAG,CACJ,CACF;YACD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX;;mHAE2G,EAC3G,GAAG,EACH,GAAG,CACJ,CACF;YACD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX;;mHAE2G,EAC3G,GAAG,EACH,GAAG,CACJ,CACF;YACD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX;;mHAE2G,EAC3G,GAAG,EACH,GAAG,CACJ,CACF;YACD,IAAI,+BAAc,C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G,EACH,GAAG,CACJ,CACF;YACD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX;;mHAE2G,EAC3G,GAAG,EACH,GAAG,CACJ,CACF;YACD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX;;;2GAGmG,EACnG,GAAG,EACH,GAAG,CACJ,CACF;YACD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX;;;;mHAI2G,EAC3G,GAAG,EACH,GAAG,CACJ,CACF;YACD,gCAAgC;SACjC,CAAC;IAcJ,CAAC;IAZC,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;;AAhSH,gCAiSC;AAhSiB,mBAAQ,GAAe,IAAI,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"NavalFlags.js","sourceRoot":"","sources":["../../../src/NavalFlags/NavalFlags.ts"],"names":[],"mappings":";;;AAAA,6DAAwD;AACxD,mDAA8C;AAE9C,MAAa,UAAU;IACrB,MAAM,CAAU,QAAQ,GAAe,IAAI,UAAU,EAAE,CAAC;IAEvC,QAAQ,GAAqB;QAC5C,wDAAwD;QACxD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX;;gIAEwH,EACxH,GAAG,EACH,GAAG,CACJ,CACF;QACD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX,2HAA2H,EAC3H,GAAG,EACH,GAAG,CACJ,CACF;QACD,IAAI,+BAAc,CAChB,GAAG,EACH,IAAI,qBAAS,CACX;;;mHAG2G,EAC3G,GAAG,EACH,GAAG,C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AC,WAAW,EAAE,KAAK,MAAM,CAAC,WAAW,EAAE,EAAE;gBACvD,OAAO,EAAE,CAAC;aACX;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;;AAhSH,gCAiSC"}
@@ -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
- * getValue assumes there is no tolerance band, as tolerance is not part of
8
- * the value calculation
9
- */
10
- static getValue(colors) {
11
- if (colors.length < 3 || colors.length > 4) {
12
- throw new RangeError('Invalid resistor size');
13
- }
14
- // Should we throw an error if the first color is black? In resistors, it's
15
- // technically not allowed, but in puzzle events who knows what they'll do.
16
- // The math works out fine (it's just a leading zero), so for now it's
17
- // allowed.
18
- // Iterate through all but the final band (the multipler) and extract the
19
- // values
20
- let value = 0;
21
- for (let i = 0; i < colors.length - 1; ++i) {
22
- const currentColor = colors[i];
23
- if (currentColor.value === undefined) {
24
- return Resistor.INVALID_RESISTOR;
25
- }
26
- value *= 10;
27
- value += currentColor.value;
28
- }
29
- return Resistor.applyMultiplier(value, colors[colors.length - 1].multiplier);
30
- }
31
- static getDisplayValue(value) {
32
- if (value >= 1000000000) {
33
- return `${value / 1000000000}G`;
34
- }
35
- else if (value >= 1000000) {
36
- return `${value / 1000000}M`;
37
- }
38
- else if (value >= 1000) {
39
- return `${value / 1000}k`;
40
- }
41
- else {
42
- return value.toString();
43
- }
44
- }
45
- static applyMultiplier(value, multipler) {
46
- if (multipler >= 1) {
47
- return value * multipler;
48
- }
49
- else if (multipler > 0) {
50
- // Avoid floating point multiplication issues
51
- return value / (1 / multipler);
52
- }
53
- else {
54
- throw new RangeError('Invalid multiplier');
55
- }
56
- }
57
- }
58
- exports.Resistor = Resistor;
59
- // Name, Color, Multiplier, Value, Tolerance
60
- Resistor.BLACK = new ResistorColorEntry_1.ResistorColorEntry('Black', '#000000', 1, 0);
61
- Resistor.BROWN = new ResistorColorEntry_1.ResistorColorEntry('Brown', '#8B4513', 10, 1, 1);
62
- Resistor.RED = new ResistorColorEntry_1.ResistorColorEntry('Red', '#FF0000', 100, 2, 2);
63
- Resistor.ORANGE = new ResistorColorEntry_1.ResistorColorEntry('Orange', '#EE7420', 1000, 3);
64
- Resistor.YELLOW = new ResistorColorEntry_1.ResistorColorEntry('Yellow', '#FFFF00', 10000, 4);
65
- Resistor.GREEN = new ResistorColorEntry_1.ResistorColorEntry('Green', '#008000', 100000, 5, 0.5);
66
- Resistor.BLUE = new ResistorColorEntry_1.ResistorColorEntry('Blue', '#0000FF', 1000000, 6, 0.25);
67
- Resistor.VIOLET = new ResistorColorEntry_1.ResistorColorEntry('Violet', '#800080', 10000000, 7, 0.1);
68
- Resistor.GREY = new ResistorColorEntry_1.ResistorColorEntry('Grey', '#808080', 100000000, 8);
69
- Resistor.WHITE = new ResistorColorEntry_1.ResistorColorEntry('White', '#FFFFFF', 1000000000, 9);
70
- Resistor.GOLD = new ResistorColorEntry_1.ResistorColorEntry('Gold', '#AB8D3F', 0.1, undefined, 5);
71
- Resistor.SILVER = new ResistorColorEntry_1.ResistorColorEntry('Silver', '#C0C0C0', 0.01, undefined, 10);
72
- Resistor.colorTable = [
73
- Resistor.BLACK,
74
- Resistor.BROWN,
75
- Resistor.RED,
76
- Resistor.ORANGE,
77
- Resistor.YELLOW,
78
- Resistor.GREEN,
79
- Resistor.BLUE,
80
- Resistor.VIOLET,
81
- Resistor.GREY,
82
- Resistor.WHITE,
83
- Resistor.GOLD,
84
- Resistor.SILVER,
85
- ];
86
- Resistor.INVALID_RESISTOR = -1;
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