Skip to content

Commit

Permalink
Replace shortid with nanoid
Browse files Browse the repository at this point in the history
  • Loading branch information
hiradary committed Feb 6, 2022
1 parent 43a3966 commit 3ca61ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reoverlay",
"version": "1.0.0",
"version": "1.0.2",
"description": "The missing solution for managing modals in React.",
"main": "lib/index.js",
"keywords": [
Expand All @@ -25,7 +25,8 @@
"build": "cross-env NODE_ENV=production rollup -c"
},
"dependencies": {
"shortid": "^2.2.15"
"nanoid": "^3.2.0",
"prop-types": "^15.7.2"
},
"peerDependencies": {
"react": ">=16.8.0",
Expand Down
4 changes: 2 additions & 2 deletions src/Reoverlay.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import shortid from 'shortid'
import { nanoid } from 'nanoid'

import { VALIDATE, EVENT } from './constants'
import { validate, eventManager, getLastElement } from './utils'
Expand Down Expand Up @@ -40,7 +40,7 @@ const Reoverlay = {
this.applyModal({
component: modal,
props,
modalKey: shortid.generate(),
modalKey: nanoid(),
type: EVENT.SHOW_MODAL,
})
}
Expand Down
15 changes: 4 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5625,10 +5625,10 @@ nan@^2.12.1:
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01"
integrity sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==

nanoid@^2.1.0:
version "2.1.11"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280"
integrity sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA==
nanoid@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.2.0.tgz#62667522da6673971cca916a6d3eff3f415ff80c"
integrity sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==

nanomatch@^1.2.9:
version "1.2.13"
Expand Down Expand Up @@ -7581,13 +7581,6 @@ shebang-regex@^3.0.0:
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==

shortid@^2.2.15:
version "2.2.15"
resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.15.tgz#2b902eaa93a69b11120373cd42a1f1fe4437c122"
integrity sha512-5EaCy2mx2Jgc/Fdn9uuDuNIIfWBpzY4XIlhoqtXF6qsf+/+SGZ+FxDdX/ZsMZiWupIWNqAEmiNY4RC+LSmCeOw==
dependencies:
nanoid "^2.1.0"

side-channel@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.2.tgz#df5d1abadb4e4bf4af1cd8852bf132d2f7876947"
Expand Down

0 comments on commit 3ca61ae

Please sign in to comment.