Encode and decode Morse code with validation support.
import { morse } from 'toolmetry';| Function | Parameters | Returns | Description |
|---|---|---|---|
morseEncode | input: string | string | Encode text to Morse code |
morseDecode | input: string | string | Decode Morse code to text |
morseIsValid | input: string | boolean | Check if valid Morse code |
import { morseEncode, morseDecode } from 'toolmetry';
const encoded = morseEncode('HELLO WORLD');
// ".... . .-.. .-.. --- / .-- --- .-. .-.. -.."
const decoded = morseDecode(encoded);
// "HELLO WORLD"import { morseIsValid } from 'toolmetry';
morseIsValid('.... . .-.. .-.. ---'); // true
morseIsValid('hello'); // false