How to use the optimal.shape function in optimal

To help you get started, we’ve selected a few optimal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github beemojs / beemo / packages / core / src / Beemo.ts View on Github external
export function configBlueprint() {
  return {
    configure: shape({
      cleanup: bool(false),
      parallel: bool(true),
    }),
    execute: shape({
      concurrency: number(),
      graph: bool(true),
    }),
    module: process.env.BEEMO_CONFIG_MODULE
      ? string(process.env.BEEMO_CONFIG_MODULE)
      : string().required(),
  };
}
github beemojs / beemo / packages / core / src / Driver.ts View on Github external
Object.keys(options).forEach(key => {
      blueprint[key] = shape({
        description: string()
          .notEmpty()
          .required(),
      });
    });
github milesj / shapeshifter / packages / core / src / Definition.ts View on Github external
createUnionType(defaultValue: unknown = null): UnionBuilder {
    return union(
      [
        string().notEmpty(),
        shape({
          type: string()
            .notEmpty()
            .required(),
        }),
      ],
      defaultValue,
    ).required();
  }
github beemojs / beemo / packages / core / src / Beemo.ts View on Github external
export function configBlueprint() {
  return {
    configure: shape({
      cleanup: bool(false),
      parallel: bool(true),
    }),
    execute: shape({
      concurrency: number(),
      graph: bool(true),
    }),
    module: process.env.BEEMO_CONFIG_MODULE
      ? string(process.env.BEEMO_CONFIG_MODULE)
      : string().required(),
  };
}

optimal

Build, validate, and transform values with immutable typed schemas.

MIT
Latest version published 3 years ago

Package Health Score

47 / 100
Full package analysis