Sign In

@coong/utils

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coong/utils - npm Package Compare versions

Comparing version
0.0.21-alpha.6
to
0.0.21-alpha.23
+3
string.d.ts
export declare const shortenAddress: (address: string) => string;
export declare const trimOffUrlProtocol: (url: string) => string;
export declare const trimTrailingSlash: (input: string) => string;
export const shortenAddress = (address) => {
if (!address) {
return '';
}
const length = address.length;
if (length <= 15) {
return address;
}
return `${address.substring(0, 6)}...${address.substring(length - 6, length)}`;
};
export const trimOffUrlProtocol = (url) => {
return url.replace(/https?:\/\//, '');
};
export const trimTrailingSlash = (input) => {
return input.endsWith('/') ? trimTrailingSlash(input.slice(0, -1)) : input;
};
+1
-1

@@ -10,3 +10,3 @@ import { CoongError, ErrorCode, ErrorCodes } from './errors';

else {
throw new CoongError(ErrorCode.UnknownRequest, message);
throw new CoongError(ErrorCode.InternalError, message);
}

@@ -13,0 +13,0 @@ }

@@ -15,3 +15,5 @@ export declare enum ErrorCode {

AccountNameUsed = "AccountNameUsed",
InvalidMnemonic = "InvalidMnemonic"
InvalidMnemonic = "InvalidMnemonic",
AccountExisted = "AccountExisted",
OriginalHashNotFound = "OriginalHashNotFound"
}

@@ -18,0 +20,0 @@ export declare const ErrorCodes: string[];

@@ -17,2 +17,4 @@ export var ErrorCode;

ErrorCode["InvalidMnemonic"] = "InvalidMnemonic";
ErrorCode["AccountExisted"] = "AccountExisted";
ErrorCode["OriginalHashNotFound"] = "OriginalHashNotFound";
})(ErrorCode || (ErrorCode = {}));

@@ -19,0 +21,0 @@ export const ErrorCodes = Object.values(ErrorCode);

export * from './errors';
export * from './assert';
export * from './string';
export * from './errors';
export * from './assert';
export * from './string';
{
"name": "@coong/utils",
"version": "0.0.21-alpha.6+8b76262",
"description": "Utilities for Coong wallet",
"version": "0.0.21-alpha.23+e4e176c",
"description": "Utilities for Coong Wallet",
"author": "Thang X. Vu <thang@coongwallet.io>",

@@ -23,3 +23,3 @@ "homepage": "https://github.com/CoongCrafts/coong-wallet/tree/main/packages/utils#readme",

"license": "Apache-2.0",
"gitHead": "8b7626225c70a206e62ebb5c152d7078dd399b64"
"gitHead": "e4e176cf945034765e2956723380d48ca1a46e35"
}
// THIS FILE IS AUTO-GENERATED, DO NOT EDIT!
export const packageInfo = { name: '@coong/utils', version: '0.0.21-alpha.0' };
export const packageInfo = { name: '@coong/utils', version: '0.0.21' };