Socket
Socket
Sign inDemoInstall

@rr0/common

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @rr0/common

Common and utility classes


Version published
Maintainers
1
Install size
8.19 kB
Created

Changelog

Source

[1.0.1] - To be released

Added

  • ObjectUtils.asSet(val, errMsg?) returns val as defined. If it was not, an AssertionError(errMsg) will be thrown.

Readme

Source

@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.

Keywords

FAQs

Last updated on 27 Nov 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc