@apptus/esales-api
Version:
Library for making requests to Elevate 4 API v3
18 lines (11 loc) • 898 B
text/typescript
import type { CheckboxFacet, ColorFacet, Facet, RangeFacet, SizeFacet, TextFacet } from '../models/mod.ts';
/** Will return `true` if the provided facet is a text facet */
export const isTextFacet = (facet: Facet): facet is TextFacet => facet.type === 'TEXT';
/** Will return `true` if the provided facet is a color facet */
export const isColorFacet = (facet: Facet): facet is ColorFacet => facet.type === 'COLOR';
/** Will return `true` if the provided facet is a range facet */
export const isRangeFacet = (facet: Facet): facet is RangeFacet => facet.type === 'RANGE';
/** Will return `true` if the provided facet is a size facet */
export const isSizeFacet = (facet: Facet): facet is SizeFacet => facet.type === 'SIZE';
/** Will return `true` if the provided facet is a checkbox facet */
export const isCheckboxFacet = (facet: Facet): facet is CheckboxFacet => facet.type === 'CHECKBOX';