21700: Install Bundler system-wide in Rails postinst
[arvados.git] / services / workbench2 / src / validators / min-length.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 export const ERROR_MESSAGE = (minLength: number) => `Min length is ${minLength}`;
6
7 export const minLength =
8     (minLength: number, errorMessage = ERROR_MESSAGE) =>
9         (value: { length: number }) =>
10             value && value.length >= minLength ? undefined : errorMessage(minLength);