1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-15 07:40:07 +02:00
copilot/packages/unitcalc
Sérgio Ramos 0667ca8ad3 chore: different test targets for CI
this allows for junit reports and parallel executions
2017-05-31 20:04:12 +01:00
..
src chore: initial lerna setup 2017-05-25 10:56:50 +01:00
test chore: initial lerna setup 2017-05-25 10:56:50 +01:00
.eslintignore chore: initial lerna setup 2017-05-25 10:56:50 +01:00
.eslintrc chore: initial lerna setup 2017-05-25 10:56:50 +01:00
.tern-project chore: initial lerna setup 2017-05-25 10:56:50 +01:00
CHANGELOG.md chore: publish 2017-05-25 16:07:31 +01:00
package.json chore: different test targets for CI 2017-05-31 20:04:12 +01:00
README.md chore: initial lerna setup 2017-05-25 10:56:50 +01:00
yarn.lock chore: different test targets for CI 2017-05-31 20:04:12 +01:00

unitcalc

License: MPL 2.0 npm standard-readme compliant

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