mirror of
https://github.com/vercel/commerce.git
synced 2025-06-17 20:51:21 +00:00
14 lines
333 B
TypeScript
14 lines
333 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;
|