Skip to content

Commit

Permalink
Hack to remove NanoID
Browse files Browse the repository at this point in the history
This is a temporary hack to remove NanoId as a dependency. It is not required for a secure token or anything that requires a cryptographically solid random number.
  • Loading branch information
ryanbethel authored Feb 15, 2024
1 parent f7af3b1 commit 44d8979
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ import { parse, fragment, serialize, serializeOuter } from '@begin/parse5'
import isCustomElement from './lib/is-custom-element.mjs'
import { encode, decode } from './lib/transcode.mjs'
import walk from './lib/walk.mjs'
import { customAlphabet } from 'nanoid'
const alphabet = '0123456789abcdefghijklmnopqrstuvwxyz';
const nanoid = customAlphabet(alphabet, 7);
// import { customAlphabet } from 'nanoid'
// const alphabet = '0123456789abcdefghijklmnopqrstuvwxyz';
// const nanoid = customAlphabet(alphabet, 7);

export default function Enhancer(options={}) {
const {
initialState={},
elements=[],
scriptTransforms=[],
styleTransforms=[],
uuidFunction=nanoid,
// uuidFunction=nanoid,
uuidFunction=()=>Math.random().toString(36).substring(2,20),
bodyContent=false,
enhancedAttr=true
} = options
Expand Down

0 comments on commit 44d8979

Please sign in to comment.