aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/utils.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-05-19 11:25:02 +1000
committerSam Potts <sam@potts.es>2018-05-19 11:25:02 +1000
commit602353f4d953c5b083ee22fd0ee479ad605de281 (patch)
tree34866e67f21a3e14c6874313ae8787795db96605 /src/js/utils.js
parent51814249afd4337c1a7d1426ea913988228a7574 (diff)
parent797b70998faf1789831cd28a4fbd4933e5ad187f (diff)
downloadplyr-602353f4d953c5b083ee22fd0ee479ad605de281.tar.lz
plyr-602353f4d953c5b083ee22fd0ee479ad605de281.tar.xz
plyr-602353f4d953c5b083ee22fd0ee479ad605de281.zip
Merge branch 'master' of github.com:sampotts/plyr
Diffstat (limited to 'src/js/utils.js')
-rw-r--r--src/js/utils.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/js/utils.js b/src/js/utils.js
index 1de5ed6c..a58d8555 100644
--- a/src/js/utils.js
+++ b/src/js/utils.js
@@ -706,6 +706,11 @@ const utils = {
return array.filter((item, index) => array.indexOf(item) === index);
},
+ // Clone nested objects
+ cloneDeep(object) {
+ return JSON.parse(JSON.stringify(object));
+ },
+
// Get the closest value in an array
closest(array, value) {
if (!utils.is.array(array) || !array.length) {