Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

Location:
imaps-frontend/node_modules/axios/lib/helpers
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/axios/lib/helpers/buildURL.js

    rd565449 r0c6b92a  
    2727 * @param {string} url The base of the url (e.g., http://www.google.com)
    2828 * @param {object} [params] The params to be appended
    29  * @param {?object} options
     29 * @param {?(object|Function)} options
    3030 *
    3131 * @returns {string} The formatted url
     
    3838 
    3939  const _encode = options && options.encode || encode;
     40
     41  if (utils.isFunction(options)) {
     42    options = {
     43      serialize: options
     44    };
     45  }
    4046
    4147  const serializeFn = options && options.serialize;
  • imaps-frontend/node_modules/axios/lib/helpers/formDataToStream.js

    rd565449 r0c6b92a  
    1 import {TextEncoder} from 'util';
     1import util from 'util';
    22import {Readable} from 'stream';
    33import utils from "../utils.js";
     
    66const BOUNDARY_ALPHABET = utils.ALPHABET.ALPHA_DIGIT + '-_';
    77
    8 const textEncoder = new TextEncoder();
     8const textEncoder = typeof TextEncoder === 'function' ? new TextEncoder() : new util.TextEncoder();
    99
    1010const CRLF = '\r\n';
  • imaps-frontend/node_modules/axios/lib/helpers/isURLSameOrigin.js

    rd565449 r0c6b92a  
    1 'use strict';
    2 
    3 import utils from './../utils.js';
    41import platform from '../platform/index.js';
    52
    6 export default platform.hasStandardBrowserEnv ?
     3export default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
     4  url = new URL(url, platform.origin);
    75
    8 // Standard browser envs have full support of the APIs needed to test
    9 // whether the request URL is of the same origin as current location.
    10   (function standardBrowserEnv() {
    11     const msie = platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent);
    12     const urlParsingNode = document.createElement('a');
    13     let originURL;
    14 
    15     /**
    16     * Parse a URL to discover its components
    17     *
    18     * @param {String} url The URL to be parsed
    19     * @returns {Object}
    20     */
    21     function resolveURL(url) {
    22       let href = url;
    23 
    24       if (msie) {
    25         // IE needs attribute set twice to normalize properties
    26         urlParsingNode.setAttribute('href', href);
    27         href = urlParsingNode.href;
    28       }
    29 
    30       urlParsingNode.setAttribute('href', href);
    31 
    32       // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
    33       return {
    34         href: urlParsingNode.href,
    35         protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
    36         host: urlParsingNode.host,
    37         search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
    38         hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
    39         hostname: urlParsingNode.hostname,
    40         port: urlParsingNode.port,
    41         pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
    42           urlParsingNode.pathname :
    43           '/' + urlParsingNode.pathname
    44       };
    45     }
    46 
    47     originURL = resolveURL(window.location.href);
    48 
    49     /**
    50     * Determine if a URL shares the same origin as the current location
    51     *
    52     * @param {String} requestURL The URL to test
    53     * @returns {boolean} True if URL shares the same origin, otherwise false
    54     */
    55     return function isURLSameOrigin(requestURL) {
    56       const parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
    57       return (parsed.protocol === originURL.protocol &&
    58           parsed.host === originURL.host);
    59     };
    60   })() :
    61 
    62   // Non standard browser envs (web workers, react-native) lack needed support.
    63   (function nonStandardBrowserEnv() {
    64     return function isURLSameOrigin() {
    65       return true;
    66     };
    67   })();
     6  return (
     7    origin.protocol === url.protocol &&
     8    origin.host === url.host &&
     9    (isMSIE || origin.port === url.port)
     10  );
     11})(
     12  new URL(platform.origin),
     13  platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
     14) : () => true;
  • imaps-frontend/node_modules/axios/lib/helpers/validator.js

    rd565449 r0c6b92a  
    5353};
    5454
     55validators.spelling = function spelling(correctSpelling) {
     56  return (value, opt) => {
     57    // eslint-disable-next-line no-console
     58    console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
     59    return true;
     60  }
     61};
     62
    5563/**
    5664 * Assert object's properties type
Note: See TracChangeset for help on using the changeset viewer.