@styled-system/core
Advanced tools
Comparing version 5.1.0 to 5.1.1
@@ -153,5 +153,5 @@ import assign from 'object-assign'; | ||
var sx = function sx(value, scale) { | ||
var sx = function sx(value, scale, _props) { | ||
var result = {}; | ||
var n = transform(value, scale); | ||
var n = transform(value, scale, _props); | ||
if (n === null) return; | ||
@@ -158,0 +158,0 @@ properties.forEach(function (prop) { |
@@ -169,5 +169,5 @@ "use strict"; | ||
var sx = function sx(value, scale) { | ||
var sx = function sx(value, scale, _props) { | ||
var result = {}; | ||
var n = transform(value, scale); | ||
var n = transform(value, scale, _props); | ||
if (n === null) return; | ||
@@ -174,0 +174,0 @@ properties.forEach(function (prop) { |
{ | ||
"name": "@styled-system/core", | ||
"version": "5.1.0", | ||
"version": "5.1.1", | ||
"main": "dist/index.js", | ||
@@ -8,3 +8,3 @@ "module": "dist/index.esm.js", | ||
"license": "MIT", | ||
"gitHead": "6477ac28b98015cea35c7b8c873b92cae453d910", | ||
"gitHead": "c8abec2db8296389c0eaa730ca514667dddff02b", | ||
"dependencies": { | ||
@@ -11,0 +11,0 @@ "object-assign": "^4.1.1" |
@@ -141,5 +141,5 @@ import assign from 'object-assign' | ||
properties = properties || [property] | ||
const sx = (value, scale) => { | ||
const sx = (value, scale, _props) => { | ||
const result = {} | ||
const n = transform(value, scale) | ||
const n = transform(value, scale, _props) | ||
if (n === null) return | ||
@@ -146,0 +146,0 @@ properties.forEach(prop => { |
@@ -273,1 +273,17 @@ import { system } from '../src' | ||
}) | ||
test('transforms values', () => { | ||
const parser = system({ | ||
margin: { | ||
property: 'margin', | ||
transform: (n, scale, props) => { | ||
const m = props.multiply || 1 | ||
return m * n | ||
} | ||
} | ||
}) | ||
const a = parser({ margin: 8 }) | ||
const b = parser({ margin: 12, multiply: 2 }) | ||
expect(a).toEqual({ margin: 8 }) | ||
expect(b).toEqual({ margin: 24 }) | ||
}) |
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
27699
982