Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// HeaderDefinition Tests
const headerDef: pmCollection.HeaderDefinition = {
key: "string",
value: "string"
};
headerDef.key; // $ExpectType string | undefined
headerDef.value; // $ExpectType string | undefined
headerDef.system; // $ExpectType boolean | undefined
// Header Tests
let header = new pmCollection.Header("string");
header = new pmCollection.Header("string", "string");
header = new pmCollection.Header(headerDef);
header.key; // $ExpectType string
header.value; // $ExpectType string
header.toString(); // $ExpectType string
header.update(headerDef); // $ExpectType void
header.valueOf(); // $ExpectType string
pmCollection.Header.create("string"); // $ExpectType Header
pmCollection.Header.create("string", "string"); // $ExpectType Header
pmCollection.Header.create(headerDef, "string"); // $ExpectType Header
pmCollection.Header.isHeader(header); // $ExpectType boolean
fp.toString(); // $ExpectType string
fp.valueOf(); // $ExpectType any
// HeaderDefinition Tests
const headerDef: pmCollection.HeaderDefinition = {
key: "string",
value: "string"
};
headerDef.key; // $ExpectType string | undefined
headerDef.value; // $ExpectType string | undefined
headerDef.system; // $ExpectType boolean | undefined
// Header Tests
let header = new pmCollection.Header("string");
header = new pmCollection.Header("string", "string");
header = new pmCollection.Header(headerDef);
header.key; // $ExpectType string
header.value; // $ExpectType string
header.toString(); // $ExpectType string
header.update(headerDef); // $ExpectType void
header.valueOf(); // $ExpectType string
pmCollection.Header.create("string"); // $ExpectType Header
pmCollection.Header.create("string", "string"); // $ExpectType Header
pmCollection.Header.create(headerDef, "string"); // $ExpectType Header
fp.valueOf(); // $ExpectType any
// HeaderDefinition Tests
const headerDef: pmCollection.HeaderDefinition = {
key: "string",
value: "string"
};
headerDef.key; // $ExpectType string | undefined
headerDef.value; // $ExpectType string | undefined
headerDef.system; // $ExpectType boolean | undefined
// Header Tests
let header = new pmCollection.Header("string");
header = new pmCollection.Header("string", "string");
header = new pmCollection.Header(headerDef);
header.key; // $ExpectType string
header.value; // $ExpectType string
header.toString(); // $ExpectType string
header.update(headerDef); // $ExpectType void
header.valueOf(); // $ExpectType string
pmCollection.Header.create("string"); // $ExpectType Header
pmCollection.Header.create("string", "string"); // $ExpectType Header
pmCollection.Header.create(headerDef, "string"); // $ExpectType Header
pmCollection.Header.isHeader(header); // $ExpectType boolean
}
else {
fakeData = safeSchemaFaker(header.schema || {}, this.components, SCHEMA_FORMATS.DEFAULT);
// for schema.type=string or number,
// adding JSON.stringify will add unnecessary extra double quotes around the value
if (header.schema && (header.schema.type === 'object')) {
fakeData = JSON.stringify(fakeData);
}
}
}
else {
fakeData = '';
}
reqHeader = new sdk.Header({
key: header.name,
value: fakeData
});
reqHeader.description = header.description;
return reqHeader;
},
if (contentObj.hasOwnProperty(cType)) {
bodyType = cType;
break;
}
}
}
bodyData = this.convertToPmBodyData(contentObj[bodyType], bodyType,
BODY_TYPE.REQUEST, this.options.indentCharacter);
updateOptions = {
mode: rDataMode,
raw: JSON.stringify(bodyData, null, 4)
};
contentHeader = new sdk.Header({
key: 'Content-Type',
value: bodyType
});
reqBody.update(updateOptions);
}
return {
body: reqBody,
contentHeader: contentHeader,
formHeaders: formHeaders
};
},