@jbrowse/core 2.0.0 → 2.1.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.
Files changed (184) hide show
  1. package/BaseFeatureWidget/BaseFeatureDetail.d.ts +9 -3
  2. package/BaseFeatureWidget/BaseFeatureDetail.js +313 -581
  3. package/BaseFeatureWidget/SequenceFeatureDetails.js +213 -478
  4. package/BaseFeatureWidget/index.js +88 -126
  5. package/BaseFeatureWidget/types.d.ts +1 -0
  6. package/BaseFeatureWidget/types.js +1 -4
  7. package/BaseFeatureWidget/util.js +40 -75
  8. package/CorePlugin.js +55 -94
  9. package/Plugin.js +9 -34
  10. package/PluginLoader.js +153 -422
  11. package/PluginManager.d.ts +28 -33
  12. package/PluginManager.js +377 -666
  13. package/ReExports/Attributes.js +3 -10
  14. package/ReExports/BaseCard.js +3 -10
  15. package/ReExports/DataGrid.js +5 -12
  16. package/ReExports/FeatureDetails.js +3 -10
  17. package/ReExports/index.js +6 -12
  18. package/ReExports/list.d.ts +5 -0
  19. package/ReExports/list.js +271 -7
  20. package/ReExports/material-ui-colors.js +15 -16
  21. package/ReExports/modules.d.ts +11 -20
  22. package/ReExports/modules.js +453 -798
  23. package/TextSearch/BaseResults.js +51 -123
  24. package/TextSearch/TextSearchManager.js +66 -144
  25. package/assemblyManager/assembly.js +280 -555
  26. package/assemblyManager/assemblyConfigSchema.js +47 -64
  27. package/assemblyManager/assemblyManager.js +126 -272
  28. package/assemblyManager/index.js +9 -22
  29. package/configuration/configurationSchema.js +167 -203
  30. package/configuration/configurationSlot.js +248 -326
  31. package/configuration/index.js +19 -35
  32. package/configuration/util.js +131 -173
  33. package/data_adapters/BaseAdapter.d.ts +2 -2
  34. package/data_adapters/BaseAdapter.js +132 -521
  35. package/data_adapters/CytobandAdapter.js +40 -126
  36. package/data_adapters/dataAdapterCache.js +77 -158
  37. package/package.json +4 -5
  38. package/pluggableElementTypes/AdapterType.js +24 -79
  39. package/pluggableElementTypes/AddTrackWorkflowType.d.ts +17 -0
  40. package/pluggableElementTypes/AddTrackWorkflowType.js +20 -0
  41. package/pluggableElementTypes/ConnectionType.js +22 -65
  42. package/pluggableElementTypes/DisplayType.js +35 -82
  43. package/pluggableElementTypes/InternetAccountType.js +23 -64
  44. package/pluggableElementTypes/PluggableElementBase.js +8 -20
  45. package/pluggableElementTypes/RpcMethodType.js +85 -427
  46. package/pluggableElementTypes/TextSearchAdapterType.js +16 -55
  47. package/pluggableElementTypes/TrackType.js +26 -70
  48. package/pluggableElementTypes/ViewType.js +21 -63
  49. package/pluggableElementTypes/WidgetType.js +21 -64
  50. package/pluggableElementTypes/index.d.ts +4 -3
  51. package/pluggableElementTypes/index.js +42 -125
  52. package/pluggableElementTypes/models/BaseConnectionModelFactory.js +28 -43
  53. package/pluggableElementTypes/models/BaseDisplayModel.js +58 -95
  54. package/pluggableElementTypes/models/BaseTrackModel.js +139 -199
  55. package/pluggableElementTypes/models/BaseViewModel.js +24 -40
  56. package/pluggableElementTypes/models/InternetAccountModel.js +116 -263
  57. package/pluggableElementTypes/models/baseConnectionConfig.js +14 -25
  58. package/pluggableElementTypes/models/baseInternetAccountConfig.js +29 -38
  59. package/pluggableElementTypes/models/baseTrackConfig.js +106 -133
  60. package/pluggableElementTypes/models/index.js +21 -70
  61. package/pluggableElementTypes/renderers/BoxRendererType.js +132 -291
  62. package/pluggableElementTypes/renderers/CircularChordRendererType.js +8 -38
  63. package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +60 -192
  64. package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +0 -2
  65. package/pluggableElementTypes/renderers/FeatureRendererType.js +89 -255
  66. package/pluggableElementTypes/renderers/RendererType.js +31 -105
  67. package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +61 -72
  68. package/pluggableElementTypes/renderers/ServerSideRendererType.js +112 -265
  69. package/pluggableElementTypes/renderers/index.js +19 -62
  70. package/pluggableElementTypes/renderers/util/serializableFilterChain.js +27 -65
  71. package/rpc/BaseRpcDriver.js +169 -405
  72. package/rpc/MainThreadRpcDriver.js +27 -150
  73. package/rpc/RpcManager.js +58 -159
  74. package/rpc/WebWorkerRpcDriver.js +54 -171
  75. package/rpc/configSchema.js +25 -49
  76. package/rpc/coreRpcMethods.d.ts +1 -3
  77. package/rpc/coreRpcMethods.js +221 -959
  78. package/rpc/remoteAbortSignals.js +46 -70
  79. package/tsconfig.build.tsbuildinfo +1 -1
  80. package/ui/AboutDialog.js +106 -162
  81. package/ui/App.js +157 -242
  82. package/ui/AssemblySelector.js +59 -120
  83. package/ui/CascadingMenu.js +101 -196
  84. package/ui/ColorPicker.d.ts +16 -0
  85. package/ui/ColorPicker.js +97 -0
  86. package/ui/Drawer.js +28 -61
  87. package/ui/DrawerWidget.js +108 -202
  88. package/ui/DropDownMenu.js +60 -91
  89. package/ui/EditableTypography.js +87 -149
  90. package/ui/ErrorMessage.js +41 -56
  91. package/ui/FactoryResetDialog.js +24 -57
  92. package/ui/FatalErrorDialog.js +59 -91
  93. package/ui/FileSelector/FileSelector.js +123 -189
  94. package/ui/FileSelector/LocalFileChooser.js +44 -75
  95. package/ui/FileSelector/UrlChooser.js +17 -38
  96. package/ui/FileSelector/index.js +6 -12
  97. package/ui/Icons.js +45 -69
  98. package/ui/Logo.js +57 -110
  99. package/ui/Menu.js +232 -354
  100. package/ui/PrerenderedCanvas.js +63 -87
  101. package/ui/ResizeHandle.js +87 -116
  102. package/ui/ReturnToImportFormDialog.js +32 -63
  103. package/ui/SanitizedHTML.js +64 -47
  104. package/ui/Snackbar.js +74 -101
  105. package/ui/SnackbarModel.js +37 -51
  106. package/ui/Tooltip.js +49 -76
  107. package/ui/ViewContainer.js +113 -196
  108. package/ui/colors.d.ts +10 -0
  109. package/ui/colors.js +78 -0
  110. package/ui/index.js +51 -181
  111. package/ui/react-colorful.d.ts +17 -0
  112. package/ui/react-colorful.js +455 -0
  113. package/ui/theme.d.ts +23 -1
  114. package/ui/theme.js +199 -247
  115. package/util/Base1DUtils.d.ts +32 -0
  116. package/util/Base1DUtils.js +174 -0
  117. package/util/Base1DViewModel.d.ts +16 -30
  118. package/util/Base1DViewModel.js +116 -293
  119. package/util/QuickLRU.js +84 -332
  120. package/util/TimeTraveller.d.ts +19 -0
  121. package/util/TimeTraveller.js +86 -0
  122. package/util/aborting.js +49 -127
  123. package/util/analytics.js +91 -154
  124. package/util/blockTypes.js +106 -240
  125. package/util/calculateDynamicBlocks.js +98 -128
  126. package/util/calculateStaticBlocks.js +105 -125
  127. package/util/color/cssColorsLevel4.js +156 -160
  128. package/util/color/index.js +33 -55
  129. package/util/compositeMap.js +49 -333
  130. package/util/formatFastaStrings.js +9 -14
  131. package/util/idMaker.js +18 -31
  132. package/util/index.d.ts +18 -32
  133. package/util/index.js +747 -1226
  134. package/util/io/RemoteFileWithRangeCache.js +88 -257
  135. package/util/io/index.js +95 -169
  136. package/util/jexl.js +60 -115
  137. package/util/jexlStrings.js +24 -29
  138. package/util/layouts/BaseLayout.js +1 -4
  139. package/util/layouts/GranularRectLayout.js +388 -555
  140. package/util/layouts/MultiLayout.js +41 -109
  141. package/util/layouts/PrecomputedLayout.js +56 -112
  142. package/util/layouts/PrecomputedMultiLayout.js +22 -59
  143. package/util/layouts/SceneGraph.js +127 -197
  144. package/util/layouts/index.js +29 -66
  145. package/util/mst-reflection.js +55 -71
  146. package/util/offscreenCanvasPonyfill.js +66 -134
  147. package/util/offscreenCanvasUtils.d.ts +2 -7
  148. package/util/offscreenCanvasUtils.js +49 -146
  149. package/util/range.js +29 -40
  150. package/util/rxjs.js +20 -27
  151. package/util/simpleFeature.js +88 -152
  152. package/util/stats.js +91 -151
  153. package/util/tracks.js +130 -173
  154. package/util/types/index.js +110 -179
  155. package/util/types/mst.js +91 -146
  156. package/util/types/util.js +1 -4
  157. package/util/when.js +54 -101
  158. package/BaseFeatureWidget/SequenceFeatureDetails.test.js +0 -122
  159. package/BaseFeatureWidget/index.test.js +0 -69
  160. package/TextSearch/BaseResults.test.js +0 -42
  161. package/configuration/configurationSchema.test.js +0 -266
  162. package/configuration/configurationSlot.test.js +0 -69
  163. package/configuration/util.test.js +0 -39
  164. package/data_adapters/BaseAdapter.test.js +0 -200
  165. package/declare.d.js +0 -1
  166. package/pluggableElementTypes/RpcMethodType.test.js +0 -118
  167. package/pluggableElementTypes/renderers/declare.d.js +0 -1
  168. package/pluggableElementTypes/renderers/util/serializableFilterChain.test.js +0 -20
  169. package/rpc/BaseRpcDriver.test.js +0 -540
  170. package/rpc/declaration.d.js +0 -1
  171. package/ui/FatalErrorDialog.test.js +0 -82
  172. package/ui/SanitizedHTML.test.js +0 -36
  173. package/ui/theme.test.js +0 -92
  174. package/util/Base1DViewModel.test.js +0 -130
  175. package/util/calculateDynamicBlocks.test.js +0 -74
  176. package/util/calculateStaticBlocks.test.js +0 -297
  177. package/util/declare.d.js +0 -1
  178. package/util/formatFastaStrings.test.js +0 -40
  179. package/util/index.test.js +0 -213
  180. package/util/jexlStrings.test.js +0 -48
  181. package/util/layouts/GranularRectLayout.test.js +0 -99
  182. package/util/range.test.js +0 -64
  183. package/util/simpleFeature.test.js +0 -34
  184. package/util/stats.test.js +0 -172
