Socket
Socket
Sign inDemoInstall

css-js-filter

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.2 to 1.1.4

14

CHANGELOG.md

@@ -5,2 +5,16 @@ # Changelog

### [1.1.4](https://github.com/wolframdeus/css-js-filter/compare/v1.1.3...v1.1.4) (2020-11-14)
### Bug Fixes
* **createcssfilter:** separate getCSSFilter and static css function fields ([5856843](https://github.com/wolframdeus/css-js-filter/commit/5856843fc7769bf7280494ffc5bd1a13599a444d))
### [1.1.3](https://github.com/wolframdeus/css-js-filter/compare/v1.1.2...v1.1.3) (2020-11-14)
### Bug Fixes
* **createcssfilter:** add an ability to pass custom getCSSFilter ([f559330](https://github.com/wolframdeus/css-js-filter/commit/f5593308591b6789f54d1d700b824306568bdca7))
### [1.1.2](https://github.com/wolframdeus/css-js-filter/compare/v1.1.1...v1.1.2) (2020-11-13)

@@ -7,0 +21,0 @@

43

dist/createCSSFilter.d.ts
import { ICSSFilter, TProcessImageFunc } from './types';
declare type TOptions = {
declare type TDefaultValue = {
/**
* Filter class name.
* Default value or values for this filter. For example, if its brightness
* filter, default value is 100 because by default images has 100%
* brightness.
*/
name?: string;
defaultValue: number | number[];
} | {
/**
* Overrides isDefault method.
* @param {number} value
* @returns {boolean}
*/
isDefault(value: number): boolean;
};
declare type TGetCSSFilter = {
/**
* CSS filter function name. For example: hue-rotate, contrast

@@ -17,21 +28,21 @@ * brightness, etc.

cssFunctionValuePostfix?: string;
} | {
/**
* Function which processes image pixels and applies filter logic.
* Returns CSS filter text representation, which could be used as
* CSS's filter property.
* @param {string} value
* @returns {string}
*/
processImage: TProcessImageFunc;
} & ({
getCSSFilter(value: number): string;
};
declare type TOptions = TDefaultValue & TGetCSSFilter & {
/**
* Default value or values for this filter. For example, if its brightness
* filter, default value is 100 because by default images has 100%
* brightness.
* Filter class name.
*/
defaultValue: number | number[];
} | {
name?: string;
/**
* Overrides isDefault method.
* @param {number} value
* @returns {boolean}
* Function which processes image pixels and applies filter logic.
*/
isDefault(value: number): boolean;
});
processImage: TProcessImageFunc;
};
/**

@@ -38,0 +49,0 @@ * Creates CSS filter.

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createCSSFilter=void 0;var utils_1=require("./utils");function createCSSFilter(e){var t=e.name,r=e.cssFunctionName,i=e.cssFunctionValuePostfix,n=e.processImage,a="isDefault"in e?e.isDefault:function(t){var r=e.defaultValue;return Array.isArray(r)?r.includes(t):r===t};function o(e,t,r){void 0===r&&(r={});var i=r.byRef,a=void 0===i||i,o=r.type,s=void 0===o?"rgba":o,u=e instanceof ImageData?e.data:e;if(u.length%utils_1.getBytesCount(s))throw new Error("Entity is corrupted. Choose another entity type or check entity itself");return u=a?u:u.slice(0),n(u,t,s),e instanceof ImageData?a?e:new ImageData(u instanceof Uint8ClampedArray?u:new Uint8ClampedArray(u),e.width,e.height):u}var s=function(){function e(){}return e.getCSSFilter=function(e){return r+"("+e+i+")"},e.applyTo=o,e.isDefault=a,e}();return"string"==typeof t&&Object.defineProperty(s,"name",{value:t}),s}exports.createCSSFilter=createCSSFilter;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createCSSFilter=void 0;var utils_1=require("./utils");function createCSSFilter(e){var t=e.name,r=e.processImage,i="getCSSFilter"in e?e.getCSSFilter:function(t){return e.cssFunctionName+"("+t+e.cssFunctionValuePostfix+")"},n="isDefault"in e?e.isDefault:function(t){var r=e.defaultValue;return Array.isArray(r)?r.includes(t):r===t};function a(e,t,i){void 0===i&&(i={});var n=i.byRef,a=void 0===n||n,o=i.type,s=void 0===o?"rgba":o,u=e instanceof ImageData?e.data:e;if(u.length%utils_1.getBytesCount(s))throw new Error("Entity is corrupted. Choose another entity type or check entity itself");return u=a?u:u.slice(0),r(u,t,s),e instanceof ImageData?a?e:new ImageData(u instanceof Uint8ClampedArray?u:new Uint8ClampedArray(u),e.width,e.height):u}var o=function(){function e(){}return e.applyTo=a,e.getCSSFilter=i,e.isDefault=n,e}();return"string"==typeof t&&Object.defineProperty(o,"name",{value:t}),o}exports.createCSSFilter=createCSSFilter;
{
"name": "css-js-filter",
"version": "1.1.2",
"version": "1.1.4",
"repository": "https://github.com/wolframdeus/css-js-filter.git",

@@ -5,0 +5,0 @@ "author": "Vladislav Kibenko <wolframdeus@gmail.com>",

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