Skip to content

stamp-cmd/type-equality

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WARNING: PACKAGE IS UNDERCONSTRUCTION

TYPE-EQUALITY README

Description: A ES6 package that check equality with types by stricts and normals

Logo

Import

npm i type-equality

import {} from "type-equality";

IsEqualTo

Check equality with types such as normals, stricts and default

IsEqualTo.Stricts("1", 1); //false
IsEqualTo.Normals("1", 1); //true
IsEqualTo.Default("1", 1); //Default Mode is "Normals" //true 
IsEqualTo.Mode = "Normals"; //Set Mode to Normals

IsNotEqualTo

Check inequality with types such as normals, stricts and default

IsNotEqualTo.Stricts("1", 1); //true
IsNotEqualTo.Normals("1", 1); //false
IsNotEqualTo.Default("1", 1); //Default Mode is "Normals" //false
IsNotEqualTo.Mode = "Normals"; //Set Mode to Normals

SetDefaultTo

Set Mode to all EqualTo to mode such as normals, stricts

SetDefaultTo("Normals"); //Set IsEqualTo & IsNotEqualTo = Normals
SetDefaultTo("Stricts"); //Set IsEqualTo & IsNotEqualTo = Stricts
SetDefaultTo("Invalid"); //TypeError: Invalid SetDefaultTo Mode

ShowDefault

Log IsEqaulTo & IsNotEqualTo Mode

ShowDefault(true); // IsEquaTo: <Mode> IsNotEqualTo: <Mode>
ShowDefault(false);
ShowDefault("Invalid"); //TypeError: Invalid SetDefaultTo Mode

TypErr (Bonus Function)

Throw TypeError with argument's message with string(recommended)

TypErr("Hello"); //TypeError: Hello

About

A package that check equality with types

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published