strings: zeroPad method

This commit is contained in:
@wwwjim 2020-09-09 01:29:21 -07:00
parent 4daa910c44
commit 91a2635446
2 changed files with 5 additions and 2 deletions

View File

@ -47,6 +47,11 @@ export const getPresentationName = (user) => {
return user.username;
};
export const zeroPad = (num, places) => {
var zero = places - num.toString().length + 1;
return Array(+(zero > 0 && zero)).join("0") + num;
};
export const getCIDGatewayURL = (cid) => {
return `https://${cid}.${Constants.gateways.ipfs}`;
};

View File

@ -27,5 +27,3 @@ export const LOCAL_PASSWORD_SECRET = `$2b$${LOCAL_PASSWORD_ROUNDS}$${
export const TEXTILE_HUB_KEY = process.env.TEXTILE_HUB_KEY;
export const TEXTILE_HUB_SECRET = process.env.TEXTILE_HUB_SECRET;
export const TEXTILE_HUB_STAGING_HOST = process.env.TEXTILE_HUB_STAGING_HOST;
console.log(TEXTILE_HUB_STAGING_HOST);