♻️ Move nanoid to utils package (#1430)

This commit is contained in:
Luke Vella 2024-11-08 17:50:07 +00:00 committed by GitHub
parent d55131c2ab
commit 0fc7d0a0c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 371 additions and 439 deletions

View file

@ -1,5 +1,6 @@
{
"name": "@rallly/utils",
"type": "module",
"version": "0.0.0",
"private": true,
"scripts": {
@ -8,6 +9,9 @@
"exports": {
"./*": "./src/*.ts"
},
"dependencies": {
"nanoid": "^5.0.8"
},
"devDependencies": {
"vitest": "^2.1.1"
}

View file

@ -0,0 +1,13 @@
import { customAlphabet } from "nanoid";
export const nanoid = customAlphabet(
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
12,
);
export const randomid = customAlphabet(
"0123456789abcdefghijklmnopqrstuvwxyz",
12,
);
export const generateOtp = customAlphabet("0123456789", 6);

View file

@ -2,6 +2,6 @@
"compilerOptions": {
"types": ["vitest/globals"],
},
"extends": "@rallly/tsconfig/react.json",
"extends": "@rallly/tsconfig/base.json",
"include": ["**/*.ts", "**/*.tsx"],
}