@teselagen/range-utils 0.3.7 → 0.3.9

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 (96) hide show
  1. package/README.md +94 -0
  2. package/flipContainedRange.d.ts +1 -1
  3. package/index.cjs +2619 -0
  4. package/index.d.ts +52 -51
  5. package/index.js +1791 -6100
  6. package/index.umd.cjs +2623 -0
  7. package/package.json +2 -3
  8. package/src/adjustRangeToDeletionOfAnotherRange.test.js +166 -105
  9. package/src/adjustRangeToInsert.js +29 -26
  10. package/src/adjustRangeToInsert.test.js +197 -109
  11. package/src/adjustRangeToRotation.js +4 -5
  12. package/src/adjustRangeToRotation.test.js +203 -119
  13. package/src/checkIfNonCircularRangesOverlap.js +18 -15
  14. package/src/checkIfNonCircularRangesOverlap.test.js +67 -42
  15. package/src/checkIfPotentiallyCircularRangesOverlap.js +22 -12
  16. package/src/checkIfPotentiallyCircularRangesOverlap.test.js +115 -70
  17. package/src/collapseOverlapsGeneratedFromRangeComparisonIfPossible.js +72 -41
  18. package/src/collapseOverlapsGeneratedFromRangeComparisonIfPossible.test.js +183 -84
  19. package/src/convertRangeIndices.js +24 -20
  20. package/src/convertRangeIndices.test.js +40 -21
  21. package/src/convertRangeTo0Based.js +7 -4
  22. package/src/convertRangeTo1Based.js +8 -4
  23. package/src/doesRangeSpanEntireSequence.js +4 -4
  24. package/src/doesRangeSpanOrigin.js +3 -3
  25. package/src/expandOrContractCircularRangeToPosition.js +45 -38
  26. package/src/expandOrContractNonCircularRangeToPosition.js +24 -21
  27. package/src/expandOrContractRangeByLength.js +16 -11
  28. package/src/expandOrContractRangeByLength.test.js +109 -71
  29. package/src/expandOrContractRangeToPosition.js +17 -9
  30. package/src/flipContainedRange.js +133 -72
  31. package/src/flipContainedRange.test.js +143 -117
  32. package/src/generateRandomRange.js +17 -15
  33. package/src/generateRandomRange.test.js +21 -21
  34. package/src/getAnnotationRangeType.js +25 -21
  35. package/src/getAnnotationRangeType.test.js +56 -57
  36. package/src/getEachPositionInRangeAsArray.js +13 -13
  37. package/src/getEachPositionInRangeAsArray.test.js +12 -8
  38. package/src/getLengthOfOverlappingRegionsBetweenTwoRanges.js +16 -8
  39. package/src/getLengthOfOverlappingRegionsBetweenTwoRanges.test.js +32 -24
  40. package/src/getMiddleOfRange.js +1 -1
  41. package/src/getMiddleOfRange.test.js +5 -13
  42. package/src/getOverlapOfNonCircularRanges.js +30 -30
  43. package/src/getOverlapsOfPotentiallyCircularRanges.js +5 -5
  44. package/src/getOverlapsOfPotentiallyCircularRanges.test.js +3 -23
  45. package/src/getPositionFromAngle.js +12 -7
  46. package/src/getRangeAngles.js +1 -1
  47. package/src/getRangeAngles.test.js +10 -11
  48. package/src/getRangeLength.test.js +5 -5
  49. package/src/getRangesBetweenTwoRanges.js +31 -22
  50. package/src/getSequenceWithinRange.js +13 -13
  51. package/src/getSequenceWithinRange.test.js +43 -45
  52. package/src/getShortestDistanceBetweenTwoPositions.js +10 -6
  53. package/src/getShortestDistanceBetweenTwoPositions.test.js +11 -13
  54. package/src/getYOffsetForPotentiallyCircularRange.js +33 -21
  55. package/src/getYOffsetsForPotentiallyCircularRanges.js +26 -19
  56. package/src/getYOffsetsForPotentiallyCircularRanges.test.js +42 -29
  57. package/src/getZeroedRangeOverlaps.js +30 -15
  58. package/src/getZeroedRangeOverlaps.test.js +75 -36
  59. package/src/index.js +52 -51
  60. package/src/index.test.js +6 -8
  61. package/src/invertRange.test.js +103 -93
  62. package/src/isPositionCloserToRangeStartThanRangeEnd.js +18 -6
  63. package/src/isPositionCloserToRangeStartThanRangeEnd.test.js +36 -16
  64. package/src/isPositionWithinRange.js +4 -4
  65. package/src/isRangeOrPositionWithinRange.js +18 -12
  66. package/src/isRangeOrPositionWithinRange.test.js +6 -6
  67. package/src/isRangeWithinRange.js +2 -3
  68. package/src/loopEachPositionInRange.js +3 -3
  69. package/src/modulatePositionByRange.js +8 -8
  70. package/src/modulatePositionByRange.test.js +10 -11
  71. package/src/modulateRangeBySequenceLength.js +7 -7
  72. package/src/modulateRangeBySequenceLength.test.js +39 -16
  73. package/src/normalizePositionByRangeLength.js +22 -18
  74. package/src/normalizePositionByRangeLength.test.js +23 -23
  75. package/src/normalizePositionByRangeLength1Based.js +7 -4
  76. package/src/normalizePositionByRangeLength1Based.test.js +9 -9
  77. package/src/normalizeRange.js +7 -7
  78. package/src/normalizeRange.test.js +9 -9
  79. package/src/provideInclusiveOptions.js +36 -23
  80. package/src/reversePositionInRange.js +16 -12
  81. package/src/splitRangeIntoTwoPartsIfItIsCircular.js +31 -28
  82. package/src/splitRangeIntoTwoPartsIfItIsCircular.test.js +22 -11
  83. package/src/translateRange.js +18 -8
  84. package/src/translateRange.test.js +18 -19
  85. package/src/trimAnnStartEndToFitSeqLength.js +9 -0
  86. package/src/trimAnnStartEndToFitSeqLength.test.js +35 -0
  87. package/src/trimNonCicularRangeByAnotherNonCircularRange.js +45 -42
  88. package/src/trimNumberToFitWithin0ToAnotherNumber.js +13 -10
  89. package/src/trimRangeByAnotherRange.js +20 -19
  90. package/src/trimRangeByAnotherRange.test.js +6 -6
  91. package/src/zeroSubrangeByContainerRange.js +29 -19
  92. package/src/zeroSubrangeByContainerRange.test.js +57 -47
  93. package/trimAnnStartEndToFitSeqLength.d.ts +1 -0
  94. package/trimAnnStartEndToFitSeqLength.test.d.ts +1 -0
  95. package/index.mjs +0 -6928
  96. package/index.umd.js +0 -6932
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@teselagen/range-utils",
3
- "version": "0.3.7",
4
- "type": "commonjs",
3
+ "version": "0.3.9",
5
4
  "dependencies": {
6
- "lodash": "^4.17.21"
5
+ "lodash-es": "^4.17.21"
7
6
  },
8
7
  "license": "MIT"
9
8
  }
@@ -1,107 +1,168 @@
1
+ import adjustRangeToDeletionOfAnotherRange from "./adjustRangeToDeletionOfAnotherRange.js";
1
2
 
2
-
3
- import adjustRangeToDeletionOfAnotherRange from './adjustRangeToDeletionOfAnotherRange.js';
4
-
5
- import assert from 'assert';
6
- describe('adjustRangeToDeletionOfAnotherRange', function() {
7
- it('deletes non circular range if fully overlapped', function() {
8
- assert.deepEqual(adjustRangeToDeletionOfAnotherRange({
9
- start: 10,
10
- end: 20
11
- }, {
12
- start: 10,
13
- end: 20
14
- }, 30), null);
15
- });
16
- it('deletes circular range if fully overlapped', function() {
17
- assert.deepEqual(adjustRangeToDeletionOfAnotherRange({
18
- start: 20,
19
- end: 10
20
- }, {
21
- start: 20,
22
- end: 10
23
- }, 30), null);
24
- });
25
- it('shifts start and end if deleting before non circular range', function() {
26
- assert.deepEqual(adjustRangeToDeletionOfAnotherRange({
27
- name: 'happy',
28
- start: 10,
29
- end: 20
30
- }, {
31
- start: 5,
32
- end: 8
33
- }, 30), {
34
- name: 'happy',
35
- start: 6,
36
- end: 16
37
- });
38
- });
39
- it('shifts start if deleting in middle of non circular range', function() {
40
- assert.deepEqual(adjustRangeToDeletionOfAnotherRange({
41
- name: 'happy',
42
- start: 20,
43
- end: 10
44
- }, {
45
- start: 15,
46
- end: 20
47
- }, 30), {
48
- name: 'happy',
49
- start: 15,
50
- end: 10
51
- });
52
- assert.deepEqual(adjustRangeToDeletionOfAnotherRange({
53
- start: 20,
54
- end: 10
55
- }, {
56
- start: 15,
57
- end: 15
58
- }, 30), {
59
- start: 19,
60
- end: 10
61
- });
62
- });
63
- it('shifts start and end if deleting before end of non circular range', function() {
64
- assert.deepEqual(adjustRangeToDeletionOfAnotherRange({
65
- start: 20,
66
- end: 10
67
- }, {
68
- start: 0,
69
- end: 0
70
- }, 30), {
71
- start: 19,
72
- end: 9
73
- });
74
- assert.deepEqual(adjustRangeToDeletionOfAnotherRange({
75
- start: 20,
76
- end: 10
77
- }, {
78
- start: 5,
79
- end: 15
80
- }, 30), {
81
- start: 9,
82
- end: 4
83
- });
84
- });
85
- it('shifts neither start nor end if deleting after start of non circular range', function() {
86
- assert.deepEqual(adjustRangeToDeletionOfAnotherRange({
87
- start: 20,
88
- end: 10
89
- }, {
90
- start: 25,
91
- end: 27
92
- }, 30), {
93
- start: 20,
94
- end: 10
95
- });
96
- assert.deepEqual(adjustRangeToDeletionOfAnotherRange({
97
- start: 20,
98
- end: 10
99
- }, {
100
- start: 20,
101
- end: 25
102
- }, 30), {
103
- start: 20,
104
- end: 10
105
- });
106
- });
3
+ import assert from "assert";
4
+ describe("adjustRangeToDeletionOfAnotherRange", function () {
5
+ it("deletes non circular range if fully overlapped", function () {
6
+ assert.deepEqual(
7
+ adjustRangeToDeletionOfAnotherRange(
8
+ {
9
+ start: 10,
10
+ end: 20
11
+ },
12
+ {
13
+ start: 10,
14
+ end: 20
15
+ },
16
+ 30
17
+ ),
18
+ null
19
+ );
20
+ });
21
+ it("deletes circular range if fully overlapped", function () {
22
+ assert.deepEqual(
23
+ adjustRangeToDeletionOfAnotherRange(
24
+ {
25
+ start: 20,
26
+ end: 10
27
+ },
28
+ {
29
+ start: 20,
30
+ end: 10
31
+ },
32
+ 30
33
+ ),
34
+ null
35
+ );
36
+ });
37
+ it("shifts start and end if deleting before non circular range", function () {
38
+ assert.deepEqual(
39
+ adjustRangeToDeletionOfAnotherRange(
40
+ {
41
+ name: "happy",
42
+ start: 10,
43
+ end: 20
44
+ },
45
+ {
46
+ start: 5,
47
+ end: 8
48
+ },
49
+ 30
50
+ ),
51
+ {
52
+ name: "happy",
53
+ start: 6,
54
+ end: 16
55
+ }
56
+ );
57
+ });
58
+ it("shifts start if deleting in middle of non circular range", function () {
59
+ assert.deepEqual(
60
+ adjustRangeToDeletionOfAnotherRange(
61
+ {
62
+ name: "happy",
63
+ start: 20,
64
+ end: 10
65
+ },
66
+ {
67
+ start: 15,
68
+ end: 20
69
+ },
70
+ 30
71
+ ),
72
+ {
73
+ name: "happy",
74
+ start: 15,
75
+ end: 10
76
+ }
77
+ );
78
+ assert.deepEqual(
79
+ adjustRangeToDeletionOfAnotherRange(
80
+ {
81
+ start: 20,
82
+ end: 10
83
+ },
84
+ {
85
+ start: 15,
86
+ end: 15
87
+ },
88
+ 30
89
+ ),
90
+ {
91
+ start: 19,
92
+ end: 10
93
+ }
94
+ );
95
+ });
96
+ it("shifts start and end if deleting before end of non circular range", function () {
97
+ assert.deepEqual(
98
+ adjustRangeToDeletionOfAnotherRange(
99
+ {
100
+ start: 20,
101
+ end: 10
102
+ },
103
+ {
104
+ start: 0,
105
+ end: 0
106
+ },
107
+ 30
108
+ ),
109
+ {
110
+ start: 19,
111
+ end: 9
112
+ }
113
+ );
114
+ assert.deepEqual(
115
+ adjustRangeToDeletionOfAnotherRange(
116
+ {
117
+ start: 20,
118
+ end: 10
119
+ },
120
+ {
121
+ start: 5,
122
+ end: 15
123
+ },
124
+ 30
125
+ ),
126
+ {
127
+ start: 9,
128
+ end: 4
129
+ }
130
+ );
131
+ });
132
+ it("shifts neither start nor end if deleting after start of non circular range", function () {
133
+ assert.deepEqual(
134
+ adjustRangeToDeletionOfAnotherRange(
135
+ {
136
+ start: 20,
137
+ end: 10
138
+ },
139
+ {
140
+ start: 25,
141
+ end: 27
142
+ },
143
+ 30
144
+ ),
145
+ {
146
+ start: 20,
147
+ end: 10
148
+ }
149
+ );
150
+ assert.deepEqual(
151
+ adjustRangeToDeletionOfAnotherRange(
152
+ {
153
+ start: 20,
154
+ end: 10
155
+ },
156
+ {
157
+ start: 20,
158
+ end: 25
159
+ },
160
+ 30
161
+ ),
162
+ {
163
+ start: 20,
164
+ end: 10
165
+ }
166
+ );
167
+ });
107
168
  });
@@ -1,28 +1,31 @@
1
+ import { assign } from "lodash-es";
1
2
 
2
- import {assign} from "lodash";
3
-
4
- export default function adjustRangeToInsert(rangeToBeAdjusted, insertStart, insertLength) {
5
- // ac.throw([ac.range, ac.posInt, ac.posInt], arguments);
6
- const newRange = assign({}, rangeToBeAdjusted);
7
- if (rangeToBeAdjusted.start > rangeToBeAdjusted.end) {
8
- //circular range
9
- if (rangeToBeAdjusted.end >= insertStart) {
10
- //adjust both start and end
11
- newRange.start += insertLength;
12
- newRange.end += insertLength;
13
- } else if (rangeToBeAdjusted.start >= insertStart) {
14
- //adjust just the start
15
- newRange.start += insertLength;
16
- }
17
- } else {
18
- if (rangeToBeAdjusted.start >= insertStart) {
19
- //adjust both start and end
20
- newRange.start += insertLength;
21
- newRange.end += insertLength;
22
- } else if (rangeToBeAdjusted.end >= insertStart) {
23
- //adjust just the end
24
- newRange.end += insertLength;
25
- }
3
+ export default function adjustRangeToInsert(
4
+ rangeToBeAdjusted,
5
+ insertStart,
6
+ insertLength
7
+ ) {
8
+ // ac.throw([ac.range, ac.posInt, ac.posInt], arguments);
9
+ const newRange = assign({}, rangeToBeAdjusted);
10
+ if (rangeToBeAdjusted.start > rangeToBeAdjusted.end) {
11
+ //circular range
12
+ if (rangeToBeAdjusted.end >= insertStart) {
13
+ //adjust both start and end
14
+ newRange.start += insertLength;
15
+ newRange.end += insertLength;
16
+ } else if (rangeToBeAdjusted.start >= insertStart) {
17
+ //adjust just the start
18
+ newRange.start += insertLength;
19
+ }
20
+ } else {
21
+ if (rangeToBeAdjusted.start >= insertStart) {
22
+ //adjust both start and end
23
+ newRange.start += insertLength;
24
+ newRange.end += insertLength;
25
+ } else if (rangeToBeAdjusted.end >= insertStart) {
26
+ //adjust just the end
27
+ newRange.end += insertLength;
26
28
  }
27
- return newRange;
28
- };
29
+ }
30
+ return newRange;
31
+ }
@@ -1,111 +1,199 @@
1
+ import adjustRangeToInsert from "./adjustRangeToInsert.js";
1
2
 
2
-
3
-
4
- import adjustRangeToInsert from './adjustRangeToInsert.js';
5
-
6
- import assert from 'assert';
7
- describe('adjustRangeToInsert', function() {
8
- it('shifts start and end if inserting before non circular range', function() {
9
- assert.deepEqual(adjustRangeToInsert({
10
- start: 10,
11
- end: 20
12
- }, 4, 5), {
13
- start: 15,
14
- end: 25
15
- });
16
- assert.deepEqual(adjustRangeToInsert({
17
- start: 10,
18
- end: 20
19
- }, 10, 5), {
20
- start: 15,
21
- end: 25
22
- });
23
- assert.deepEqual(adjustRangeToInsert({
24
- start: 10,
25
- end: 20
26
- }, 0, 5), {
27
- start: 15,
28
- end: 25
29
- });
30
- });
31
- it('shifts end if inserting in middle of non circular range', function() {
32
- assert.deepEqual(adjustRangeToInsert({
33
- start: 10,
34
- end: 20
35
- }, 11, 5), {
36
- start: 10,
37
- end: 25
38
- });
39
- assert.deepEqual(adjustRangeToInsert({
40
- start: 10,
41
- end: 20
42
- }, 20, 5), {
43
- start: 10,
44
- end: 25
45
- });
46
- });
47
- it('shifts neither start nor end if inserting in after end of non circular range', function() {
48
- assert.deepEqual(adjustRangeToInsert({
49
- start: 10,
50
- end: 20
51
- }, 24, 5), {
52
- start: 10,
53
- end: 20
54
- });
55
- assert.deepEqual(adjustRangeToInsert({
56
- start: 10,
57
- end: 20
58
- }, 21, 5), {
59
- start: 10,
60
- end: 20
61
- });
62
- });
63
- it('shifts neither start nor end if inserting in after start of circular range', function() {
64
- assert.deepEqual(adjustRangeToInsert({
65
- start: 20,
66
- end: 10
67
- }, 24, 5), {
68
- start: 20,
69
- end: 10
70
- });
71
- assert.deepEqual(adjustRangeToInsert({
72
- start: 20,
73
- end: 10
74
- }, 21, 5), {
75
- start: 20,
76
- end: 10
77
- });
78
- });
79
- it('shifts both start and end if inserting in before end of circular range', function() {
80
- assert.deepEqual(adjustRangeToInsert({
81
- start: 20,
82
- end: 10
83
- }, 5, 5), {
84
- start: 25,
85
- end: 15
86
- });
87
- assert.deepEqual(adjustRangeToInsert({
88
- start: 20,
89
- end: 10
90
- }, 10, 5), {
91
- start: 25,
92
- end: 15
93
- });
94
- });
95
- it('shifts just start if inserting in after end but before start of circular range', function() {
96
- assert.deepEqual(adjustRangeToInsert({
97
- start: 20,
98
- end: 10
99
- }, 11, 5), {
100
- start: 25,
101
- end: 10
102
- });
103
- assert.deepEqual(adjustRangeToInsert({
104
- start: 20,
105
- end: 10
106
- }, 20, 5), {
107
- start: 25,
108
- end: 10
109
- });
110
- });
3
+ import assert from "assert";
4
+ describe("adjustRangeToInsert", function () {
5
+ it("shifts start and end if inserting before non circular range", function () {
6
+ assert.deepEqual(
7
+ adjustRangeToInsert(
8
+ {
9
+ start: 10,
10
+ end: 20
11
+ },
12
+ 4,
13
+ 5
14
+ ),
15
+ {
16
+ start: 15,
17
+ end: 25
18
+ }
19
+ );
20
+ assert.deepEqual(
21
+ adjustRangeToInsert(
22
+ {
23
+ start: 10,
24
+ end: 20
25
+ },
26
+ 10,
27
+ 5
28
+ ),
29
+ {
30
+ start: 15,
31
+ end: 25
32
+ }
33
+ );
34
+ assert.deepEqual(
35
+ adjustRangeToInsert(
36
+ {
37
+ start: 10,
38
+ end: 20
39
+ },
40
+ 0,
41
+ 5
42
+ ),
43
+ {
44
+ start: 15,
45
+ end: 25
46
+ }
47
+ );
48
+ });
49
+ it("shifts end if inserting in middle of non circular range", function () {
50
+ assert.deepEqual(
51
+ adjustRangeToInsert(
52
+ {
53
+ start: 10,
54
+ end: 20
55
+ },
56
+ 11,
57
+ 5
58
+ ),
59
+ {
60
+ start: 10,
61
+ end: 25
62
+ }
63
+ );
64
+ assert.deepEqual(
65
+ adjustRangeToInsert(
66
+ {
67
+ start: 10,
68
+ end: 20
69
+ },
70
+ 20,
71
+ 5
72
+ ),
73
+ {
74
+ start: 10,
75
+ end: 25
76
+ }
77
+ );
78
+ });
79
+ it("shifts neither start nor end if inserting in after end of non circular range", function () {
80
+ assert.deepEqual(
81
+ adjustRangeToInsert(
82
+ {
83
+ start: 10,
84
+ end: 20
85
+ },
86
+ 24,
87
+ 5
88
+ ),
89
+ {
90
+ start: 10,
91
+ end: 20
92
+ }
93
+ );
94
+ assert.deepEqual(
95
+ adjustRangeToInsert(
96
+ {
97
+ start: 10,
98
+ end: 20
99
+ },
100
+ 21,
101
+ 5
102
+ ),
103
+ {
104
+ start: 10,
105
+ end: 20
106
+ }
107
+ );
108
+ });
109
+ it("shifts neither start nor end if inserting in after start of circular range", function () {
110
+ assert.deepEqual(
111
+ adjustRangeToInsert(
112
+ {
113
+ start: 20,
114
+ end: 10
115
+ },
116
+ 24,
117
+ 5
118
+ ),
119
+ {
120
+ start: 20,
121
+ end: 10
122
+ }
123
+ );
124
+ assert.deepEqual(
125
+ adjustRangeToInsert(
126
+ {
127
+ start: 20,
128
+ end: 10
129
+ },
130
+ 21,
131
+ 5
132
+ ),
133
+ {
134
+ start: 20,
135
+ end: 10
136
+ }
137
+ );
138
+ });
139
+ it("shifts both start and end if inserting in before end of circular range", function () {
140
+ assert.deepEqual(
141
+ adjustRangeToInsert(
142
+ {
143
+ start: 20,
144
+ end: 10
145
+ },
146
+ 5,
147
+ 5
148
+ ),
149
+ {
150
+ start: 25,
151
+ end: 15
152
+ }
153
+ );
154
+ assert.deepEqual(
155
+ adjustRangeToInsert(
156
+ {
157
+ start: 20,
158
+ end: 10
159
+ },
160
+ 10,
161
+ 5
162
+ ),
163
+ {
164
+ start: 25,
165
+ end: 15
166
+ }
167
+ );
168
+ });
169
+ it("shifts just start if inserting in after end but before start of circular range", function () {
170
+ assert.deepEqual(
171
+ adjustRangeToInsert(
172
+ {
173
+ start: 20,
174
+ end: 10
175
+ },
176
+ 11,
177
+ 5
178
+ ),
179
+ {
180
+ start: 25,
181
+ end: 10
182
+ }
183
+ );
184
+ assert.deepEqual(
185
+ adjustRangeToInsert(
186
+ {
187
+ start: 20,
188
+ end: 10
189
+ },
190
+ 20,
191
+ 5
192
+ ),
193
+ {
194
+ start: 25,
195
+ end: 10
196
+ }
197
+ );
198
+ });
111
199
  });
@@ -1,7 +1,6 @@
1
+ import { assign } from "lodash-es";
1
2
 
2
- import {assign} from "lodash";
3
-
4
- import {identity} from 'lodash';
3
+ import { identity } from "lodash-es";
5
4
 
6
5
  export default function adjustRangeToRotation(
7
6
  rangeToBeAdjusted,
@@ -9,7 +8,7 @@ export default function adjustRangeToRotation(
9
8
  rangeLength
10
9
  ) {
11
10
  // ac.throw([ac.range, ac.posInt, ac.posInt], arguments);
12
- const mod = rangeLength ? modulo : identity
11
+ const mod = rangeLength ? modulo : identity;
13
12
 
14
13
  const newRange = assign({}, rangeToBeAdjusted, {
15
14
  start: mod(rangeToBeAdjusted.start - (rotateTo || 0), rangeLength),
@@ -17,7 +16,7 @@ export default function adjustRangeToRotation(
17
16
  });
18
17
 
19
18
  return newRange;
20
- };
19
+ }
21
20
 
22
21
  function modulo(n, m) {
23
22
  return ((n % m) + m) % m;