ant-design-vue/components/vc-select/utils/commonUtil.ts

13 lines
374 B
TypeScript
Raw Normal View History

2020-10-07 14:49:01 +00:00
export function toArray<T>(value: T | T[]): T[] {
if (Array.isArray(value)) {
return value;
}
return value !== undefined ? [value] : [];
}
export const isClient =
typeof window !== 'undefined' && window.document && window.document.documentElement;
/** Is client side and not jsdom */
export const isBrowserClient = process.env.NODE_ENV !== 'test' && isClient;