mirror of
https://github.com/yldio/copilot.git
synced 2024-12-01 07:30:07 +02:00
c45fb3ce41
- cloudapi-gql@1.0.3 - joyent-cp-frontend@1.0.3 - joyent-cp-gql-mock-server@1.0.3 - joyent-cp-gql-schema@1.0.3 - joyent-cp-rdb-bootstrap@1.0.3 - normalized-styled-components@1.0.4 - pseudo-json-ast@1.0.5 - pseudo-yaml-ast@1.0.5 - remcalc@1.0.4 - rnd-id@1.0.4 - styled-is@1.0.6 - joyent-ui-toolkit@1.0.3 - unitcalc@1.0.4 |
||
---|---|---|
.. | ||
src | ||
test | ||
.eslintignore | ||
.eslintrc | ||
.tern-project | ||
CHANGELOG.md | ||
package.json | ||
README.md | ||
yarn.lock |
unitcalc
Calculate the rem
's from unit values.
Table of Contents
Install
yarn add --dev unitcalc
Usage
import unitcalc from 'unitcalc';
import assert from 'assert';
assert.deepEqual(unitcalc(1, 2, 3, 4), '0.375rem 0.75rem 1.125rem 1.5rem');
assert.deepEqual(unitcalc('1'), '0.375rem');
assert.deepEqual(unitcalc.withBase(10, '1'), '0.625rem');
assert.deepEqual(
unitcalc('1', '2', '3', '4'),
'0.375rem 0.75rem 1.125rem 1.5rem'
);
assert.deepEqual(
unitcalc.withBase(10, '1', '2', '3', '4'),
'0.625rem 1.25rem 1.875rem 2.5rem'
);
assert.deepEqual(unitcalc('1 2 3 4'), '0.375rem 0.75rem 1.125rem 1.5rem');
assert.deepEqual(
unitcalc.withBase(10, '1 2 3 4'),
'0.625rem 1.25rem 1.875rem 2.5rem'
);
License
MPL-2.0