Skip to content

Commit

Permalink
chore(utils): Update utils/deprecation.ts from MigranTS output
Browse files Browse the repository at this point in the history
This manually applies certain changes from BeksOmega's ts/migration2
branch, but notably:

- I did not apply the reordering of the doc comments at the top.
- I applied the deletion of types and @Package from the JSDoc.
- I preserved the import goog and goog.declareModuleId lines.
- I have applied a whitespace change on line 37 which violates the
  styleguide; I want to figure out why clang-format is not fixing
  this.
  • Loading branch information
cpcallen committed Jun 16, 2022
1 parent 70516d5 commit 6484e42
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions core/utils/deprecation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,21 @@ goog.declareModuleId('Blockly.utils.deprecation');

/**
* Warn developers that a function or property is deprecated.
* @param {string} name The name of the function or property.
* @param {string} deprecationDate The date of deprecation.
* @param name The name of the function or property.
* @param deprecationDate The date of deprecation.
* Prefer 'month yyyy' or 'quarter yyyy' format.
* @param {string} deletionDate The date of deletion, in the same format as the
* @param deletionDate The date of deletion, in the same format as the
* deprecation date.
* @param {string=} opt_use The name of a function or property to use instead,
* if any.
* @param opt_use The name of a function or property to use instead, if any.
* @alias Blockly.utils.deprecation.warn
* @package
*/
const warn = function(name: string, deprecationDate: string, deletionDate: string, opt_use?: string) {
export function warn(
name: string, deprecationDate: string, deletionDate: string,
opt_use?: string) {
let msg = name + ' was deprecated on ' + deprecationDate +
' and will be deleted on ' + deletionDate + '.';
' and will be deleted on ' + deletionDate + '.';
if (opt_use) {
msg += '\nUse ' + opt_use + ' instead.';
}
console.warn(msg);
};
export {warn};
}

0 comments on commit 6484e42

Please sign in to comment.