bravia-remote/utils.js

8 lines
202 B
JavaScript
Raw Normal View History

2017-01-08 22:24:52 +01:00
function *repeat(seq, times) {
for(let i = 0; i < times; i++) yield *seq
}
function *alternate(a, delim) {
for(const x of a) { yield *[x, delim] }
}
Object.assign(module.exports, {repeat, alternate})