tp-react-elements 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/_virtual/index.esm12.js +2 -2
  2. package/dist/_virtual/index.esm13.js +2 -2
  3. package/dist/_virtual/index.esm14.js +2 -2
  4. package/dist/_virtual/index.esm4.js +2 -2
  5. package/dist/_virtual/index.esm5.js +2 -2
  6. package/dist/_virtual/index.esm6.js +2 -2
  7. package/dist/_virtual/index.esm7.js +2 -2
  8. package/dist/components/DatePicker/index.esm.js +6 -2
  9. package/dist/components/DateRangePicker/DateRangePicker.esm.js +1 -1
  10. package/dist/components/FileUpload/index.esm.js +7 -3
  11. package/dist/components/Form/FormRenderWrapper.esm.js +2 -2
  12. package/dist/components/FormComponents/index.esm.js +2 -2
  13. package/dist/components/TimePicker/index.esm.js +5 -1
  14. package/dist/index.esm.js +6 -6
  15. package/dist/node_modules/axios/lib/adapters/fetch.esm.js +2 -2
  16. package/dist/node_modules/axios/lib/cancel/CanceledError.esm.js +15 -18
  17. package/dist/node_modules/axios/lib/core/Axios.esm.js +11 -2
  18. package/dist/node_modules/axios/lib/core/AxiosError.esm.js +65 -102
  19. package/dist/node_modules/axios/lib/core/InterceptorManager.esm.js +1 -0
  20. package/dist/node_modules/axios/lib/core/mergeConfig.esm.js +22 -9
  21. package/dist/node_modules/axios/lib/defaults/transitional.esm.js +2 -1
  22. package/dist/node_modules/axios/lib/env/data.esm.js +1 -1
  23. package/dist/node_modules/axios/lib/helpers/buildURL.esm.js +7 -10
  24. package/dist/node_modules/axios/lib/helpers/composeSignals.esm.js +1 -1
  25. package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.esm.js +4 -0
  26. package/dist/node_modules/axios/lib/helpers/spread.esm.js +1 -1
  27. package/dist/node_modules/axios/lib/utils.esm.js +198 -117
  28. package/dist/node_modules/date-fns/_lib/defaultLocale.esm.js +2 -2
  29. package/dist/node_modules/date-fns/addDays.esm.js +1 -1
  30. package/dist/node_modules/date-fns/constructFrom.esm.js +1 -1
  31. package/dist/node_modules/date-fns/differenceInCalendarDays.esm.js +1 -1
  32. package/dist/node_modules/date-fns/format.esm.js +1 -1
  33. package/dist/node_modules/date-fns/format.esm2.js +4 -4
  34. package/dist/node_modules/date-fns/getDayOfYear.esm.js +1 -1
  35. package/dist/node_modules/date-fns/getDefaultOptions.esm.js +1 -1
  36. package/dist/node_modules/date-fns/getISODay.esm.js +1 -1
  37. package/dist/node_modules/date-fns/getISOWeek.esm.js +1 -1
  38. package/dist/node_modules/date-fns/getISOWeekYear.esm.js +1 -1
  39. package/dist/node_modules/date-fns/getWeek.esm.js +1 -1
  40. package/dist/node_modules/date-fns/getWeekYear.esm.js +1 -1
  41. package/dist/node_modules/date-fns/index.esm.js +491 -491
  42. package/dist/node_modules/date-fns/isDate.esm.js +1 -1
  43. package/dist/node_modules/date-fns/isValid.esm.js +1 -1
  44. package/dist/node_modules/date-fns/lightFormat.esm.js +3 -3
  45. package/dist/node_modules/date-fns/locale/en-US.esm.js +1 -1
  46. package/dist/node_modules/date-fns/parse.esm.js +1 -1
  47. package/dist/node_modules/date-fns/parse.esm2.js +4 -4
  48. package/dist/node_modules/date-fns/setDay.esm.js +1 -1
  49. package/dist/node_modules/date-fns/setISODay.esm.js +1 -1
  50. package/dist/node_modules/date-fns/setISOWeek.esm.js +1 -1
  51. package/dist/node_modules/date-fns/setWeek.esm.js +1 -1
  52. package/dist/node_modules/date-fns/startOfDay.esm.js +1 -1
  53. package/dist/node_modules/date-fns/startOfISOWeek.esm.js +1 -1
  54. package/dist/node_modules/date-fns/startOfISOWeekYear.esm.js +1 -1
  55. package/dist/node_modules/date-fns/startOfWeek.esm.js +1 -1
  56. package/dist/node_modules/date-fns/startOfWeekYear.esm.js +1 -1
  57. package/dist/node_modules/date-fns/startOfYear.esm.js +1 -1
  58. package/dist/node_modules/date-fns/toDate.esm.js +1 -1
  59. package/dist/node_modules/date-fns/transpose.esm.js +1 -1
  60. package/dist/node_modules/react-date-range/dist/components/Calendar/index.esm.js +1 -1
  61. package/dist/node_modules/react-date-range/dist/components/DateInput/index.esm.js +1 -1
  62. package/dist/node_modules/react-date-range/dist/components/DateRange/index.esm.js +1 -1
  63. package/dist/node_modules/react-date-range/dist/components/DateRangePicker/index.esm.js +1 -1
  64. package/dist/node_modules/react-date-range/dist/components/DefinedRange/index.esm.js +1 -1
  65. package/dist/node_modules/react-date-range/dist/components/InputRangeField/index.esm.js +1 -1
  66. package/dist/node_modules/react-date-range/dist/components/Month/index.esm.js +1 -1
  67. package/dist/node_modules/react-date-range/dist/index.esm.js +9 -9
  68. package/dist/node_modules/react-list/react-list.esm.js +2 -2
  69. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
