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.11.1 to 1.12.0

dist/errors/missing-go-mod-version-directive-error.d.ts

1

dist/errors/index.d.ts
export { InvalidUserInputError } from './invalid-user-input-error';
export { MissingGoModVersionDirectiveError } from './missing-go-mod-version-directive-error';

@@ -5,2 +5,4 @@ "use strict";

Object.defineProperty(exports, "InvalidUserInputError", { enumerable: true, get: function () { return invalid_user_input_error_1.InvalidUserInputError; } });
var missing_go_mod_version_directive_error_1 = require("./missing-go-mod-version-directive-error");
Object.defineProperty(exports, "MissingGoModVersionDirectiveError", { enumerable: true, get: function () { return missing_go_mod_version_directive_error_1.MissingGoModVersionDirectiveError; } });
// Other common parser error types:

@@ -7,0 +9,0 @@ // OutOfSyncError - not applicable yet, since for dep/vendor, the manifests do not contain the names of actual

4

dist/index.d.ts

@@ -1,6 +0,6 @@

import { parseGoPkgConfig, parseGoVendorConfig, parseGoModGraph, parseGoModRelativeManifestReplaces } from './parsers';
import { parseGoPkgConfig, parseGoVendorConfig, parseGoModGraph, parseGoModRelativeManifestReplaces, parseGoModVersionDirective } from './parsers';
import { DepTree, GoPackageManagerType, GoPackageConfig, ModuleVersion, GoModuleConfig } from './types';
export { GoPackageManagerType };
export { parseGoPkgConfig, parseGoVendorConfig, parseGoModGraph, parseGoModRelativeManifestReplaces, GoPackageConfig, ModuleVersion, GoModuleConfig, };
export { parseGoPkgConfig, parseGoVendorConfig, parseGoModGraph, parseGoModRelativeManifestReplaces, parseGoModVersionDirective, GoPackageConfig, ModuleVersion, GoModuleConfig, };
export declare function buildGoPkgDepTree(manifestFileContents: string, lockFileContents: string, options?: unknown): Promise<DepTree>;
export declare function buildGoVendorDepTree(manifestFileContents: string): Promise<DepTree>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildGoVendorDepTree = exports.buildGoPkgDepTree = exports.parseGoModRelativeManifestReplaces = exports.parseGoModGraph = exports.parseGoVendorConfig = exports.parseGoPkgConfig = void 0;
exports.buildGoVendorDepTree = exports.buildGoPkgDepTree = exports.parseGoModVersionDirective = exports.parseGoModRelativeManifestReplaces = exports.parseGoModGraph = exports.parseGoVendorConfig = exports.parseGoPkgConfig = void 0;
const parsers_1 = require("./parsers");

@@ -9,2 +9,3 @@ Object.defineProperty(exports, "parseGoPkgConfig", { enumerable: true, get: function () { return parsers_1.parseGoPkgConfig; } });

Object.defineProperty(exports, "parseGoModRelativeManifestReplaces", { enumerable: true, get: function () { return parsers_1.parseGoModRelativeManifestReplaces; } });
Object.defineProperty(exports, "parseGoModVersionDirective", { enumerable: true, get: function () { return parsers_1.parseGoModVersionDirective; } });
const types_1 = require("./types");

@@ -11,0 +12,0 @@ // TODO(kyegupov): make all build* functions sync

import { DepGraph } from '@snyk/dep-graph';
export declare function parseGoModGraph(goModGraphOutput: string, projectName?: string, projectVersion?: string): DepGraph;
export declare function normalizeVersion(version: string): string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeVersion = exports.parseGoModGraph = void 0;
exports.parseGoModGraph = void 0;
const dep_graph_1 = require("@snyk/dep-graph");

@@ -16,6 +16,3 @@ const types_1 = require("../types");

// Handle cases for prefixed-semver, see https://golang.org/ref/mod#major-version-suffixes
return [
name.replace(GO_SEMVER_PREFIXED_MODULES_REGEX, '$1$2'),
normalizeVersion(v),
];
return [name.replace(GO_SEMVER_PREFIXED_MODULES_REGEX, '$1$2'), v];
});

@@ -57,17 +54,2 @@ }

}
function extractHash(version) {
return version.split('-').pop() || version;
}
function normalizeVersion(version) {
if (!version) {
return version;
}
// https://go.dev/ref/mod#pseudo-versions
const isPseudoVersion = /.*(([0-9]{4})(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])(2[0-3]|[01][0-9])([0-5][0-9])([0-5][0-9]))-.*/.test(version);
if (isPseudoVersion) {
version = `#${extractHash(version)}`;
}
return version;
}
exports.normalizeVersion = normalizeVersion;
//# sourceMappingURL=gomod-graph-parser.js.map

@@ -5,1 +5,2 @@ export { parseGoModGraph } from './gomod-graph-parser';

export { parseGoModRelativeManifestReplaces } from './gomod-relative-manifest-parser';
export { parseGoModVersionDirective } from './gomod-version-directive-parser';

@@ -11,2 +11,4 @@ "use strict";

Object.defineProperty(exports, "parseGoModRelativeManifestReplaces", { enumerable: true, get: function () { return gomod_relative_manifest_parser_1.parseGoModRelativeManifestReplaces; } });
var gomod_version_directive_parser_1 = require("./gomod-version-directive-parser");
Object.defineProperty(exports, "parseGoModVersionDirective", { enumerable: true, get: function () { return gomod_version_directive_parser_1.parseGoModVersionDirective; } });
//# sourceMappingURL=index.js.map

@@ -51,3 +51,3 @@ {

},
"version": "1.11.1"
"version": "1.12.0"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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