.add('mtil.function.inherits', function () {
				var inst;

				function Foo() {}
				function Bar() {}

				mtil(Bar, Foo);
				inst = new Bar();
			})
Пример #2
0
	}

	if (arr instanceof Collection) {
		arr = arr.arr;
	}

	/**
	 * @property arr
	 * @type {Array}
	 */
	this.arr = arr || [];

	Emitter.call(this);
}

proto = inherits(Collection, Emitter);

/**
 * @method add
 * @param {*} item
 * @chainable
 */
proto.add = function (item) {
	return this.splice(this.arr.length, 0, item);
};

/**
 * @method empty
 * @chainable
 */
proto.empty = function () {
Пример #3
0
 */
function PuraCompiler(options) {
	if (!(this instanceof PuraCompiler)) {
		return new PuraCompiler(options);
	}

	/**
	 * @property options
	 * @type {Object}
	 */
	this.options = mixin({}, defaults, options);

	Transform.call(this, { objectMode: true });
}

proto = inherits(PuraCompiler, Transform);

/**
 * @method _transform
 * @param {Vinyl} file
 * @param {String} enc
 * @param {Function} cb
 */
proto._transform = function (file, enc, cb) {
	var options = this.options,
		path = file && file.path,
		ast = file && file.ast;

	if (!ast) {
		return cb();
	}
Пример #4
0
	/**
	 * @property options
	 * @type {Object}
	 */
	this.options = mixin({}, this.defaults, options);

	/**
	 * @property data
	 * @type {Object}
	 */
	this.data = {};

	Transform.call(this, { objectMode: true });
}

proto = inherits(Trabea, Transform);

/**
 * Default options.
 *
 * @property defaults
 * @type {Object}
 */
proto.defaults = {
	title: 'Documentation'
};

/**
 * @method _transform
 * @param {Vinyl} file
 * @param {String} enc