How to use extendr - 10 common examples

To help you get started, we’ve selected a few extendr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bevry-archive / feedr / source / index.js View on Github external
constructor(config = {}) {
		// Prepare
		const me = this

		// Extend and dereference our configuration
		this.config = extendr.deep(
			{
				log: null,
				cache: 1000 * 60 * 60 * 24, // one day by default
				tmpPath: null,
				requestOptions: null,
				plugins: null
			},
			this.config || {},
			config
		)

		// Get the temp path right away
		safeps.getTmpPath(function(err, tmpPath) {
			if (err) {
				console.error(err)
			} else {
github bevry / caterpillar / source / logger.js View on Github external
getLogEntry(args) {
		const date = new Date().toISOString()
		const lineInfo = this.getLineInfo()

		const level = args.shift()
		let levelInfo
		try {
			levelInfo = this.getLevelInfo(level)
		} catch (err) {
			// if it threw (level was not a valid name or number), then use the default level
			levelInfo = this.getLevelInfo('default')
			args.unshift(level)
		}

		return extend({ date, args }, levelInfo, lineInfo)
	}
github fomantic / Fomantic-UI / node / node_modules / docpad / node_modules / bal-util / out / lib / balutil.js View on Github external
// Generated by CoffeeScript 1.6.3
var balUtil;

balUtil = require('extendr').extend({}, require('./compare'), require('./events'), require('./flow'), require('./html'), require('./paths'));

module.exports = balUtil;
github bevry / watchr / source / index.js View on Github external
setConfig(opts /* :WatcherOpts */) {
		// Apply
		extendr.extend(this.config, opts)

		// Stat
		if (this.config.stat) {
			this.stat = this.config.stat
			delete this.config.stat
		}

		// Chain
		return this
	}
github bevry / projectz / source / lib / projectz.js View on Github external
enhancePackages(next /* :function */) /* :this */ {
		// Create the data for the `package.json` format
		this.dataForPackageFilesEnhanced.package = extendr.extend(
			// New Object
			{},

			// Old Data
			this.dataForPackageFiles.package || {},

			// Enhanced Data
			{
				name: this.mergedPackageData.name,
				version: this.mergedPackageData.version,
				license: this.mergedPackageData.license,
				description: this.mergedPackageData.description,
				keywords: this.mergedPackageData.keywords,
				author: projectzUtil
					.getPeopleTextArray(this.mergedPackageData.authors, {
						displayYears: true
github bevry / projectz / source / lib / projectz.js View on Github external
devDependencies: this.mergedPackageData.devDependencies,
				main: this.mergedPackageData.main
			}
		)

		// Explicit data
		if (this.mergedPackageData.packages.package) {
			extendr.extend(
				this.dataForPackageFilesEnhanced.package,
				this.mergedPackageData.packages.package
			)
		}

		// jQuery
		// Create the data for the `jquery.json` format, which is essentially exactly the same as the `package.json` format so just extend that
		this.dataForPackageFilesEnhanced.jquery = extendr.extend(
			// New Object
			{},

			// Old Data
			this.dataForPackageFiles.jquery || {},

			// Enhanced Data
			this.dataForPackageFilesEnhanced.package || {}
		)

		// Explicit data
		if (this.mergedPackageData.packages.jquery) {
			extendr.extend(
				this.dataForPackageFilesEnhanced.jquery,
				this.mergedPackageData.packages.jquery
			)
github bevry / projectz / source / lib / projectz.js View on Github external
main: this.mergedPackageData.main,
				scripts: [this.mergedPackageData.main]
			}
		)

		// Explicit data
		if (this.mergedPackageData.packages.component) {
			extendr.extend(
				this.dataForPackageFilesEnhanced.component,
				this.mergedPackageData.packages.component
			)
		}

		// Bower
		// Create the data for the `bower.json` format
		this.dataForPackageFilesEnhanced.bower = extendr.extend(
			// New Object
			{},

			// Old Data
			this.dataForPackageFiles.bower || {},

			// Enhanced Data
			{
				name: this.mergedPackageData.name,
				version: this.mergedPackageData.version,
				license: this.mergedPackageData.license,
				description: this.mergedPackageData.description,
				keywords: this.mergedPackageData.keywords,
				authors: projectzUtil.getPeopleTextArray(
					this.mergedPackageData.authors,
					{ displayYears: true }
github bevry / projectz / source / lib / projectz.js View on Github external
// jQuery
		// Create the data for the `jquery.json` format, which is essentially exactly the same as the `package.json` format so just extend that
		this.dataForPackageFilesEnhanced.jquery = extendr.extend(
			// New Object
			{},

			// Old Data
			this.dataForPackageFiles.jquery || {},

			// Enhanced Data
			this.dataForPackageFilesEnhanced.package || {}
		)

		// Explicit data
		if (this.mergedPackageData.packages.jquery) {
			extendr.extend(
				this.dataForPackageFilesEnhanced.jquery,
				this.mergedPackageData.packages.jquery
			)
		}

		// Component
		// Create the data for the `component.json` format
		this.dataForPackageFilesEnhanced.component = extendr.extend(
			// New Object
			{},

			// Old Data
			this.dataForPackageFiles.component || {},

			// Enhanced Data
			{
github lorenwest / node-monitor / node_modules / docpad / node_modules / watchr / node_modules / bal-util / out / lib / balutil.js View on Github external
// Generated by CoffeeScript 1.6.2
var balUtil;

balUtil = require('extendr').extend({}, require('./compare'), require('./events'), require('./flow'), require('./html'), require('./modules'), require('./paths'));

module.exports = balUtil;
github bevry / taskgroup / source / taskgroup.js View on Github external
setNestedTaskConfig(opts) {
		// Fetch and copy options to the state's nested task configuration
		extendr.deep(this.state.nestedTaskConfig, opts)

		// Chain
		return this
	}

extendr

Utilities for cloning, extending, and de-referencing objects in shallow, deep, and safe ways

Artistic-2.0
Latest version published 11 months ago

Package Health Score

61 / 100
Full package analysis