1.1.3 • Published 1 year ago
@rr0/common v1.1.3
@rr0/common
A typed library for common and utility tasks.
Installation
npm install @rr0/common --saveAPI
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- valis strictly- undefined.
- ObjectUtils.isDefined(val)checks if- valis strictly anything but- undefined.
- ObjectUtils.isUnset(val)checks if- valis strictly- undefinedor- null.
- ObjectUtils.isSet(val)checks if- valis strictly anything but- undefinednor- 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- valis a- string.
Gender
Gender is an enumeration to qualify things' gender.