- var InputRangeField = {};
1
+ var Month = {};
2
2
 
3
- export { InputRangeField as __exports };
3
+ export { Month as __exports };
@@ -1,3 +1,3 @@
1
- var Month = {};
1
+ var DateInput = {};
2
2
 
3
- export { Month as __exports };
3
+ export { DateInput as __exports };
@@ -1,3 +1,3 @@
1
- var DateInput = {};
1
+ var InputRangeField = {};
2
2
 
3
- export { DateInput as __exports };
3
+ export { InputRangeField as __exports };
@@ -1,3 +1,3 @@
1
- var DefinedRange = {};
1
+ var DateRange = {};
2
2
 
3
- export { DefinedRange as __exports };
3
+ export { DateRange as __exports };
@@ -1,3 +1,3 @@
1
- var DateRange = {};
1
+ var Calendar = {};
2
2
 
3
- export { DateRange as __exports };
3
+ export { Calendar as __exports };
@@ -1,3 +1,3 @@
1
- var DateRangePicker = {};
1
+ var DefinedRange = {};
2
2
 
3
- export { DateRangePicker as __exports };
3
+ export { DefinedRange as __exports };
@@ -1,3 +1,3 @@
1
- var Calendar = {};
1
+ var DateRangePicker = {};
2
2
 
3
- export { Calendar as __exports };
3
+ export { DateRangePicker as __exports };
@@ -1,4 +1,8 @@
1
- export { default as DatepickerWrapperV2 } from '../FormComponents/DatePicker/DatepickerWrapperV2.esm.js';
1
+ import DatepickerWrapperV2 from '../FormComponents/DatePicker/DatepickerWrapperV2.esm.js';
2
2
  export { default as MonthPicker } from '../FormComponents/DatePicker/MonthPicker.esm.js';
3
- export { default as Monthpickerrender } from '../FormComponents/DatePicker/Monthpickerrender.esm.js';
3
+ import Monthpickerrender from '../FormComponents/DatePicker/Monthpickerrender.esm.js';
4
4
  export { default as YearPickerField } from '../FormComponents/YearPickerField/YearPickerField.esm.js';
