aboutsummaryrefslogtreecommitdiff
path: root/node_modules/moment/src/lib/locale/set.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/moment/src/lib/locale/set.js')
-rw-r--r--node_modules/moment/src/lib/locale/set.js56
1 files changed, 0 insertions, 56 deletions
diff --git a/node_modules/moment/src/lib/locale/set.js b/node_modules/moment/src/lib/locale/set.js
deleted file mode 100644
index 3b069de..0000000
--- a/node_modules/moment/src/lib/locale/set.js
+++ /dev/null
@@ -1,56 +0,0 @@
-import isFunction from '../utils/is-function';
-import extend from '../utils/extend';
-import isObject from '../utils/is-object';
-import hasOwnProp from '../utils/has-own-prop';
-
-export function set(config) {
- var prop, i;
- for (i in config) {
- if (hasOwnProp(config, i)) {
- prop = config[i];
- if (isFunction(prop)) {
- this[i] = prop;
- } else {
- this['_' + i] = prop;
- }
- }
- }
- this._config = config;
- // Lenient ordinal parsing accepts just a number in addition to
- // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
- // TODO: Remove "ordinalParse" fallback in next major release.
- this._dayOfMonthOrdinalParseLenient = new RegExp(
- (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
- '|' +
- /\d{1,2}/.source
- );
-}
-
-export function mergeConfigs(parentConfig, childConfig) {
- var res = extend({}, parentConfig),
- prop;
- for (prop in childConfig) {
- if (hasOwnProp(childConfig, prop)) {
- if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
- res[prop] = {};
- extend(res[prop], parentConfig[prop]);
- extend(res[prop], childConfig[prop]);
- } else if (childConfig[prop] != null) {
- res[prop] = childConfig[prop];
- } else {
- delete res[prop];
- }
- }
- }
- for (prop in parentConfig) {
- if (
- hasOwnProp(parentConfig, prop) &&
- !hasOwnProp(childConfig, prop) &&
- isObject(parentConfig[prop])
- ) {
- // make sure changes to properties don't modify parent config
- res[prop] = extend({}, res[prop]);
- }
- }
- return res;
-}