Sha256: bf2f07114bc25ef6b0533c9aa6b73ed3b799304e78d6f40c08f890f0be687c7d

Contents?: true

Size: 462 Bytes

Versions: 39

Compression:

Stored size: 462 Bytes

Contents

var utils = require('../utils');

/**
 * Return type of `node`.
 *
 * Examples:
 * 
 *    type(12)
 *    // => 'unit'
 *
 *    type(#fff)
 *    // => 'color'
 *
 *    type(type)
 *    // => 'function'
 *
 *    type(unbound)
 *    typeof(unbound)
 *    type-of(unbound)
 *    // => 'ident'
 *
 * @param {Node} node
 * @return {String}
 * @api public
 */

module.exports = function type(node){
  utils.assertPresent(node, 'expression');
  return node.nodeName;
};

Version data entries

39 entries across 20 versions & 2 rubygems

Version Path
ela-4.1.6 node_modules/stylus/lib/functions/type.js
ela-4.1.6 node_modules/nib/node_modules/stylus/lib/functions/type.js
ela-4.1.5 node_modules/stylus/lib/functions/type.js
ela-4.1.5 node_modules/nib/node_modules/stylus/lib/functions/type.js
ela-4.1.4 node_modules/nib/node_modules/stylus/lib/functions/type.js
ela-4.1.4 node_modules/stylus/lib/functions/type.js
ela-4.1.3 node_modules/stylus/lib/functions/type.js
ela-4.1.3 node_modules/nib/node_modules/stylus/lib/functions/type.js
ela-4.1.2 node_modules/stylus/lib/functions/type.js
ela-4.1.2 node_modules/nib/node_modules/stylus/lib/functions/type.js
ela-4.1.1 node_modules/stylus/lib/functions/type.js
ela-4.1.1 node_modules/nib/node_modules/stylus/lib/functions/type.js
ela-4.1.0 node_modules/stylus/lib/functions/type.js
ela-4.1.0 node_modules/nib/node_modules/stylus/lib/functions/type.js
ela-4.0.0 node_modules/stylus/lib/functions/type.js
ela-4.0.0 node_modules/nib/node_modules/stylus/lib/functions/type.js
ela-3.4.3 node_modules/stylus/lib/functions/type.js
ela-3.4.3 node_modules/nib/node_modules/stylus/lib/functions/type.js
ela-3.4.2 node_modules/nib/node_modules/stylus/lib/functions/type.js
ela-3.4.2 node_modules/stylus/lib/functions/type.js