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

Function trimmed

packages/effect/src/Schema.ts:4261–4273  ·  view source on GitHub ↗
(
  annotations?: Annotations.Filter<Schema.Type<S>>
)

Source from the content-addressed store, hash-verified

4259 * @since 3.10.0
4260 */
4261export const trimmed = <S extends Schema.Any>(
4262 annotations?: Annotations.Filter<Schema.Type<S>>
4263) =>
4264<A extends string>(self: S & Schema<A, Schema.Encoded<S>, Schema.Context<S>>): filter<S> =>
4265 self.pipe(
4266 filter((a) => a === a.trim(), {
4267 schemaId: TrimmedSchemaId,
4268 title: "trimmed",
4269 description: "a string with no leading or trailing whitespace",
4270 jsonSchema: { pattern: "^\\S[\\s\\S]*\\S$|^\\S$|^$" },
4271 ...annotations
4272 })
4273 )
4274
4275/**
4276 * @category schema id

Callers 1

TrimmedClass · 0.85

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…