FIND YOUR NEXT FEW LINES

Results for “strict”

Small, practical examples. Search by task or narrow things down below.

268 snippets foundClear filters
AngularLifecycle & observable data

Transform an observable value

Transform an observable value with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
TypeScriptText handling & Unicode

Transform each regex match with a callback

TypeScript: A replacement callback computes the replacement separately for each match.

TypeScript✓ Tested
TypeScriptText handling & Unicode

Trim and discard blank lines

TypeScript: Split a text block, trim each line, and keep nonempty values.

TypeScript✓ Tested
TypeScriptCollections & records

Type a dictionary with Record

Limit a lookup table to a known set of keys.

Record✓ Tested
TypeScriptTypes & functions

Type a function’s inputs and output

Catch mismatched arguments during compilation.

function✓ Tested
TypeScriptUtilities & async

Type an object update with Partial

Allow a caller to provide just the fields to change.

Partial✓ Tested
TypeScriptGetting Started

Update a running count

TypeScript: Change a variable after its initial value has been assigned.

TypeScript✓ Tested
AngularSignals & state

Update a signal from its previous value

Update a signal from its previous value with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
TypeScriptSafe data handling

Update an object with a readonly input

Create a changed copy while retaining the original.

readonly✓ Tested
TypeScriptPromises & iteration protocols

Use the first fulfilled promise result

TypeScript: Promise.any ignores individual rejections until one input fulfills.

TypeScript✓ Tested
AngularEvents & DOM interaction

Validate a field when focus leaves it

Validate a field when focus leaves it with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
TypeScriptNumbers & numeric validation

Validate a finite numeric value without coercion

TypeScript: Number.isFinite rejects numeric strings as well as NaN and infinity.

TypeScript✓ Tested