Files
github-actions-magento2/supported-version/src/kind/validations/is-known-kind.ts
T
Damien Retzinger 5c198049f7 feat(supported-version): validate custom_versions
Previously, @danslo reported that he tried to use `custom_versions` without
setting the kind. This isn't the correct behavior.
I've added a validator to alert him of this.
2023-04-16 15:18:23 -04:00

12 lines
298 B
TypeScript

import { KNOWN_KINDS, Kind } from "../kinds";
export const isKnownKind = (kind: Kind): boolean => {
if(!(kind in KNOWN_KINDS)) {
throw new Error(
`Invalid kind provided, supported kinds are: ${Object.keys(KNOWN_KINDS).join(', ')}`
);
}
return true;
};