Sha256: 0a2c768db5a28efc837c6a5b2f7e9399d6ff7aca4bfaa88ccd6b52f91f055575

Contents?: true

Size: 1.23 KB

Versions: 36

Compression:

Stored size: 1.23 KB

Contents

/*!
 * depd
 * Copyright(c) 2014 Douglas Christopher Wilson
 * MIT Licensed
 */

/**
 * Module exports.
 */

lazyProperty(module.exports, 'bufferConcat', function bufferConcat() {
  return Buffer.concat || require('./buffer-concat')
})

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')
})

/**
 * 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()
}

Version data entries

36 entries across 33 versions & 5 rubygems

Version Path
webpack_rails-2.0.1 lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/index.js
webpack_rails-2.0.0 lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/index.js
webpack_rails-1.3.1 lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/index.js
webpack_rails-1.3.0 lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/index.js
webpack_rails-1.2.2 lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/index.js
webpack_rails-1.2.1 lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/index.js
webpack_rails-1.2.0 lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/index.js
hooch-0.4.2 jasmine/node_modules/karma/node_modules/connect/node_modules/depd/lib/compat/index.js
webpack_rails-1.1.1 lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/index.js
webpack_rails-1.1.0 lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/index.js
webpack_rails-1.0.1 lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/index.js
webpack_rails-1.0.0 lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/index.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/connect/node_modules/depd/lib/compat/index.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/connect/node_modules/depd/lib/compat/index.js
gulp_assets-1.0.0.pre.5 template/node_modules/webpack-dev-server/node_modules/express/node_modules/depd/lib/compat/index.js
gulp_assets-1.0.0.pre.5 template/node_modules/gulp-livereload/node_modules/tiny-lr/node_modules/body-parser/node_modules/depd/lib/compat/index.js
gulp_assets-1.0.0.pre.4 template/node_modules/webpack-dev-server/node_modules/express/node_modules/depd/lib/compat/index.js
gulp_assets-1.0.0.pre.4 template/node_modules/gulp-livereload/node_modules/tiny-lr/node_modules/body-parser/node_modules/depd/lib/compat/index.js
gulp_assets-1.0.0.pre.3 template/node_modules/gulp-livereload/node_modules/tiny-lr/node_modules/body-parser/node_modules/depd/lib/compat/index.js
gulp_assets-1.0.0.pre.3 template/node_modules/webpack-dev-server/node_modules/express/node_modules/depd/lib/compat/index.js