2.5.6 • Published 3 years ago

ftdgomez-utils v2.5.6

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

What is this?!

Just a bunch of helpers functions that I use all the time. Functions are self documented with JSDoc format

Installation

npm i ftdgomez_utils

See utils.md for documentation

env variables:

NEXT_PUBLIC variables are only used if you are using next js and require to put those on the client side.

  • API_URL_BASE
  • NEXT_PUBLIC_API_URL_BASE

    used by _fetch

  • AUTH_COOKIE_NAME

  • NEXT_PUBLIC_AUTH_COOKIE_NAME

    used by _checkAuthorizationCookie

Usage:

For now, there are two set of functions. The validationMethods and utils.

Validation Methods:

See validationMethods.md for documentation

import { validationMethods } from 'ftdgomez-utils';

const { isString, oneOf, isEmail } = validationMethods;

isString('hello world') // return true
oneOf('value', ['yes','no','value']) // return true
isEmail('hellothisisnotanemail') // return false

Utils:

See utils.md for documentation

import { _objectSize, _where } from 'ftdgomez-utils';

_objectSize({ a: 1, b: 2, c: 3}) // return 3

_where(
    [{ id: 1, name: 'John'}, { id: 2, name: 'Jane' }], 
    {id: 1}
  ); // return [{ id: 1, name: 'John' }]
2.5.6

3 years ago

2.5.4

3 years ago

2.5.0

3 years ago

2.5.2

3 years ago

2.5.1

3 years ago

2.5.3

3 years ago

2.3.0

3 years ago

2.2.0

3 years ago

2.4.0

3 years ago

2.0.0

3 years ago

1.0.0

3 years ago