Repository URL to install this package:
|
Version:
3.0.0 ▾
|
interface PropsToIdentifier {
[key: string]: unknown
identifier?: string
className?: string
/** @deprecated */
vectorClassName?: string
namespace?: string
}
let index = 0
function fromPropsToIdentifier(props: PropsToIdentifier): string {
if (process.env.NODE_ENV === 'test') {
return '@@ID'
}
index += 1
const identifier =
props.identifier ||
props.className ||
props.vectorClassName ||
props.namespace ||
'EMPTY'
return identifier + index
}
export {
PropsToIdentifier,
fromPropsToIdentifier,
}