@blogcode/utils
v0.0.5
Published
Utilities for BlogcodeVN
Readme
Blogcode Utilities
Active
Enum
enum Active {
YES = "Y",
NO = "N",
}isActive
function isActive(state: string): boolean;Authorize
Enum
enum AuthorizeType {
BEARER = 'bearer',
BASIC = 'basic',
}isBearer
function isBearer(type: string): boolean;isBasic
function isBasic(type: string): boolean;camelToKebab
function camelToKebab(str: string): string;Color
hex2rgb
function hex2rgb(color: string): [number?, number?, number?, number?];Gender
enum Gender {
MALE = "Male",
FEMALE = "Female",
}Numeric
swapMinMax
function swapMinMax(min: number, max: number): [nunber, number];inRange
function inRange(value: number, min: number, max: number): boolean;inRangeLeft
function inRangeLeft(value: number, min: number, max: number): boolean;inRangeRight
function inRangeRight(value: number, min: number, max: number): boolean;inRangeInclusive
function inRangeInclusive(value: number, min: number, max: number): boolean;hexadecimal2decimal
function hexadecimal2decimal(hd: string | number): number;