Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

snyk-go-parser

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snyk-go-parser - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

7

dist/index.d.ts
import { parseGoPkgConfig, parseGoVendorConfig } from './parser';
import { toSnykVersion, parseVersion } from './gomod-parser';
import { DepTree, GoPackageManagerType, GoProjectConfig, ModuleVersion } from './types';
import { parseGoMod, toSnykVersion, parseVersion } from './gomod-parser';
import { DepTree, GoPackageManagerType, GoProjectConfig, ModuleVersion, GoMod } from './types';
interface DepDict {

@@ -13,5 +13,4 @@ [dep: string]: DepTree;

export { GoPackageManagerType };
export { parseGoPkgConfig, parseGoVendorConfig, GoProjectConfig, ModuleVersion, toSnykVersion, parseVersion };
export { parseGoPkgConfig, parseGoVendorConfig, GoProjectConfig, ModuleVersion, toSnykVersion, parseVersion, GoMod, parseGoMod, };
export declare function buildGoPkgDepTree(manifestFileContents: string, lockFileContents: string, options?: unknown): Promise<DepTree>;
export declare function buildGoVendorDepTree(manifestFileContents: string, options?: unknown): Promise<DepTree>;
export declare function buildGoModDepTree(manifestFileContents: string, options?: unknown): DepTree;

@@ -8,2 +8,3 @@ "use strict";

var gomod_parser_1 = require("./gomod-parser");
exports.parseGoMod = gomod_parser_1.parseGoMod;
exports.toSnykVersion = gomod_parser_1.toSnykVersion;

@@ -35,36 +36,5 @@ exports.parseVersion = gomod_parser_1.parseVersion;

exports.buildGoVendorDepTree = buildGoVendorDepTree;
// We are not using go.sum file here because it's not actually a lockfile and contains dependencies
// that are actually long gone.
function buildGoModDepTree(manifestFileContents, options) {
function buildGoDepTree(goProjectConfig) {
var e_1, _a;
// We actually use only some bits of the go.mod contents
var goMod = gomod_parser_1.parseGoMod(manifestFileContents);
var depTree = {
name: goMod.moduleName,
version: '0.0.0',
dependencies: {},
};
var dependencies = depTree.dependencies;
try {
for (var _b = tslib_1.__values(goMod.requires), _c = _b.next(); !_c.done; _c = _b.next()) {
var req = _c.value;
dependencies[req.moduleName] = {
name: req.moduleName,
version: gomod_parser_1.toSnykVersion(req.version),
};
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
return depTree;
}
exports.buildGoModDepTree = buildGoModDepTree;
function buildGoDepTree(goProjectConfig) {
var e_2, _a;
var depTree = {
name: goProjectConfig.packageName || 'root',

@@ -84,3 +54,3 @@ version: '0.0.0',

}
catch (e_2_1) { e_2 = { error: e_2_1 }; }
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {

@@ -90,3 +60,3 @@ try {

}
finally { if (e_2) throw e_2.error; }
finally { if (e_1) throw e_1.error; }
}

@@ -93,0 +63,0 @@ return depTree;

@@ -40,3 +40,3 @@ {

},
"version": "1.2.0"
"version": "1.3.0"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc