🧩 match-with
Pattern matching object structures. Semi-related to tc39/proposal-pattern-matching.
Installation
yarn add match-with
Usage
Basic syntax:
; matchsubject: any .withpattern1: any, callback1:result: any .withpattern2: any, callback2:result: any .defaultcallback3:result: any .result;
Examples:
...; matchsubject .with, .result; // "match"; matchsubject .with, .default; matchsubject .with,; matchsubject .with, .with,;
Community
Let me know what you think. After you ★ this project, follow me @Rygu on Twitter.
License
BSD 3-Clause license. Copyright © 2019, Rick Wong. All rights reserved.