snyk 1.805.0 → 1.806.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/727.index.js
CHANGED
|
@@ -193223,7 +193223,7 @@ async function _parsedNuspec(nuspecContent, targetFramework, depName) {
|
|
|
193223
193223
|
const parsedNuspec = await parseXML.parseStringPromise(nuspecContent);
|
|
193224
193224
|
let ownDeps = [];
|
|
193225
193225
|
//note: this will throw if assertion fails
|
|
193226
|
-
assertNuspecSchema(parsedNuspec);
|
|
193226
|
+
assertNuspecSchema(nuspecContent, parsedNuspec);
|
|
193227
193227
|
for (const metadata of parsedNuspec.package.metadata) {
|
|
193228
193228
|
(_a = metadata.dependencies) === null || _a === void 0 ? void 0 : _a.forEach(rawDependency => {
|
|
193229
193229
|
// Find and add target framework version specific dependencies
|
|
@@ -193249,34 +193249,30 @@ async function _parsedNuspec(nuspecContent, targetFramework, depName) {
|
|
|
193249
193249
|
};
|
|
193250
193250
|
}
|
|
193251
193251
|
exports._parsedNuspec = _parsedNuspec;
|
|
193252
|
-
function assertNuspecSchema(parsedNuspec) {
|
|
193252
|
+
function assertNuspecSchema(nuspecContent, parsedNuspec) {
|
|
193253
193253
|
var _a;
|
|
193254
193254
|
if (!((_a = parsedNuspec.package) === null || _a === void 0 ? void 0 : _a.metadata)) {
|
|
193255
|
-
throw new Error('This is an invalid nuspec file. Package or Metadata xml section is missing. This is a required element. See https://docs.microsoft.com/en-us/nuget/reference/nuspec'
|
|
193255
|
+
throw new Error('This is an invalid nuspec file. Package or Metadata xml section is missing. This is a required element. See https://docs.microsoft.com/en-us/nuget/reference/nuspec. The nuspec in question: ' +
|
|
193256
|
+
nuspecContent);
|
|
193256
193257
|
}
|
|
193257
193258
|
//just in case, this should *not* happen
|
|
193258
193259
|
if (!Array.isArray(parsedNuspec.package.metadata)) {
|
|
193259
|
-
throw new Error('This is an invalid nuspec file; the metadata tag is supposed to be a collection of objects but it is not!'
|
|
193260
|
+
throw new Error('This is an invalid nuspec file; the metadata tag is supposed to be a collection of objects but it is not! The nuspec in question: ' +
|
|
193261
|
+
nuspecContent);
|
|
193260
193262
|
}
|
|
193261
193263
|
for (const metadata of parsedNuspec.package.metadata) {
|
|
193262
193264
|
//just in case, this shouldn't happen as this would indicate invalid/malformed nuspec file
|
|
193263
193265
|
if (metadata == null || typeof metadata !== 'object') {
|
|
193264
193266
|
throw new Error('Expected elements in a "metadata" tag to be objects, but they were ' +
|
|
193265
193267
|
typeof metadata +
|
|
193266
|
-
', this is not supposed to happen and is likely due to malformed nuspec file.'
|
|
193268
|
+
', this is not supposed to happen and is likely due to malformed nuspec file. The nuspec in question: ' +
|
|
193269
|
+
nuspecContent);
|
|
193267
193270
|
}
|
|
193268
193271
|
if (metadata.dependencies) {
|
|
193269
193272
|
//just in case, error would indicate malformed nuspec
|
|
193270
193273
|
if (!Array.isArray(metadata.dependencies)) {
|
|
193271
|
-
throw new Error('Expected that "dependencies" tag would be an array but it isn\'t. This is not supposed to happen and is likely due to malformed nuspec file!'
|
|
193272
|
-
|
|
193273
|
-
for (const rawDependency of metadata.dependencies) {
|
|
193274
|
-
//just in case, shouldn't happen as this would indicate malformed nuspec format
|
|
193275
|
-
if (typeof rawDependency !== 'object') {
|
|
193276
|
-
throw new Error('Unexpected dependency value. Expected it to be object but it was ' +
|
|
193277
|
-
typeof rawDependency +
|
|
193278
|
-
', this is likely a malformed nuspec');
|
|
193279
|
-
}
|
|
193274
|
+
throw new Error('Expected that "dependencies" tag would be an array but it isn\'t. This is not supposed to happen and is likely due to malformed nuspec file! The nuspec in question: ' +
|
|
193275
|
+
nuspecContent);
|
|
193280
193276
|
}
|
|
193281
193277
|
}
|
|
193282
193278
|
}
|