diff options
Diffstat (limited to 'library/moment/src/lib/utils/defaults.js')
-rw-r--r-- | library/moment/src/lib/utils/defaults.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/library/moment/src/lib/utils/defaults.js b/library/moment/src/lib/utils/defaults.js new file mode 100644 index 000000000..45c5e8794 --- /dev/null +++ b/library/moment/src/lib/utils/defaults.js @@ -0,0 +1,10 @@ +// Pick the first defined of two or three arguments. +export default function defaults(a, b, c) { + if (a != null) { + return a; + } + if (b != null) { + return b; + } + return c; +} |