node-xmpp/node-stringprep — pull request #57 by pixelglow (2014-07-03 03:56:36+00:00)
Title: Options for IDN toUnicode() and toASCII()

I've added some options for calling `toUnicode` and `toASCII`. Pass an options object as the second param:

* `allowUnassigned` will convert any unassigned Unicode code points (`toUnicode`, `toASCII`).
* `useSTD3Rules` will use the STD3 rules i.e. only a-z, 0-9 and hyphens are allowed (`toASCII`).
* `throwIfError` will throw if an error occurs, instead of just returning the same string (`toASCII`).

The last two options don't apply to `toUnicode` because the underlying `libicu` function does not error on bad input (despite documenting that it does).

I've included unit tests for the essential functionality.