fix(core): update

This commit is contained in:
2020-12-31 04:42:46 +00:00
parent bef836fc83
commit 0266afca8e
4 changed files with 12 additions and 20 deletions

View File

@ -21,9 +21,9 @@ export const createRandomString = (
};
/**
* creates a cryptic string in the speicifed length
* creates a crytic string in the speicifed length
* @param lengthArg the length of the crypto string
*/
export const createCryptoRandomString = (lengthArg: number): string => {
return plugins.isounique.uni();
return plugins.cryptoRandomString(lengthArg);
};

View File

@ -1,31 +1,24 @@
// node native
import * as smartenv from '@pushrocks/smartenv';
const smartenvInstance = new smartenv.Smartenv();
// node native
const crypto = smartenvInstance.getSafeNodeModule('crypto');
import * as url from 'url';
export { crypto, url };
// pushrocks scope
import * as isounique from '@pushrocks/isounique';
export {
isounique
};
// third party
const jsBase64 = require('js-base64').Base64;
const stripIndent = require('strip-indent');
const normalizeNewline = require('normalize-newline');
const randomatic = require('randomatic');
const randomatic = smartenvInstance.getSafeNodeModule('randomatic');
const cryptoRandomString = smartenvInstance.getSafeNodeModule('crypto-random-string');
export {
jsBase64,
stripIndent,
normalizeNewline,
randomatic,
}
cryptoRandomString
}