Skip to content

Instantly share code, notes, and snippets.

@jsmanifest
Created July 3, 2019 16:10
Show Gist options
  • Select an option

  • Save jsmanifest/8b3b423d38f87e8969f9930df8ef4365 to your computer and use it in GitHub Desktop.

Select an option

Save jsmanifest/8b3b423d38f87e8969f9930df8ef4365 to your computer and use it in GitHub Desktop.
const hasInvalidChars = /^.*?(?=[\+\^#%&$\*:<>\?/\{\|\}\[\]\)\(]).*$/g.test(
inputValue,
)
const callApi = async (keywords) => {
try {
const url = `https://someapi.com/v1/search/?keywords=${keywords}/`
return api.searchStuff(url)
} catch (error) {
throw error
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment