Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async search(param: SearchParam): Promise {
const manager = this.project.createPackageManager();
const query = this.prepareQuery(param.query);
const packages = await npms.search(query, param.from, param.size);
const extensions = [];
for (const raw of packages) {
if (PublishedNodePackage.is(raw)) {
const extensionPackage = await manager.pck.findExtensionPackage(raw.name);
if (extensionPackage) {
const extension = this.toRawExtension(extensionPackage);
extensions.push(extension);
}
}
}
return extensions;
}
protected prepareQuery(query: string): string {