source: trip-planner-front/node_modules/stylus/lib/functions/type.js@ e29cc2e

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

initial commit

  • Property mode set to 100644
File size: 491 bytes
Line 
1var utils = require('../utils');
2
3/**
4 * Return type of `node`.
5 *
6 * Examples:
7 *
8 * type(12)
9 * // => 'unit'
10 *
11 * type(#fff)
12 * // => 'color'
13 *
14 * type(type)
15 * // => 'function'
16 *
17 * type(unbound)
18 * typeof(unbound)
19 * type-of(unbound)
20 * // => 'ident'
21 *
22 * @param {Node} node
23 * @return {String}
24 * @api public
25 */
26
27function type(node){
28 utils.assertPresent(node, 'expression');
29 return node.nodeName;
30}
31type.params = ['node'];
32module.exports = type;
Note: See TracBrowser for help on using the repository browser.