aboutsummaryrefslogtreecommitdiff
path: root/node_modules/moment/src/lib/parse
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
commitcc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch)
tree92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/moment/src/lib/parse
parent3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff)
remove node_modules
Diffstat (limited to 'node_modules/moment/src/lib/parse')
-rw-r--r--node_modules/moment/src/lib/parse/regex.js54
-rw-r--r--node_modules/moment/src/lib/parse/token.js33
2 files changed, 0 insertions, 87 deletions
diff --git a/node_modules/moment/src/lib/parse/regex.js b/node_modules/moment/src/lib/parse/regex.js
deleted file mode 100644
index 4b86f34c7..000000000
--- a/node_modules/moment/src/lib/parse/regex.js
+++ /dev/null
@@ -1,54 +0,0 @@
-export var match1 = /\d/; // 0 - 9
-export var match2 = /\d\d/; // 00 - 99
-export var match3 = /\d{3}/; // 000 - 999
-export var match4 = /\d{4}/; // 0000 - 9999
-export var match6 = /[+-]?\d{6}/; // -999999 - 999999
-export var match1to2 = /\d\d?/; // 0 - 99
-export var match3to4 = /\d\d\d\d?/; // 999 - 9999
-export var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
-export var match1to3 = /\d{1,3}/; // 0 - 999
-export var match1to4 = /\d{1,4}/; // 0 - 9999
-export var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
-
-export var matchUnsigned = /\d+/; // 0 - inf
-export var matchSigned = /[+-]?\d+/; // -inf - inf
-
-export var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
-export var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
-
-export var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
-
-// any word (or two) characters or numbers including two/three word month in arabic.
-// includes scottish gaelic two word and hyphenated months
-export var matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;
-
-
-import hasOwnProp from '../utils/has-own-prop';
-import isFunction from '../utils/is-function';
-
-var regexes = {};
-
-export function addRegexToken (token, regex, strictRegex) {
- regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
- return (isStrict && strictRegex) ? strictRegex : regex;
- };
-}
-
-export function getParseRegexForToken (token, config) {
- if (!hasOwnProp(regexes, token)) {
- return new RegExp(unescapeFormat(token));
- }
-
- return regexes[token](config._strict, config._locale);
-}
-
-// Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
-function unescapeFormat(s) {
- return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
- return p1 || p2 || p3 || p4;
- }));
-}
-
-export function regexEscape(s) {
- return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
-}
diff --git a/node_modules/moment/src/lib/parse/token.js b/node_modules/moment/src/lib/parse/token.js
deleted file mode 100644
index 24b4474f8..000000000
--- a/node_modules/moment/src/lib/parse/token.js
+++ /dev/null
@@ -1,33 +0,0 @@
-import hasOwnProp from '../utils/has-own-prop';
-import isNumber from '../utils/is-number';
-import toInt from '../utils/to-int';
-
-var tokens = {};
-
-export function addParseToken (token, callback) {
- var i, func = callback;
- if (typeof token === 'string') {
- token = [token];
- }
- if (isNumber(callback)) {
- func = function (input, array) {
- array[callback] = toInt(input);
- };
- }
- for (i = 0; i < token.length; i++) {
- tokens[token[i]] = func;
- }
-}
-
-export function addWeekParseToken (token, callback) {
- addParseToken(token, function (input, array, config, token) {
- config._w = config._w || {};
- callback(input, config._w, config, token);
- });
-}
-
-export function addTimeToArrayFromToken(token, input, config) {
- if (input != null && hasOwnProp(tokens, token)) {
- tokens[token](input, config._a, config, token);
- }
-}