Skip to content

Instantly share code, notes, and snippets.

@MeetMartin
Created October 29, 2018 21:55
Show Gist options
  • Save MeetMartin/e495c651bcf4bfd7794939744c980f3a to your computer and use it in GitHub Desktop.
Save MeetMartin/e495c651bcf4bfd7794939744c980f3a to your computer and use it in GitHub Desktop.
import match from 'conditional-expression';
match('funny joke')
.equals('sad').then('I am false')
.with(/[a-z]/).then('I am true and I am the result')
.includes('joke').then('I am true but I am not evaluated')
.else('I just execute everything');
// returns 'I am true and I am the result'
@XuanZhenJun
Copy link

这是干嘛用的

@MeetMartin
Copy link
Author

你不懂什么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment