can-util
Common JavaScript utilities for the rest of CanJS.
Object
can-util/js
- [can-util/js/base-url/base-url] - Get and/or set the "base" (containing path) of the document.
- deep-assign - Assign properties from a source object to a target object, deeply copying properties that are objects or arrays.
- defaults - Mimics _.defaults. Assigns first level properties in sources from left to right if they are not already defined.
- diff - Returns the difference between two ArrayLike objects (that have nonnegative integer keys and the
length
property) as an array of patch objects. - diff-object - Find the differences between two objects, based on properties and values.
- each - Loop over each element in an Array-Like data structure.
- get - Returns the value at the specified property path of an object.
- import - Imports a module.
- is-array-like - Determines if an object is "array like", meaning it can be looped over. Any object with a
.length
property is array like. - is-empty-object - Used to determine if an object is an empty object (an object with no enumerable properties) such as
{}
. - [can-util/js/is-function/is-function] - Used to determine if a value is a function.
- is-node - Determines if your code is running in Node.js.
- is-plain-object - Attempts to determine if an object is a plain object like those you would create using the curly braces syntax:
{}
. - is-promise - Determines if object is a Promise.
- is-promise-like - Determines if an object is "Then-able".
- is-web-worker - Determines if the code is running with a Web Worker.
- join-uris - Provides a convenient way to join together URIs handling relative paths.
- make-array - Takes any array-like object (can-list, NodeList, etc.) and converts it to a JavaScript array.
- make-promise - Will make isPromiseLike object into Promise.
- omit - Omit properties from an object.
- set-immediate - Polyfill for setImmediate() if it doesn't exist in the global context.
- string - String utilities used by CanJS libraries.
- string-to-any - Turns a string representation of a primitive type back into the associated primitive.
can-util/dom
- attr - A module that makes it easy to access attributes and properties of elements.
- child-nodes - Get all of the childNodes of a given node.
- class-name - Allows querying and manipulation of classes on HTML elements.
- data - Allows associating data as a key/value pair for a particular DOM node.
- dispatch - Dispatch an event on an element.
- events - Allows you to listen to a domEvent and special domEvents as well as dispatch domEvents.
- frag - Convert a String, HTMLElement, documentFragment, or contentArray into a documentFragment.
- mutate - Mutate an element by appending, inserting, and removing DOM nodes. Use this so that on the server "inserted" will be fired.
deprecated
- ajax - Deprecated. Use can-ajax instead.
- assign - Deprecated. Use can-assign instead.
- cid - Deprecated. Use can-cid instead.
- deparam - Deprecated. Use can-deparam instead.
- dev - Deprecated. Use [can-log/dev/dev] instead.
- [can-util/dom/document/document] - Deprecated. Use document instead.
- global - Deprecated. Use global instead.
- is-browser-window - Deprecated. Use is-browser-window instead.
- is-string - Deprecated. Use
typeof
instead. - log - Deprecated. Use log instead.
- param - Deprecated. Use can-param instead.
- types - Deprecated. Use can-types instead.