Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@santi100/coloring-lib

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@santi100/coloring-lib - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

16

cjs/index.d.ts
declare type Color = 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'bold';
declare type Effect = 'bold' | 'blink' | 'conceal';
declare type Parameter = Color | Effect;

@@ -8,14 +10,4 @@ /**

*/
declare function coloring(string: string, color: Color): string;
/* declare namespace Coloring {
export const black: () => string;
export const red: () => string;
export const green: () => string;
export const yellow: () => string;
export const blue: () => string;
export const magenta: () => string;
export const cyan: () => string;
export const white: () => string;
export const bold: () => string;
} */
declare function coloring(string: string, color: Parameter): string;
declare class Coloring {

@@ -22,0 +14,0 @@ black(text: string): Coloring;

declare type Color = 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' |
'bold' | 'blink' | 'conceal';
declare type Effect = 'bold' | 'blink' | 'conceal';
declare type Parameter = Color | Effect;
declare type ParameterArray = Parameter[];

@@ -16,3 +18,3 @@ /**

*/
declare function coloring(string: string, color: [Color, ...Effect]): string;
declare function coloring(string: string, color: ParameterArray): string;

@@ -33,3 +35,3 @@ declare class Coloring {

}
export { coloring, Coloring, type Color, type Effect };
export { coloring, Coloring, type Color, type Effect, type Parameter, type ParameterArray };
export default coloring;

@@ -17,3 +17,7 @@ // @ts-check

function coloring(string, color) {
assertType(color, 'string'); assert(Array.isArray(color));
assertType(color, 'string'); assert(Array.isArray(color), {
expected: true,
actual: Array.isArray(color),
operator: 'Array.isArray()'
});
if (typeof color === 'string')

@@ -20,0 +24,0 @@ return `${COLORS[color.toLowerCase()]}${string}\x1b[0m`;

{
"name": "@santi100/coloring-lib",
"version": "1.0.2",
"version": "1.0.3",
"repository": {
"url": "https://github.com/santi100a/coloring-lib"
},
"main": "index.js",
"license": "Other",
"dependencies": {
"@santi100/assertion-lib": "^1.0.1"
"@santi100/assertion-lib": "^1.0.2"
},
"type": "module"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc