From e11b992810c3501856cc0a8f4952de43ed15eea9 Mon Sep 17 00:00:00 2001 From: theMackabu Date: Tue, 7 Apr 2026 02:47:22 -0700 Subject: [PATCH] add match demo --- examples/demo/match.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 examples/demo/match.js diff --git a/examples/demo/match.js b/examples/demo/match.js new file mode 100644 index 0000000..fef8e70 --- /dev/null +++ b/examples/demo/match.js @@ -0,0 +1,11 @@ +const msg = Ant.match(process.argv[2], { + 200: 'ok', + 404: 'not found', + [$ >= 500 && $ < 600]: 'server error', + [Symbol.default]: code => { + console.log('unexpected code'); + return `unknown value ${code}`; + } +}); + +console.log(msg); -- 2.51.2