@opencloning/utils 1.4.11 → 1.5.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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @opencloning/utils
2
2
 
3
+ ## 1.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#648](https://github.com/manulera/OpenCloning_frontend/pull/648) [`800ebcd`](https://github.com/manulera/OpenCloning_frontend/commit/800ebcd4ed610ad89d538e1d59314977aae40583) Thanks [@manulera](https://github.com/manulera)! - Multiple enzymes can be used in the Assembler
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies []:
12
+ - @opencloning/store@1.5.0
13
+
3
14
  ## 1.4.11
4
15
 
5
16
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencloning/utils",
3
- "version": "1.4.11",
3
+ "version": "1.5.0",
4
4
  "type": "module",
5
5
  "main": "./src/utils/index.js",
6
6
  "exports": {
@@ -19,7 +19,8 @@
19
19
  "./ncbiRequests": "./src/utils/ncbiRequests.js",
20
20
  "./other": "./src/utils/other.js",
21
21
  "./transformCoords": "./src/utils/transformCoords.js",
22
- "./selectedRegionUtils": "./src/utils/selectedRegionUtils.js"
22
+ "./selectedRegionUtils": "./src/utils/selectedRegionUtils.js",
23
+ "./normalizeSyntax": "./src/utils/normalizeSyntax.js"
23
24
  },
24
25
  "repository": {
25
26
  "type": "git",
@@ -27,7 +28,7 @@
27
28
  "directory": "packages/utils"
28
29
  },
29
30
  "dependencies": {
30
- "@opencloning/store": "1.4.11",
31
+ "@opencloning/store": "1.5.0",
31
32
  "@teselagen/bio-parsers": "^0.4.34",
32
33
  "@teselagen/sequence-utils": "^0.3.42",
33
34
  "@zip.js/zip.js": "^2.7.62",
@@ -16,3 +16,4 @@ export * from './ncbiRequests.js';
16
16
  export * from './other.js';
17
17
  export { default as getTransformCoords } from './transformCoords.js';
18
18
  export * from './selectedRegionUtils.js';
19
+ export * from './normalizeSyntax.js';
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Normalizes syntax data for assembly enzymes. Handles legacy assemblyEnzyme (string).
3
+ * @param {Object} syntax - Raw syntax object from JSON
4
+ * @returns {Object} syntax with assemblyEnzymes: string[]
5
+ */
6
+ export function normalizeSyntaxEnzymes(syntax) {
7
+ if (!syntax) return syntax;
8
+ const enzymes = syntax.assemblyEnzymes ??
9
+ (syntax.assemblyEnzyme != null ? [syntax.assemblyEnzyme] : ['BsaI']);
10
+ return { ...syntax, assemblyEnzymes: Array.isArray(enzymes) ? enzymes : [enzymes] };
11
+ }