Last change
on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
379 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var utils = require('../utils')
|
---|
| 2 | , nodes = require('../nodes');
|
---|
| 3 |
|
---|
| 4 | /**
|
---|
| 5 | * Apply Math `fn` to `n`.
|
---|
| 6 | *
|
---|
| 7 | * @param {Unit} n
|
---|
| 8 | * @param {String} fn
|
---|
| 9 | * @return {Unit}
|
---|
| 10 | * @api private
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | function math(n, fn){
|
---|
| 14 | utils.assertType(n, 'unit', 'n');
|
---|
| 15 | utils.assertString(fn, 'fn');
|
---|
| 16 | return new nodes.Unit(Math[fn.string](n.val), n.type);
|
---|
| 17 | }
|
---|
| 18 | math.params = ['n', 'fn'];
|
---|
| 19 | module.exports = math;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.