Remove default exports (#755)

* Remove default exports

* Cleanup tests

* Exports in util

* Single secp256k1 instance

* Length check

* format check

* encoded lengths
This commit is contained in:
Jaco Greeff
2020-11-08 18:07:31 +01:00
committed by GitHub
parent 80f28da707
commit f07d66562b
238 changed files with 706 additions and 723 deletions
+1 -1
View File
@@ -8,6 +8,6 @@ import camelcase from 'camelcase';
* @summary Convert a dash/dot/underscore/space separated string/String to camelCase
*/
// eslint-disable-next-line @typescript-eslint/ban-types
export default function stringCamelCase (value: string | String): string {
export function stringCamelCase (value: string | String): string {
return camelcase(value.toString());
}
+6 -6
View File
@@ -5,9 +5,9 @@
* @summary Utility methods to convert to work with `string` values
*/
export { default as stringCamelCase } from './camelCase';
export { default as stringLowerFirst } from './lowerFirst';
export { default as stringShorten } from './shorten';
export { default as stringToHex } from './toHex';
export { default as stringToU8a } from './toU8a';
export { default as stringUpperFirst } from './upperFirst';
export { stringCamelCase } from './camelCase';
export { stringLowerFirst } from './lowerFirst';
export { stringShorten } from './shorten';
export { stringToHex } from './toHex';
export { stringToU8a } from './toU8a';
export { stringUpperFirst } from './upperFirst';
+1 -1
View File
@@ -16,7 +16,7 @@
* ```
*/
// eslint-disable-next-line @typescript-eslint/ban-types
export default function stringLowerFirst (value?: string | String | null): string {
export function stringLowerFirst (value?: string | String | null): string {
return value
? value.charAt(0).toLowerCase() + value.slice(1)
: '';
+1 -1
View File
@@ -16,7 +16,7 @@
* ```
*/
// eslint-disable-next-line @typescript-eslint/ban-types
export default function stringShorten (value: String | string, prefixLength = 6): string {
export function stringShorten (value: String | string, prefixLength = 6): string {
if (value.length <= 2 + 2 * prefixLength) {
return value.toString();
}
+3 -3
View File
@@ -1,8 +1,8 @@
// Copyright 2017-2020 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
import u8aToHex from '../u8a/toHex';
import stringToU8a from './toU8a';
import { u8aToHex } from '../u8a/toHex';
import { stringToU8a } from './toU8a';
/**
* @name stringToHex
@@ -19,7 +19,7 @@ import stringToU8a from './toU8a';
* ```
*/
// eslint-disable-next-line @typescript-eslint/ban-types
export default function stringToHex (value?: String | string): string {
export function stringToHex (value?: String | string): string {
return u8aToHex(
stringToU8a(value)
);
+1 -1
View File
@@ -20,7 +20,7 @@ const encoder = new TextEncoder();
* ```
*/
// eslint-disable-next-line @typescript-eslint/ban-types
export default function stringToU8a (value?: String | string): Uint8Array {
export function stringToU8a (value?: String | string): Uint8Array {
return value
? encoder.encode(value.toString())
: new Uint8Array();
+1 -1
View File
@@ -16,7 +16,7 @@
* ```
*/
// eslint-disable-next-line @typescript-eslint/ban-types
export default function stringUpperFirst (value?: String | string | null): string {
export function stringUpperFirst (value?: String | string | null): string {
return value
? value.charAt(0).toUpperCase() + value.slice(1)
: '';