Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[APITEST-766] Added Packages to Collection Schema #1352

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/collection/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ _.assign(Script.prototype, /** @lends Script.prototype */ {
* @type {string}
*/
this.type = options.type || 'text/javascript';

/**
* @arguments {Script.prototype}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo?

Suggested change
* @arguments {Script.prototype}
* @augments {Script.prototype}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we even need this JSDoc tag? 🤔

* @type {Array<Object>}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would provide more info about the interface:

Suggested change
* @type {Array<Object>}
* @type {Array<{ id: string, name: string }>}

*/
this.packages = options.packages || [];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: newline after this.

_.has(options, 'src') && (

/**
Expand Down
3 changes: 3 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2158,15 +2158,18 @@ declare module "postman-collection" {
* @param [options.type] - Script type
* @param [options.src] - Script source url
* @param [options.exec] - Script to execute
* @param [options.packages] - List of packages to be preloaded
*/
update(options?: {
type?: string;
src?: string;
exec?: string[] | string;
packages?: Object[];
}): void;
type: string;
src: Url;
exec: string[];
packages: Object[];
/**
* Check whether an object is an instance of ItemGroup.
* @param obj - -
Expand Down
Loading