@@ -1,28 +1,10 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.contrastingTextColor = contrastingTextColor;
7
- exports.emphasize = emphasize;
8
- Object.defineProperty(exports, "isNamedColor", {
9
- enumerable: true,
10
- get: function get() {
11
- return _cssColorsLevel.isNamedColor;
12
- }
13
- });
14
- exports.makeContrasting = makeContrasting;
15
- Object.defineProperty(exports, "namedColorToHex", {
16
- enumerable: true,
17
- get: function get() {
18
- return _cssColorsLevel.namedColorToHex;
19
- }
20
- });
21
-
22
- var _styles = require("@mui/material/styles");
23
-
24
- var _cssColorsLevel = require("./cssColorsLevel4");
25
-
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makeContrasting = exports.emphasize = exports.contrastingTextColor = exports.isNamedColor = exports.namedColorToHex = void 0;
4
+ const styles_1 = require("@mui/material/styles");
5
+ const cssColorsLevel4_1 = require("./cssColorsLevel4");
6
+ Object.defineProperty(exports, "namedColorToHex", { enumerable: true, get: function () { return cssColorsLevel4_1.namedColorToHex; } });
7
+ Object.defineProperty(exports, "isNamedColor", { enumerable: true, get: function () { return cssColorsLevel4_1.isNamedColor; } });
26
8
  /**
27
9
  * Algorithmically pick a contrasting text color that will
28
10
  * be visible on top of the given background color. Either
@@ -33,9 +15,10 @@ var _cssColorsLevel = require("./cssColorsLevel4");
33
15
  * @returns 'black' or 'white'
34
16
  */
