cdk-common 2.0.1102 → 2.0.1104
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.
- package/.jsii +44 -2
- package/API.md +42 -0
- package/lib/main.js +1 -1
- package/lib/managed-policies.d.ts +8 -1
- package/lib/managed-policies.js +8 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/assert.d.ts +2 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/module.d.ts +7 -0
- package/node_modules/@types/concat-stream/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/concat-stream/node_modules/@types/node/stream.d.ts +6 -1
- package/node_modules/@types/concat-stream/node_modules/@types/node/test.d.ts +40 -133
- package/node_modules/@types/concat-stream/node_modules/@types/node/vm.d.ts +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/form-data/node_modules/@types/node/assert.d.ts +2 -0
- package/node_modules/@types/form-data/node_modules/@types/node/module.d.ts +7 -0
- package/node_modules/@types/form-data/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/form-data/node_modules/@types/node/stream.d.ts +6 -1
- package/node_modules/@types/form-data/node_modules/@types/node/test.d.ts +40 -133
- package/node_modules/@types/form-data/node_modules/@types/node/vm.d.ts +1 -1
- package/node_modules/es-set-tostringtag/.eslintrc +13 -0
- package/node_modules/es-set-tostringtag/.nycrc +9 -0
- package/node_modules/es-set-tostringtag/CHANGELOG.md +67 -0
- package/node_modules/es-set-tostringtag/LICENSE +21 -0
- package/node_modules/es-set-tostringtag/README.md +53 -0
- package/node_modules/es-set-tostringtag/index.d.ts +10 -0
- package/node_modules/es-set-tostringtag/index.js +35 -0
- package/node_modules/es-set-tostringtag/package.json +78 -0
- package/node_modules/es-set-tostringtag/test/index.js +85 -0
- package/node_modules/es-set-tostringtag/tsconfig.json +9 -0
- package/node_modules/form-data/lib/form_data.js +23 -21
- package/node_modules/form-data/package.json +18 -15
- package/node_modules/has-tostringtag/.eslintrc +5 -0
- package/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
- package/node_modules/has-tostringtag/.nycrc +13 -0
- package/node_modules/has-tostringtag/CHANGELOG.md +42 -0
- package/node_modules/has-tostringtag/LICENSE +21 -0
- package/node_modules/has-tostringtag/README.md +46 -0
- package/node_modules/has-tostringtag/index.d.ts +3 -0
- package/node_modules/has-tostringtag/index.js +8 -0
- package/node_modules/has-tostringtag/package.json +108 -0
- package/node_modules/has-tostringtag/shams.d.ts +3 -0
- package/node_modules/has-tostringtag/shams.js +8 -0
- package/node_modules/has-tostringtag/test/index.js +21 -0
- package/node_modules/has-tostringtag/test/shams/core-js.js +31 -0
- package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +30 -0
- package/node_modules/has-tostringtag/test/tests.js +15 -0
- package/node_modules/has-tostringtag/tsconfig.json +49 -0
- package/package.json +2 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 ECMAScript Shims
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# es-set-tostringtag <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
|
2
|
+
|
|
3
|
+
[![github actions][actions-image]][actions-url]
|
|
4
|
+
[![coverage][codecov-image]][codecov-url]
|
|
5
|
+
[![License][license-image]][license-url]
|
|
6
|
+
[![Downloads][downloads-image]][downloads-url]
|
|
7
|
+
|
|
8
|
+
[![npm badge][npm-badge-png]][package-url]
|
|
9
|
+
|
|
10
|
+
A helper to optimistically set Symbol.toStringTag, when possible.
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
Most common usage:
|
|
14
|
+
```js
|
|
15
|
+
var assert = require('assert');
|
|
16
|
+
var setToStringTag = require('es-set-tostringtag');
|
|
17
|
+
|
|
18
|
+
var obj = {};
|
|
19
|
+
|
|
20
|
+
assert.equal(Object.prototype.toString.call(obj), '[object Object]');
|
|
21
|
+
|
|
22
|
+
setToStringTag(obj, 'tagged!');
|
|
23
|
+
|
|
24
|
+
assert.equal(Object.prototype.toString.call(obj), '[object tagged!]');
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Options
|
|
28
|
+
An optional options argument can be provided as the third argument. The available options are:
|
|
29
|
+
|
|
30
|
+
### `force`
|
|
31
|
+
If the `force` option is set to `true`, the toStringTag will be set even if it is already set.
|
|
32
|
+
|
|
33
|
+
### `nonConfigurable`
|
|
34
|
+
If the `nonConfigurable` option is set to `true`, the toStringTag will be defined as non-configurable when possible.
|
|
35
|
+
|
|
36
|
+
## Tests
|
|
37
|
+
Simply clone the repo, `npm install`, and run `npm test`
|
|
38
|
+
|
|
39
|
+
[package-url]: https://npmjs.com/package/es-set-tostringtag
|
|
40
|
+
[npm-version-svg]: https://versionbadg.es/es-shims/es-set-tostringtag.svg
|
|
41
|
+
[deps-svg]: https://david-dm.org/es-shims/es-set-tostringtag.svg
|
|
42
|
+
[deps-url]: https://david-dm.org/es-shims/es-set-tostringtag
|
|
43
|
+
[dev-deps-svg]: https://david-dm.org/es-shims/es-set-tostringtag/dev-status.svg
|
|
44
|
+
[dev-deps-url]: https://david-dm.org/es-shims/es-set-tostringtag#info=devDependencies
|
|
45
|
+
[npm-badge-png]: https://nodei.co/npm/es-set-tostringtag.png?downloads=true&stars=true
|
|
46
|
+
[license-image]: https://img.shields.io/npm/l/es-set-tostringtag.svg
|
|
47
|
+
[license-url]: LICENSE
|
|
48
|
+
[downloads-image]: https://img.shields.io/npm/dm/es-set-tostringtag.svg
|
|
49
|
+
[downloads-url]: https://npm-stat.com/charts.html?package=es-set-tostringtag
|
|
50
|
+
[codecov-image]: https://codecov.io/gh/es-shims/es-set-tostringtag/branch/main/graphs/badge.svg
|
|
51
|
+
[codecov-url]: https://app.codecov.io/gh/es-shims/es-set-tostringtag/
|
|
52
|
+
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/es-set-tostringtag
|
|
53
|
+
[actions-url]: https://github.com/es-shims/es-set-tostringtag/actions
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var GetIntrinsic = require('get-intrinsic');
|
|
4
|
+
|
|
5
|
+
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
|
6
|
+
|
|
7
|
+
var hasToStringTag = require('has-tostringtag/shams')();
|
|
8
|
+
var hasOwn = require('hasown');
|
|
9
|
+
var $TypeError = require('es-errors/type');
|
|
10
|
+
|
|
11
|
+
var toStringTag = hasToStringTag ? Symbol.toStringTag : null;
|
|
12
|
+
|
|
13
|
+
/** @type {import('.')} */
|
|
14
|
+
module.exports = function setToStringTag(object, value) {
|
|
15
|
+
var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force;
|
|
16
|
+
var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable;
|
|
17
|
+
if (
|
|
18
|
+
(typeof overrideIfSet !== 'undefined' && typeof overrideIfSet !== 'boolean')
|
|
19
|
+
|| (typeof nonConfigurable !== 'undefined' && typeof nonConfigurable !== 'boolean')
|
|
20
|
+
) {
|
|
21
|
+
throw new $TypeError('if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans');
|
|
22
|
+
}
|
|
23
|
+
if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) {
|
|
24
|
+
if ($defineProperty) {
|
|
25
|
+
$defineProperty(object, toStringTag, {
|
|
26
|
+
configurable: !nonConfigurable,
|
|
27
|
+
enumerable: false,
|
|
28
|
+
value: value,
|
|
29
|
+
writable: false
|
|
30
|
+
});
|
|
31
|
+
} else {
|
|
32
|
+
object[toStringTag] = value; // eslint-disable-line no-param-reassign
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "es-set-tostringtag",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "A helper to optimistically set Symbol.toStringTag, when possible.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./index.js",
|
|
8
|
+
"./package.json": "./package.json"
|
|
9
|
+
},
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"scripts": {
|
|
12
|
+
"prepack": "npmignore --auto --commentLines=autogenerated",
|
|
13
|
+
"prepublishOnly": "safe-publish-latest",
|
|
14
|
+
"prepublish": "not-in-publish || npm run prepublishOnly",
|
|
15
|
+
"prelint": "evalmd README.md",
|
|
16
|
+
"lint": "eslint --ext=js,mjs .",
|
|
17
|
+
"postlint": "tsc -p . && attw -P",
|
|
18
|
+
"pretest": "npm run lint",
|
|
19
|
+
"tests-only": "nyc tape 'test/**/*.js'",
|
|
20
|
+
"test": "npm run tests-only",
|
|
21
|
+
"posttest": "npx npm@\">= 10.2\" audit --production",
|
|
22
|
+
"version": "auto-changelog && git add CHANGELOG.md",
|
|
23
|
+
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/es-shims/es-set-tostringtag.git"
|
|
28
|
+
},
|
|
29
|
+
"author": "Jordan Harband <ljharb@gmail.com>",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/es-shims/es-set-tostringtag/issues"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/es-shims/es-set-tostringtag#readme",
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@arethetypeswrong/cli": "^0.17.2",
|
|
37
|
+
"@ljharb/eslint-config": "^21.1.1",
|
|
38
|
+
"@ljharb/tsconfig": "^0.2.3",
|
|
39
|
+
"@types/get-intrinsic": "^1.2.3",
|
|
40
|
+
"@types/has-symbols": "^1.0.2",
|
|
41
|
+
"@types/tape": "^5.8.0",
|
|
42
|
+
"auto-changelog": "^2.5.0",
|
|
43
|
+
"encoding": "^0.1.13",
|
|
44
|
+
"eslint": "=8.8.0",
|
|
45
|
+
"evalmd": "^0.0.19",
|
|
46
|
+
"in-publish": "^2.0.1",
|
|
47
|
+
"npmignore": "^0.3.1",
|
|
48
|
+
"nyc": "^10.3.2",
|
|
49
|
+
"safe-publish-latest": "^2.0.0",
|
|
50
|
+
"tape": "^5.9.0",
|
|
51
|
+
"typescript": "next"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"es-errors": "^1.3.0",
|
|
55
|
+
"get-intrinsic": "^1.2.6",
|
|
56
|
+
"has-tostringtag": "^1.0.2",
|
|
57
|
+
"hasown": "^2.0.2"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">= 0.4"
|
|
61
|
+
},
|
|
62
|
+
"auto-changelog": {
|
|
63
|
+
"output": "CHANGELOG.md",
|
|
64
|
+
"template": "keepachangelog",
|
|
65
|
+
"unreleased": false,
|
|
66
|
+
"commitLimit": false,
|
|
67
|
+
"backfillLimit": false,
|
|
68
|
+
"hideCredit": true
|
|
69
|
+
},
|
|
70
|
+
"testling": {
|
|
71
|
+
"files": "./test/index.js"
|
|
72
|
+
},
|
|
73
|
+
"publishConfig": {
|
|
74
|
+
"ignore": [
|
|
75
|
+
".github/workflows"
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var test = require('tape');
|
|
4
|
+
var hasToStringTag = require('has-tostringtag/shams')();
|
|
5
|
+
var hasOwn = require('hasown');
|
|
6
|
+
|
|
7
|
+
var setToStringTag = require('../');
|
|
8
|
+
|
|
9
|
+
test('setToStringTag', function (t) {
|
|
10
|
+
t.equal(typeof setToStringTag, 'function', 'is a function');
|
|
11
|
+
|
|
12
|
+
/** @type {{ [Symbol.toStringTag]?: typeof sentinel }} */
|
|
13
|
+
var obj = {};
|
|
14
|
+
var sentinel = {};
|
|
15
|
+
|
|
16
|
+
setToStringTag(obj, sentinel);
|
|
17
|
+
|
|
18
|
+
t['throws'](
|
|
19
|
+
// @ts-expect-error
|
|
20
|
+
function () { setToStringTag(obj, sentinel, { force: 'yes' }); },
|
|
21
|
+
TypeError,
|
|
22
|
+
'throws if options is not an object'
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
t.test('has Symbol.toStringTag', { skip: !hasToStringTag }, function (st) {
|
|
26
|
+
st.ok(hasOwn(obj, Symbol.toStringTag), 'has toStringTag property');
|
|
27
|
+
|
|
28
|
+
st.equal(obj[Symbol.toStringTag], sentinel, 'toStringTag property is as expected');
|
|
29
|
+
|
|
30
|
+
st.equal(String(obj), '[object Object]', 'toStringTag works');
|
|
31
|
+
|
|
32
|
+
/** @type {{ [Symbol.toStringTag]?: string }} */
|
|
33
|
+
var tagged = {};
|
|
34
|
+
tagged[Symbol.toStringTag] = 'already tagged';
|
|
35
|
+
st.equal(String(tagged), '[object already tagged]', 'toStringTag works');
|
|
36
|
+
|
|
37
|
+
setToStringTag(tagged, 'new tag');
|
|
38
|
+
st.equal(String(tagged), '[object already tagged]', 'toStringTag is unchanged');
|
|
39
|
+
|
|
40
|
+
setToStringTag(tagged, 'new tag', { force: true });
|
|
41
|
+
st.equal(String(tagged), '[object new tag]', 'toStringTag is changed with force: true');
|
|
42
|
+
|
|
43
|
+
st.deepEqual(
|
|
44
|
+
Object.getOwnPropertyDescriptor(tagged, Symbol.toStringTag),
|
|
45
|
+
{
|
|
46
|
+
configurable: true,
|
|
47
|
+
enumerable: false,
|
|
48
|
+
value: 'new tag',
|
|
49
|
+
writable: false
|
|
50
|
+
},
|
|
51
|
+
'has expected property descriptor'
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
setToStringTag(tagged, 'new tag', { force: true, nonConfigurable: true });
|
|
55
|
+
st.deepEqual(
|
|
56
|
+
Object.getOwnPropertyDescriptor(tagged, Symbol.toStringTag),
|
|
57
|
+
{
|
|
58
|
+
configurable: false,
|
|
59
|
+
enumerable: false,
|
|
60
|
+
value: 'new tag',
|
|
61
|
+
writable: false
|
|
62
|
+
},
|
|
63
|
+
'is nonconfigurable'
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
st.end();
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
t.test('does not have Symbol.toStringTag', { skip: hasToStringTag }, function (st) {
|
|
70
|
+
var passed = true;
|
|
71
|
+
for (var key in obj) { // eslint-disable-line no-restricted-syntax
|
|
72
|
+
if (hasOwn(obj, key)) {
|
|
73
|
+
st.fail('object has own key ' + key);
|
|
74
|
+
passed = false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (passed) {
|
|
78
|
+
st.ok(true, 'object has no enumerable own keys');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
st.end();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
t.end();
|
|
85
|
+
});
|
|
@@ -7,6 +7,7 @@ var parseUrl = require('url').parse;
|
|
|
7
7
|
var fs = require('fs');
|
|
8
8
|
var mime = require('mime-types');
|
|
9
9
|
var asynckit = require('asynckit');
|
|
10
|
+
var setToStringTag = require('es-set-tostringtag');
|
|
10
11
|
var populate = require('./populate.js');
|
|
11
12
|
var Buffer = require('safe-buffer').Buffer; // eslint-disable-line no-shadow
|
|
12
13
|
|
|
@@ -102,7 +103,7 @@ FormData.prototype._trackLength = function(header, value, options) {
|
|
|
102
103
|
FormData.LINE_BREAK.length;
|
|
103
104
|
|
|
104
105
|
// empty or either doesn't have path or not an http response
|
|
105
|
-
if (!value || ( !value.path && !(value.readable &&
|
|
106
|
+
if (!value || ( !value.path && !(value.readable && Object.prototype.hasOwnProperty.call(value, 'httpVersion')) )) {
|
|
106
107
|
return;
|
|
107
108
|
}
|
|
108
109
|
|
|
@@ -113,8 +114,7 @@ FormData.prototype._trackLength = function(header, value, options) {
|
|
|
113
114
|
};
|
|
114
115
|
|
|
115
116
|
FormData.prototype._lengthRetriever = function(value, callback) {
|
|
116
|
-
|
|
117
|
-
if (value.hasOwnProperty('fd')) {
|
|
117
|
+
if (Object.prototype.hasOwnProperty.call(value, 'fd')) {
|
|
118
118
|
|
|
119
119
|
// take read range into a account
|
|
120
120
|
// `end` = Infinity –> read file till the end
|
|
@@ -149,11 +149,11 @@ FormData.prototype._lengthRetriever = function(value, callback) {
|
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
// or http response
|
|
152
|
-
} else if (
|
|
152
|
+
} else if (Object.prototype.hasOwnProperty.call(value, 'httpVersion')) {
|
|
153
153
|
callback(null, +value.headers['content-length']);
|
|
154
154
|
|
|
155
155
|
// or request stream http://github.com/mikeal/request
|
|
156
|
-
} else if (
|
|
156
|
+
} else if (Object.prototype.hasOwnProperty.call(value, 'httpModule')) {
|
|
157
157
|
// wait till response come back
|
|
158
158
|
value.on('response', function(response) {
|
|
159
159
|
value.pause();
|
|
@@ -193,22 +193,23 @@ FormData.prototype._multiPartHeader = function(field, value, options) {
|
|
|
193
193
|
|
|
194
194
|
var header;
|
|
195
195
|
for (var prop in headers) {
|
|
196
|
-
if (
|
|
197
|
-
|
|
196
|
+
if (Object.prototype.hasOwnProperty.call(headers, prop)) {
|
|
197
|
+
header = headers[prop];
|
|
198
198
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
// skip nullish headers.
|
|
200
|
+
if (header == null) {
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
203
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
204
|
+
// convert all headers to arrays.
|
|
205
|
+
if (!Array.isArray(header)) {
|
|
206
|
+
header = [header];
|
|
207
|
+
}
|
|
208
208
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
// add non-empty headers.
|
|
210
|
+
if (header.length) {
|
|
211
|
+
contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
|
|
212
|
+
}
|
|
212
213
|
}
|
|
213
214
|
}
|
|
214
215
|
|
|
@@ -229,7 +230,7 @@ FormData.prototype._getContentDisposition = function(value, options) {
|
|
|
229
230
|
// formidable and the browser add a name property
|
|
230
231
|
// fs- and request- streams have path property
|
|
231
232
|
filename = path.basename(options.filename || value.name || value.path);
|
|
232
|
-
} else if (value.readable &&
|
|
233
|
+
} else if (value.readable && Object.prototype.hasOwnProperty.call(value, 'httpVersion')) {
|
|
233
234
|
// or try http response
|
|
234
235
|
filename = path.basename(value.client._httpMessage.path || '');
|
|
235
236
|
}
|
|
@@ -257,7 +258,7 @@ FormData.prototype._getContentType = function(value, options) {
|
|
|
257
258
|
}
|
|
258
259
|
|
|
259
260
|
// or if it's http-reponse
|
|
260
|
-
if (!contentType && value.readable &&
|
|
261
|
+
if (!contentType && value.readable && Object.prototype.hasOwnProperty.call(value, 'httpVersion')) {
|
|
261
262
|
contentType = value.headers['content-type'];
|
|
262
263
|
}
|
|
263
264
|
|
|
@@ -298,7 +299,7 @@ FormData.prototype.getHeaders = function(userHeaders) {
|
|
|
298
299
|
};
|
|
299
300
|
|
|
300
301
|
for (header in userHeaders) {
|
|
301
|
-
if (
|
|
302
|
+
if (Object.prototype.hasOwnProperty.call(userHeaders, header)) {
|
|
302
303
|
formHeaders[header.toLowerCase()] = userHeaders[header];
|
|
303
304
|
}
|
|
304
305
|
}
|
|
@@ -482,3 +483,4 @@ FormData.prototype._error = function(err) {
|
|
|
482
483
|
FormData.prototype.toString = function () {
|
|
483
484
|
return '[object FormData]';
|
|
484
485
|
};
|
|
486
|
+
setToStringTag(FormData, 'FormData');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "Felix Geisendörfer <felix@debuggable.com> (http://debuggable.com/)",
|
|
3
3
|
"name": "form-data",
|
|
4
4
|
"description": "A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.",
|
|
5
|
-
"version": "2.5.
|
|
5
|
+
"version": "2.5.3",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git://github.com/form-data/form-data.git"
|
|
@@ -42,31 +42,34 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"asynckit": "^0.4.0",
|
|
45
|
-
"combined-stream": "^1.0.
|
|
46
|
-
"
|
|
45
|
+
"combined-stream": "^1.0.8",
|
|
46
|
+
"es-set-tostringtag": "^2.1.0",
|
|
47
|
+
"mime-types": "^2.1.35",
|
|
47
48
|
"safe-buffer": "^5.2.1"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
|
-
"@types/
|
|
51
|
-
"
|
|
51
|
+
"@types/combined-stream": "^1.0.6",
|
|
52
|
+
"@types/mime-types": "^2.1.4",
|
|
53
|
+
"@types/node": "^12.20.55",
|
|
54
|
+
"browserify": "^13.3.0",
|
|
52
55
|
"browserify-istanbul": "^2.0.0",
|
|
53
|
-
"coveralls": "^3.
|
|
56
|
+
"coveralls": "^3.1.1",
|
|
54
57
|
"cross-spawn": "^4.0.2",
|
|
55
|
-
"eslint": "^6.0
|
|
58
|
+
"eslint": "^6.8.0",
|
|
56
59
|
"fake": "^0.2.2",
|
|
57
60
|
"far": "^0.0.7",
|
|
58
|
-
"formidable": "^1.
|
|
59
|
-
"in-publish": "^2.0.
|
|
61
|
+
"formidable": "^1.2.6",
|
|
62
|
+
"in-publish": "^2.0.1",
|
|
60
63
|
"is-node-modern": "^1.0.0",
|
|
61
64
|
"istanbul": "^0.4.5",
|
|
62
65
|
"obake": "^0.1.2",
|
|
63
|
-
"phantomjs-prebuilt": "^2.1.
|
|
64
|
-
"pkgfiles": "^2.3.
|
|
65
|
-
"pre-commit": "^1.
|
|
66
|
-
"request": "
|
|
66
|
+
"phantomjs-prebuilt": "^2.1.16",
|
|
67
|
+
"pkgfiles": "^2.3.2",
|
|
68
|
+
"pre-commit": "^1.2.2",
|
|
69
|
+
"request": "~2.87.0",
|
|
67
70
|
"rimraf": "^2.7.1",
|
|
68
|
-
"tape": "^
|
|
69
|
-
"typescript": "^3.
|
|
71
|
+
"tape": "^5.9.0",
|
|
72
|
+
"typescript": "^3.9.10"
|
|
70
73
|
},
|
|
71
74
|
"license": "MIT"
|
|
72
75
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# These are supported funding model platforms
|
|
2
|
+
|
|
3
|
+
github: [ljharb]
|
|
4
|
+
patreon: # Replace with a single Patreon username
|
|
5
|
+
open_collective: # Replace with a single Open Collective username
|
|
6
|
+
ko_fi: # Replace with a single Ko-fi username
|
|
7
|
+
tidelift: npm/has-tostringtag
|
|
8
|
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
9
|
+
liberapay: # Replace with a single Liberapay username
|
|
10
|
+
issuehunt: # Replace with a single IssueHunt username
|
|
11
|
+
otechie: # Replace with a single Otechie username
|
|
12
|
+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [v1.0.2](https://github.com/inspect-js/has-tostringtag/compare/v1.0.1...v1.0.2) - 2024-02-01
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- [Fix] move `has-symbols` back to prod deps [`#3`](https://github.com/inspect-js/has-tostringtag/issues/3)
|
|
13
|
+
|
|
14
|
+
## [v1.0.1](https://github.com/inspect-js/has-tostringtag/compare/v1.0.0...v1.0.1) - 2024-02-01
|
|
15
|
+
|
|
16
|
+
### Commits
|
|
17
|
+
|
|
18
|
+
- [patch] add types [`9276414`](https://github.com/inspect-js/has-tostringtag/commit/9276414b22fab3eeb234688841722c4be113201f)
|
|
19
|
+
- [meta] use `npmignore` to autogenerate an npmignore file [`5c0dcd1`](https://github.com/inspect-js/has-tostringtag/commit/5c0dcd1ff66419562a30d1fd88b966cc36bce5fc)
|
|
20
|
+
- [actions] reuse common workflows [`dee9509`](https://github.com/inspect-js/has-tostringtag/commit/dee950904ab5719b62cf8d73d2ac950b09093266)
|
|
21
|
+
- [actions] update codecov uploader [`b8cb3a0`](https://github.com/inspect-js/has-tostringtag/commit/b8cb3a0b8ffbb1593012c4c2daa45fb25642825d)
|
|
22
|
+
- [Tests] generate coverage [`be5b288`](https://github.com/inspect-js/has-tostringtag/commit/be5b28889e2735cdbcef387f84c2829995f2f05e)
|
|
23
|
+
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`69a0827`](https://github.com/inspect-js/has-tostringtag/commit/69a0827974e9b877b2c75b70b057555da8f25a65)
|
|
24
|
+
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`4c9e210`](https://github.com/inspect-js/has-tostringtag/commit/4c9e210a5682f0557a3235d36b68ce809d7fb825)
|
|
25
|
+
- [actions] update rebase action to use reusable workflow [`ca8dcd3`](https://github.com/inspect-js/has-tostringtag/commit/ca8dcd3a6f3f5805d7e3fd461b654aedba0946e7)
|
|
26
|
+
- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `npmignore`, `tape` [`07f3eaf`](https://github.com/inspect-js/has-tostringtag/commit/07f3eafa45dd98208c94479737da77f9a69b94c4)
|
|
27
|
+
- [Deps] update `has-symbols` [`999e009`](https://github.com/inspect-js/has-tostringtag/commit/999e0095a7d1749a58f55472ec8bf8108cdfdcf3)
|
|
28
|
+
- [Tests] remove staging tests since they fail on modern node [`9d9526b`](https://github.com/inspect-js/has-tostringtag/commit/9d9526b1dc1ca7f2292b52efda4c3d857b0e39bd)
|
|
29
|
+
|
|
30
|
+
## v1.0.0 - 2021-08-05
|
|
31
|
+
|
|
32
|
+
### Commits
|
|
33
|
+
|
|
34
|
+
- Tests [`6b6f573`](https://github.com/inspect-js/has-tostringtag/commit/6b6f5734dc2058badb300ff0783efdad95fe1a65)
|
|
35
|
+
- Initial commit [`2f8190e`](https://github.com/inspect-js/has-tostringtag/commit/2f8190e799fac32ba9b95a076c0255e01d7ce475)
|
|
36
|
+
- [meta] do not publish github action workflow files [`6e08cc4`](https://github.com/inspect-js/has-tostringtag/commit/6e08cc4e0fea7ec71ef66e70734b2af2c4a8b71b)
|
|
37
|
+
- readme [`94bed6c`](https://github.com/inspect-js/has-tostringtag/commit/94bed6c9560cbbfda034f8d6c260bb7b0db33c1a)
|
|
38
|
+
- npm init [`be67840`](https://github.com/inspect-js/has-tostringtag/commit/be67840ab92ee7adb98bcc65261975543f815fa5)
|
|
39
|
+
- Implementation [`c4914ec`](https://github.com/inspect-js/has-tostringtag/commit/c4914ecc51ddee692c85b471ae0a5d8123030fbf)
|
|
40
|
+
- [meta] use `auto-changelog` [`4aaf768`](https://github.com/inspect-js/has-tostringtag/commit/4aaf76895ae01d7b739f2b19f967ef2372506cd7)
|
|
41
|
+
- Only apps should have lockfiles [`bc4d99e`](https://github.com/inspect-js/has-tostringtag/commit/bc4d99e4bf494afbaa235c5f098df6e642edf724)
|
|
42
|
+
- [meta] add `safe-publish-latest` [`6523c05`](https://github.com/inspect-js/has-tostringtag/commit/6523c05c9b87140f3ae74c9daf91633dd9ff4e1f)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Inspect JS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# has-tostringtag <sup>[![Version Badge][2]][1]</sup>
|
|
2
|
+
|
|
3
|
+
[![github actions][actions-image]][actions-url]
|
|
4
|
+
[![coverage][codecov-image]][codecov-url]
|
|
5
|
+
[![dependency status][5]][6]
|
|
6
|
+
[![dev dependency status][7]][8]
|
|
7
|
+
[![License][license-image]][license-url]
|
|
8
|
+
[![Downloads][downloads-image]][downloads-url]
|
|
9
|
+
|
|
10
|
+
[![npm badge][11]][1]
|
|
11
|
+
|
|
12
|
+
Determine if the JS environment has `Symbol.toStringTag` support. Supports spec, or shams.
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
var hasSymbolToStringTag = require('has-tostringtag');
|
|
18
|
+
|
|
19
|
+
hasSymbolToStringTag() === true; // if the environment has native Symbol.toStringTag support. Not polyfillable, not forgeable.
|
|
20
|
+
|
|
21
|
+
var hasSymbolToStringTagKinda = require('has-tostringtag/shams');
|
|
22
|
+
hasSymbolToStringTagKinda() === true; // if the environment has a Symbol.toStringTag sham that mostly follows the spec.
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Supported Symbol shams
|
|
26
|
+
- get-own-property-symbols [npm](https://www.npmjs.com/package/get-own-property-symbols) | [github](https://github.com/WebReflection/get-own-property-symbols)
|
|
27
|
+
- core-js [npm](https://www.npmjs.com/package/core-js) | [github](https://github.com/zloirock/core-js)
|
|
28
|
+
|
|
29
|
+
## Tests
|
|
30
|
+
Simply clone the repo, `npm install`, and run `npm test`
|
|
31
|
+
|
|
32
|
+
[1]: https://npmjs.org/package/has-tostringtag
|
|
33
|
+
[2]: https://versionbadg.es/inspect-js/has-tostringtag.svg
|
|
34
|
+
[5]: https://david-dm.org/inspect-js/has-tostringtag.svg
|
|
35
|
+
[6]: https://david-dm.org/inspect-js/has-tostringtag
|
|
36
|
+
[7]: https://david-dm.org/inspect-js/has-tostringtag/dev-status.svg
|
|
37
|
+
[8]: https://david-dm.org/inspect-js/has-tostringtag#info=devDependencies
|
|
38
|
+
[11]: https://nodei.co/npm/has-tostringtag.png?downloads=true&stars=true
|
|
39
|
+
[license-image]: https://img.shields.io/npm/l/has-tostringtag.svg
|
|
40
|
+
[license-url]: LICENSE
|
|
41
|
+
[downloads-image]: https://img.shields.io/npm/dm/has-tostringtag.svg
|
|
42
|
+
[downloads-url]: https://npm-stat.com/charts.html?package=has-tostringtag
|
|
43
|
+
[codecov-image]: https://codecov.io/gh/inspect-js/has-tostringtag/branch/main/graphs/badge.svg
|
|
44
|
+
[codecov-url]: https://app.codecov.io/gh/inspect-js/has-tostringtag/
|
|
45
|
+
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-tostringtag
|
|
46
|
+
[actions-url]: https://github.com/inspect-js/has-tostringtag/actions
|