Sha256: 12dae49e544b31db5a31ec1123082b4fd23df257eb95ffdb0abc9133591d02e8

Contents?: true

Size: 1.01 KB

Versions: 41

Compression:

Stored size: 1.01 KB

Contents

/*!
 * Stylus - Namespace
 * Copyright (c) Automattic <developer.wordpress.com>
 * MIT Licensed
 */

/**
 * Module dependencies.
 */

var Node = require('./node');

/**
 * Initialize a new `Namespace` with the given `val` and `prefix`
 *
 * @param {String|Call} val
 * @param {String} [prefix]
 * @api public
 */

var Namespace = module.exports = function Namespace(val, prefix){
  Node.call(this);
  this.val = val;
  this.prefix = prefix;
};

/**
 * Inherit from `Node.prototype`.
 */

Namespace.prototype.__proto__ = Node.prototype;

/**
 * Return @namespace "val".
 *
 * @return {String}
 * @api public
 */

Namespace.prototype.toString = function(){
  return '@namespace ' + (this.prefix ? this.prefix + ' ' : '') + this.val;
};

/**
 * Return a JSON representation of this node.
 *
 * @return {Object}
 * @api public
 */

Namespace.prototype.toJSON = function(){
  return {
    __type: 'Namespace',
    val: this.val,
    prefix: this.prefix,
    lineno: this.lineno,
    column: this.column,
    filename: this.filename
  };
};

Version data entries

41 entries across 22 versions & 3 rubygems

Version Path
epuber-stylus-source-0.56.0 vendor/lib/nodes/namespace.js
epuber-stylus-source-0.54.8 vendor/lib/nodes/namespace.js
ela-4.1.6 node_modules/nib/node_modules/stylus/lib/nodes/namespace.js
ela-4.1.6 node_modules/stylus/lib/nodes/namespace.js
ela-4.1.5 node_modules/nib/node_modules/stylus/lib/nodes/namespace.js
ela-4.1.5 node_modules/stylus/lib/nodes/namespace.js
ela-4.1.4 node_modules/nib/node_modules/stylus/lib/nodes/namespace.js
ela-4.1.4 node_modules/stylus/lib/nodes/namespace.js
ela-4.1.3 node_modules/stylus/lib/nodes/namespace.js
ela-4.1.3 node_modules/nib/node_modules/stylus/lib/nodes/namespace.js
ela-4.1.2 node_modules/stylus/lib/nodes/namespace.js
ela-4.1.2 node_modules/nib/node_modules/stylus/lib/nodes/namespace.js
ela-4.1.1 node_modules/nib/node_modules/stylus/lib/nodes/namespace.js
ela-4.1.1 node_modules/stylus/lib/nodes/namespace.js
ela-4.1.0 node_modules/nib/node_modules/stylus/lib/nodes/namespace.js
ela-4.1.0 node_modules/stylus/lib/nodes/namespace.js
ela-4.0.0 node_modules/stylus/lib/nodes/namespace.js
ela-4.0.0 node_modules/nib/node_modules/stylus/lib/nodes/namespace.js
ela-3.4.3 node_modules/nib/node_modules/stylus/lib/nodes/namespace.js
ela-3.4.3 node_modules/stylus/lib/nodes/namespace.js