JSPM

js.optional

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q28499F
  • License MIT

Package Exports

  • js.optional

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (js.optional) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

js.Optional

API

  1. equals({*}) - Indicates whether some other object is "equal to" this Optional.
  2. filter({function}) - If a value is present, pass the Optional value to predicate function, return an Optional describing the value, otherwise return an empty Optional.
  3. isPresent() - If a value is present, return true if Optional value is not 'null' of 'undefined', otherwise return false.
  4. isPresent({function}) - If a value is present, invoke the specified consumer with the value, otherwise do nothing.
  5. map({function}) - If a value is present, apply the provided mapping function to it, and if the result is non-null, return an Optional describing the result. Otherwise return an empty Optional.
  6. orElse({*}) - Return the value if present, otherwise return other.
  7. orElseGet({Optional}) - Return the value if present, otherwise invoke 'other.get' and return the result of that invocation.

Static

  1. empty() - Returns an empty Optional.
  2. of() - Returns an Optional describing the specified value, if non-null, otherwise returns an empty Optional.
  3. ofNullable() - Returns an Optional describing the specified value, if non-null, otherwise returns an empty Optional.