mirror of
https://github.com/hoverkraft-tech/compose-action.git
synced 2026-01-11 23:23:06 +08:00
* fix: broken action test * fix: run npm install * fix: add missing node_modules * fix: invalid option creating * fix: add missing composeFile parameter * fix: change test order * WIP: add debug code * WIP: fix main.js * WIP: fix action * WIP: debug * WIP: debug * fix: remove double quote
deprecation
Log a deprecation message with stack
Usage
| Browsers |
Load |
|---|---|
| Node |
Install with |
function foo() {
bar();
}
function bar() {
baz();
}
function baz() {
console.warn(new Deprecation("[my-lib] foo() is deprecated, use bar()"));
}
foo();
// { Deprecation: [my-lib] foo() is deprecated, use bar()
// at baz (/path/to/file.js:12:15)
// at bar (/path/to/file.js:8:3)
// at foo (/path/to/file.js:4:3)
To log a deprecation message only once, you can use the once module.
const Deprecation = require("deprecation");
const once = require("once");
const deprecateFoo = once(console.warn);
function foo() {
deprecateFoo(new Deprecation("[my-lib] foo() is deprecated, use bar()"));
}
foo();
foo(); // logs nothing