summaryrefslogtreecommitdiff
path: root/node_modules/depd/lib
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/depd/lib')
-rw-r--r--node_modules/depd/lib/browser/index.js77
-rw-r--r--node_modules/depd/lib/compat/callsite-tostring.js103
-rw-r--r--node_modules/depd/lib/compat/event-listener-count.js22
-rw-r--r--node_modules/depd/lib/compat/index.js79
4 files changed, 0 insertions, 281 deletions
diff --git a/node_modules/depd/lib/browser/index.js b/node_modules/depd/lib/browser/index.js
deleted file mode 100644
index 6be45cc..0000000
--- a/node_modules/depd/lib/browser/index.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/*!
- * depd
- * Copyright(c) 2015 Douglas Christopher Wilson
- * MIT Licensed
- */
-
-'use strict'
-
-/**
- * Module exports.
- * @public
- */
-
-module.exports = depd
-
-/**
- * Create deprecate for namespace in caller.
- */
-
-function depd (namespace) {
- if (!namespace) {
- throw new TypeError('argument namespace is required')
- }
-
- function deprecate (message) {
- // no-op in browser
- }
-
- deprecate._file = undefined
- deprecate._ignored = true
- deprecate._namespace = namespace
- deprecate._traced = false
- deprecate._warned = Object.create(null)
-
- deprecate.function = wrapfunction
- deprecate.property = wrapproperty
-
- return deprecate
-}
-
-/**
- * Return a wrapped function in a deprecation message.
- *
- * This is a no-op version of the wrapper, which does nothing but call
- * validation.
- */
-
-function wrapfunction (fn, message) {
- if (typeof fn !== 'function') {
- throw new TypeError('argument fn must be a function')
- }
-
- return fn
-}
-
-/**
- * Wrap property in a deprecation message.
- *
- * This is a no-op version of the wrapper, which does nothing but call
- * validation.
- */
-
-function wrapproperty (obj, prop, message) {
- if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
- throw new TypeError('argument obj must be object')
- }
-
- var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
-
- if (!descriptor) {
- throw new TypeError('must call property on owner object')
- }
-
- if (!descriptor.configurable) {
- throw new TypeError('property must be configurable')
- }
-}
diff --git a/node_modules/depd/lib/compat/callsite-tostring.js b/node_modules/depd/lib/compat/callsite-tostring.js
deleted file mode 100644
index 73186dc..0000000
--- a/node_modules/depd/lib/compat/callsite-tostring.js
+++ /dev/null
@@ -1,103 +0,0 @@
-/*!
- * depd
- * Copyright(c) 2014 Douglas Christopher Wilson
- * MIT Licensed
- */
-
-'use strict'
-
-/**
- * Module exports.
- */
-
-module.exports = callSiteToString
-
-/**
- * Format a CallSite file location to a string.
- */
-
-function callSiteFileLocation (callSite) {
- var fileName
- var fileLocation = ''
-
- if (callSite.isNative()) {
- fileLocation = 'native'
- } else if (callSite.isEval()) {
- fileName = callSite.getScriptNameOrSourceURL()
- if (!fileName) {
- fileLocation = callSite.getEvalOrigin()
- }
- } else {
- fileName = callSite.getFileName()
- }
-
- if (fileName) {
- fileLocation += fileName
-
- var lineNumber = callSite.getLineNumber()
- if (lineNumber != null) {
- fileLocation += ':' + lineNumber
-
- var columnNumber = callSite.getColumnNumber()
- if (columnNumber) {
- fileLocation += ':' + columnNumber
- }
- }
- }
-
- return fileLocation || 'unknown source'
-}
-
-/**
- * Format a CallSite to a string.
- */
-
-function callSiteToString (callSite) {
- var addSuffix = true
- var fileLocation = callSiteFileLocation(callSite)
- var functionName = callSite.getFunctionName()
- var isConstructor = callSite.isConstructor()
- var isMethodCall = !(callSite.isToplevel() || isConstructor)
- var line = ''
-
- if (isMethodCall) {
- var methodName = callSite.getMethodName()
- var typeName = getConstructorName(callSite)
-
- if (functionName) {
- if (typeName && functionName.indexOf(typeName) !== 0) {
- line += typeName + '.'
- }
-
- line += functionName
-
- if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) {
- line += ' [as ' + methodName + ']'
- }
- } else {
- line += typeName + '.' + (methodName || '<anonymous>')
- }
- } else if (isConstructor) {
- line += 'new ' + (functionName || '<anonymous>')
- } else if (functionName) {
- line += functionName
- } else {
- addSuffix = false
- line += fileLocation
- }
-
- if (addSuffix) {
- line += ' (' + fileLocation + ')'
- }
-
- return line
-}
-
-/**
- * Get constructor name of reviver.
- */
-
-function getConstructorName (obj) {
- var receiver = obj.receiver
- return (receiver.constructor && receiver.constructor.name) || null
-}
diff --git a/node_modules/depd/lib/compat/event-listener-count.js b/node_modules/depd/lib/compat/event-listener-count.js
deleted file mode 100644
index 3a8925d..0000000
--- a/node_modules/depd/lib/compat/event-listener-count.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*!
- * depd
- * Copyright(c) 2015 Douglas Christopher Wilson
- * MIT Licensed
- */
-
-'use strict'
-
-/**
- * Module exports.
- * @public
- */
-
-module.exports = eventListenerCount
-
-/**
- * Get the count of listeners on an event emitter of a specific type.
- */
-
-function eventListenerCount (emitter, type) {
- return emitter.listeners(type).length
-}
diff --git a/node_modules/depd/lib/compat/index.js b/node_modules/depd/lib/compat/index.js
deleted file mode 100644
index 955b333..0000000
--- a/node_modules/depd/lib/compat/index.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/*!
- * depd
- * Copyright(c) 2014-2015 Douglas Christopher Wilson
- * MIT Licensed
- */
-
-'use strict'
-
-/**
- * Module dependencies.
- * @private
- */
-
-var EventEmitter = require('events').EventEmitter
-
-/**
- * Module exports.
- * @public
- */
-
-lazyProperty(module.exports, 'callSiteToString', function callSiteToString () {
- var limit = Error.stackTraceLimit
- var obj = {}
- var prep = Error.prepareStackTrace
-
- function prepareObjectStackTrace (obj, stack) {
- return stack
- }
-
- Error.prepareStackTrace = prepareObjectStackTrace
- Error.stackTraceLimit = 2
-
- // capture the stack
- Error.captureStackTrace(obj)
-
- // slice the stack
- var stack = obj.stack.slice()
-
- Error.prepareStackTrace = prep
- Error.stackTraceLimit = limit
-
- return stack[0].toString ? toString : require('./callsite-tostring')
-})
-
-lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount () {
- return EventEmitter.listenerCount || require('./event-listener-count')
-})
-
-/**
- * Define a lazy property.
- */
-
-function lazyProperty (obj, prop, getter) {
- function get () {
- var val = getter()
-
- Object.defineProperty(obj, prop, {
- configurable: true,
- enumerable: true,
- value: val
- })
-
- return val
- }
-
- Object.defineProperty(obj, prop, {
- configurable: true,
- enumerable: true,
- get: get
- })
-}
-
-/**
- * Call toString() on the obj
- */
-
-function toString (obj) {
- return obj.toString()
-}