smooth-jeans-bake.md 1.1 KB


"@sv443-network/userutils": minor

Initial release - Features:

  • onSelector() to call a listener once a selector is found in the DOM
  • autoPlural() to automatically pluralize a string
  • clamp() to clamp a number between a min and max value
  • pauseFor() to pause the execution of a function for a given amount of time
  • debounce() to call a function only once, after a given amount of time
  • getUnsafeWindow() to get the unsafeWindow object or fall back to the regular window object
  • insertAfter() to insert an element as a sibling after another element
  • addParent() to add a parent element around another element
  • addGlobalStyle() to add a global style to the page
  • preloadImages() to preload images into the browser cache for faster loading later on
  • fetchAdvanced() as a wrapper around the fetch API with a timeout option
  • openInNewTab() to open a link in a new tab
  • interceptEvent() to conditionally intercept events registered by addEventListener() on any given EventTarget object
  • interceptWindowEvent() to conditionally intercept events registered by addEventListener() on the window object