mirror of
https://github.com/vercel/commerce.git
synced 2025-05-18 23:46:58 +00:00
14 lines
328 B
TypeScript
14 lines
328 B
TypeScript
const validateAllProductsTaxonomyId = (taxonomyId: unknown): string | false => {
|
|
if (!taxonomyId || taxonomyId === 'false') {
|
|
return false
|
|
}
|
|
|
|
if (typeof taxonomyId === 'string') {
|
|
return taxonomyId
|
|
}
|
|
|
|
throw new TypeError('taxonomyId must be a string or falsy.')
|
|
}
|
|
|
|
export default validateAllProductsTaxonomyId
|