Skip to content

Instantly share code, notes, and snippets.

@WimJongeneel
Created December 15, 2019 10:49
Show Gist options
  • Save WimJongeneel/f2d52c6c13245d377a9145cffc6ed540 to your computer and use it in GitHub Desktop.
Save WimJongeneel/f2d52c6c13245d377a9145cffc6ed540 to your computer and use it in GitHub Desktop.
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