Back | Home
الـ Path الحالي: /home/picotech/domains/instantly.picotech.app/public_html/public/uploads/../uploads/../../../../instantly.picotech.app/homes/../../wa.picotech.app/public_html/node_modules/escape-html/.././object-assign/../@hapi/../base64id/../yargs-parser/../protobufjs/.././peek-readable/../domutils/../@adiwajshing/../base64id/../forwarded/../y18n/../lodash/../validator/lib
الملفات الموجودة في هذا الـ Path:
.
..
alpha.js
blacklist.js
contains.js
equals.js
escape.js
isAfter.js
isAlpha.js
isAlphanumeric.js
isAscii.js
isBIC.js
isBase32.js
isBase58.js
isBase64.js
isBefore.js
isBoolean.js
isBtcAddress.js
isByteLength.js
isCreditCard.js
isCurrency.js
isDataURI.js
isDate.js
isDecimal.js
isDivisibleBy.js
isEAN.js
isEmail.js
isEmpty.js
isEthereumAddress.js
isFQDN.js
isFloat.js
isFullWidth.js
isHSL.js
isHalfWidth.js
isHash.js
isHexColor.js
isHexadecimal.js
isIBAN.js
isIMEI.js
isIP.js
isIPRange.js
isISBN.js
isISIN.js
isISO31661Alpha2.js
isISO31661Alpha3.js
isISO4217.js
isISO6346.js
isISO6391.js
isISO8601.js
isISRC.js
isISSN.js
isIdentityCard.js
isIn.js
isInt.js
isJSON.js
isJWT.js
isLatLong.js
isLength.js
isLicensePlate.js
isLocale.js
isLowercase.js
isLuhnNumber.js
isLuhnValid.js
isMACAddress.js
isMD5.js
isMagnetURI.js
isMailtoURI.js
isMimeType.js
isMobilePhone.js
isMongoId.js
isMultibyte.js
isNumeric.js
isOctal.js
isPassportNumber.js
isPort.js
isPostalCode.js
isRFC3339.js
isRgbColor.js
isSemVer.js
isSlug.js
isStrongPassword.js
isSurrogatePair.js
isTaxID.js
isTime.js
isURL.js
isUUID.js
isUppercase.js
isVAT.js
isVariableWidth.js
isWhitelisted.js
ltrim.js
matches.js
normalizeEmail.js
rtrim.js
stripLow.js
toBoolean.js
toDate.js
toFloat.js
toInt.js
trim.js
unescape.js
util
whitelist.js

مشاهدة ملف: isLocale.js

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = isLocale;

var _assertString = _interopRequireDefault(require("./util/assertString"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/*
  = 3ALPHA              ; selected ISO 639 codes
    *2("-" 3ALPHA)      ; permanently reserved
 */
var extlang = '([A-Za-z]{3}(-[A-Za-z]{3}){0,2})';
/*
  = 2*3ALPHA            ; shortest ISO 639 code
    ["-" extlang]       ; sometimes followed by
                        ; extended language subtags
  / 4ALPHA              ; or reserved for future use
  / 5*8ALPHA            ; or registered language subtag
 */

var language = "(([a-zA-Z]{2,3}(-".concat(extlang, ")?)|([a-zA-Z]{5,8}))");
/*
  = 4ALPHA              ; ISO 15924 code
 */

var script = '([A-Za-z]{4})';
/*
  = 2ALPHA              ; ISO 3166-1 code
  / 3DIGIT              ; UN M.49 code
 */

var region = '([A-Za-z]{2}|\\d{3})';
/*
  = 5*8alphanum         ; registered variants
  / (DIGIT 3alphanum)
 */

var variant = '([A-Za-z0-9]{5,8}|(\\d[A-Z-a-z0-9]{3}))';
/*
  = DIGIT               ; 0 - 9
  / %x41-57             ; A - W
  / %x59-5A             ; Y - Z
  / %x61-77             ; a - w
  / %x79-7A             ; y - z
 */

var singleton = '(\\d|[A-W]|[Y-Z]|[a-w]|[y-z])';
/*
  = singleton 1*("-" (2*8alphanum))
                        ; Single alphanumerics
                        ; "x" reserved for private use
 */

var extension = "(".concat(singleton, "(-[A-Za-z0-9]{2,8})+)");
/*
  = "x" 1*("-" (1*8alphanum))
 */

var privateuse = '(x(-[A-Za-z0-9]{1,8})+)'; // irregular tags do not match the 'langtag' production and would not
// otherwise be considered 'well-formed'. These tags are all valid, but
// most are deprecated in favor of more modern subtags or subtag combination

var irregular = '((en-GB-oed)|(i-ami)|(i-bnn)|(i-default)|(i-enochian)|' + '(i-hak)|(i-klingon)|(i-lux)|(i-mingo)|(i-navajo)|(i-pwn)|(i-tao)|' + '(i-tay)|(i-tsu)|(sgn-BE-FR)|(sgn-BE-NL)|(sgn-CH-DE))'; // regular tags match the 'langtag' production, but their subtags are not
// extended language or variant subtags: their meaning is defined by
// their registration and all of these are deprecated in favor of a more
// modern subtag or sequence of subtags

var regular = '((art-lojban)|(cel-gaulish)|(no-bok)|(no-nyn)|(zh-guoyu)|' + '(zh-hakka)|(zh-min)|(zh-min-nan)|(zh-xiang))';
/*
  = irregular           ; non-redundant tags registered
  / regular             ; during the RFC 3066 era

 */

var grandfathered = "(".concat(irregular, "|").concat(regular, ")");
/*
  RFC 5646 defines delimitation of subtags via a hyphen:

      "Subtag" refers to a specific section of a tag, delimited by a
      hyphen, such as the subtags 'zh', 'Hant', and 'CN' in the tag "zh-
      Hant-CN".  Examples of subtags in this document are enclosed in
      single quotes ('Hant')

  However, we need to add "_" to maintain the existing behaviour.
 */

var delimiter = '(-|_)';
/*
  = language
    ["-" script]
    ["-" region]
    *("-" variant)
    *("-" extension)
    ["-" privateuse]
 */

var langtag = "".concat(language, "(").concat(delimiter).concat(script, ")?(").concat(delimiter).concat(region, ")?(").concat(delimiter).concat(variant, ")*(").concat(delimiter).concat(extension, ")*(").concat(delimiter).concat(privateuse, ")?");
/*
  Regex implementation based on BCP RFC 5646
  Tags for Identifying Languages
  https://www.rfc-editor.org/rfc/rfc5646.html
 */

var languageTagRegex = new RegExp("(^".concat(privateuse, "$)|(^").concat(grandfathered, "$)|(^").concat(langtag, "$)"));

function isLocale(str) {
  (0, _assertString.default)(str);
  return languageTagRegex.test(str);
}

module.exports = exports.default;
module.exports.default = exports.default;