Skip to content

Commit

Permalink
util: Add keyValues and values method
Browse files Browse the repository at this point in the history
  • Loading branch information
gifnksm committed Mar 22, 2016
1 parent 20c77d4 commit c838ef0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions content/modules/util.js
Expand Up @@ -1642,6 +1642,20 @@ var util = function () {
g.next();
},

keyValues:
function keyValues(obj) {
for (let k of Object.keys(obj)) {
yield [k, obj[k]];
}
},

values:
function values(obj) {
for (let k of Object.keys(obj)) {
yield obj[k];
}
},

// }} ======================================================================= //

// String {{ ================================================================ //
Expand Down

0 comments on commit c838ef0

Please sign in to comment.