Skip to content

Instantly share code, notes, and snippets.

@koss-lebedev
Created May 24, 2018 12:30
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 koss-lebedev/0aa86874f1eceeff9f304fa1db4b38a4 to your computer and use it in GitHub Desktop.
Save koss-lebedev/0aa86874f1eceeff9f304fa1db4b38a4 to your computer and use it in GitHub Desktop.
// @flow
const isStringEmpty = (str?: string): boolean => {
return Boolean(str && str.trim() !== "")
}
const first = isStringEmpty(null)
const second = isStringEmpty("")
const third = isStringEmpty("test")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment