thecodrr/fdir

View on GitHub
src/api/functions/get-array.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Options } from "../../types";

export type GetArrayFunction = (paths: string[]) => string[];

const getArray: GetArrayFunction = (paths) => {
  return paths;
};

const getArrayGroup: GetArrayFunction = () => {
  return [""].slice(0, 0);
};

export function build(options: Options): GetArrayFunction {
  return options.group ? getArrayGroup : getArray;
}