MCPcopy
hub / github.com/Effect-TS/effect / includes

Function includes

packages/effect/src/Schema.ts:4493–4512  ·  view source on GitHub ↗
(
  searchString: string,
  annotations?: Annotations.Filter<Schema.Type<S>>
)

Source from the content-addressed store, hash-verified

4491 * @since 3.10.0
4492 */
4493export const includes = <S extends Schema.Any>(
4494 searchString: string,
4495 annotations?: Annotations.Filter<Schema.Type<S>>
4496) =>
4497<A extends string>(self: S & Schema<A, Schema.Encoded<S>, Schema.Context<S>>): filter<S> => {
4498 const formatted = JSON.stringify(searchString)
4499 return self.pipe(
4500 filter(
4501 (a) => a.includes(searchString),
4502 {
4503 schemaId: IncludesSchemaId,
4504 [IncludesSchemaId]: { includes: searchString },
4505 title: `includes(${formatted})`,
4506 description: `a string including ${formatted}`,
4507 jsonSchema: { pattern: `.*${searchString}.*` },
4508 ...annotations
4509 }
4510 )
4511 )
4512}
4513
4514/**
4515 * @category schema id

Callers

nothing calls this directly

Calls 2

filterFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…