@@ -1055,7 +1055,7 @@ function stringToBytes(str) {
10551055}
10561056
10571057var DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8' ;
1058- var URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8' ;
1058+ var URL$1 = '6ba7b811-9dad-11d1-80b4-00c04fd430c8' ;
10591059function v35 ( name , version , hashfunc ) {
10601060 function generateUUID ( value , namespace , buf , offset ) {
10611061 if ( typeof value === 'string' ) {
@@ -1100,7 +1100,7 @@ function v35 (name, version, hashfunc) {
11001100
11011101
11021102 generateUUID . DNS = DNS ;
1103- generateUUID . URL = URL ;
1103+ generateUUID . URL = URL$1 ;
11041104 return generateUUID ;
11051105}
11061106
@@ -2789,7 +2789,7 @@ function encode(val) {
27892789 *
27902790 * @param {string } url The base of the url (e.g., http://www.google.com)
27912791 * @param {object } [params] The params to be appended
2792- * @param {?object } options
2792+ * @param {?( object|Function) } options
27932793 *
27942794 * @returns {string } The formatted url
27952795 */
@@ -2801,6 +2801,12 @@ function buildURL(url, params, options) {
28012801
28022802 const _encode = options && options . encode || encode ;
28032803
2804+ if ( utils$1 . isFunction ( options ) ) {
2805+ options = {
2806+ serialize : options
2807+ } ;
2808+ }
2809+
28042810 const serializeFn = options && options . serialize ;
28052811
28062812 let serializedParams ;
@@ -3789,68 +3795,18 @@ const progressEventDecorator = (total, throttled) => {
37893795
37903796const asyncDecorator = ( fn ) => ( ...args ) => utils$1 . asap ( ( ) => fn ( ...args ) ) ;
37913797
3792- var isURLSameOrigin = platform . hasStandardBrowserEnv ?
3793-
3794- // Standard browser envs have full support of the APIs needed to test
3795- // whether the request URL is of the same origin as current location.
3796- ( function standardBrowserEnv ( ) {
3797- const msie = platform . navigator && / ( m s i e | t r i d e n t ) / i. test ( platform . navigator . userAgent ) ;
3798- const urlParsingNode = document . createElement ( 'a' ) ;
3799- let originURL ;
3800-
3801- /**
3802- * Parse a URL to discover its components
3803- *
3804- * @param {String } url The URL to be parsed
3805- * @returns {Object }
3806- */
3807- function resolveURL ( url ) {
3808- let href = url ;
3809-
3810- if ( msie ) {
3811- // IE needs attribute set twice to normalize properties
3812- urlParsingNode . setAttribute ( 'href' , href ) ;
3813- href = urlParsingNode . href ;
3814- }
3815-
3816- urlParsingNode . setAttribute ( 'href' , href ) ;
3817-
3818- // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
3819- return {
3820- href : urlParsingNode . href ,
3821- protocol : urlParsingNode . protocol ? urlParsingNode . protocol . replace ( / : $ / , '' ) : '' ,
3822- host : urlParsingNode . host ,
3823- search : urlParsingNode . search ? urlParsingNode . search . replace ( / ^ \? / , '' ) : '' ,
3824- hash : urlParsingNode . hash ? urlParsingNode . hash . replace ( / ^ # / , '' ) : '' ,
3825- hostname : urlParsingNode . hostname ,
3826- port : urlParsingNode . port ,
3827- pathname : ( urlParsingNode . pathname . charAt ( 0 ) === '/' ) ?
3828- urlParsingNode . pathname :
3829- '/' + urlParsingNode . pathname
3830- } ;
3831- }
3832-
3833- originURL = resolveURL ( window . location . href ) ;
3798+ var isURLSameOrigin = platform . hasStandardBrowserEnv ? ( ( origin , isMSIE ) => ( url ) => {
3799+ url = new URL ( url , platform . origin ) ;
38343800
3835- /**
3836- * Determine if a URL shares the same origin as the current location
3837- *
3838- * @param {String } requestURL The URL to test
3839- * @returns {boolean } True if URL shares the same origin, otherwise false
3840- */
3841- return function isURLSameOrigin ( requestURL ) {
3842- const parsed = ( utils$1 . isString ( requestURL ) ) ? resolveURL ( requestURL ) : requestURL ;
3843- return ( parsed . protocol === originURL . protocol &&
3844- parsed . host === originURL . host ) ;
3845- } ;
3846- } ) ( ) :
3847-
3848- // Non standard browser envs (web workers, react-native) lack needed support.
3849- ( function nonStandardBrowserEnv ( ) {
3850- return function isURLSameOrigin ( ) {
3851- return true ;
3852- } ;
3853- } ) ( ) ;
3801+ return (
3802+ origin . protocol === url . protocol &&
3803+ origin . host === url . host &&
3804+ ( isMSIE || origin . port === url . port )
3805+ ) ;
3806+ } ) (
3807+ new URL ( platform . origin ) ,
3808+ platform . navigator && / ( m s i e | t r i d e n t ) / i. test ( platform . navigator . userAgent )
3809+ ) : ( ) => true ;
38543810
38553811var cookies = platform . hasStandardBrowserEnv ?
38563812
@@ -3952,7 +3908,7 @@ function mergeConfig(config1, config2) {
39523908 config2 = config2 || { } ;
39533909 const config = { } ;
39543910
3955- function getMergedValue ( target , source , caseless ) {
3911+ function getMergedValue ( target , source , prop , caseless ) {
39563912 if ( utils$1 . isPlainObject ( target ) && utils$1 . isPlainObject ( source ) ) {
39573913 return utils$1 . merge . call ( { caseless} , target , source ) ;
39583914 } else if ( utils$1 . isPlainObject ( source ) ) {
@@ -3964,11 +3920,11 @@ function mergeConfig(config1, config2) {
39643920 }
39653921
39663922 // eslint-disable-next-line consistent-return
3967- function mergeDeepProperties ( a , b , caseless ) {
3923+ function mergeDeepProperties ( a , b , prop , caseless ) {
39683924 if ( ! utils$1 . isUndefined ( b ) ) {
3969- return getMergedValue ( a , b , caseless ) ;
3925+ return getMergedValue ( a , b , prop , caseless ) ;
39703926 } else if ( ! utils$1 . isUndefined ( a ) ) {
3971- return getMergedValue ( undefined , a , caseless ) ;
3927+ return getMergedValue ( undefined , a , prop , caseless ) ;
39723928 }
39733929 }
39743930
@@ -4026,7 +3982,7 @@ function mergeConfig(config1, config2) {
40263982 socketPath : defaultToConfig2 ,
40273983 responseEncoding : defaultToConfig2 ,
40283984 validateStatus : mergeDirectKeys ,
4029- headers : ( a , b ) => mergeDeepProperties ( headersToObject ( a ) , headersToObject ( b ) , true )
3985+ headers : ( a , b , prop ) => mergeDeepProperties ( headersToObject ( a ) , headersToObject ( b ) , prop , true )
40303986 } ;
40313987
40323988 utils$1 . forEach ( Object . keys ( Object . assign ( { } , config1 , config2 ) ) , function computeConfigValue ( prop ) {
@@ -4770,7 +4726,7 @@ function dispatchRequest(config) {
47704726 } ) ;
47714727}
47724728
4773- const VERSION = "1.7.7 " ;
4729+ const VERSION = "1.7.9 " ;
47744730
47754731const validators$1 = { } ;
47764732
@@ -4821,6 +4777,14 @@ validators$1.transitional = function transitional(validator, version, message) {
48214777 } ;
48224778} ;
48234779
4780+ validators$1 . spelling = function spelling ( correctSpelling ) {
4781+ return ( value , opt ) => {
4782+ // eslint-disable-next-line no-console
4783+ console . warn ( `${ opt } is likely a misspelling of ${ correctSpelling } ` ) ;
4784+ return true ;
4785+ }
4786+ } ;
4787+
48244788/**
48254789 * Assert object's properties type
48264790 *
@@ -4890,9 +4854,9 @@ class Axios {
48904854 return await this . _request ( configOrUrl , config ) ;
48914855 } catch ( err ) {
48924856 if ( err instanceof Error ) {
4893- let dummy ;
4857+ let dummy = { } ;
48944858
4895- Error . captureStackTrace ? Error . captureStackTrace ( dummy = { } ) : ( dummy = new Error ( ) ) ;
4859+ Error . captureStackTrace ? Error . captureStackTrace ( dummy ) : ( dummy = new Error ( ) ) ;
48964860
48974861 // slice off the Error: ... line
48984862 const stack = dummy . stack ? dummy . stack . replace ( / ^ .+ \n / , '' ) : '' ;
@@ -4947,6 +4911,11 @@ class Axios {
49474911 }
49484912 }
49494913
4914+ validator . assertOptions ( config , {
4915+ baseUrl : validators . spelling ( 'baseURL' ) ,
4916+ withXsrfToken : validators . spelling ( 'withXSRFToken' )
4917+ } , true ) ;
4918+
49504919 // Set config.method
49514920 config . method = ( config . method || this . defaults . method || 'get' ) . toLowerCase ( ) ;
49524921
@@ -6045,13 +6014,14 @@ function rdbClient(options = {}) {
60456014 if ( ! db . createTransaction )
60466015 throw new Error ( 'Transaction not supported through http' ) ;
60476016 const transaction = db . createTransaction ( _options ) ;
6017+
60486018 try {
60496019 const nextClient = client ( { transaction } ) ;
60506020 await fn ( nextClient ) ;
6051- await transaction ( db . commit ) ;
6021+ await transaction ( transaction . commit ) ;
60526022 }
60536023 catch ( e ) {
6054- await transaction ( db . rollback . bind ( null , e ) ) ;
6024+ await transaction ( transaction . rollback . bind ( null , e ) ) ;
60556025 }
60566026 }
60576027
0 commit comments