Skip to content

Instantly share code, notes, and snippets.

@mjgartendev
Created August 25, 2020 19:34
Show Gist options
  • Save mjgartendev/48fea80ac1f76619559f74bfcef8aed5 to your computer and use it in GitHub Desktop.
Save mjgartendev/48fea80ac1f76619559f74bfcef8aed5 to your computer and use it in GitHub Desktop.
A collection of common utilities
// pipe
// curry
const letter = /[a-zA-Z]/g
const digit = /[0-9]/
const formEls = /^(?:input|select|textarea)$/i
const keyEvent = /^key/
const mouseEvent = /^(?:mouse|contextmenu)|click/
const focusMorph = /^(?:focusinfocus|focusoutblur)$/
const typenamespace = /^([^.]*)(?:\.(.+)|)$/
const escapedHtml = /&(?:amp|lt|gt|quot|#39);/g
const emptyStringLeading = /\b__p \+= '';/g
const emptyStringMiddle = /\b(__p \+=) '' \+/g
const emptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g
// Unpkg
// Gist
// Github
// SchemaStore
// Constructor
// Mixin
// Plugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment