Blame view

天文台pc/tianwentai-ui/node_modules/react-day-picker/src/contexts/Modifiers/utils/matcherToArray.ts 325 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  import { Matcher } from 'types/Matchers';
  
  /** Normalize to array a matcher input. */
  export function matcherToArray(
    matcher: Matcher | Matcher[] | undefined
  ): Matcher[] {
    if (Array.isArray(matcher)) {
      return [...matcher];
    } else if (matcher !== undefined) {
      return [matcher];
    } else {
      return [];
    }
  }