diff --git a/package-lock.json b/package-lock.json index eff3911..ce56ed4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1350,7 +1350,8 @@ "@pushrocks/isounique": { "version": "1.0.4", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fisounique/-/isounique-1.0.4.tgz", - "integrity": "sha512-P1xLsuA1+8LQpoWCo2nP2vIQXKGUl5wDWU6CD7xTDZc3uw0He5V/qCPHM5zpIZsS7IuZOxDDpWb7aFveB11tXw==" + "integrity": "sha512-P1xLsuA1+8LQpoWCo2nP2vIQXKGUl5wDWU6CD7xTDZc3uw0He5V/qCPHM5zpIZsS7IuZOxDDpWb7aFveB11tXw==", + "dev": true }, "@pushrocks/lik": { "version": "4.0.20", @@ -3926,7 +3927,6 @@ "version": "3.3.0", "resolved": "https://verdaccio.lossless.one/crypto-random-string/-/crypto-random-string-3.3.0.tgz", "integrity": "sha512-teWAwfMb1d6brahYyKqcBEb5Yp8PJPvPOdOonXDnvaKOTmKDFNVE8E3Y2XQuzjNV/3XMwHbrX9fHWvrhRKt4Gg==", - "dev": true, "requires": { "type-fest": "^0.8.1" } @@ -10484,8 +10484,7 @@ "type-fest": { "version": "0.8.1", "resolved": "https://verdaccio.lossless.one/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==" }, "type-is": { "version": "1.6.18", diff --git a/package.json b/package.json index 263d849..561c2cc 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ "tslint-config-prettier": "^1.18.0" }, "dependencies": { - "@pushrocks/isounique": "^1.0.4", "@pushrocks/smartenv": "^4.0.16", + "crypto-random-string": "^3.3.0", "js-base64": "^2.5.1", "normalize-newline": "^3.0.0", "randomatic": "^3.1.1", diff --git a/ts/smartstring.create.ts b/ts/smartstring.create.ts index 65d6e70..5133f07 100644 --- a/ts/smartstring.create.ts +++ b/ts/smartstring.create.ts @@ -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); }; diff --git a/ts/smartstring.plugins.ts b/ts/smartstring.plugins.ts index 5756c34..e84f3df 100644 --- a/ts/smartstring.plugins.ts +++ b/ts/smartstring.plugins.ts @@ -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 +} \ No newline at end of file