Remove /index imports (swap to bare) (#362)
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { arrayFilter } from './index';
|
||||
import { arrayFilter } from '.';
|
||||
|
||||
describe('filterArray', () => {
|
||||
it('filters arrays, removing undefined', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { assert } from './index';
|
||||
import { assert } from '.';
|
||||
|
||||
describe('assert', () => {
|
||||
it('should not throw an error when test is true', () => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import isFunction from '../is/function';
|
||||
|
||||
import { bnFromHex } from './index';
|
||||
import { bnFromHex } from '.';
|
||||
|
||||
describe('bnFromHex', () => {
|
||||
it('exists as a function', () => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import BN from 'bn.js';
|
||||
|
||||
import { bnToBn } from './index';
|
||||
import { bnToBn } from '.';
|
||||
|
||||
describe('bnToBn', () => {
|
||||
it('converts null values to 0x00', () => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import BN from 'bn.js';
|
||||
|
||||
import { bnToHex } from './index';
|
||||
import { bnToHex } from '.';
|
||||
|
||||
describe('bnToHex', () => {
|
||||
it('converts null values to 0x00', () => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import BN from 'bn.js';
|
||||
|
||||
import { bnToU8a } from './index';
|
||||
import { bnToU8a } from '.';
|
||||
|
||||
describe('bnToU8a', () => {
|
||||
it('converts null values to 0x00', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { bufferToU8a } from './index';
|
||||
import { bufferToU8a } from '.';
|
||||
|
||||
describe('bufferToU8a', () => {
|
||||
it('returns an empty buffer when null provided', () => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import isError from '../is/error';
|
||||
import { ExtError } from './index';
|
||||
import { ExtError } from '.';
|
||||
|
||||
describe('ExtError', () => {
|
||||
describe('constructor', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { hexAddPrefix } from './index';
|
||||
import { hexAddPrefix } from '.';
|
||||
|
||||
describe('hexAddPrefix', () => {
|
||||
it('does not add when prefix is available', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { hexFixLength } from './index';
|
||||
import { hexFixLength } from '.';
|
||||
|
||||
describe('hexFixLength', () => {
|
||||
it('returns bitLength === -1 as-is', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { hexHasPrefix } from './index';
|
||||
import { hexHasPrefix } from '.';
|
||||
|
||||
describe('hexHasPrefix', () => {
|
||||
it('returns true when hex prefix is found', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { hexStripPrefix } from './index';
|
||||
import { hexStripPrefix } from '.';
|
||||
|
||||
describe('hexStripPrefix', () => {
|
||||
it('returns an empty string when null value supplied', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { hexToBn } from './index';
|
||||
import { hexToBn } from '.';
|
||||
|
||||
describe('hexToBn', () => {
|
||||
it('converts prefixed hex values to BN', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { hexToNumber } from './index';
|
||||
import { hexToNumber } from '.';
|
||||
|
||||
describe('hexToNumber', () => {
|
||||
it('converts an empty to NaN', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { hexToU8a } from './index';
|
||||
import { hexToU8a } from '.';
|
||||
|
||||
describe('hexToU8a', () => {
|
||||
it('returns an empty Uint8Array when null provided', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { assert } from './index';
|
||||
import { assert } from '.';
|
||||
|
||||
describe('index', () => {
|
||||
it('exports ok', () => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import BN from 'bn.js';
|
||||
|
||||
import { isBn } from './index';
|
||||
import { isBn } from '.';
|
||||
|
||||
describe('isBN', () => {
|
||||
it('returns true when a BN value', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { isBoolean } from './index';
|
||||
import { isBoolean } from '.';
|
||||
|
||||
describe('isBoolean', () => {
|
||||
it('returns true on false', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { isBuffer } from './index';
|
||||
import { isBuffer } from '.';
|
||||
|
||||
describe('isBuffer', () => {
|
||||
it('returns true when a Buffer value', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { isError } from './index';
|
||||
import { isError } from '.';
|
||||
|
||||
describe('isError', () => {
|
||||
it('returns true when an Error value', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { isFunction } from './index';
|
||||
import { isFunction } from '.';
|
||||
|
||||
describe('isFunction', () => {
|
||||
it('returns true on valid functions', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { isHex } from './index';
|
||||
import { isHex } from '.';
|
||||
|
||||
describe('isHex', () => {
|
||||
const test = '1234abcd';
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { isInstanceOf } from './index';
|
||||
import { isInstanceOf } from '.';
|
||||
|
||||
describe('isInstanceOf', () => {
|
||||
it('returns true on real instances', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { isIp } from './index';
|
||||
import { isIp } from '.';
|
||||
|
||||
describe('isIp', () => {
|
||||
it('returns false when non-ip found', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { isJsonObject } from './index';
|
||||
import { isJsonObject } from '.';
|
||||
|
||||
const jsonObject = `{
|
||||
"Test": "1234",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { isNull } from './index';
|
||||
import { isNull } from '.';
|
||||
|
||||
describe('isNull', () => {
|
||||
it('returns true when a null value', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { isNumber } from './index';
|
||||
import { isNumber } from '.';
|
||||
|
||||
describe('isNumber', () => {
|
||||
it('returns true on valid numbers', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { isObject } from './index';
|
||||
import { isObject } from '.';
|
||||
|
||||
describe('isObject', () => {
|
||||
it('returns true on valid objects', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { isObservable } from './index';
|
||||
import { isObservable } from '.';
|
||||
|
||||
describe('isObservable', () => {
|
||||
it('returns true on valid observables', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { isString } from './index';
|
||||
import { isString } from '.';
|
||||
|
||||
describe('isString', () => {
|
||||
it('returns true on valid strings', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { isU8a } from './index';
|
||||
import { isU8a } from '.';
|
||||
|
||||
describe('isUint8Array', () => {
|
||||
it('returns false on undefined values', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { isUndefined } from './index';
|
||||
import { isUndefined } from '.';
|
||||
|
||||
describe('isUndefined', () => {
|
||||
it('returns true on undefined values', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { logger } from './index';
|
||||
import { logger } from '.';
|
||||
import { format } from './logger';
|
||||
|
||||
describe('logger', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { numberToHex } from './index';
|
||||
import { numberToHex } from '.';
|
||||
|
||||
describe('numberToHex', () => {
|
||||
it('converts undefined to 0x', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { numberToU8a } from './index';
|
||||
import { numberToU8a } from '.';
|
||||
|
||||
describe('numberToU8a', () => {
|
||||
it('converts 0 to empty', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { promisify } from './index';
|
||||
import { promisify } from '.';
|
||||
|
||||
describe('promisify', () => {
|
||||
it('handles functions with no parameters (resolve)', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { stringCamelCase } from './index';
|
||||
import { stringCamelCase } from '.';
|
||||
|
||||
describe('stringCamelCase', () => {
|
||||
it('works correctly', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { stringLowerFirst } from './index';
|
||||
import { stringLowerFirst } from '.';
|
||||
|
||||
describe('stringLowerFirst', () => {
|
||||
it("lowers the first letter if it's a capital letter", () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { stringShorten } from './index';
|
||||
import { stringShorten } from '.';
|
||||
|
||||
describe('stringShorten', () => {
|
||||
it('returns the value as-is when <= maxLength', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { stringToU8a } from '../index';
|
||||
import { stringToU8a } from '..';
|
||||
|
||||
describe('stringToU8a', () => {
|
||||
it('decodes to an empty string for undefined', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { u8aConcat } from './index';
|
||||
import { u8aConcat } from '.';
|
||||
|
||||
describe('u8aConcat', () => {
|
||||
it('concatenates arrays', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { u8aFixLength } from './index';
|
||||
import { u8aFixLength } from '.';
|
||||
|
||||
describe('u8aFixLength', () => {
|
||||
it('returns bitLength === -1 as-is', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { u8aToBn } from './index';
|
||||
import { u8aToBn } from '.';
|
||||
|
||||
describe('u8aToBn', () => {
|
||||
it('converts little-endian by default', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { u8aToBuffer } from './index';
|
||||
import { u8aToBuffer } from '.';
|
||||
|
||||
describe('u8aToBuffer', () => {
|
||||
it('returns [] when the buffer is null', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { u8aToHex } from './index';
|
||||
import { u8aToHex } from '.';
|
||||
|
||||
describe('u8aToHex', () => {
|
||||
it('returns empty as 0x', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { u8aToString } from '../index';
|
||||
import { u8aToString } from '..';
|
||||
|
||||
describe('u8aToString', () => {
|
||||
it('decodes to an empty string for undefined', () => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { u8aToU8a } from './index';
|
||||
import { u8aToU8a } from '.';
|
||||
|
||||
describe('u8aToU8a', () => {
|
||||
it('returns an empty Uint8Array when null provided', () => {
|
||||
|
||||
Reference in New Issue
Block a user