@mattsjones/css-utils
Advanced tools
Comparing version 0.0.2 to 0.0.3
# @mattsjones/css-utils | ||
## 0.0.3 | ||
### Patch Changes | ||
- 551f10f: Change calc `value` to `toString()` | ||
- af4a319: Fix calc type declaration | ||
## 0.0.2 | ||
### Patch Changes | ||
- 22ee0d6: Add 'calc' util |
@@ -7,10 +7,11 @@ declare type Operand = string | number; | ||
export declare const negate: (x: Operand) => string; | ||
export declare const calc: (x: Operand) => { | ||
add: (...operands: Array<Operand>) => any; | ||
subtract: (...operands: Array<Operand>) => any; | ||
multiply: (...operands: Array<Operand>) => any; | ||
divide: (...operands: Array<Operand>) => any; | ||
negate: () => any; | ||
value: Operand; | ||
declare type CalcChain = { | ||
add: (...operands: Array<Operand>) => CalcChain; | ||
subtract: (...operands: Array<Operand>) => CalcChain; | ||
multiply: (...operands: Array<Operand>) => CalcChain; | ||
divide: (...operands: Array<Operand>) => CalcChain; | ||
negate: () => CalcChain; | ||
toString: () => string; | ||
}; | ||
export declare const calc: (x: Operand) => CalcChain; | ||
export {}; |
@@ -13,3 +13,3 @@ 'use strict'; | ||
const calc = x => { | ||
const chain = { | ||
return { | ||
add: (...operands) => calc(add(x, ...operands)), | ||
@@ -20,9 +20,4 @@ subtract: (...operands) => calc(subtract(x, ...operands)), | ||
negate: () => calc(negate(x)), | ||
value: x | ||
toString: () => x.toString() | ||
}; | ||
Object.defineProperty(chain, 'toString', { | ||
value: () => x, | ||
writable: false | ||
}); | ||
return chain; | ||
}; | ||
@@ -29,0 +24,0 @@ |
@@ -13,3 +13,3 @@ 'use strict'; | ||
const calc = x => { | ||
const chain = { | ||
return { | ||
add: (...operands) => calc(add(x, ...operands)), | ||
@@ -20,9 +20,4 @@ subtract: (...operands) => calc(subtract(x, ...operands)), | ||
negate: () => calc(negate(x)), | ||
value: x | ||
toString: () => x.toString() | ||
}; | ||
Object.defineProperty(chain, 'toString', { | ||
value: () => x, | ||
writable: false | ||
}); | ||
return chain; | ||
}; | ||
@@ -29,0 +24,0 @@ |
@@ -9,3 +9,3 @@ const toExpression = (operator, ...operands) => operands.join(` ${operator} `).replace(/calc/g, ''); | ||
const calc = x => { | ||
const chain = { | ||
return { | ||
add: (...operands) => calc(add(x, ...operands)), | ||
@@ -16,11 +16,6 @@ subtract: (...operands) => calc(subtract(x, ...operands)), | ||
negate: () => calc(negate(x)), | ||
value: x | ||
toString: () => x.toString() | ||
}; | ||
Object.defineProperty(chain, 'toString', { | ||
value: () => x, | ||
writable: false | ||
}); | ||
return chain; | ||
}; | ||
export { add, calc, divide, multiply, negate, subtract }; |
{ | ||
"name": "@mattsjones/css-utils", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"main": "dist/mattsjones-css-utils.cjs.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/mattsjones-css-utils.esm.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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
4422
88