35
17
  function contrastingTextColor(color) {
36
- var luminance = getLuminance(color);
37
- return luminance > 0.5 ? 'black' : 'white';
18
+ const luminance = getLuminance(color);
19
+ return luminance > 0.5 ? 'black' : 'white';
38
20
  }
21
+ exports.contrastingTextColor = contrastingTextColor;
39
22
  /**
40
23
  * The relative brightness of any point in a color space,
41
24
  * normalized to 0 for darkest black and 1 for lightest white.
@@ -47,11 +30,9 @@ function contrastingTextColor(color) {
47
30
  * hsl(), hsla(), or named color
48
31
  * @returns The relative brightness of the color in the range 0 - 1
49
32
  */
50
-
51
-
52
33
  function getLuminance(color) {
53
- var convertedColor = (0, _cssColorsLevel.namedColorToHex)(color);
54
- return (0, _styles.getLuminance)(convertedColor || color);
34
+ const convertedColor = (0, cssColorsLevel4_1.namedColorToHex)(color);
35
+ return (0, styles_1.getLuminance)(convertedColor || color);
55
36
  }
56
37
  /**
57
38
  * Darken or lighten a color, depending on its luminance.
@@ -63,29 +44,26 @@ function getLuminance(color) {
63
44
  * @param coefficient - multiplier in the range 0 - 1, defaults to 0.15
64
45
  * @returns A CSS color string. Hex input values are returned as rgb
65
46
  */
