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

2.20.0 • Public • Published

@smartsoft001/utils

Usage

npm i @smartsoft001/utis

ArrayService

Methods:

addItem creating new array with pushed item
removeItem creating new array without item
sort return sorted array

GuidService

Methods:

create creating guid string

NipService

Methods:

isValid(nip: string) check valid nip format
isInvalid(nip: string) check invalid nip format

ObjectService

Methods:

createByType(data: any, type: any): T create object with data
removeTypes(obj: any): any remove object type from data

PasswordService

Methods:

hash(p: string): Promise hash password text
compare(p: string, h: string): Promise compare password text with hashed text

PeselService

Methods:

isValid(pesel: string) check pesel format
isInvalid(pesel: string) check invalid pesel format

SpecificationService

Methods:

valid(value: T, spec: { criteria: any }, custom: ISpecificationCustom = null): boolean checking if the value meets the specifications
invalid(value: T, spec: { criteria: any }, custom: ISpecificationCustom = null): boolean checking if the object does not meet the specifications
getSqlCriteria(spec: { criteria: any }): string convert specification to sql

ZipCodeService

Methods:

isValid(code: string) check zip code format
isInvalid(code: string) check invalid zip code format

Readme

Keywords

none

Package Sidebar

Install

npm i @smartsoft001/utils

Weekly Downloads

178

Version

2.20.0

License

none

Unpacked Size

26.3 kB

Total Files

32

Last publish

Collaborators

  • emiljuchnikowski