From 9df98e65f842cf3acae09cbdd969966f42d64469 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sat, 14 Oct 2017 18:40:54 +0200 Subject: update dependencies --- node_modules/moment/src/lib/utils/is-object-empty.js | 15 ++++++++++----- node_modules/moment/src/lib/utils/mod.js | 3 +++ 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 node_modules/moment/src/lib/utils/mod.js (limited to 'node_modules/moment/src/lib/utils') diff --git a/node_modules/moment/src/lib/utils/is-object-empty.js b/node_modules/moment/src/lib/utils/is-object-empty.js index 1f2d939a5..695c3d248 100644 --- a/node_modules/moment/src/lib/utils/is-object-empty.js +++ b/node_modules/moment/src/lib/utils/is-object-empty.js @@ -1,8 +1,13 @@ export default function isObjectEmpty(obj) { - var k; - for (k in obj) { - // even if its not own property I'd still call it non-empty - return false; + if (Object.getOwnPropertyNames) { + return (Object.getOwnPropertyNames(obj).length === 0); + } else { + var k; + for (k in obj) { + if (obj.hasOwnProperty(k)) { + return false; + } + } + return true; } - return true; } diff --git a/node_modules/moment/src/lib/utils/mod.js b/node_modules/moment/src/lib/utils/mod.js new file mode 100644 index 000000000..8046cdac9 --- /dev/null +++ b/node_modules/moment/src/lib/utils/mod.js @@ -0,0 +1,3 @@ +export default function mod(n, x) { + return ((n % x) + x) % x; +} -- cgit v1.2.3