]> git.arvados.org - arvados-workbench2.git/blob - src/validators/optional.tsx
owner-names-and-updated-navigating-on-data-explorer-name
[arvados-workbench2.git] / src / validators / optional.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 export const optional = (validator: (value: any) => string | undefined) =>
6     (value: any) =>
7         value === undefined || value === null || value === ''  ? undefined : validator(value);