1.0.1 • Published 1 year ago

@rr0/common v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@rr0/common

RR0

A typed library for common and utility tasks.

Installation

npm install @rr0/common --save

API

User preferences

UserPreferences defines a type which requires a locale property.

Key-value type

KeyValue<T> defines a type whole all fields are of type T.

Object utilities

  • ObjectUtils.isUndefined(val) checks if val is strictly undefined.
  • ObjectUtils.isDefined(val) checks if val is strictly anything but undefined.
  • ObjectUtils.isUnset(val) checks if val is strictly undefined or null.
  • ObjectUtils.isSet(val) checks if val is strictly anything but undefined nor null.
  • ObjectUtils.asSet(val, errMsg?) returns val as defined. If it was not, an AssertionError(errMsg) will be thrown.

String utilities

  • StringUtils.toString(val) returns a string representation of val, enclosed in quotes if val is a string.

Gender

Gender is an enumeration to qualify things' gender.

1.0.1

1 year ago

0.1.10

2 years ago

0.1.8

2 years ago

0.1.9

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

4 years ago