JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q33651F
  • License ISC

Package Exports

  • @tdallau/helpers

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 (@tdallau/helpers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

This package contains some helper functions i use in many project. Some examples are:

  const isNum1 = isNumber(3);
  const isNum2 = isStringNumber('3');

  // creating a Option<string> instance from package @tdallau/types
  const some = some<string>('value');
  const none = none<string>();

 // creating a Either<string, number> instance from package @tdallau/types
  const left = leftEither<string, number>('value');
  const right = rightEither<string, number>('value');

  // using Func<string> from package @tdallau/types to create a promise<string>
  const p = promisify<string>((resolve, reject) => {
    if (1 == 1) {
      resolve('equil!!');
      return;
    }
    reject('somthing went wrong!!')
  })

  await timer(2000 /* ms */);