mirror of
https://github.com/flynx/types.js.git
synced 2025-10-29 02:20:07 +00:00
added .enumerate(..) to generators....
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
7f80627670
commit
73a33e4ff9
@ -329,6 +329,8 @@ object.Mixin('GeneratorMixin', 'soft', {
|
||||
e(...args)
|
||||
: e }) }),
|
||||
//zip: makeGenerator('zip'),
|
||||
|
||||
enumerate: makeGenerator('enumerate'),
|
||||
})
|
||||
|
||||
|
||||
@ -496,6 +498,11 @@ object.Mixin('GeneratorProtoMixin', 'soft', {
|
||||
// XXX
|
||||
},
|
||||
//*/
|
||||
|
||||
enumerate: function*(){
|
||||
var i = 0
|
||||
for(var e of this){
|
||||
yield [i++, e] } },
|
||||
})
|
||||
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ig-types",
|
||||
"version": "6.15.5",
|
||||
"version": "6.15.6",
|
||||
"description": "Generic JavaScript types and type extensions...",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user