66
-
67
-
68
- function emphasize(color) {
69
- var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;
70
- var convertedColor = (0, _cssColorsLevel.namedColorToHex)(color);
71
- return (0, _styles.emphasize)(convertedColor || color, coefficient);
47
+ function emphasize(color, coefficient = 0.15) {
48
+ const convertedColor = (0, cssColorsLevel4_1.namedColorToHex)(color);
49
+ return (0, styles_1.emphasize)(convertedColor || color, coefficient);
72
50
  }
73
-
74
- function makeContrasting(foreground) {
75
- var background = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'white';
76
- var minContrastRatio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3;
77
- var convertedForeground = (0, _cssColorsLevel.namedColorToHex)(foreground) || foreground;
78
- var convertedBackground = (0, _cssColorsLevel.namedColorToHex)(background) || background;
79
- var backgroundLuminance = getLuminance(convertedBackground);
80
- var contrastRatio = (0, _styles.getContrastRatio)(convertedForeground, convertedBackground);
81
- var originalColor = convertedForeground;
82
- var coefficient = 0.05;
83
-
84
- while (contrastRatio < minContrastRatio) {
85
- convertedForeground = backgroundLuminance > 0.5 ? (0, _styles.darken)(originalColor, coefficient) : (0, _styles.lighten)(originalColor, coefficient);
86
- coefficient += 0.05;
87
- contrastRatio = (0, _styles.getContrastRatio)(convertedForeground, convertedBackground);
88
- }
89
-
90
- return convertedForeground;
91
- }
51
+ exports.emphasize = emphasize;
52
+ function makeContrasting(foreground, background = 'white', minContrastRatio = 3) {
53
+ let convertedForeground = (0, cssColorsLevel4_1.namedColorToHex)(foreground) || foreground;
54
+ const convertedBackground = (0, cssColorsLevel4_1.namedColorToHex)(background) || background;
55
+ const backgroundLuminance = getLuminance(convertedBackground);
56
+ let contrastRatio = (0, styles_1.getContrastRatio)(convertedForeground, convertedBackground);
57
+ const originalColor = convertedForeground;
58
+ let coefficient = 0.05;
59
+ while (contrastRatio < minContrastRatio) {
60
+ convertedForeground =
61
+ backgroundLuminance > 0.5
62
+ ? (0, styles_1.darken)(originalColor, coefficient)
63
+ : (0, styles_1.lighten)(originalColor, coefficient);
64
+ coefficient += 0.05;
65
+ contrastRatio = (0, styles_1.getContrastRatio)(convertedForeground, convertedBackground);
66
+ }
67
+ return convertedForeground;
68
+ }
69
+ exports.makeContrasting = makeContrasting;
@@ -1,347 +1,63 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
-
10
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
-
12
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
-
14
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
-
16
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
17
-
18
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
-
20
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
21
-
2
+ Object.defineProperty(exports, "__esModule", { value: true });
22
3
  // takes an array or Map or Set (anything iterable with values()) of Maps
23
4
  // and lets you query them as one Map
24
- var CompositeMap = /*#__PURE__*/function (_Symbol$iterator) {
25
- function CompositeMap(submaps) {
26
- (0, _classCallCheck2.default)(this, CompositeMap);
27
- this.submaps = submaps;
28
- }
29
-
30
- (0, _createClass2.default)(CompositeMap, [{
31
- key: "has",
32
- value: function has(id) {
33
- var _iterator = _createForOfIteratorHelper(this.submaps.values()),
34
- _step;
35
-
36
- try {
37
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
38
- var submap = _step.value;
39
-
40
- if (submap.has(id)) {
41
- return true;
42
- }
5
+ class CompositeMap {
6
+ constructor(submaps) {
7
+ this.submaps = submaps;
8
+ }
9
+ has(id) {
10
+ for (const submap of this.submaps.values()) {
11
+ if (submap.has(id)) {
12
+ return true;
13
+ }
43
14
  }
44
- } catch (err) {
45
- _iterator.e(err);
46
- } finally {
47
- _iterator.f();
48
- }
49
-
50
- return false;
15
+ return false;
51
16
  }
52
- }, {
53
- key: "get",
54
- value: function get(id) {
55
- var _iterator2 = _createForOfIteratorHelper(this.submaps.values()),
56
- _step2;
57
-
58
- try {
59
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
60
- var submap = _step2.value;
61
-
62
- if (submap.has(id)) {
63
- return submap.get(id);
64
- }
17
+ get(id) {
18
+ for (const submap of this.submaps.values()) {
19
+ if (submap.has(id)) {
20
+ return submap.get(id);
21
+ }
65
22
  }
66
- } catch (err) {
67
- _iterator2.e(err);
68
- } finally {
69
- _iterator2.f();
70
- }
71
-
72
- return undefined;
23
+ return undefined;
73
24
  }
74
- }, {
75
- key: "values",
76
- value: /*#__PURE__*/_regenerator.default.mark(function values() {
77
- var _iterator3, _step3, key;
78
-
79
- return _regenerator.default.wrap(function values$(_context) {
80
- while (1) {
81
- switch (_context.prev = _context.next) {
82
- case 0:
83
- _iterator3 = _createForOfIteratorHelper(this.keys());
84
- _context.prev = 1;
85
-
86
- _iterator3.s();
87
-
88
- case 3:
89
- if ((_step3 = _iterator3.n()).done) {
90
- _context.next = 9;
91
- break;
92
- }
93
-
94
- key = _step3.value;
95
- _context.next = 7;
96
- return this.get(key);
97
-
98
- case 7:
99
- _context.next = 3;
100
- break;
101
-
102
- case 9:
103
- _context.next = 14;
104
- break;
105
-
106
- case 11:
107
- _context.prev = 11;
108
- _context.t0 = _context["catch"](1);
109
-
110
- _iterator3.e(_context.t0);
111
-
112
- case 14:
113
- _context.prev = 14;
114
-
115
- _iterator3.f();
116
-
117
- return _context.finish(14);
118
-
119
- case 17:
120
- case "end":
121
- return _context.stop();
122
- }
25
+ *values() {
26
+ for (const key of this.keys()) {
27
+ yield this.get(key);
123
28
  }
124
- }, values, this, [[1, 11, 14, 17]]);
125
- })
126
- }, {
127
- key: "keys",
128
- value: /*#__PURE__*/_regenerator.default.mark(function keys() {
129
- var keys, _iterator4, _step4, submap, _iterator6, _step6, key, _iterator5, _step5, _key;
130
-
131
- return _regenerator.default.wrap(function keys$(_context2) {
132
- while (1) {
133
- switch (_context2.prev = _context2.next) {
134
- case 0:
135
- keys = new Set();
136
- _iterator4 = _createForOfIteratorHelper(this.submaps.values());
137
-
138
- try {
139
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
140
- submap = _step4.value;
141
- _iterator6 = _createForOfIteratorHelper(submap.keys());
142
-
143
- try {
144
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
145
- key = _step6.value;
146
- keys.add(key);
147
- }
148
- } catch (err) {
149
- _iterator6.e(err);
150
- } finally {
151
- _iterator6.f();
152
- }
153
- }
154
- } catch (err) {
155
- _iterator4.e(err);
156
- } finally {
157
- _iterator4.f();
158
- }
159
-
160
- _iterator5 = _createForOfIteratorHelper(keys);
161
- _context2.prev = 4;
162
-
163
- _iterator5.s();
164
-
165
- case 6:
166
- if ((_step5 = _iterator5.n()).done) {
167
- _context2.next = 12;
168
- break;
169
- }
170
-
171
- _key = _step5.value;
172
- _context2.next = 10;
173
- return _key;
174
-
175
- case 10:
176
- _context2.next = 6;
177
- break;
178
-
179
- case 12:
180
- _context2.next = 17;
181
- break;
182
-
183
- case 14:
184
- _context2.prev = 14;
185
- _context2.t0 = _context2["catch"](4);
186
-
187
- _iterator5.e(_context2.t0);
188
-
189
- case 17:
190
- _context2.prev = 17;
191
-
192
- _iterator5.f();
193
-
194
- return _context2.finish(17);
195
-
196
- case 20:
197
- case "end":
198
- return _context2.stop();
199
- }
29
+ }
30
+ *keys() {
31
+ const keys = new Set();
32
+ for (const submap of this.submaps.values()) {
33
+ for (const key of submap.keys()) {
34
+ keys.add(key);
35
+ }
200
36
  }
201
- }, keys, this, [[4, 14, 17, 20]]);
202
- })
203
- }, {
204
- key: "find",
205
- value: function find(f) {
206
- var _iterator7 = _createForOfIteratorHelper(this.submaps.values()),
207
- _step7;
208
-
209
- try {
210
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
211
- var submap = _step7.value;
212
-
213
- var _iterator8 = _createForOfIteratorHelper(submap.values()),
214
- _step8;
215
-
216
- try {
217
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
218
- var value = _step8.value;
219
- var found = f(value);
220
-
221
- if (found) {
222
- return value;
223
- }
37
+ for (const key of keys) {
38
+ yield key;
39
+ }
40
+ }
41
+ find(f) {
42
+ for (const submap of this.submaps.values()) {
43
+ for (const value of submap.values()) {
44
+ const found = f(value);
45
+ if (found) {
46
+ return value;
47
+ }
224
48
  }
225
- } catch (err) {
226
- _iterator8.e(err);
227
- } finally {
228
- _iterator8.f();
229
- }
230
49
  }
231
- } catch (err) {
232
- _iterator7.e(err);
233
- } finally {
234
- _iterator7.f();
235
- }
236
-
237
- return undefined;
50
+ return undefined;
238
51
  }
239
- }, {
240
- key: _Symbol$iterator,
241
- value: /*#__PURE__*/_regenerator.default.mark(function value() {
242
- var _iterator9, _step9, key;
243
-
244
- return _regenerator.default.wrap(function value$(_context3) {
245
- while (1) {
246
- switch (_context3.prev = _context3.next) {
247
- case 0:
248
- _iterator9 = _createForOfIteratorHelper(this.keys());
249
- _context3.prev = 1;
250
-
251
- _iterator9.s();
252
-
253
- case 3:
254
- if ((_step9 = _iterator9.n()).done) {
255
- _context3.next = 9;
256
- break;
257
- }
258
-
259
- key = _step9.value;
260
- _context3.next = 7;
261
- return [key, this.get(key)];
262
-
263
- case 7:
264
- _context3.next = 3;
265
- break;
266
-
267
- case 9:
268
- _context3.next = 14;
269
- break;
270
-
271
- case 11:
272
- _context3.prev = 11;
273
- _context3.t0 = _context3["catch"](1);
274
-
275
- _iterator9.e(_context3.t0);
276
-
277
- case 14:
278
- _context3.prev = 14;
279
-
280
- _iterator9.f();
281
-
282
- return _context3.finish(14);
283
-
284
- case 17:
285
- case "end":
286
- return _context3.stop();
287
- }
52
+ *[Symbol.iterator]() {
53
+ for (const key of this.keys()) {
54
+ yield [key, this.get(key)];
288
55
  }
289
- }, value, this, [[1, 11, 14, 17]]);
290
- })
291
- }, {
292
- key: "entries",
293
- value: /*#__PURE__*/_regenerator.default.mark(function entries() {
294
- var _iterator10, _step10, k;
295
-
296
- return _regenerator.default.wrap(function entries$(_context4) {
297
- while (1) {
298
- switch (_context4.prev = _context4.next) {
299
- case 0:
300
- _iterator10 = _createForOfIteratorHelper(this.keys());
301
- _context4.prev = 1;
302
-
303
- _iterator10.s();
304
-
305
- case 3:
306
- if ((_step10 = _iterator10.n()).done) {
307
- _context4.next = 9;
308
- break;
309
- }
310
-
311
- k = _step10.value;
312
- _context4.next = 7;
313
- return [k, this.get(k)];
314
-
315
- case 7:
316
- _context4.next = 3;
317
- break;
318
-
319
- case 9:
320
- _context4.next = 14;
321
- break;
322
-
323
- case 11:
324
- _context4.prev = 11;
325
- _context4.t0 = _context4["catch"](1);
326
-
327
- _iterator10.e(_context4.t0);
328
-
329
- case 14:
330
- _context4.prev = 14;
331
-
332
- _iterator10.f();
333
-
334
- return _context4.finish(14);
335
-
336
- case 17:
337
- case "end":
338
- return _context4.stop();
339
- }
56
+ }
57
+ *entries() {
58
+ for (const k of this.keys()) {
59
+ yield [k, this.get(k)];
340
60
  }
341
- }, entries, this, [[1, 11, 14, 17]]);
342
- })
343
- }]);
344
- return CompositeMap;
345
- }(Symbol.iterator);
346
-
347
- exports.default = CompositeMap;
61
+ }
62
+ }
63
+ exports.default = CompositeMap;
@@ -1,11 +1,6 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.formatFastaLines = formatFastaLines;
7
- exports.formatSeqFasta = formatSeqFasta;
8
-
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formatSeqFasta = exports.formatFastaLines = void 0;
9
4
  /**
10
5
  * Returns sequence with new line every 80 characters
11
6
  * ref https://stackoverflow.com/a/51506718/2129219
@@ -14,18 +9,18 @@ exports.formatSeqFasta = formatSeqFasta;
14
9
  * @returns formated sequence string
15
10
  */
16
11
  function formatFastaLines(seqString) {
17
- return seqString.replace(/(.{1,80})/g, '$1\n').trimEnd();
12
+ return seqString.replace(/(.{1,80})/g, '$1\n').trimEnd();
18
13
  }
14
+ exports.formatFastaLines = formatFastaLines;
19
15
  /**
20
16
  * Formats the sequences chunks into Fasta format
21
17
  *
22
18
  * @param chunks - array of seq chunks of the form `{ header: string, seq: string }`
23
19
  * @returns formatted sequence in fasta format
24
20
  */
25
-
26
-
27
21
  function formatSeqFasta(chunks) {
28
- return chunks.map(function (chunk) {
29
- return ">".concat(chunk.header, "\n").concat(formatFastaLines(chunk.seq));
30
- }).join('\n');
31
- }
22
+ return chunks
23
+ .map(chunk => `>${chunk.header}\n${formatFastaLines(chunk.seq)}`)
24
+ .join('\n');
25
+ }
26
+ exports.formatSeqFasta = formatSeqFasta;
package/util/idMaker.js CHANGED
@@ -1,37 +1,24 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = idMaker;
9
-
10
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
-
12
- var _ = require("./");
13
-
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _1 = require("./");
14
4
  // generates a short "id fingerprint" from the config passed to the base
15
5
  // feature adapter by recursively enumerating props, but if config is too big
16
6
  // does not process entire config (FromConfigAdapter for example can be large)
17
7
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
- function idMaker(args) {
19
- var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
20
- var keys = Object.keys(args);
21
-
22
- for (var i = 0; i < keys.length; i++) {
23
- var key = keys[i];
24
-
25
- if (id.length > 5000) {
26
- break;
27
- }
28
-
29
- if ((0, _typeof2.default)(args[key]) === 'object' && args[key]) {
30
- id += idMaker(args[key], id);
31
- } else {
32
- id += "".concat(key, "-").concat(args[key], ";");
8
+ function idMaker(args, id = '') {
9
+ const keys = Object.keys(args);
10
+ for (let i = 0; i < keys.length; i++) {
11
+ const key = keys[i];
12
+ if (id.length > 5000) {
13
+ break;
14
+ }
15
+ if (typeof args[key] === 'object' && args[key]) {
16
+ id += idMaker(args[key], id);
17
+ }
18
+ else {
19
+ id += `${key}-${args[key]};`;
20
+ }
33
21
  }
34
- }
35
-
36
- return (0, _.hashCode)(id);
37
- }
22
+ return (0, _1.hashCode)(id);
23
+ }
24
+ exports.default = idMaker;