javascript-color-gradient
Advanced tools
Comparing version 1.0.2 to 1.2.2
{ | ||
"name": "javascript-color-gradient", | ||
"version": "1.0.2", | ||
"description": "color-gradient is a lightweight JavaScript library, used to generate an array of color gradients by providing start and finish colors, as well as the required number of midpoints. ", | ||
"main": "src/index.js", | ||
"version": "1.2.2", | ||
"description": "javascript-color-gradient is a lightweight JavaScript library, used to generate an array of color gradients by providing start and finish colors, as well as the required number of midpoints. ", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"test": "mocha src/index.test.js -w" | ||
"test": "mocha src/index.test.js -w", | ||
"prebuild": "rimraf dist", | ||
"build": "npm-run-all --parallel build:*", | ||
"build:main": "babel --out-dir dist --ignore *.test.js src", | ||
"build:umd": "webpack --output-filename index.umd.js", | ||
"build:umd.min": "webpack --output-filname index.umd.min.js -p" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Adrinlol/color-gradient.git" | ||
"url": "https://github.com/Adrinlol/javascript-color-gradient.git" | ||
}, | ||
@@ -23,9 +28,23 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/Adrinlol/color-gradient/issues" | ||
"url": "https://github.com/Adrinlol/javascript-color-gradient/issues" | ||
}, | ||
"homepage": "https://github.com/Adrinlol/color-gradient#readme", | ||
"homepage": "https://github.com/Adrinlol/javascript-color-gradient#readme", | ||
"devDependencies": { | ||
"babel-cli": "6.26.0", | ||
"babel-loader": "8.1.0", | ||
"babel-preset-es2015": "6.24.1", | ||
"babel-preset-stage-2": "6.24.1", | ||
"chai": "4.2.0", | ||
"mocha": "7.1.2" | ||
"mocha": "7.1.2", | ||
"npm-run-all": "4.1.5", | ||
"rimraf": "3.0.2", | ||
"webpack": "4.43.0", | ||
"webpack-cli": "3.3.11" | ||
}, | ||
"babel": { | ||
"presets": [ | ||
"es2015", | ||
"stage-2" | ||
] | ||
} | ||
} |
@@ -1,31 +0,43 @@ | ||
const Gradient = require('./index'); | ||
const expect = require('chai').expect; | ||
const Gradient = require("./index"); | ||
const expect = require("chai").expect; | ||
const colorGradient = new Gradient(); | ||
const firstColor = "#3F2CAF"; | ||
const secondColor = "#8BC2E3"; | ||
const numberProps = 10; | ||
describe('javascript-color-gradient', function() { | ||
describe('getArray', function() { | ||
it('should return an array of strings', function() { | ||
expect(colorGradient.getArray).to.satisfy(isArrayOfStrings); | ||
describe("javascript-color-gradient", function () { | ||
describe("getArray", function () { | ||
it("should return an array of strings", function () { | ||
expect(colorGradient.getArray).to.satisfy(isArrayOfStrings); | ||
function isArrayOfStrings(array) { | ||
return array.every(function(item) { | ||
return typeof item === 'string'; | ||
}); | ||
} | ||
}) | ||
function isArrayOfStrings() { | ||
return function (item) { | ||
return typeof item === "string"; | ||
}; | ||
} | ||
}); | ||
}); | ||
describe('getColor', function() { | ||
it('should be a number', function() { | ||
expect(colorGradient.getColor).to.satisfy(isNumber); | ||
describe("setGradient", function () { | ||
it("type should be an object", function () { | ||
expect(colorGradient.setGradient(firstColor, secondColor)).to.satisfy( | ||
isObject | ||
); | ||
function isNumber() { | ||
return (function(item) { | ||
return typeof item === 'number'; | ||
}); | ||
} | ||
}); | ||
function isObject(object) { | ||
return typeof object === "object"; | ||
} | ||
}); | ||
}); | ||
}); | ||
describe("getColor", function () { | ||
it("should start with #", function () { | ||
expect(colorGradient.getColor(numberProps)).to.satisfy(isNumber); | ||
function isNumber(item) { | ||
return item.startsWith("#"); | ||
} | ||
}); | ||
}); | ||
}); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
35347
11
255
0
51
10
1