@teselagen/sequence-utils 0.2.1 → 0.3.3

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 (2) hide show
  1. package/package.json +2 -2
  2. package/src/diffUtils.js +14 -17
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@teselagen/sequence-utils",
3
- "version": "0.2.1",
3
+ "version": "0.3.3",
4
4
  "type": "commonjs",
5
5
  "dependencies": {
6
- "@teselagen/range-utils": "0.2.1",
6
+ "@teselagen/range-utils": "0.3.3",
7
7
  "bson-objectid": "^2.0.4",
8
8
  "escape-string-regexp": "^5.0.0",
9
9
  "jsondiffpatch": "0.4.1",
package/src/diffUtils.js CHANGED
@@ -1,31 +1,28 @@
1
- import { cloneDeep, forEach } from 'lodash';
2
- import { diff, patch, reverse } from 'jsondiffpatch/dist/jsondiffpatch.umd'
3
-
4
-
5
- import tidyUpSequenceData from './tidyUpSequenceData';
1
+ import { cloneDeep, forEach } from "lodash";
2
+ import { diff, patch, reverse } from "jsondiffpatch/dist/jsondiffpatch.umd";
6
3
 
4
+ import tidyUpSequenceData from "./tidyUpSequenceData";
7
5
 
8
6
  const getDiffFromSeqs = (oldData, newData, { ignoreKeys = [] } = {}) => {
9
-
10
7
  oldData = tidyUpSequenceData(oldData, {
11
8
  annotationsAsObjects: true,
12
- noTranslationData: true,
9
+ noTranslationData: true
13
10
  });
14
11
  newData = tidyUpSequenceData(newData, {
15
12
  annotationsAsObjects: true,
16
- noTranslationData: true,
13
+ noTranslationData: true
17
14
  });
18
15
 
19
16
  [oldData, newData].forEach((d) => {
20
17
  [
21
- 'cutsites',
22
- 'orfs',
23
- 'filteredFeatures',
24
- 'size',
25
- 'fromFileUpload',
26
- 'description',
27
- 'materiallyAvailable',
28
- ...ignoreKeys,
18
+ "cutsites",
19
+ "orfs",
20
+ "filteredFeatures",
21
+ "size",
22
+ "fromFileUpload",
23
+ "description",
24
+ "materiallyAvailable",
25
+ ...ignoreKeys
29
26
  ].forEach((prop) => {
30
27
  delete d[prop];
31
28
  });
@@ -33,7 +30,7 @@ const getDiffFromSeqs = (oldData, newData, { ignoreKeys = [] } = {}) => {
33
30
  forEach(d.translations, (translation, key) => {
34
31
  if (
35
32
  translation.translationType &&
36
- translation.translationType !== 'User Created'
33
+ translation.translationType !== "User Created"
37
34
  ) {
38
35
  delete d.translations[key];
39
36
  } else {