@keystonejs/utils
Advanced tools
Comparing version 5.1.1 to 5.1.2
# @keystonejs/utils | ||
## 5.1.2 | ||
### Patch Changes | ||
- [`3d2c4b3f`](https://github.com/keystonejs/keystone/commit/3d2c4b3fb8f05e79fc1a4a8e39077058466795a2) [#2112](https://github.com/keystonejs/keystone/pull/2112) - Added knex adaptar database version validiation | ||
## 5.1.1 | ||
@@ -4,0 +10,0 @@ |
@@ -11,2 +11,3 @@ 'use strict'; | ||
var isPromise = _interopDefault(require('p-is-promise')); | ||
var semver = _interopDefault(require('semver')); | ||
@@ -203,6 +204,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
if (typeof input === 'object') { | ||
return input; | ||
} else { | ||
return input.split('.').map(v => Number(v)); | ||
input = input.join('.'); | ||
} | ||
return semver.coerce(input); | ||
}; | ||
@@ -212,3 +213,3 @@ | ||
const v2 = parseVersion(base); | ||
return v1[0] >= v2[0] && v1[1] >= v2[1] && v1[2] >= v2[2]; | ||
return semver.gte(v1, v2); | ||
}; | ||
@@ -215,0 +216,0 @@ |
@@ -11,3 +11,3 @@ "use strict"; | ||
var _defineProperty = _interopDefault(require("@babel/runtime/helpers/defineProperty")), pLazy = _interopDefault(require("p-lazy")), pReflect = _interopDefault(require("p-reflect")), isPromise = _interopDefault(require("p-is-promise")); | ||
var _defineProperty = _interopDefault(require("@babel/runtime/helpers/defineProperty")), pLazy = _interopDefault(require("p-lazy")), pReflect = _interopDefault(require("p-reflect")), isPromise = _interopDefault(require("p-is-promise")), semver = _interopDefault(require("semver")); | ||
@@ -112,4 +112,5 @@ function ownKeys(object, enumerableOnly) { | ||
}, countArrays = obj => Object.values(obj).reduce((total, items) => total + (items ? items.length : 0), 0), versionGreaterOrEqualTo = (comp, base) => { | ||
const parseVersion = input => "object" == typeof input ? input : input.split(".").map(v => Number(v)), v1 = parseVersion(comp), v2 = parseVersion(base); | ||
return v1[0] >= v2[0] && v1[1] >= v2[1] && v1[2] >= v2[2]; | ||
const parseVersion = input => ("object" == typeof input && (input = input.join(".")), | ||
semver.coerce(input)), v1 = parseVersion(comp), v2 = parseVersion(base); | ||
return semver.gte(v1, v2); | ||
}; | ||
@@ -116,0 +117,0 @@ |
@@ -5,2 +5,3 @@ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty'; | ||
import isPromise from 'p-is-promise'; | ||
import semver from 'semver'; | ||
@@ -197,6 +198,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
if (typeof input === 'object') { | ||
return input; | ||
} else { | ||
return input.split('.').map(v => Number(v)); | ||
input = input.join('.'); | ||
} | ||
return semver.coerce(input); | ||
}; | ||
@@ -206,5 +207,5 @@ | ||
const v2 = parseVersion(base); | ||
return v1[0] >= v2[0] && v1[1] >= v2[1] && v1[2] >= v2[2]; | ||
return semver.gte(v1, v2); | ||
}; | ||
export { arrayToObject, captureSuspensePromises, compose, countArrays, createLazyDeferred, defaultObj, escapeRegExp, filterValues, flatMap, flatten, getType, identity, intersection, mapKeyNames, mapKeys, mergeWhereClause, noop, objMerge, omit, omitBy, pick, resolveAllKeys, unique, versionGreaterOrEqualTo, zipObj }; |
{ | ||
"name": "@keystonejs/utils", | ||
"description": "Common utility functions used throughout @keystonejs packages.", | ||
"version": "5.1.1", | ||
"version": "5.1.2", | ||
"author": "The KeystoneJS Development Team", | ||
@@ -18,4 +18,5 @@ "license": "MIT", | ||
"p-lazy": "^3.0.0", | ||
"p-reflect": "^2.1.0" | ||
"p-reflect": "^2.1.0", | ||
"semver": "^5.7.1" | ||
} | ||
} |
import pLazy from 'p-lazy'; | ||
import pReflect from 'p-reflect'; | ||
import isPromise from 'p-is-promise'; | ||
import semver from 'semver'; | ||
@@ -210,6 +211,5 @@ export const noop = x => x; | ||
if (typeof input === 'object') { | ||
return input; | ||
} else { | ||
return input.split('.').map(v => Number(v)); | ||
input = input.join('.'); | ||
} | ||
return semver.coerce(input); | ||
}; | ||
@@ -219,4 +219,3 @@ | ||
const v2 = parseVersion(base); | ||
return v1[0] >= v2[0] && v1[1] >= v2[1] && v1[2] >= v2[2]; | ||
return semver.gte(v1, v2); | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
35316
709
0
5
+ Addedsemver@^5.7.1
+ Addedsemver@5.7.2(transitive)