aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/utils.js
diff options
context:
space:
mode:
authorAlbin Larsson <mail@albinlarsson.com>2018-05-14 06:49:04 +0200
committerAlbin Larsson <mail@albinlarsson.com>2018-05-14 06:49:04 +0200
commit7ca21697907850790f875d01bf27870a0386527b (patch)
tree647ad6234f0f25d8a42c1f5a05654efc283e562e /src/js/utils.js
parent765c01e83dc4173d778538061a82e1973a8574f0 (diff)
downloadplyr-7ca21697907850790f875d01bf27870a0386527b.tar.lz
plyr-7ca21697907850790f875d01bf27870a0386527b.tar.xz
plyr-7ca21697907850790f875d01bf27870a0386527b.zip
Expose defaults (enable overriding)
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 ebfb9c96..5c4934a1 100644
--- a/src/js/utils.js
+++ b/src/js/utils.js
@@ -703,6 +703,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) {