Mike Frawley
59d383c151
Revert "Create #alias method, callable on any object, _ by default."
...
This reverts commit c43de549ba .
Conflicts:
test/objects.js
2010-02-23 17:26:32 -06:00
Mike Frawley
5a5e14d7a4
add #times utility method.
...
_(3).times(alert)
added tests and internal docs
2010-02-17 10:21:59 -06:00
Mike Frawley
263b1ee92d
add #buildLookup method to turn collection in to a fast lookup hash
...
implement #without in terms of it
add tests and internal docs
2010-02-17 10:12:22 -06:00
Mike Frawley
130e860ecf
improve #isEmpty implementation. add 2 tests
2010-02-17 09:48:29 -06:00
Mike Frawley
c43de549ba
Create #alias method, callable on any object, _ by default.
...
While I'm not a fan of making abstractions where a simpe solution
exists, I think this is good as it makes a public API for extending
underscore, therefore making it "ok" to make your own alias names.
Also give us some future proofing in case we ever add in hooks on
method definition. For example, right now if you add a method
or make an alias in user code, it isn't added to the wrapper prototype.
Added tests and inline docs, no external docs
2010-02-17 09:41:18 -06:00
Jeremy Ashkenas
11e7af06e9
close that iframe document after writing to it
2010-02-08 07:12:40 -05:00
Jeremy Ashkenas
d01bb56833
adding type tests across iframes for all isType functions
2010-02-05 08:22:40 -05:00
Jeremy Ashkenas
5b5ee87c7a
Underscore 0.5.8, with collection functions that once again work on NodeLists and HTMLCollections
2010-01-28 00:55:41 -05:00
Jeremy Ashkenas
30858c50a8
added suggested speed boost for isNumber
2010-01-20 13:50:08 -05:00
Jeremy Ashkenas
7ec091cc55
safer isArguments function -- make sure we're not dealing with strings or functions
2010-01-20 12:45:32 -05:00
Jeremy Ashkenas
7d9e603be8
Underscore 0.5.6, with custom template delimiters
2010-01-18 12:45:04 -05:00
noah
94195e661d
Made _.template delimeters customizable
2010-01-15 23:25:52 -05:00
Jeremy Ashkenas
6866ffb840
adding a test for single quotes in templates
2010-01-05 11:28:29 -05:00
Jeremy Ashkenas
4be6a194cd
replacing all isType tests that relied on string comparisons with versions that check for existence of known methods and properties. Less safe, but more than an order of magnitude faster.
2010-01-01 19:05:34 -05:00
Jeremy Ashkenas
d49196f2e7
pulling Evgeniy Dolzhenko's patch to add _.tap, with tests
2009-12-11 09:25:20 -05:00
Jeremy Ashkenas
5c314d206e
adding an isArguments checker and enabling iteration (using each) over JS object hashes that have numeric length properties
2009-12-09 13:41:19 -05:00
Jeremy Ashkenas
225d795836
merging in iamnoah's optimizations for the isType family of functions, and other references to core prototoypes
2009-12-09 12:44:55 -05:00
Jeremy Ashkenas
e863fbf285
Merge branch 'master' of git://github.com/iamnoah/underscore
2009-12-09 12:07:24 -05:00
Noah Sloan
76cccb6a2d
added JSLitmus tests for isType functions
2009-12-09 10:25:58 -06:00
Jeremy Ashkenas
2ba87d6b44
adding test case for previous commit
2009-12-09 11:20:09 -05:00
Jeremy Ashkenas
3eb9c28039
Underscore shouldn't be able to iterate over the letters of a string cross-browser -- indexing into a string isn't supported in IE
2009-12-08 17:31:01 -05:00
Jeremy Ashkenas
2afcffb30a
added guards to _.first and _.rest and tests, they now work as function parameters to _.map
2009-12-07 23:36:31 -05:00
Jeremy Ashkenas
39001bd029
API changes: _.bindAll now takes the context object as the first parameter, instead of the last, and _.functions (_.methods) now takes an explicitreceiver, returning a list of its methods
2009-12-06 23:54:41 -05:00
Jeremy Ashkenas
06c74e76f0
added an isRegExp test
2009-12-06 23:10:44 -05:00
Jeremy Ashkenas
66dc6c2ac1
shrunk down all of the 'is' functions into a single generation, added isRegExp, added a regexp equality test to isEqual, after grayrest's patch
2009-12-06 22:48:40 -05:00
Jeremy Ashkenas
7a1f92a8c5
documentation for Underscore 0.4.7, with isDate, isNaN, and isNull
2009-12-06 13:43:16 -05:00
Jeremy Ashkenas
4b2744a75a
0.4.6 is on the books, with kylichuku's range function
2009-11-30 23:20:11 -05:00
Kirill Ishanov
451d9c5d62
implemented 6 more passing tests for range. Now works like python's range
2009-12-01 02:10:56 +03:00
Kirill Ishanov
d8cf99ba89
initial implementation of _.range
2009-12-01 00:44:13 +03:00
Jeremy Ashkenas
ae968a6ea0
Underscore 0.4.5, with first/rest, head/tail, and all Array functions guaranteed to work on 'arguments' objects. Many method implementations reworked to use _.rest()
2009-11-19 09:37:56 -05:00
Jeremy Ashkenas
b5f111e8d4
Merge branch 'master' of git://github.com/lukesutton/underscore
2009-11-19 08:35:10 -05:00
Jeremy Ashkenas
f8e939d30a
fixing template test validation for IE
2009-11-18 21:54:50 -05:00
Luke Sutton
4ed79d5f77
Correct the test for functions() to account for the new functions and aliases.
2009-11-19 11:35:21 +10:30
Luke Sutton
8cac2d5bd7
Add init(), tail() and reverse() Array functions. Alias first() to head();
2009-11-19 11:07:14 +10:30
Jeremy Ashkenas
c9e46262ab
Underscore 0.4.4, with isNumber, isString, and isEqual(NaN, NaN)
2009-11-18 16:09:55 -05:00
Jeremy Ashkenas
80939448a7
fixing broken _.breakLoop test -- implementation was fine, test was out of date.
2009-11-12 21:31:03 -05:00
Jeremy Ashkenas
f6e67a5bf2
version 0.4.2 -- quick patch to rename get() to value() for clarity, and adding jQuery comparisons in the speed tests
2009-11-09 08:28:32 -05:00
Jeremy Ashkenas
cb85480659
0.4.1 is out, with array methods proxied for wrapped objects, an _.breakLoop(), and an _.isEmpty()
2009-11-08 14:18:24 -05:00
Jeremy Ashkenas
5eec4e5d22
adding breakLoop
2009-11-08 12:07:10 -05:00
Jeremy Ashkenas
9d4e34e19e
testing bind without context
2009-11-07 23:24:12 -05:00
Jeremy Ashkenas
b5920e94a3
added an isEmpty function that works on arrays and objects
2009-11-07 23:04:18 -05:00
Jeremy Ashkenas
ed37b9df49
0.4.0 is out, with OOP-style and chaining
2009-11-07 14:29:40 -05:00
Jeremy Ashkenas
4f0afda61c
adding OO-style object wrapping (thanks macournoyer) -- now you can to _(array).each();
2009-11-07 12:39:59 -05:00
Jeremy Ashkenas
cb38c6ae63
adding a reduceRight (it's in JS 1.8), and aliasing foldl and foldr
2009-10-30 09:40:19 -04:00
Jeremy Ashkenas
eca085a9d9
typo
2009-10-29 14:58:50 -04:00
Jeremy Ashkenas
e9bc165bc3
adding an identity test (silly, I know) to utility tests
2009-10-29 14:50:48 -04:00
Jeremy Ashkenas
42637b5880
Issue #2 -- each now calls iterator with (value, key, list) when iterating over javascript objects
2009-10-29 10:46:53 -04:00
Jeremy Ashkenas
8e7b8d2dea
started passing in the collection as the third argument to _.each iterators (Issue #1 )
2009-10-29 10:26:16 -04:00
Jeremy Ashkenas
a82a01ebfc
elaborate underscore initialization so that it works seamlessly on CommonJS, as well as in the browser
2009-10-28 23:53:40 -04:00
Jeremy Ashkenas
4f783846de
merged in kriskowal's CommonJS branch and Dmitry Baranovskiy's optimizations
2009-10-28 23:21:24 -04:00