@pooltogether/utilities
Advanced tools
Comparing version 0.0.21 to 0.0.22
@@ -8,1 +8,7 @@ /** | ||
export declare const isValidAddress: (address: any) => boolean; | ||
/** | ||
* Shortens a hash into something a little more user friendly | ||
* @param hash | ||
* @returns | ||
*/ | ||
export declare const shorten: (hash: any) => string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isValidAddress = void 0; | ||
exports.shorten = exports.isValidAddress = void 0; | ||
const ethers_1 = require("ethers"); | ||
@@ -26,2 +26,17 @@ /** | ||
exports.isValidAddress = isValidAddress; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9hZGRyZXNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLG1DQUErQjtBQUUvQjs7Ozs7R0FLRztBQUNJLE1BQU0sY0FBYyxHQUFHLENBQUMsT0FBTyxFQUFFLEVBQUU7SUFDeEMsSUFBSSxDQUFDLE9BQU87UUFBRSxPQUFNO0lBRXBCLElBQUk7UUFDRixlQUFNLENBQUMsS0FBSyxDQUFDLFVBQVUsQ0FBQyxPQUFPLENBQUMsQ0FBQTtLQUNqQztJQUFDLE9BQU8sQ0FBQyxFQUFFO1FBQ1YsT0FBTyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQTtRQUVoQixJQUFJLENBQUMsQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLGlCQUFpQixDQUFDLEVBQUU7WUFDdEMsT0FBTyxLQUFLLENBQUE7U0FDYjtLQUNGO0lBQ0QsT0FBTyxJQUFJLENBQUE7QUFDYixDQUFDLENBQUE7QUFiWSxRQUFBLGNBQWMsa0JBYTFCIn0= | ||
const expression = /^(\w{6})\w*(\w{4})$/; | ||
/** | ||
* Shortens a hash into something a little more user friendly | ||
* @param hash | ||
* @returns | ||
*/ | ||
const shorten = (hash) => { | ||
let result; | ||
if (!hash) { | ||
return null; | ||
} | ||
result = expression.exec(hash); | ||
return `${result[1]}...${result[2]}`; | ||
}; | ||
exports.shorten = shorten; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9hZGRyZXNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLG1DQUErQjtBQUUvQjs7Ozs7R0FLRztBQUNJLE1BQU0sY0FBYyxHQUFHLENBQUMsT0FBTyxFQUFFLEVBQUU7SUFDeEMsSUFBSSxDQUFDLE9BQU87UUFBRSxPQUFNO0lBRXBCLElBQUk7UUFDRixlQUFNLENBQUMsS0FBSyxDQUFDLFVBQVUsQ0FBQyxPQUFPLENBQUMsQ0FBQTtLQUNqQztJQUFDLE9BQU8sQ0FBQyxFQUFFO1FBQ1YsT0FBTyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQTtRQUVoQixJQUFJLENBQUMsQ0FBQyxPQUFPLENBQUMsS0FBSyxDQUFDLGlCQUFpQixDQUFDLEVBQUU7WUFDdEMsT0FBTyxLQUFLLENBQUE7U0FDYjtLQUNGO0lBQ0QsT0FBTyxJQUFJLENBQUE7QUFDYixDQUFDLENBQUE7QUFiWSxRQUFBLGNBQWMsa0JBYTFCO0FBRUQsTUFBTSxVQUFVLEdBQUcscUJBQXFCLENBQUE7QUFDeEM7Ozs7R0FJRztBQUNJLE1BQU0sT0FBTyxHQUFHLENBQUMsSUFBSSxFQUFFLEVBQUU7SUFDOUIsSUFBSSxNQUFNLENBQUE7SUFFVixJQUFJLENBQUMsSUFBSSxFQUFFO1FBQ1QsT0FBTyxJQUFJLENBQUE7S0FDWjtJQUVELE1BQU0sR0FBRyxVQUFVLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFBO0lBRTlCLE9BQU8sR0FBRyxNQUFNLENBQUMsQ0FBQyxDQUFDLE1BQU0sTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUE7QUFDdEMsQ0FBQyxDQUFBO0FBVlksUUFBQSxPQUFPLFdBVW5CIn0= |
@@ -292,3 +292,4 @@ declare const _default: { | ||
isValidAddress: (address: any) => boolean; | ||
shorten: (hash: any) => string; | ||
}; | ||
export = _default; |
{ | ||
"name": "@pooltogether/utilities", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"description": "Shared utility functions across PoolTogether apps", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
129376
2285