-
-
Notifications
You must be signed in to change notification settings - Fork 37
utils.js
-
isProcessEnv() ⇒
boolean
-
Similar to
isStandardBrowserEnv
, just check it's running in a Node environment -
isProcessFormData(val) ⇒
boolean
-
Determine if a value is a
form-data
node module -
userAgent() ⇒
string
-
Compose the
User-Agent
content -
implicityReturnValues(message, response) ⇒
AssertionError
-
Customize an
AssertionError
with the originaldata
, minimum implementated theAxiosResponse
stucture.Note here: It's not a good idea that thrown the
AssertionError
fromaxios.transformData
forEach
stack. The fulfilledAxiosResponse
is{ status, statusText, headers, config, request }
, here can only touched thedata
andheaders
, postpone onto next major version to re-design.
Similar to isStandardBrowserEnv
, just check it's running in a Node environment
Kind: global function
Returns: boolean
- Ture on Node, otherwise false
Determine if a value is a form-data
node module
Kind: global function
Returns: boolean
- True if value is a form-data
module, otherwise false
See
Param | Type | Description |
---|---|---|
val | Object |
To test value |
Compose the User-Agent
content
Kind: global function
Returns: string
- - The User-Agent
value
Customize an AssertionError
with the original data
, minimum implementated the AxiosResponse
stucture.
Note here: It's not a good idea that thrown the AssertionError
from axios.transformData
forEach
stack.
The fulfilled AxiosResponse
is { status, statusText, headers, config, request }
,
here can only touched the data
and headers
, postpone onto next major version to re-design.
Kind: global function
Returns: AssertionError
- - The customized AssertionError
Param | Type | Description |
---|---|---|
message | string |
The message |
response |
string | object | any
|
the response |
...params |
Array.<string> | Array.<int>
|
the params |