redoc-express
Advanced tools
+1
-1
| { | ||
| "name": "redoc-express", | ||
| "version": "2.1.0", | ||
| "version": "2.1.1", | ||
| "description": "Express Middleware for OpenAPI/Swagger-generated API Reference Documentation", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
| import { Ioption } from './redoc-html-template'; | ||
| declare function redocExpressMiddleware(options?: Ioption): any; | ||
| export default redocExpressMiddleware; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| var redoc_html_template_1 = require("./redoc-html-template"); | ||
| function redocExpressMiddleware(options) { | ||
| if (options === void 0) { options = { | ||
| title: 'ReDoc', | ||
| specUrl: 'http://petstore.swagger.io/v2/swagger.json' | ||
| }; } | ||
| return function middleware(req, res) { | ||
| res.type('html'); | ||
| res.send((0, redoc_html_template_1.redocHtml)(options)); | ||
| }; | ||
| } | ||
| exports.default = redocExpressMiddleware; | ||
| module.exports = redocExpressMiddleware; | ||
| module.exports.default = redocExpressMiddleware; |
| export interface Ioption { | ||
| title: string; | ||
| specUrl: string; | ||
| nonce?: string; | ||
| redocOptions?: object; | ||
| } | ||
| declare function redocHtml(options?: Ioption): string; | ||
| export { redocHtml }; | ||
| export default redocHtml; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.redocHtml = void 0; | ||
| var html = "<!DOCTYPE html>\n<html>\n <head>\n <title>[[title]]</title>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <link href=\"https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700\" rel=\"stylesheet\" />\n <style>\n body {\n margin: 0;\n padding: 0;\n }\n </style>\n </head>\n <body>\n <div id=\"redoc-container\"></div>\n <script nonce='[[nonce]]' src=\"https://unpkg.com/redoc@latest/bundles/redoc.standalone.js\"> </script>\n </body>\n <script>\n Redoc.init(\n \"[[spec-url]]\",\n [[options]],\n document.getElementById(\"redoc-container\")\n );\n </script>\n</html>"; | ||
| function redocHtml(options) { | ||
| if (options === void 0) { options = { | ||
| title: 'ReDoc', | ||
| specUrl: 'http://petstore.swagger.io/v2/swagger.json' | ||
| }; } | ||
| var title = options.title, specUrl = options.specUrl, _a = options.nonce, nonce = _a === void 0 ? '' : _a, _b = options.redocOptions, redocOptions = _b === void 0 ? {} : _b; | ||
| return html | ||
| .replace('[[title]]', title) | ||
| .replace('[[spec-url]]', specUrl) | ||
| .replace('[[nonce]]', nonce) | ||
| .replace('[[options]]', JSON.stringify(redocOptions)); | ||
| } | ||
| exports.redocHtml = redocHtml; | ||
| exports.default = redocHtml; |
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
0
-100%4841
-33.28%3
-57.14%0
-100%1
Infinity%