source: trip-planner-front/node_modules/stylus/lib/functions/math.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 379 bytes
Line 
1var 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
13function 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}
18math.params = ['n', 'fn'];
19module.exports = math;
Note: See TracBrowser for help on using the repository browser.