Skip to content

2.0.0-prerelease.1@next

Pre-release
Pre-release

Choose a tag to compare

@niieani niieani released this 15 Aug 22:07
· 219 commits to master since this release

2.0.0-prerelease.1 (2019-08-15)

BREAKING CHANGES

  • when used from Node (without ESM enabled), you now need to require('hashids/cjs')
  • constructor: we now expect salt and alphabet to be valid strings and minLength to be a valid number (if any are provided)
  • Hashids now throws errors when being constructed with incorrect options (previously, it silently fallbacked to defaults)

Bug Fixes

  • extract BigInt test cases so they don't throw in unsupported envs (20f3df1)

Code Refactoring

  • constructor: simplify constructor & extract 'shuffle' (85c7f49)

Features

  • transparent support of BigInts. If your environment supports them,
    you can use the standard API to encode and decode them.
    Note that trying to decode a BigInt hashid on an unsupported environment will throw an error. Fixes #58. (df2c831)
  • lifted the limitation that the alphabet cannot contain spaces (df2c831)
  • both the alphabet and salt may now contain multi-byte characters (e.g. for an emoji-based alphabet) (526b6ca)
  • it is now possible to provide custom seps (e.g. to avoid custom curses). Fixes #17.

Chores

  • upgraded all dependencies
  • tests now use jest testing framework
  • extracted static methods to helper functions
  • converted the implementation to TypeScript
  • added prettier
  • added stricter eslint rules
  • added semantic-release for automated releases