@eik/common
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -0,1 +1,9 @@ | ||
## [1.3.2](https://github.com/eik-lib/common/compare/v1.3.1...v1.3.2) (2020-12-16) | ||
### Bug Fixes | ||
* Added ajv-formats to support uri's ([66e86d0](https://github.com/eik-lib/common/commit/66e86d09d16644ad35e40617b4a5e3b380e587f3)) | ||
* **deps:** update dependency ajv to v7 ([bb61f63](https://github.com/eik-lib/common/commit/bb61f638259a0d379b6a43490e016c08bf6ac04e)) | ||
# [1.3.0](https://github.com/eik-lib/common/compare/v1.2.0...v1.3.0) (2020-09-25) | ||
@@ -2,0 +10,0 @@ |
@@ -14,4 +14,3 @@ 'use strict'; | ||
const assert = (validate, message) => { | ||
return value => { | ||
const assert = (validate, message) => value => { | ||
const valid = validate(value); | ||
@@ -23,3 +22,2 @@ if (valid.error) { | ||
}; | ||
}; | ||
@@ -26,0 +24,0 @@ module.exports = { |
'use strict'; | ||
const formats = require('ajv-formats'); | ||
const semver = require('semver'); | ||
const npmPkg = require('validate-npm-package-name'); | ||
const Ajv = require('ajv').default; | ||
const Ajv = require('ajv'); | ||
const eikJSONSchema = require('./eikjson.schema.json'); | ||
@@ -11,2 +12,3 @@ | ||
const ajv = new Ajv(ajvOptions); | ||
formats(ajv); // Needed to support "uri" | ||
const validate = ajv.compile({ | ||
@@ -27,4 +29,3 @@ $schema: 'http://json-schema.org/schema#', | ||
}); | ||
const createNameValidator = (jsonSchemaValidator) => { | ||
return (value) => { | ||
const createNameValidator = (jsonSchemaValidator) => (value) => { | ||
const result = jsonSchemaValidator(value); | ||
@@ -58,5 +59,3 @@ if (!result.error) { | ||
} | ||
} | ||
const createVersionValidator = (jsonSchemaValidator) => { | ||
return (value) => { | ||
const createVersionValidator = (jsonSchemaValidator) => (value) => { | ||
const result = jsonSchemaValidator(value); | ||
@@ -81,3 +80,2 @@ if (!result.error) { | ||
} | ||
} | ||
@@ -84,0 +82,0 @@ const name = createNameValidator(createValidator(eikJSONSchema.properties.name)); |
'use strict'; | ||
const isStream = (stream) => { | ||
return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; | ||
}; | ||
const isStream = (stream) => stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; | ||
module.exports.isStream = isStream; | ||
const isReadableStream = (stream) => { | ||
return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; | ||
}; | ||
const isReadableStream = (stream) => isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; | ||
module.exports.isReadableStream = isReadableStream; |
@@ -25,4 +25,3 @@ /* eslint-disable no-plusplus */ | ||
const globP = (path) => { | ||
return new Promise((res, rej) => | ||
const globP = (path) => new Promise((res, rej) => | ||
glob(path, (err, f) => { | ||
@@ -35,4 +34,3 @@ if (err) { | ||
}), | ||
); | ||
} | ||
) | ||
@@ -39,0 +37,0 @@ module.exports = async (files, path, options = {}) => { |
@@ -57,5 +57,3 @@ 'use strict'; | ||
// TODO; https://github.com/asset-pipe/core/issues/12 | ||
const extra = value => { | ||
return value; | ||
}; | ||
const extra = value => value; | ||
module.exports.extra = extra; | ||
@@ -62,0 +60,0 @@ |
{ | ||
"name": "@eik/common", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Common utilities for Eik modules", | ||
@@ -28,3 +28,4 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"ajv": "^6.10.2", | ||
"ajv": "^7.0.0", | ||
"ajv-formats": "^1.5.1", | ||
"glob": "^7.1.6", | ||
@@ -44,3 +45,3 @@ "node-fetch": "^2.6.1", | ||
"eslint-config-airbnb-base": "14.2.1", | ||
"eslint-config-prettier": "6.15.0", | ||
"eslint-config-prettier": "7.0.0", | ||
"eslint-plugin-import": "2.22.1", | ||
@@ -47,0 +48,0 @@ "eslint-plugin-prettier": "3.3.0", |
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
21266
0
6
432
+ Addedajv-formats@^1.5.1
+ Addedajv@7.2.4(transitive)
+ Addedajv-formats@1.6.1(transitive)
+ Addedjson-schema-traverse@1.0.0(transitive)
+ Addedrequire-from-string@2.0.2(transitive)
- Removedajv@6.12.6(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedjson-schema-traverse@0.4.1(transitive)
Updatedajv@^7.0.0