New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

javascript-color-gradient

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

javascript-color-gradient - npm Package Compare versions

Comparing version 1.0.2 to 1.2.2

dist/index.js

35

package.json
{
"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("#");
}
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc