Fix JSDoc comment security vulnerability: escape only necessary */ sequences #1368
Annotations
2 errors
|
Run yarn test
Process completed with exit code 1.
|
|
Run yarn test:
tests/spec/jsdoc-escaping/basic.test.ts#L43
Error: Snapshot `jsdoc-escaping > should escape JSDoc comment characters in descriptions 1` mismatched
- Expected
+ Received
@@ -144,23 +144,28 @@
: input,
[ContentType.Text]: (input: any) =>
input !== null && typeof input !== "string"
? JSON.stringify(input)
: input,
- [ContentType.FormData]: (input: any) =>
- Object.keys(input || {}).reduce((formData, key) => {
+ [ContentType.FormData]: (input: any) => {
+ if (input instanceof FormData) {
+ return input;
+ }
+
+ return Object.keys(input || {}).reduce((formData, key) => {
const property = input[key];
formData.append(
key,
property instanceof Blob
? property
: typeof property === "object" && property !== null
? JSON.stringify(property)
: `${property}`,
);
return formData;
- }, new FormData()),
+ }, new FormData());
+ },
[ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),
};
protected mergeRequestParams(
params1: RequestParams,
❯ tests/spec/jsdoc-escaping/basic.test.ts:43:21
|
Loading