Skip to content

Instantly share code, notes, and snippets.

@haskellcamargo
Forked from suissa/words.06.b.js
Last active November 2, 2017 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haskellcamargo/cc6c335213be1bfe96631423edb8b27b to your computer and use it in GitHub Desktop.
Save haskellcamargo/cc6c335213be1bfe96631423edb8b27b to your computer and use it in GitHub Desktop.
import { __, reject, contains, either } from 'ramda'
const words = [
'oi', 'como', 'vai', 'você', 'seu', 'idiota'
]
const blacklist = [
'idiota', 'babaca', 'fdp'
]
const verbs = [
'vai', 'vou'
]
const clear = reject(either(contains(__, blacklist), contains(__, verbs)))
console.log('cleanWords: ', clear(words))
// wordsClean: [ 'oi', 'como', 'você', 'seu' ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment