Skip to content

Commit

Permalink
updating deps; removing validate.io-nonnegative-integer-array
Browse files Browse the repository at this point in the history
  • Loading branch information
tnrich committed Sep 23, 2021
1 parent 7221639 commit e5e0f6d
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 76 deletions.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
"bson-objectid": "^1.1.1",
"escape-string-regexp": "^1.0.5",
"jsondiffpatch": "^0.3.11",
"string-splice": "^1.3.0",
"validate.io-nonnegative-integer-array": "^1.0.1"
"string-splice": "^1.3.0"
},
"devDependencies": {
"@types/jest": "^23.3.11",
Expand All @@ -59,7 +58,6 @@
"npm-check": "^5.0.1",
"nwb": "^0.23.0",
"prettier": "^1.15.3",
"ve-range-utils": "2.5.5",
"ve-sequence-utils": "^3.3.16"
"ve-range-utils": "2.6.3"
}
}
1 change: 0 additions & 1 deletion src/getOrfsFromSequence.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// const areNonNegativeIntegers = require('validate.io-nonnegative-integer-array');
const ObjectId = require("bson-objectid");
const getReverseComplementSequenceString = require("./getReverseComplementSequenceString");
// const ac = require('ve-api-check');
Expand Down
19 changes: 1 addition & 18 deletions src/mapAnnotationsToRows.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
// const ac = require('ve-api-check');
// ac.throw([ac.string,ac.bool],arguments);
const {
each,
forEach,
startsWith,
filter
// some, sortBy, uniq
} = require("lodash");
// const areNonNegativeIntegers = require('validate.io-nonnegative-integer-array');
const { each, forEach, startsWith, filter } = require("lodash");
const {
getYOffsetForPotentiallyCircularRange,
splitRangeIntoTwoPartsIfItIsCircular
Expand All @@ -18,14 +9,6 @@ module.exports = function mapAnnotationsToRows(
sequenceLength,
bpsPerRow
) {
// ac.throw(ac.arrayOf(ac.shape({
// start: ac.posInt,
// end: ac.posInt,
// // id: ac.oneOfType([ac.object, ac.string])
// })), annotations);
// ac.throw(ac.posInt, sequenceLength);
// ac.throw(ac.posInt, bpsPerRow);

const annotationsToRowsMap = {};
const yOffsetLevelMap = {};
const wrappedAnnotations = {};
Expand Down
13 changes: 10 additions & 3 deletions src/tidyUpAnnotation.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const { cloneDeep } = require("lodash");
const FeatureTypes = require("./FeatureTypes.js");
const featureColors = require("./featureColors");
const areNonNegativeIntegers = require("validate.io-nonnegative-integer-array");
const bsonObjectid = require("bson-objectid");

module.exports = function tidyUpAnnotation(
Expand Down Expand Up @@ -124,7 +123,11 @@ function coerceLocation({
location.start = location.start * 3;
location.end = location.end * 3 + 2;
}
if (!areNonNegativeIntegers([location.start]) || location.start > size - 1) {
if (
location.start < 0 ||
!(location.start <= size - 1) ||
location.start > size - 1
) {
messages.push(
"Invalid annotation start: " +
location.start +
Expand All @@ -135,7 +138,11 @@ function coerceLocation({
); //setting it to 0 internally, but users will see it as 1
location.start = size - (isProtein ? 3 : 1);
}
if (!areNonNegativeIntegers([location.end]) || location.end > size - 1) {
if (
location.end < 0 ||
!(location.end <= size - 1) ||
location.end > size - 1
) {
messages.push(
"Invalid annotation end: " +
location.end +
Expand Down
3 changes: 1 addition & 2 deletions src/tidyUpSequenceData.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
const bsonObjectid = require("bson-objectid");
const getAminoAcidDataForEachBaseOfDna = require("./getAminoAcidDataForEachBaseOfDna");
const { cloneDeep } = require("lodash");
const areNonNegativeIntegers = require("validate.io-nonnegative-integer-array");
const annotationTypes = require("./annotationTypes");
const filterSequenceString = require("./filterSequenceString");
const tidyUpAnnotation = require("./tidyUpAnnotation");
Expand Down Expand Up @@ -140,7 +139,7 @@ module.exports = function tidyUpSequenceData(pSeqData, options = {}) {
annotationTypes.forEach(function(name) {
seqData[name] = seqData[name].reduce(function(acc, item) {
let itemId;
if (areNonNegativeIntegers(item.id) || item.id) {
if (item.id || item.id === 0) {
itemId = item.id;
} else {
itemId = bsonObjectid().str;
Expand Down
2 changes: 1 addition & 1 deletion src/tidyUpSequenceData.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe("tidyUpSequenceData", function() {
end: 20,
locations: [
{
start: 3,
start: "3", //this should be converted to an int :)
end: 5
},
{
Expand Down
51 changes: 4 additions & 47 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11004,60 +11004,17 @@ validate-npm-package-license@^3.0.1:
spdx-correct "^3.0.0"
spdx-expression-parse "^3.0.0"

validate.io-array@^1.0.3:
version "1.0.6"
resolved "https://registry.yarnpkg.com/validate.io-array/-/validate.io-array-1.0.6.tgz#5b5a2cafd8f8b85abb2f886ba153f2d93a27774d"
integrity sha1-W1osr9j4uFq7L4hroVPy2Tond00=

validate.io-integer@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/validate.io-integer/-/validate.io-integer-1.0.5.tgz#168496480b95be2247ec443f2233de4f89878068"
integrity sha1-FoSWSAuVviJH7EQ/IjPeT4mHgGg=
dependencies:
validate.io-number "^1.0.3"

validate.io-nonnegative-integer-array@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/validate.io-nonnegative-integer-array/-/validate.io-nonnegative-integer-array-1.0.1.tgz#66330a665f5598b96f25f69081f81f632ea4db4f"
integrity sha1-ZjMKZl9VmLlvJfaQgfgfYy6k208=
dependencies:
validate.io-array "^1.0.3"
validate.io-nonnegative-integer "^1.0.0"

validate.io-nonnegative-integer@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/validate.io-nonnegative-integer/-/validate.io-nonnegative-integer-1.0.0.tgz#8069243a08c5f98e95413c929dfd7b18f3f6f29f"
integrity sha1-gGkkOgjF+Y6VQTySnf17GPP28p8=
dependencies:
validate.io-integer "^1.0.5"

validate.io-number@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/validate.io-number/-/validate.io-number-1.0.3.tgz#f63ffeda248bf28a67a8d48e0e3b461a1665baf8"
integrity sha1-9j/+2iSL8opnqNSODjtGGhZluvg=

vary@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"
integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=

ve-range-utils@2.5.5:
version "2.5.5"
resolved "https://registry.yarnpkg.com/ve-range-utils/-/ve-range-utils-2.5.5.tgz#54d8bb442666b10b4cfe9bfef457c3f6cbd7a1a0"
integrity sha512-rxdps7rO3WO0btj5zrR34aPTolYxSHxAPNkX+AyuufaaiggAoinRcsu9Xx1sTmVa7uwQuLeTKr8U7j9VhZAPZw==
ve-range-utils@2.6.3:
version "2.6.3"
resolved "https://registry.yarnpkg.com/ve-range-utils/-/ve-range-utils-2.6.3.tgz#ef7e36efcfba563860f6ff89350ad8f6ae28f244"
integrity sha512-HiUuyaiqKRirrc1/5P4/XpnFOvb1Z+lpcwyHn+mc1LecXipNViBIVfCQU8LIxbScFXuvTzgClS1ywdJRvs6HWA==
dependencies:
lodash "^4.17.4"
validate.io-nonnegative-integer-array "^1.0.1"

ve-sequence-utils@^3.3.16:
version "3.3.16"
resolved "https://registry.yarnpkg.com/ve-sequence-utils/-/ve-sequence-utils-3.3.16.tgz#ac1a7bdf4187953b0990b16b3154decd07066a1b"
integrity sha512-JTARqUoYZECY2OpMZFhG6P3+YtpovgNbju36hWeYFaxfMXB8LE7L33BJ4TvIyI+OKP5UCf/gRMZMmTzZUa+9AA==
dependencies:
bson-objectid "^1.1.1"
escape-string-regexp "^1.0.5"
string-splice "^1.3.0"
validate.io-nonnegative-integer-array "^1.0.1"

[email protected]:
version "1.10.0"
Expand Down

0 comments on commit e5e0f6d

Please sign in to comment.