Skip to content

Commit

Permalink
Merge pull request #17 from DarthHater/master
Browse files Browse the repository at this point in the history
TypeScript: Allow for undefined or null values for optional properties
  • Loading branch information
steven-esser authored Jan 8, 2021
2 parents 61a2540 + e15bd68 commit 66444a4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/package-url.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ declare module "packageurl-js" {
/**
* some name prefix such as a Maven groupid, a Docker image owner, a GitHub user or organization. Optional and type-specific.
*/
namespace: string;
namespace: string | undefined | null;

/**
* the name of the package. Required.
Expand All @@ -48,22 +48,26 @@ declare module "packageurl-js" {
/**
* the version of the package. Optional.
*/
version: string;
version: string | undefined | null;

/**
* extra qualifying data for a package such as an OS, architecture, a distro, etc. Optional and type-specific.
*/
qualifiers: {
[key: string]: string;
};
} | undefined | null;

/**
* extra subpath within a package, relative to the package root. Optional.
*/
subpath: string;

constructor(type: string, namespace: string, name: string, version: string,
qualifiers: { [key: string]: string; }, subpath: string);
subpath: string | undefined | null;

constructor(type: string,
namespace: string | undefined | null,
name: string,
version: string | undefined | null,
qualifiers: { [key: string]: string; } | undefined | null,
subpath: string | undefined | null);

/**
* Converts the PackageURL to a string
Expand Down

0 comments on commit 66444a4

Please sign in to comment.