Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Commit

Permalink
fix(iro): add Iro.write for backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Orlov committed Nov 16, 2018
1 parent 8492334 commit 5ae317c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ describe('Iro', () => {
});
});

describe('write', () => {
it('should return Iro', () => {
expect(Iro.write('')).to.equal(Iro);
});
});

describe('red', () => {
it('should apply red colour for Node.js console', () => {
expect(Iro.red('hello')).to.equal('\u001b[31mhello\u001b[0m');
Expand Down
13 changes: 12 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,18 @@ export abstract class Iro {
* @static
*/
public static describe = (...x: any[]): typeof Iro => {
Iro.warn('"Shell.describe" is deprecated and will be removed in future releases. Please, use "Shell.log" instead.');
Iro.warn('"Shell.describe" is deprecated and will be removed in future releases. Please, use "Iro.log" instead.');
return Iro.log(...x);
}

/**
* Alias to `Iro.log`. Deprecated. Added for backwards compatibility with `@totemish/shell`.
* @alias log
* @deprecated
* @static
*/
public static write = (...x: any[]): typeof Iro => {
Iro.warn('"Shell.write" is deprecated and will be removed in future releases. Please, use "Shell.log" instead.');
return Iro.log(...x);
}

Expand Down

0 comments on commit 5ae317c

Please sign in to comment.