A collection of application-agnostic ES6 modules with the following goals:
- Modules should provide stable interfaces to accomplish common tasks
- Module implementations should be lightweight, high-quality, and may be 3rd-party
- Modules must support ES5 environments
- DOM
add-ready-handler
: adds a DOM-ready callbackload-script
: append a<script>
to the DOM<head>
- function
debounce
: throttle the invocation of a function
- is
is-array
: determine if an item is an arrayis-defined
: determine if an item is definedis-string
: determine if an item is a stringis-undefined
: determine if an item is undefined
- object
assign
: universalObject.assign()
has-own-property
:Object.hasOwnProperty()
that also accepts nested keys
- string
ends-with
: determine if a string ends with another string
import endsWith from '@tubepress/es-utils/es/string/ends-with';
if (endsWith('foo-bar', 'bar')) {
...
}