swagger-jsdoc
Advanced tools
Comparing version 7.0.0-rc.4 to 7.0.0-rc.5
{ | ||
"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)); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
181351
0
25
1739
5
1
+ Addedlodash.mergewith@4.6.2
+ Addedlodash.mergewith@4.6.2(transitive)