Created
December 15, 2019 10:49
-
-
Save WimJongeneel/f2d52c6c13245d377a9145cffc6ed540 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
match(vector) | |
.with({ x: 1, y: 1, z: 1 }, () => 'vector3') | |
.with({ x: 2, y:1 }, () => 'vector2') | |
.with({ x: 1 }, () => 'vector1') | |
.otherwise( () => 'no match') | |
.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment