Add tslint (#151)

This commit is contained in:
Jaco Greeff
2018-06-27 10:15:46 +02:00
committed by GitHub
parent 499a877f15
commit 73477a2809
134 changed files with 989 additions and 884 deletions
+12 -12
View File
@@ -3,18 +3,18 @@
// of the ISC license. See the LICENSE file for details.
/**
@name u8aFixLength
@signature u8aFixLength (value: string, bitLength: number = -1, withPadding: boolean = false): string
@summary Shifts a Uint8Array to a specific bitLength
@description
Returns a uint8Array with the specified number of bits contained in the return value. (If bitLength is -1, length checking is not done). Values with more bits are trimmed to the specified length.
@example
import { u8aFixLength } from '@polkadot/util';
u8aFixLength('0x12') // => 0x12
u8aFixLength('0x12', 16) // => 0x0012
u8aFixLength('0x1234', 8) // => 0x12
*/
* @name u8aFixLength
* @signature u8aFixLength (value: string, bitLength: number = -1, withPadding: boolean = false): string
* @summary Shifts a Uint8Array to a specific bitLength
* @description
* Returns a uint8Array with the specified number of bits contained in the return value. (If bitLength is -1, length checking is not done). Values with more bits are trimmed to the specified length.
* @example
* import { u8aFixLength } from '@polkadot/util';
*
* u8aFixLength('0x12') // => 0x12
* u8aFixLength('0x12', 16) // => 0x0012
* u8aFixLength('0x1234', 8) // => 0x12
*/
export default function u8aFixLength (value: Uint8Array, bitLength: number = -1, atStart: boolean = false): Uint8Array {
const byteLength = Math.ceil(bitLength / 8);