Sha256: 15432f2d3328003ff7405ffb2efd0596ca29a5107282332c3f84b7c81cf7d137

Contents?: true

Size: 1.29 KB

Versions: 24

Compression:

Stored size: 1.29 KB

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.warn = warn;
exports.warnFileDeprecation = warnFileDeprecation;
exports.warnOptionDeprecation = warnOptionDeprecation;

/* global global, console */
function warn(warning, type) {
  if (global && global._YAML_SILENCE_WARNINGS) return;
  const {
    emitWarning
  } = global && global.process; // This will throw in Jest if `warning` is an Error instance due to
  // https://github.com/facebook/jest/issues/2549

  if (emitWarning) emitWarning(warning, type);else {
    // eslint-disable-next-line no-console
    console.warn(type ? `${type}: ${warning}` : warning);
  }
}

function warnFileDeprecation(filename) {
  if (global && global._YAML_SILENCE_DEPRECATION_WARNINGS) return;
  const path = filename.replace(/.*yaml[/\\]/i, '').replace(/\.js$/, '').replace(/\\/g, '/');
  warn(`The endpoint 'yaml/${path}' will be removed in a future release.`, 'DeprecationWarning');
}

const warned = {};

function warnOptionDeprecation(name, alternative) {
  if (global && global._YAML_SILENCE_DEPRECATION_WARNINGS) return;
  if (warned[name]) return;
  warned[name] = true;
  let msg = `The option '${name}' will be removed in a future release`;
  msg += alternative ? `, use '${alternative}' instead.` : '.';
  warn(msg, 'DeprecationWarning');
}

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
trusty-cms-5.0.7 node_modules/yaml/dist/warnings.js
trusty-cms-5.0.6 node_modules/yaml/dist/warnings.js
trusty-cms-5.0.5 node_modules/yaml/dist/warnings.js
trusty-cms-5.0.4 node_modules/yaml/dist/warnings.js
trusty-cms-5.0.3 node_modules/yaml/dist/warnings.js
trusty-cms-5.0.2 node_modules/yaml/dist/warnings.js
trusty-cms-5.0.1 node_modules/yaml/dist/warnings.js
trusty-cms-4.3.5 node_modules/yaml/dist/warnings.js
trusty-cms-5.0.0 node_modules/yaml/dist/warnings.js
trusty-cms-4.3.4 node_modules/yaml/dist/warnings.js
trusty-cms-4.3.3 node_modules/yaml/dist/warnings.js
trusty-cms-4.3.2 node_modules/yaml/dist/warnings.js
trusty-cms-4.3.1 node_modules/yaml/dist/warnings.js
trusty-cms-4.3 node_modules/yaml/dist/warnings.js
trusty-cms-4.2.3 node_modules/yaml/dist/warnings.js
trusty-cms-4.2.2 node_modules/yaml/dist/warnings.js
trusty-cms-4.2.1 node_modules/yaml/dist/warnings.js
trusty-cms-4.2 node_modules/yaml/dist/warnings.js
trusty-cms-4.1.9 node_modules/yaml/dist/warnings.js
trusty-cms-4.1.8 node_modules/yaml/dist/warnings.js