@syncmarket/utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@syncmarket/utils

Utilidades disponibles

isHTTPUrl

Comprueba si una URL es válida.

Uso

import { isHTTPUrl } from '@syncmarket/utils'

const HTTP_URL = 'http://example.com'
const HTTPS_URL = 'https://example.com'
const MAIL_URL = 'mailto://email@example.com'

isHTTPUrl(HTTP_URL) // true
isHTTPUrl(HTTPS_URL) // true
isHTTPUrl(MAIL_URL) // false
isHTTPUrl('hola') // false

sleep

Esta utilidad es para agregar un tiempo de espera antes de continuar con el resto del código.

Uso

import { sleep } from '@syncmarket/utils'

const THREE_SECONDS_DELAY = 3000

console.log('hola')

await sleep(THREE_SECONDS_DELAY)

console.log('world')

Readme

Keywords

Package Sidebar

Install

npm i @syncmarket/utils

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

5.88 kB

Total Files

8

Last publish

Collaborators

  • syncmarket