langchain.js
    Preparing search index...
    • Type guard to check if a given value is a Standard Schema V1 object.

      Type Parameters

      • Input = unknown

        The type of input validated by this schema.

      • Output = Input

        The type of output produced after validation.

      Parameters

      • schema: StandardSchemaV1<Input, Output>

        The value to test.

      Returns schema is StandardSchemaV1<Input, Output>

      True if the schema conforms to the Standard Schema interface.

      A Standard Schema object is expected to have a ~standard property with a validate function. This guard does NOT check for JSON schema support.

      if (isStandardSchema(mySchema)) {
      const result = mySchema["~standard"].validate(input);
      }
    • Type guard to check if a given value is a Standard Schema V1 object.

      Type Parameters

      • Input = unknown

        The type of input validated by this schema.

      • Output = Input

        The type of output produced after validation.

      Parameters

      • schema: unknown

        The value to test.

      Returns schema is StandardSchemaV1<Input, Output>

      True if the schema conforms to the Standard Schema interface.

      A Standard Schema object is expected to have a ~standard property with a validate function. This guard does NOT check for JSON schema support.

      if (isStandardSchema(mySchema)) {
      const result = mySchema["~standard"].validate(input);
      }