Socket
Socket
Sign inDemoInstall

@khanacademy/wonder-blocks-color

Package Overview
Dependencies
0
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.1 to 1.2.2

dist/index.d.ts

13

CHANGELOG.md
# @khanacademy/wonder-blocks-color
## 1.2.2
### Patch Changes
- d816af08: Update build and test configs use TypeScript
- 3891f544: Update babel config to include plugins that Storybook needed
- 0d28bb1c: Configured TypeScript
- 3d05f764: Fix HOCs and other type errors
- c2ec4902: Update eslint configuration, fix lint
- 2983c05b: Include 'types' field in package.json
- 77ff6a66: Generate Flow types from TypeScript types
- ec8d4b7f: Fix miscellaneous TypeScript errors
## 1.2.1

@@ -4,0 +17,0 @@

28

dist/es/index.js

@@ -1,2 +0,15 @@

import _extends from '@babel/runtime/helpers/extends';
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}

@@ -6,3 +19,2 @@ const color6Regexp = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;

const rgbaRegexp = /^rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\s*\)$/i;
const parse = color => {

@@ -12,5 +24,3 @@ if (typeof color !== "string") {

}
const color3Match = color.match(color3Regexp);
if (color3Match) {

@@ -24,5 +34,3 @@ return {

}
const color6Match = color.match(color6Regexp);
if (color6Match) {

@@ -36,5 +44,3 @@ return {

}
const rgbaMatch = color.match(rgbaRegexp);
if (rgbaMatch) {

@@ -48,6 +54,4 @@ return {

}
throw new Error(`Failed to parse color: ${color}`);
};
const format = color => {

@@ -57,3 +61,2 @@ const r = Math.round(color.r);

const b = Math.round(color.b);
if (color.a === 1) {

@@ -64,3 +67,2 @@ const _s = c => {

};
return `#${_s(r)}${_s(g)}${_s(b)}`;

@@ -71,3 +73,2 @@ } else {

};
const fade = (color, percentage) => {

@@ -77,3 +78,2 @@ if (percentage < 0 || percentage > 1) {

}
const components = parse(color);

@@ -80,0 +80,0 @@ return format(_extends({}, components, {

@@ -5,12 +5,20 @@ 'use strict';

var _extends = require('@babel/runtime/helpers/extends');
function _extends() {
_extends = Object.assign ? Object.assign.bind() : function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
const color6Regexp = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;
const color3Regexp = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i;
const rgbaRegexp = /^rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\s*\)$/i;
const parse = color => {

@@ -20,5 +28,3 @@ if (typeof color !== "string") {

}
const color3Match = color.match(color3Regexp);
if (color3Match) {

@@ -32,5 +38,3 @@ return {

}
const color6Match = color.match(color6Regexp);
if (color6Match) {

@@ -44,5 +48,3 @@ return {

}
const rgbaMatch = color.match(rgbaRegexp);
if (rgbaMatch) {

@@ -56,6 +58,4 @@ return {

}
throw new Error(`Failed to parse color: ${color}`);
};
const format = color => {

@@ -65,3 +65,2 @@ const r = Math.round(color.r);

const b = Math.round(color.b);
if (color.a === 1) {

@@ -72,3 +71,2 @@ const _s = c => {

};
return `#${_s(r)}${_s(g)}${_s(b)}`;

@@ -79,3 +77,2 @@ } else {

};
const fade = (color, percentage) => {

@@ -85,5 +82,4 @@ if (percentage < 0 || percentage > 1) {

}
const components = parse(color);
return format(_extends__default["default"]({}, components, {
return format(_extends({}, components, {
a: components.a * percentage

@@ -90,0 +86,0 @@ }));

{
"name": "@khanacademy/wonder-blocks-color",
"version": "1.2.1",
"version": "1.2.2",
"design": "v2",

@@ -11,3 +11,3 @@ "publishConfig": {

"module": "dist/es/index.js",
"source": "src/index.js",
"types": "dist/index.d.ts",
"scripts": {

@@ -17,3 +17,3 @@ "test": "echo \"Error: no test specified\" && exit 1"

"devDependencies": {
"wb-dev-build-settings": "^0.7.1"
"wb-dev-build-settings": "^0.7.2"
},

@@ -20,0 +20,0 @@ "author": "",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc