0.0.10 • Published 2 years ago

@bizchain.vn/utils v0.0.10

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Utils

Utils functions used by BizChain Labs

Helper functions

export function isEmpty(value: unknown): boolean
//Simple way extract plaintext from HTML. Best use for not very long HTML string
export function removeHTMLTags(str: string): string
//Convert readable password to un-readable password to keep in the database, if someone get this, he/she cannot use
export async function passwordHash(password: string): Promise<string>
///Determine whether the provided `date` is less than number of provided `days`
export function isRecentlyUpdate(date: string, days: number): boolean

Regex

  • REGEX_ENGLISH_NAME
  • REGEX_ANYNAME
  • REGEX_EMAIL whether email is valid in format or not
  • REGEX_EXTERNAL_URL whether slug is an external url

Email

//Send email via MailJet services
export async function sendMailJet(emailData: TEmailData, config: TMailJetConfig): Promise<unknown>

React Hook

/**
 * Whether current position of scrollY has been greater than a supplied position
 * @param pos 
 * @returns 
 */
export function useScrollOver(pos: number): boolean
/**
 * Whether user is going down
 * @param _minY the minimum distant before starting checking. Default is 0 for to check immediately
 */
export function useScrollDown(_minY?: number): {
    isGoingDown: boolean;
    isOnTop: boolean;
}
0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago