diff options
author | Sam Potts <sam@potts.es> | 2018-05-14 23:38:25 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-14 23:38:25 +1000 |
commit | 4a01027da0c1873f27f20a4d9ce50713d4b3c214 (patch) | |
tree | 647ad6234f0f25d8a42c1f5a05654efc283e562e /src/js/utils.js | |
parent | 765c01e83dc4173d778538061a82e1973a8574f0 (diff) | |
parent | 7ca21697907850790f875d01bf27870a0386527b (diff) | |
download | plyr-4a01027da0c1873f27f20a4d9ce50713d4b3c214.tar.lz plyr-4a01027da0c1873f27f20a4d9ce50713d4b3c214.tar.xz plyr-4a01027da0c1873f27f20a4d9ce50713d4b3c214.zip |
Merge pull request #961 from friday/expose-defaults
Enable overriding defaults
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) { |