Skip to content

fix(types): issue with typing for types option#124

Open
kucherenko wants to merge 1 commit into
klaudiosinani:masterfrom
kucherenko:master
Open

fix(types): issue with typing for types option#124
kucherenko wants to merge 1 commit into
klaudiosinani:masterfrom
kucherenko:master

Conversation

@kucherenko

Copy link
Copy Markdown

Fix types of types option, based on the documentation and source code I can provide not fully described object for types e.g.

const {Signale} = require('signale');

const options = {
  types: {
    error: {
      badge: '!!',
      label: 'fatal error'
    },
    success: {
      badge: '++',
      label: 'huge success'
    }
  }
};

const signale = new Signale();
signale.error('Default Error Log');
signale.success('Default Success Log');

const custom = new Signale(options);
custom.error('Custom Error Log');
custom.success('Custom Success Log');

or

const {Signale} = require('signale');

const options = {
  types: {
    error: {
      badge: '!!',
      label: 'fatal error'
    },
    success: {
      badge: '++',
      label: 'huge success'
    }
  }
};

const signale = new Signale();
signale.error('Default Error Log');
signale.success('Default Success Log');

const custom = new Signale(options);
custom.error('Custom Error Log');
custom.success('Custom Success Log');

In the PR I suggest the fix for typescript types only, the documentation and javascript code continue working as usual.

@sonarqubecloud

Copy link
Copy Markdown

1 similar comment
@sonarqubecloud

sonarqubecloud Bot commented Oct 5, 2025

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant