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

swagger-jsdoc

Package Overview
Dependencies
Maintainers
3
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagger-jsdoc - npm Package Compare versions

Comparing version 7.0.0-rc.4 to 7.0.0-rc.5

coverage/clover.xml

44

package.json
{
"name": "swagger-jsdoc",
"description": "Generates swagger doc based on JSDoc",
"version": "7.0.0-rc.4",
"version": "7.0.0-rc.5",
"engines": {
"node": ">=12.0.0"
},
"scripts": {
"lint": "eslint .",
"test:lint": "eslint .",
"test:library": "NODE_OPTIONS=--experimental-vm-modules jest --no-cache",
"test:example:app": "cd examples/app && yarn run test",
"test:example:cli": "cd examples/cli && yarn run test",
"test:example:extensions": "cd examples/extensions && yarn run test",
"test:example:yaml": "cd examples/yaml-anchors-aliases && yarn run test",
"test": "run-p test:* test:example:*"
},
"type": "module",
"exports": "./index.js",
"jest": {
"transform": {},
"testPathIgnorePatterns": [
"<rootDir>/node_modules/",
"<rootDir>/examples/"
]
},
"dependencies": {
"doctrine": "3.0.0",
"glob": "7.1.6",
"lodash.mergewith": "4.6.2",
"swagger-parser": "10.0.2",
"yaml": "2.0.0-1"
},
"devDependencies": {
"eslint": "7.19.0",
"eslint-config-prettier": "7.2.0",
"eslint-loader": "4.0.2",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jest": "24.1.3",
"eslint-plugin-prettier": "3.3.1",
"husky": "4.3.8",
"jest": "26.6.3",
"lerna": "3.22.1",
"lint-staged": "10.5.4",
"npm-run-all": "4.1.5",
"prettier": "2.2.1"
},
"license": "MIT",

@@ -61,13 +31,3 @@ "homepage": "https://github.com/Surnet/swagger-jsdoc",

"url": "https://github.com/Surnet/swagger-jsdoc/issues"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,json,md,yml,yaml}": [
"prettier --write"
]
}
}

@@ -6,7 +6,8 @@ import doctrine from 'doctrine';

import {
hasEmptyProperty,
convertGlobPaths,
extractAnnotations,
extractYamlFromJsDoc,
hasEmptyProperty,
isTagPresentInTags,
mergeDeep,
} from './utils.js';

@@ -150,6 +151,6 @@

for (const definition of Object.keys(annotation[property])) {
swaggerObject[property][definition] = {
...swaggerObject[property][definition],
...annotation[property][definition],
};
swaggerObject[property][definition] = mergeDeep(
swaggerObject[property][definition],
annotation[property][definition]
);
}

@@ -173,6 +174,6 @@ } else if (property === 'tags') {

// Paths which are not defined as "paths" property, starting with a slash "/"
swaggerObject.paths[property] = {
...swaggerObject.paths[property],
...annotation[property],
};
swaggerObject.paths[property] = mergeDeep(
swaggerObject.paths[property],
annotation[property]
);
}

@@ -179,0 +180,0 @@ }

import { promises as fs } from 'fs';
import { extname } from 'path';
import glob from 'glob';
import mergeWith from 'lodash.mergewith';

@@ -138,1 +139,11 @@ /**

}
/**
* A recursive deep-merge that ignores null values when merging.
* This returns the merged object and does not mutate.
* @param {object} first the first object to get merged
* @param {object} second the second object to get merged
*/
export function mergeDeep(first, second) {
return mergeWith({}, first, second, (a, b) => (b === null ? a : undefined));
}
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