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

Function endsWith

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

Source from the content-addressed store, hash-verified

4460 * @since 3.10.0
4461 */
4462export const endsWith = <S extends Schema.Any>(
4463 endsWith: string,
4464 annotations?: Annotations.Filter<Schema.Type<S>>
4465) =>
4466<A extends string>(self: S & Schema<A, Schema.Encoded<S>, Schema.Context<S>>): filter<S> => {
4467 const formatted = JSON.stringify(endsWith)
4468 return self.pipe(
4469 filter(
4470 (a) => a.endsWith(endsWith),
4471 {
4472 schemaId: EndsWithSchemaId,
4473 [EndsWithSchemaId]: { endsWith },
4474 title: `endsWith(${formatted})`,
4475 description: `a string ending with ${formatted}`,
4476 jsonSchema: { pattern: `^.*${endsWith}$` },
4477 ...annotations
4478 }
4479 )
4480 )
4481}
4482
4483/**
4484 * @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…