diff --git a/striker-ui/lib/test_input/createTestInputFunction.ts b/striker-ui/lib/test_input/createTestInputFunction.ts new file mode 100644 index 00000000..2e4da004 --- /dev/null +++ b/striker-ui/lib/test_input/createTestInputFunction.ts @@ -0,0 +1,14 @@ +import testInput from './testInput'; +import { + InputTestBatches, + TestInputFunction, +} from '../../types/TestInputFunction'; + +const createTestInputFunction = + (tests: InputTestBatches) => + ( + ...[options, ...restArgs]: Parameters + ): ReturnType => + testInput({ tests, ...options }, ...restArgs); + +export default createTestInputFunction; diff --git a/striker-ui/lib/test_input/index.ts b/striker-ui/lib/test_input/index.ts index a5241c87..6d9d3c16 100644 --- a/striker-ui/lib/test_input/index.ts +++ b/striker-ui/lib/test_input/index.ts @@ -1,7 +1,15 @@ +import createTestInputFunction from './createTestInputFunction'; import testInput from './testInput'; import testLength from './testLength'; import testMax from './testMax'; import testNotBlank from './testNotBlank'; import testRange from './testRange'; -export { testInput, testLength, testMax, testNotBlank, testRange }; +export { + createTestInputFunction, + testInput, + testLength, + testMax, + testNotBlank, + testRange, +};