Skip to main content

nonEmpty

Utility function to clone a given array schema with the "non-empty" cardinality.

Example​

import { nonEmpty, array, string } from "@sodd/core";

const schema = array(string()); // `"many"` cardinality by default

const nonEmptySchema = nonEmpty(schema); // `"non-empty"` cardinality