5
+
6
+
7
+
8
+ export { DatepickerWrapperV2, Monthpickerrender };
@@ -6,7 +6,7 @@ import 'dayjs';
6
6
  import { renderLabel } from '../../utils/Constants/FormConstants.esm.js';
7
7
  import FormBottomField from '../FormComponents/FormBottomField/FormBottomField.esm.js';
8
8
  import { Box, TextField, Popover } from '@mui/material';
9
- import { formatDate as format } from '../../node_modules/date-fns/format.esm.js';
9
+ import { format } from '../../node_modules/date-fns/format.esm.js';
10
10
  import { parse } from '../../node_modules/date-fns/parse.esm.js';
11
11
  import { isValid } from '../../node_modules/date-fns/isValid.esm.js';
12
12
 
@@ -1,3 +1,7 @@
1
- export { default as FormRenderFileUpload } from '../FormComponents/FileUpload/FormRenderFileUpload.esm.js';
2
- export { default as FormRenderMultiFileUpload } from '../FormComponents/FileUpload/FormRenderMultiFileUpload.esm.js';
3
- export { default as MultiFileWithPreview } from '../FormComponents/FileUpload/MultiFileWithPreview.esm.js';
1
+ import FormRenderFileUpload from '../FormComponents/FileUpload/FormRenderFileUpload.esm.js';
2
+ import FormRenderMultiFileUpload from '../FormComponents/FileUpload/FormRenderMultiFileUpload.esm.js';
3
+ import MultiFileWithPreview from '../FormComponents/FileUpload/MultiFileWithPreview.esm.js';
4
+
5
+
6
+
7
+ export { FormRenderFileUpload, FormRenderMultiFileUpload, MultiFileWithPreview };
@@ -28,6 +28,6 @@ const FormRenderWrapper = ({ formArray, name = '', numberOfColumns = 3, form, va
28
28
  * Export the FormRenderWrapper component for use in form containers
29
29
  * This component is the main entry point for rendering form fields
30
30
  */
31
- var FormRenderWrapper$1 = React__default.memo(FormRenderWrapper);
31
+ var FormRenderWrapper_default = React__default.memo(FormRenderWrapper);
32
32
 
33
- export { FormRenderWrapper$1 as default };
33
+ export { FormRenderWrapper_default as default };
@@ -32,7 +32,7 @@ import '@mui/icons-material/UploadFile';
32
32
  import '@mui/icons-material/PictureAsPdf';
33
33
  import '@mui/icons-material/TableChart';
34
34
  import '@mui/icons-material/Description';
35
- export { default as RichTextEditor } from './RichTextEditor/RichTextEditor.esm.js';
36
- export { default as RichTextEditorWrapper } from './RichTextEditor/RichTextEditorWrapper.esm.js';
37
35
  export { default as FormErrorField } from './FormErrorField/FormErrorField.esm.js';
38
36
  export { default as HelperText } from './HelperText/HelperText.esm.js';
37
+ export { default as RichTextEditor } from './RichTextEditor/RichTextEditor.esm.js';
38
+ export { default as RichTextEditorWrapper } from './RichTextEditor/RichTextEditorWrapper.esm.js';
@@ -1 +1,5 @@
1
- export { default as TimePicker } from '../FormComponents/TimePicker/TimePicker.esm.js';
1
+ import TimePickerFieldWrapper from '../FormComponents/TimePicker/TimePicker.esm.js';
2
+
3
+
4
+
5
+ export { TimePickerFieldWrapper as TimePicker };
package/dist/index.esm.js CHANGED
@@ -5,10 +5,10 @@ export { default as DeleteField } from './components/DeleteComponent/DeleteField
5
5
  export { default as SessionTimeoutField } from './components/SessionTimeOut/SessionTimeOut.esm.js';
6
6
  export { default as useFormValidatingContext } from './components/Form/FormConstants.esm.js';
7
7
  export { TPElementsProvider } from './auth/authContext.esm.js';
8
- import * as index from './utils/index.esm.js';
9
- export { index as Utils };
10
- import * as index$1 from './validation/index.esm.js';
11
- export { index$1 as ValidationSchemas };
12
- import * as index$2 from './theme/index.esm.js';
13
- export { index$2 as Theme };
8
+ import * as index$1 from './utils/index.esm.js';
9
+ export { index$1 as Utils };
10
+ import * as index$2 from './validation/index.esm.js';
11
+ export { index$2 as ValidationSchemas };
12
+ import * as index from './theme/index.esm.js';
13
+ export { index as Theme };
14
14
  export { calculateTotalArrayValueTotal, checkIsDateIsBefore, findMenuHierarchy, getDesiredDate, getFormattedDate, getInitials, getUsernameFromEmail, handleDownloadReactTableDataExcel, lightenColor } from './utils/Constants/FunctionConstants.esm.js';
@@ -247,14 +247,14 @@ const factory = (env) => {
247
247
 
248
248
  if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
249
249
  throw Object.assign(
250
- new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
250
+ new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request, err && err.response),
251
251
  {
252
252
  cause: err.cause || err
253
253
  }
254
254
  )
255
255
  }
256
256
 
257
- throw AxiosError.from(err, err && err.code, config, request);
257
+ throw AxiosError.from(err, err && err.code, config, request, err && err.response);
258
258
  }
