UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

1 lines 545 B
{"version":3,"file":"get-safe-id.mjs","names":[],"sources":["../../../../src/core/utils/get-safe-id/get-safe-id.ts"],"sourcesContent":["export function getSafeId(uid: string, errorMessage: string) {\n return (value: string) => {\n if (typeof value !== 'string' || value.trim().length === 0) {\n throw new Error(errorMessage);\n }\n\n return `${uid}-${value}`;\n };\n}\n"],"mappings":";;AAAA,SAAgB,UAAU,KAAa,cAAsB;AAC3D,SAAQ,UAAkB;AACxB,MAAI,OAAO,UAAU,YAAY,MAAM,MAAM,CAAC,WAAW,EACvD,OAAM,IAAI,MAAM,aAAa;AAG/B,SAAO,GAAG,IAAI,GAAG"}