This package has been deprecated

Author message:

The package is no longer supported. Use @eastbanctech/ts-optional instead.

@itfobos/ts-optional
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Build Status

TS Optional

Typescript adapted Java Optional class.

The library barebone is generated with typescript-library-starter.

How to install

npm i @itfobos/ts-optional

API documentation

Documentation is available here.

Usage examples

Optional instance can be created with:
  • Optional.ofNullable(someValue)
  • Optional.of(nonNullableValue)
  • Optional.empty()
Can be used like:
  const entityUuid = Optional.of(response)
      .filter(resp => resp.isPresent)
      .map(responseToEntity)
      .map(entity => entity.uuid)
      .filter(isNotNullOrEmpty)
      .orElseGet(() => route.snapshot.queryParamMap.get('uuid') as string);

Supported Node versions

Automatically tested with Node versions:

  • 8
  • 10
  • 11
  • 12

Travis CI

To integrate with the CI:

  • github personal access tokens should be generated.
  • npm account email should be defined as NPM_EMAIL environment variable for all branches.
  • npm access tokens should be defined as NPM_TOKEN environment variable for all branches.

Package Sidebar

Install

npm i @itfobos/ts-optional

Weekly Downloads

0

Version

0.1.3

License

MIT

Unpacked Size

93.1 kB

Total Files

25

Last publish

Collaborators

  • itfobos