added .enumerate(..) to generators....

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-07-05 16:43:28 +03:00
parent 7f80627670
commit 73a33e4ff9
2 changed files with 8 additions and 1 deletions

View File

@ -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] } },
})

View File

@ -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": {