Blame view

node_modules/loopback-datasource-juggler/lib/browser.depd.js 682 Bytes
f7563de62   Palak Handa   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  // Copyright IBM Corp. 2015,2016. All Rights Reserved.
  // Node module: loopback-datasource-juggler
  // This file is licensed under the MIT License.
  // License text available at https://opensource.org/licenses/MIT
  'use strict';
  
  // A lightweight alternative to "depd" that works in the browser
  module.exports = function depd(namespace) {
    var warned = {};
    return function deprecate(message) {
      if (warned[message]) return;
      warned[message] = true;
  
      if (process.noDeprecation) {
        return;
      } else if (process.traceDeprecation) {
        console.trace(namespace, 'deprecated', message);
      } else {
        console.warn(namespace, 'deprecated', message);
      }
    };
  };