Skip to content

Commit

Permalink
fix: polyfill structuredClone (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Oct 23, 2023
1 parent c99e52b commit 6e9a6fe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/timings.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
if (typeof structuredClone === 'undefined') {
// older versions of Node might not have "structuredClone"
// so use a simply polyfill
structuredClone = (x) => JSON.parse(JSON.stringify(x))
}

/**
* Split the list of items into "n" lists by "duration" property
* in each item. Sorts the list first, then round-robin fills
Expand Down

0 comments on commit 6e9a6fe

Please sign in to comment.