CoolFace
Apppublic

opusdev/vector-similarity-api

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes
deprecatedMethod.js27 linesDownload Raw Back to helpers
1'use strict';2 3/*eslint no-console:0*/4 5/**6 * Supply a warning to the developer that a method they are using7 * has been deprecated.8 *9 * @param {string} method The name of the deprecated method10 * @param {string} [instead] The alternate method to use if applicable11 * @param {string} [docs] The documentation URL to get further details12 *13 * @returns {void}14 */15export default function deprecatedMethod(method, instead, docs) {16  try {17    console.warn(18      'DEPRECATED method `' + method + '`.' +19      (instead ? ' Use `' + instead + '` instead.' : '') +20      ' This method will be removed in a future release.');21 22    if (docs) {23      console.warn('For more information about usage see ' + docs);24    }25  } catch (e) { /* Ignore */ }26}27