Skip to content

Commit 465e406

Browse files
committed
Accept root as an async function
1 parent d0362f6 commit 465e406

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export default (editor, opts = {}) => {
3838
},
3939

4040
async createDirectory(zip, root) {
41+
root = typeof root === 'function' ? await root(editor) : root;
42+
4143
for (const name in root) {
4244
if (root.hasOwnProperty(name)) {
4345
let content = root[name];

0 commit comments

Comments
 (0)