Results for “get”
Small, practical examples. Search by task or narrow things down below.
Use named states for a controller
Arduino / C: An enum makes state transitions easier to read than unexplained numbers.
Arduino / C✓ Tested
Use the first fulfilled promise result
TypeScript: Promise.any ignores individual rejections until one input fulfills.
TypeScript✓ Tested
Validate a complete numeric serial command
Arduino / C: Check for digits, an end pointer, and an application-specific range.
Arduino / C✓ Tested
Validate a finite numeric value without coercion
TypeScript: Number.isFinite rejects numeric strings as well as NaN and infinity.
TypeScript✓ Tested
Validate a small stored payload with a checksum
Arduino / C: Store a checksum with the payload and reject a changed byte.
Arduino / C✓ Tested
Validate a whole ASCII identifier
TypeScript: Use an anchored expression without the multiline flag and reject a trailing line break explicitly.
TypeScript✓ Tested
Validate an unknown value with a type guard
Check a field before treating unknown data as a typed object.
unknown✓ Tested
Write and read a setting in EEPROM
Persist one byte using the update operation.
EEPROM✓ Tested