259
259
  }
260
260
  };
@@ -1,23 +1,20 @@
1
1
  import AxiosError from '../core/AxiosError.esm.js';
2
- import utils from '../utils.esm.js';
3
2
 
4
- /**
5
- * A `CanceledError` is an object that is thrown when an operation is canceled.
6
- *
7
- * @param {string=} message The message.
8
- * @param {Object=} config The config.
9
- * @param {Object=} request The request.
10
- *
11
- * @returns {CanceledError} The created error.
12
- */
13
- function CanceledError(message, config, request) {
14
- // eslint-disable-next-line no-eq-null,eqeqeq
15
- AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
16
- this.name = 'CanceledError';
3
+ class CanceledError extends AxiosError {
4
+ /**
5
+ * A `CanceledError` is an object that is thrown when an operation is canceled.
6
+ *
7
+ * @param {string=} message The message.
8
+ * @param {Object=} config The config.
9
+ * @param {Object=} request The request.
10
+ *
11
+ * @returns {CanceledError} The created error.
12
+ */
13
+ constructor(message, config, request) {
14
+ super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
15
+ this.name = 'CanceledError';
16
+ this.__CANCEL__ = true;
17
+ }
17
18
  }
18
19
 
19
- utils.inherits(CanceledError, AxiosError, {
20
- __CANCEL__: true
21
- });
22
-
23
20
  export { CanceledError as default };
@@ -6,6 +6,7 @@ import mergeConfig from './mergeConfig.esm.js';
6
6
  import buildFullPath from './buildFullPath.esm.js';
7
7
  import validator from '../helpers/validator.esm.js';
8
8
  import AxiosHeaders from './AxiosHeaders.esm.js';
9
+ import transitionalDefaults from '../defaults/transitional.esm.js';
9
10
 
10
11
  const validators = validator.validators;
11
12
 
@@ -78,7 +79,8 @@ class Axios {
78
79
  validator.assertOptions(transitional, {
79
80
  silentJSONParsing: validators.transitional(validators.boolean),
80
81
  forcedJSONParsing: validators.transitional(validators.boolean),
81
- clarifyTimeoutError: validators.transitional(validators.boolean)
82
+ clarifyTimeoutError: validators.transitional(validators.boolean),
83
+ legacyInterceptorReqResOrdering: validators.transitional(validators.boolean)
82
84
  }, false);
83
85
  }
84
86
 
@@ -135,7 +137,14 @@ class Axios {
135
137
 
136
138
  synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
137
139
 
138
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
140
+ const transitional = config.transitional || transitionalDefaults;
141
+ const legacyInterceptorReqResOrdering = transitional && transitional.legacyInterceptorReqResOrdering;
142
+
143
+ if (legacyInterceptorReqResOrdering) {
144
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
145
+ } else {
146
+ requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
147
+ }
139
148
  });
