auditjs
Version:
Audit dependencies to identify known vulnerabilities and maintenance problems
34 lines • 1.31 kB
JavaScript
;
/*
* Copyright 2019-Present Sonatype Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.Coordinates = void 0;
class Coordinates {
constructor(name, version, group) {
this.name = name;
this.version = version;
this.group = group;
}
toPurl(ecosystem = 'npm') {
if (this.group) {
// TODO: IQ does not need the @ sign replaced with %40, probably want to figure out someway to handle this correctly
return `pkg:${ecosystem}/${this.group.replace('@', '%40')}/${this.name}@${this.version}`;
}
return `pkg:${ecosystem}/${this.name}@${this.version}`;
}
}
exports.Coordinates = Coordinates;
//# sourceMappingURL=Coordinates.js.map