(minimum: number, maximum: number)
| 5284 | * @since 3.10.0 |
| 5285 | */ |
| 5286 | export const clamp = (minimum: number, maximum: number) => |
| 5287 | <S extends Schema.Any, A extends number>( |
| 5288 | self: S & Schema<A, Schema.Encoded<S>, Schema.Context<S>> |
| 5289 | ): transform<S, filter<SchemaClass<A>>> => { |
| 5290 | return transform( |
| 5291 | self, |
| 5292 | typeSchema(self).pipe(between(minimum, maximum)), |
| 5293 | { |
| 5294 | strict: false, |
| 5295 | decode: (i) => number_.clamp(i, { minimum, maximum }), |
| 5296 | encode: identity |
| 5297 | } |
| 5298 | ) |
| 5299 | } |
| 5300 | |
| 5301 | /** |
| 5302 | * Transforms a `string` into a `number` by parsing the string using the `parse` |
nothing calls this directly
no test coverage detected