Package Exports
- @polkadot/util
- @polkadot/util/array/filter
- @polkadot/util/assert
- @polkadot/util/bn/toHex
- @polkadot/util/bn/toU8a
- @polkadot/util/buffer/fromHex
- @polkadot/util/buffer/toHex
- @polkadot/util/buffer/toNumber
- @polkadot/util/buffer/toU8a
- @polkadot/util/ext/error
- @polkadot/util/hex
- @polkadot/util/hex/addPrefix
- @polkadot/util/hex/fixLength
- @polkadot/util/hex/hasPrefix
- @polkadot/util/hex/stripPrefix
- @polkadot/util/hex/toBn
- @polkadot/util/hex/toBuffer
- @polkadot/util/hex/toU8a
- @polkadot/util/index
- @polkadot/util/is
- @polkadot/util/is/bn
- @polkadot/util/is/boolean
- @polkadot/util/is/buffer
- @polkadot/util/is/error
- @polkadot/util/is/function
- @polkadot/util/is/hex
- @polkadot/util/is/instanceOf
- @polkadot/util/is/ip
- @polkadot/util/is/null
- @polkadot/util/is/number
- @polkadot/util/is/object
- @polkadot/util/is/string
- @polkadot/util/is/uint8Array
- @polkadot/util/is/undefined
- @polkadot/util/jsonrpc/signature
- @polkadot/util/logger
- @polkadot/util/number/toBuffer
- @polkadot/util/number/toHex
- @polkadot/util/number/toU8a
- @polkadot/util/promisify
- @polkadot/util/string
- @polkadot/util/string/shorten
- @polkadot/util/syncify
- @polkadot/util/u8a
- @polkadot/util/u8a/concat
- @polkadot/util/u8a/fromString
- @polkadot/util/u8a/fromUtf8
- @polkadot/util/u8a/toBuffer
- @polkadot/util/u8a/toHex
- @polkadot/util/u8a/toUtf8
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 (@polkadot/util) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@polkadot/util
Various useful utility functions that are used across all projects in the @polkadot namespace. It provides utility functions with additional safety checks, allowing not only for consistent coding, but also reducing the general boilerplate.
Usage
Installation -
npm install --save @polkadot/util
Functions can be imported directly from the package, e.g.
import { isHex } from '@polkadot/util';
Alternatively the function can be accessed directly,
import isHex from '@polkadot/util/is/hex';
Available Utilities
For a list of currently exposed methods, see the library documentation.