140
149
 
141
150
  const responseInterceptorChain = [];
@@ -1,108 +1,71 @@
1
1
  import utils from '../utils.esm.js';
2
2
 
3
- /**
4
- * Create an Error with the specified message, config, error code, request and response.
5
- *
6
- * @param {string} message The error message.
7
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
8
- * @param {Object} [config] The config.
9
- * @param {Object} [request] The request.
10
- * @param {Object} [response] The response.
11
- *
12
- * @returns {Error} The created error.
13
- */
14
- function AxiosError(message, code, config, request, response) {
15
- Error.call(this);
16
-
17
- if (Error.captureStackTrace) {
18
- Error.captureStackTrace(this, this.constructor);
19
- } else {
20
- this.stack = (new Error()).stack;
21
- }
22
-
23
- this.message = message;
24
- this.name = 'AxiosError';
25
- code && (this.code = code);
26
- config && (this.config = config);
27
- request && (this.request = request);
28
- if (response) {
29
- this.response = response;
30
- this.status = response.status ? response.status : null;
31
- }
3
+ class AxiosError extends Error {
4
+ static from(error, code, config, request, response, customProps) {
5
+ const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
6
+ axiosError.cause = error;
7
+ axiosError.name = error.name;
8
+ customProps && Object.assign(axiosError, customProps);
9
+ return axiosError;
10
+ }
11
+
12
+ /**
13
+ * Create an Error with the specified message, config, error code, request and response.
14
+ *
15
+ * @param {string} message The error message.
16
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
17
+ * @param {Object} [config] The config.
18
+ * @param {Object} [request] The request.
19
+ * @param {Object} [response] The response.
20
+ *
21
+ * @returns {Error} The created error.
22
+ */
23
+ constructor(message, code, config, request, response) {
24
+ super(message);
25
+ this.name = 'AxiosError';
26
+ this.isAxiosError = true;
27
+ code && (this.code = code);
28
+ config && (this.config = config);
29
+ request && (this.request = request);
30
+ if (response) {
31
+ this.response = response;
32
+ this.status = response.status;
33
+ }
34
+ }
35
+
36
+ toJSON() {
37
+ return {
38
+ // Standard
39
+ message: this.message,
40
+ name: this.name,
41
+ // Microsoft
42
+ description: this.description,
43
+ number: this.number,
44
+ // Mozilla
45
+ fileName: this.fileName,
46
+ lineNumber: this.lineNumber,
47
+ columnNumber: this.columnNumber,
48
+ stack: this.stack,
49
+ // Axios
50
+ config: utils.toJSONObject(this.config),
51
+ code: this.code,
52
+ status: this.status,
53
+ };
54
+ }
32
55
  }
33
56
 
34
- utils.inherits(AxiosError, Error, {
35
- toJSON: function toJSON() {
36
- return {
37
- // Standard
38
- message: this.message,
39
- name: this.name,
40
- // Microsoft
41
- description: this.description,
42
- number: this.number,
43
- // Mozilla
44
- fileName: this.fileName,
45
- lineNumber: this.lineNumber,
46
- columnNumber: this.columnNumber,
47
- stack: this.stack,
48
- // Axios
49
- config: utils.toJSONObject(this.config),
50
- code: this.code,
51
- status: this.status
52
- };
53
- }
54
- });
55
-
56
- const prototype = AxiosError.prototype;
57
- const descriptors = {};
58
-
59
- [
60
- 'ERR_BAD_OPTION_VALUE',
61
- 'ERR_BAD_OPTION',
62
- 'ECONNABORTED',
63
- 'ETIMEDOUT',
64
- 'ERR_NETWORK',
65
- 'ERR_FR_TOO_MANY_REDIRECTS',
66
- 'ERR_DEPRECATED',
67
- 'ERR_BAD_RESPONSE',
68
- 'ERR_BAD_REQUEST',
69
- 'ERR_CANCELED',
70
- 'ERR_NOT_SUPPORT',
71
- 'ERR_INVALID_URL'
72
- // eslint-disable-next-line func-names
73
- ].forEach(code => {
74
- descriptors[code] = {value: code};
75
- });
76
-
77
- Object.defineProperties(AxiosError, descriptors);
78
- Object.defineProperty(prototype, 'isAxiosError', {value: true});
79
-
80
- // eslint-disable-next-line func-names
81
- AxiosError.from = (error, code, config, request, response, customProps) => {
82
- const axiosError = Object.create(prototype);
83
-
84
- utils.toFlatObject(error, axiosError, function filter(obj) {
85
- return obj !== Error.prototype;
86
- }, prop => {
87
- return prop !== 'isAxiosError';
88
- });
89
-
90
- const msg = error && error.message ? error.message : 'Error';
91
-
92
- // Prefer explicit code; otherwise copy the low-level error's code (e.g. ECONNREFUSED)
93
- const errCode = code == null && error ? error.code : code;
94
- AxiosError.call(axiosError, msg, errCode, config, request, response);
95
-
96
- // Chain the original error on the standard field; non-enumerable to avoid JSON noise
97
- if (error && axiosError.cause == null) {
98
- Object.defineProperty(axiosError, 'cause', { value: error, configurable: true });
99
- }
100
-
101
- axiosError.name = (error && error.name) || 'Error';
102
-
103
- customProps && Object.assign(axiosError, customProps);
104
-
105
- return axiosError;
106
- };
57
+ // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
58
+ AxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
59
+ AxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
60
+ AxiosError.ECONNABORTED = 'ECONNABORTED';
61
+ AxiosError.ETIMEDOUT = 'ETIMEDOUT';
62
+ AxiosError.ERR_NETWORK = 'ERR_NETWORK';
63
+ AxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
64
+ AxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';
65
+ AxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
66
+ AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
67
+ AxiosError.ERR_CANCELED = 'ERR_CANCELED';
68
+ AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
69
+ AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
107
70
 
108
71
  export { AxiosError as default };
@@ -10,6 +10,7 @@ class InterceptorManager {
10
10
  *
11
11
  * @param {Function} fulfilled The function to handle `then` for a `Promise`
12
12
  * @param {Function} rejected The function to handle `reject` for a `Promise`
13
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
13
14
  *
14
15
  * @return {Number} An ID used to remove interceptor later
15
16
  */
@@ -1,7 +1,8 @@
1
1
  import utils from '../utils.esm.js';
2
2
  import AxiosHeaders from './AxiosHeaders.esm.js';
3
3
 
4
- const headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;
4
+ const headersToObject = (thing) =>
5
+ thing instanceof AxiosHeaders ? { ...thing } : thing;
5
6
 
6
7
  /**
7
8
  * Config-specific merge-function which creates a new config-object
@@ -19,7 +20,7 @@ function mergeConfig(config1, config2) {
19
20
 
20
21
  function getMergedValue(target, source, prop, caseless) {
21
22
  if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
22
- return utils.merge.call({caseless}, target, source);
23
+ return utils.merge.call({ caseless }, target, source);
23
24
  } else if (utils.isPlainObject(source)) {
24
25
  return utils.merge({}, source);
25
26
  } else if (utils.isArray(source)) {
@@ -28,7 +29,6 @@ function mergeConfig(config1, config2) {
28
29
  return source;
29
30
  }
30
31
 
31
- // eslint-disable-next-line consistent-return
32
32
  function mergeDeepProperties(a, b, prop, caseless) {
33
33
  if (!utils.isUndefined(b)) {
34
34
  return getMergedValue(a, b, prop, caseless);
@@ -91,14 +91,27 @@ function mergeConfig(config1, config2) {
91
91
  socketPath: defaultToConfig2,
92
92
  responseEncoding: defaultToConfig2,
93
93
  validateStatus: mergeDirectKeys,
94
- headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
94
+ headers: (a, b, prop) =>
95
+ mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
95
96
  };
96
97
 
97
- utils.forEach(Object.keys({...config1, ...config2}), function computeConfigValue(prop) {
98
- const merge = mergeMap[prop] || mergeDeepProperties;
99
- const configValue = merge(config1[prop], config2[prop], prop);
100
- (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
101
- });
98
+ utils.forEach(
99
+ Object.keys({ ...config1, ...config2 }),
100
+ function computeConfigValue(prop) {
101
+ if (
102
+ prop === "__proto__" ||
103
+ prop === "constructor" ||
104
+ prop === "prototype"
105
+ )
106
+ return;
107
+ const merge = utils.hasOwnProp(mergeMap, prop)
108
+ ? mergeMap[prop]
109
+ : mergeDeepProperties;
110
+ const configValue = merge(config1[prop], config2[prop], prop);
111
+ (utils.isUndefined(configValue) && merge !== mergeDirectKeys) ||
112
+ (config[prop] = configValue);
113
+ },
114
+ );
102
115
 
103
116
  return config;
104
117
  }
@@ -1,7 +1,8 @@
1
1
  var transitionalDefaults = {
2
2
  silentJSONParsing: true,
3
3
  forcedJSONParsing: true,
4
- clarifyTimeoutError: false
4
+ clarifyTimeoutError: false,
5
+ legacyInterceptorReqResOrdering: true
5
6
  };
6
7
 
7
8
  export { transitionalDefaults as default };
@@ -1,3 +1,3 @@
1
- const VERSION = "1.13.2";
1
+ const VERSION = "1.13.5";
2
2
 
3
3
  export { VERSION };
@@ -27,29 +27,26 @@ function encode(val) {
27
27
  * @returns {string} The formatted url
28
28
  */
29
29
  function buildURL(url, params, options) {
30
- /*eslint no-param-reassign:0*/
31
30
  if (!params) {
32
31
  return url;
33
32
  }
34
-
33
+
35
34
  const _encode = options && options.encode || encode;
36
35
 
37
- if (utils.isFunction(options)) {
38
- options = {
39
- serialize: options
40
- };
41
- }
36
+ const _options = utils.isFunction(options) ? {
37
+ serialize: options
38
+ } : options;
42
39
 
43
- const serializeFn = options && options.serialize;
40
+ const serializeFn = _options && _options.serialize;
44
41
 
45
42
  let serializedParams;
46
43
 
47
44
  if (serializeFn) {
48
- serializedParams = serializeFn(params, options);
45
+ serializedParams = serializeFn(params, _options);
49
46
  } else {
50
47
  serializedParams = utils.isURLSearchParams(params) ?
51
48
  params.toString() :
52
- new AxiosURLSearchParams(params, options).toString(_encode);
49
+ new AxiosURLSearchParams(params, _options).toString(_encode);
53
50
  }
54
51
 
55
52
  if (serializedParams) {
@@ -21,7 +21,7 @@ const composeSignals = (signals, timeout) => {
21
21
 
22
22
  let timer = timeout && setTimeout(() => {
23
23
  timer = null;
24
- onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT));
24
+ onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
25
25
  }, timeout);
26
26
 
27
27
  const unsubscribe = () => {
@@ -9,6 +9,10 @@ function isAbsoluteURL(url) {
9
9
  // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
10
10
  // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
11
11
  // by any combination of letters, digits, plus, period, or hyphen.
12
+ if (typeof url !== 'string') {
13
+ return false;
14
+ }
15
+
12
16
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
13
17
  }
14
18
 
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * ```js
7
7
  * function f(x, y, z) {}
8
- * var args = [1, 2, 3];
8
+ * const args = [1, 2, 3];
9
9
  * f.apply(null, args);
10
10
  * ```
11
11
  *