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