feat: id
This commit is contained in:
parent
4e9e5a0c96
commit
0d1f635ffa
|
|
@ -1,9 +1,7 @@
|
|||
import { customAlphabet } from 'nanoid'
|
||||
import { id } from 'd2/utils/id.js'
|
||||
import { kebabCase } from 'lodash-es'
|
||||
import { pascalCase } from 'd2/utils/string.js'
|
||||
|
||||
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz', 10)
|
||||
|
||||
/**
|
||||
* Format component name
|
||||
* @param {string} name simple component name has no prefix
|
||||
|
|
@ -19,7 +17,7 @@ export function makeName (name) {
|
|||
* @returns {string} component name. eg: 'D2Aisjkxuednj'
|
||||
*/
|
||||
export function makeRandomName () {
|
||||
return makeName(nanoid())
|
||||
return makeName(id())
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
import { customAlphabet } from 'nanoid'
|
||||
|
||||
export const id = customAlphabet('abcdefghijklmnopqrstuvwxyz', 10)
|
||||
Loading…
Reference in New Issue