Skip to content

Instantly share code, notes, and snippets.

@jo
Created July 6, 2015 15:50
Show Gist options
  • Save jo/d59786a299d795ee6e54 to your computer and use it in GitHub Desktop.
Save jo/d59786a299d795ee6e54 to your computer and use it in GitHub Desktop.
function(doc) {
function emitObject(path, o) {
if (typeof o !== 'object') {
return emit(path, o);
}
for (var key in o) {
emitObject(path.concat(key), o[key])
}
}
emitObject([], doc)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment