diff --git a/package-lock.json b/package-lock.json index 00eda77..fd473c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1722,9 +1722,9 @@ } }, "@readme/eslint-config": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@readme/eslint-config/-/eslint-config-1.12.0.tgz", - "integrity": "sha512-52m/b1pf6LGWd21x65FPvYxNV9jMJaWwMLZyRKX7F640jFMFNJsheLk8T/1PTRjZJAKYMBFQYpZcl9OgxblNmg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@readme/eslint-config/-/eslint-config-1.13.0.tgz", + "integrity": "sha512-w0QleQOXmCfyxbZKiuqRPPaBJgIwFeb8bc+V6E+ZZo1KLXpw8OBeRwC53QW9MeDNp1ATWooZct83uXQaFi0n0w==", "dev": true, "requires": { "eslint-config-airbnb-base": "^14.0.0", @@ -1856,20 +1856,20 @@ "dev": true }, "@typescript-eslint/experimental-utils": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.19.0.tgz", - "integrity": "sha512-zwpg6zEOPbhB3+GaQfufzlMUOO6GXCNZq6skk+b2ZkZAIoBhVoanWK255BS1g5x9bMwHpLhX0Rpn5Fc3NdCZdg==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.20.0.tgz", + "integrity": "sha512-fEBy9xYrwG9hfBLFEwGW2lKwDRTmYzH3DwTmYbT+SMycmxAoPl0eGretnBFj/s+NfYBG63w/5c3lsvqqz5mYag==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.19.0", + "@typescript-eslint/typescript-estree": "2.20.0", "eslint-scope": "^5.0.0" } }, "@typescript-eslint/typescript-estree": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.19.0.tgz", - "integrity": "sha512-n6/Xa37k0jQdwpUszffi19AlNbVCR0sdvCs3DmSKMD7wBttKY31lhD2fug5kMD91B2qW4mQldaTEc1PEzvGu8w==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.20.0.tgz", + "integrity": "sha512-WlFk8QtI8pPaE7JGQGxU7nGcnk1ccKAJkhbVookv94ZcAef3m6oCE/jEDL6dGte3JcD7reKrA0o55XhBRiVT3A==", "dev": true, "requires": { "debug": "^4.1.1", @@ -3329,9 +3329,9 @@ } }, "eslint-plugin-jest": { - "version": "23.7.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.7.0.tgz", - "integrity": "sha512-zkiyGlvJeHNjAEz8FaIxTXNblJJ/zj3waNbYbgflK7K6uy0cpE5zJBt/JpJtOBGM/UGkC6BqsQ4n0y7kQ2HA8w==", + "version": "23.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.8.0.tgz", + "integrity": "sha512-DKXmLxguZ1Lru4u5YM12ko3WLq6gqo7dhV2b63K731+/PNyZ/Ff6NGONQsGUtPLG9zU3kdz/N+2LTbweNZifeg==", "dev": true, "requires": { "@typescript-eslint/experimental-utils": "^2.5.0" @@ -3451,9 +3451,9 @@ "dev": true }, "eslint-plugin-unicorn": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-16.0.0.tgz", - "integrity": "sha512-zqWMYzTopdixyqu0+3td4vIGmpBxwdBVeWBm3TzwnFMvHoAE6tTQ/w2Xv5RG/MklKkfQdHsRqa8CVsSpjSA4qQ==", + "version": "16.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-16.1.1.tgz", + "integrity": "sha512-IMxCsntb0T8s660Irc40gtzXtxuXHcOn36G9G8OYKfiseBD/kNrA1cNJhsJ0xQteDASGrFwqdzBsYEkUvczhOA==", "dev": true, "requires": { "ci-info": "^2.0.0", @@ -3549,9 +3549,9 @@ } }, "semver": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.2.tgz", - "integrity": "sha512-BJs9T/H8sEVHbeigqzIEo57Iu/3DG6c4QoqTfbQB3BPA4zgzAomh/Fk9E7QtjWQ8mx2dgA9YCfSF4y9k9bHNpQ==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.1.3.tgz", + "integrity": "sha512-ekM0zfiA9SCBlsKa2X1hxyxiI4L3B6EbVJkkdgQXnSEEaHlGdvyodMruTiulSRWMMB4NeIuYNMC9rTKTz97GxA==", "dev": true } } @@ -8089,9 +8089,9 @@ } }, "regexp-tree": { - "version": "0.1.18", - "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.18.tgz", - "integrity": "sha512-mKLUfTDU1GE5jGR7cn2IEPDzYjmOviZOHYAR1XGe8Lg48Mdk684waD1Fqhv2Nef+TsDVdmIj08m/GUKTMk7J2Q==", + "version": "0.1.20", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.20.tgz", + "integrity": "sha512-gSiH74kc00oTbQkN7tZogZe0ttKwyxyDVLAnU20aWoarbLE9AypbJHRlZ567h4Zi19q3cPVRWDYbfECElrHgsQ==", "dev": true }, "regexp.prototype.flags": { diff --git a/src/extractor.js b/src/extractor.js index 1f2e54c..1f232d1 100644 --- a/src/extractor.js +++ b/src/extractor.js @@ -132,6 +132,7 @@ class Extractor { } } +// eslint-disable-next-line unicorn/no-unsafe-regex Extractor.ROUTE_REGEX = /@(?:oas|api)\s+\[(\w+)\]\s+(.*?)(?:\s+(.*))?$/m; Extractor.SCHEMA_REGEX = /@schema\s+(.*)$/m; diff --git a/src/loader.js b/src/loader.js index e1e0754..e52bd39 100644 --- a/src/loader.js +++ b/src/loader.js @@ -207,6 +207,7 @@ class Loader { } static expandParam(param = '', swaggerVersion) { + // eslint-disable-next-line unicorn/no-unsafe-regex const parsed = param.match(/(?:\((.*)\))?\s*([\w._-]*)(?:=([^{*]*))?([*])?\s*{(.*?)(?::(.*))?}\s*(.*)?/); if (!parsed || !parsed[1] || !parsed[5]) return false;