diff options
author | Albin Larsson <mail@albinlarsson.com> | 2018-05-14 06:49:04 +0200 |
---|---|---|
committer | Albin Larsson <mail@albinlarsson.com> | 2018-05-14 06:49:04 +0200 |
commit | 7ca21697907850790f875d01bf27870a0386527b (patch) | |
tree | 647ad6234f0f25d8a42c1f5a05654efc283e562e /src/js/utils.js | |
parent | 765c01e83dc4173d778538061a82e1973a8574f0 (diff) | |
download | plyr-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.js | 5 |
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) { |