Comparing version 1.2.4 to 1.2.5
@@ -5,2 +5,8 @@ # Changelog | ||
## [1.2.4] 2018-03-06 | ||
### Added | ||
- `props` can now be passed to `styler`. | ||
## [1.2.4] 2018-03-04 | ||
@@ -7,0 +13,0 @@ |
@@ -1,4 +0,4 @@ | ||
import { Styler } from './styler/types'; | ||
declare const createStyler: (node: Element) => Styler; | ||
export default function (nodeOrSelector: Element | string): Styler; | ||
import { Styler, Props } from './styler/types'; | ||
declare const createStyler: (node: Element, props: Props) => Styler; | ||
export default function (nodeOrSelector: Element | string, props: Props): Styler; | ||
export { createStyler, Styler }; |
10
index.js
@@ -6,4 +6,4 @@ "use strict"; | ||
var cache = new WeakMap(); | ||
var createStyler = function (node) { | ||
var styler = (node instanceof SVGElement) ? svg_1.default(node) : css_1.default(node); | ||
var createStyler = function (node, props) { | ||
var styler = (node instanceof SVGElement) ? svg_1.default(node) : css_1.default(node, props); | ||
cache.set(node, styler); | ||
@@ -13,10 +13,10 @@ return styler; | ||
exports.createStyler = createStyler; | ||
var getStyler = function (node) { return cache.has(node) ? cache.get(node) : createStyler(node); }; | ||
function default_1(nodeOrSelector) { | ||
var getStyler = function (node, props) { return cache.has(node) ? cache.get(node) : createStyler(node, props); }; | ||
function default_1(nodeOrSelector, props) { | ||
var node = (typeof nodeOrSelector === 'string') | ||
? document.querySelector(nodeOrSelector) | ||
: nodeOrSelector; | ||
return getStyler(node); | ||
return getStyler(node, props); | ||
} | ||
exports.default = default_1; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "stylefire", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "Performant, simplified stylers for CSS, SVG, path and DOM scroll.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
56039