Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 9f912eb82e
Fetching contributors…

Cannot retrieve contributors at this time

119 lines (87 sloc) 3.416 kb
Buster core 0.2.0 documentation
:Author: Christian Johansen
A collection of utilities commonly used across Buster.JS projects.
Table of contents
* <<buster-core,The buster-core module>>
The buster-core module
The buster-core module is stable and can be freely used when extending Buster,
or for any other projects should you wish to do so.
Returns +true+ if the object is a DOM node. The check is made by attempting to
call +appendChild+ on it, passing in an element.
Returns +true+ if the object is a DOM element. The check is made by calling
+isNode+ and asserting that the element's +nodeType+ is 1 (i.e. element).
+buster.bind(object, methodOrString)+
Binds a function to an object, such that its +this+ value is fixed regardless of
how it's called. The function works much like +Function.prototype.bind+ - it is
provided here to work in environments that do not support
var homer = {
name: "Homer",
burp: function () {
return + " goes buuuuuurp";
var func = buster.bind(homer, homer.burp);
func(); // "Homer goes buuuuuurp"
var func2 = buster.bind(home, "burp");
func2(); // "Homer goes buuuuuurp"
Returns true if the argument is an +arguments+ object. Buster checks this by
making sure the object is array-like, but not actually an array.
function check() {
buster.isArguments(arguments); // true
buster.isArguments([]); // false
Cross-browser implementation of
From MDC: "returns an array whose elements are strings corresponding to the
enumerable properties found directly upon object. The ordering of the properties
is the same as that given by looping over the properties of the object
Cross-browser implementation of
<a href="">Object.create</a>
+buster.create+ only supports creating a new object with the specified
object as its prototype. It does not support property descriptors.
+buster.extend(target, source1, source2, ...)+
Extends the target object by copying all the properties of all the sources onto
it. Sources as processed in order. The method also returns the target object.
var target = { id: 42, num: 0 };
target = buster.create(target,
{ id: 13, name: "One" },
{ name: "Two", prop: "erty" });
//=> { id: 13, num: 0, name: "Two", prop: "erty" }
Calls the callback on the next tick of the event loop. On Node.js this method
simply delegates to +process.nextTick+. In the browser, +nextTick+ is emulated
by passing the callback to +setTimeout(callback, 0)+
buster-core license
Jump to Line
Something went wrong with that request. Please try again.