diff --git a/package-lock.json b/package-lock.json index caa14a9..01bced9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1350,8 +1350,7 @@ "@pushrocks/isounique": { "version": "1.0.4", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fisounique/-/isounique-1.0.4.tgz", - "integrity": "sha512-P1xLsuA1+8LQpoWCo2nP2vIQXKGUl5wDWU6CD7xTDZc3uw0He5V/qCPHM5zpIZsS7IuZOxDDpWb7aFveB11tXw==", - "dev": true + "integrity": "sha512-P1xLsuA1+8LQpoWCo2nP2vIQXKGUl5wDWU6CD7xTDZc3uw0He5V/qCPHM5zpIZsS7IuZOxDDpWb7aFveB11tXw==" }, "@pushrocks/lik": { "version": "4.0.20", @@ -7528,11 +7527,6 @@ "dev": true, "optional": true }, - "nanoid": { - "version": "3.1.20", - "resolved": "https://verdaccio.lossless.one/nanoid/-/nanoid-3.1.20.tgz", - "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==" - }, "nanomatch": { "version": "1.2.13", "resolved": "https://verdaccio.lossless.one/nanomatch/-/nanomatch-1.2.13.tgz", diff --git a/package.json b/package.json index ba866d6..d08766a 100644 --- a/package.json +++ b/package.json @@ -33,9 +33,9 @@ "tslint-config-prettier": "^1.18.0" }, "dependencies": { + "@pushrocks/isounique": "^1.0.4", "@pushrocks/smartenv": "^4.0.16", "js-base64": "^2.5.1", - "nanoid": "^3.1.20", "normalize-newline": "^3.0.0", "randomatic": "^3.1.1", "strip-indent": "^3.0.0", diff --git a/ts/smartstring.create.ts b/ts/smartstring.create.ts index 727a1a4..65d6e70 100644 --- a/ts/smartstring.create.ts +++ b/ts/smartstring.create.ts @@ -25,5 +25,5 @@ export const createRandomString = ( * @param lengthArg the length of the crypto string */ export const createCryptoRandomString = (lengthArg: number): string => { - return plugins.nanoid(lengthArg); + return plugins.isounique.uni(); }; diff --git a/ts/smartstring.plugins.ts b/ts/smartstring.plugins.ts index 1f69382..5756c34 100644 --- a/ts/smartstring.plugins.ts +++ b/ts/smartstring.plugins.ts @@ -1,12 +1,19 @@ -// node native import * as smartenv from '@pushrocks/smartenv'; const smartenvInstance = new smartenv.Smartenv(); -const crypto = smartenvInstance.getSafeNodeModule('crypto'); +// 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; @@ -14,12 +21,11 @@ const stripIndent = require('strip-indent'); const normalizeNewline = require('normalize-newline'); const randomatic = require('randomatic'); -import { nanoid } from 'nanoid'; + export { jsBase64, stripIndent, normalizeNewline, randomatic, - nanoid }