koa2-swagger-ui
Advanced tools
Comparing version 4.0.1 to 5.0.0
@@ -1,2 +0,2 @@ | ||
import { Middleware } from 'koa'; | ||
import type { Middleware } from 'koa'; | ||
export interface SwaggerOptions { | ||
@@ -26,3 +26,2 @@ [key: string]: string | boolean | string[] | Record<string, unknown> | null | undefined; | ||
} | ||
declare function koaSwagger(config?: Partial<KoaSwaggerUiOptions>): Middleware; | ||
export default koaSwagger; | ||
export declare function koaSwagger(config?: Partial<KoaSwaggerUiOptions>): Middleware; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.koaSwagger = void 0; | ||
const fs_1 = require("fs"); | ||
const handlebars_1 = __importDefault(require("handlebars")); | ||
const Handlebars = require("handlebars"); | ||
const lodash_1 = require("lodash"); | ||
@@ -39,8 +37,8 @@ const path_1 = require("path"); | ||
const options = lodash_1.defaultsDeep(config, defaultOptions); | ||
handlebars_1.default.registerHelper('json', context => JSON.stringify(context)); | ||
handlebars_1.default.registerHelper('strfnc', (fnc) => fnc); | ||
handlebars_1.default.registerHelper('isset', function (conditional, opt) { | ||
Handlebars.registerHelper('json', context => JSON.stringify(context)); | ||
Handlebars.registerHelper('strfnc', (fnc) => fnc); | ||
Handlebars.registerHelper('isset', function (conditional, opt) { | ||
return conditional ? opt.fn(this) : opt.inverse(this); | ||
}); | ||
const index = handlebars_1.default.compile(fs_1.readFileSync(path_1.join(__dirname, './index.hbs'), 'utf-8')); | ||
const index = Handlebars.compile(fs_1.readFileSync(path_1.join(__dirname, './index.hbs'), 'utf-8')); | ||
// eslint-disable-next-line func-names | ||
@@ -65,4 +63,3 @@ return function koaSwaggerUi(ctx, next) { | ||
} | ||
exports.default = koaSwagger; | ||
module.exports = koaSwagger; | ||
exports.koaSwagger = koaSwagger; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "koa2-swagger-ui", | ||
"version": "4.0.1", | ||
"version": "5.0.0", | ||
"description": "Swagger UI middleware for koa", | ||
"main": "./dist/index.js", | ||
"typings": "./dist/index.d.ts", | ||
"main": "dist/index.js", | ||
"typings": "dist/index.d.ts", | ||
"files": [ | ||
@@ -22,26 +22,23 @@ "dist" | ||
"dependencies": { | ||
"@types/koa": "^2.11.3", | ||
"@types/koa": "^2.11.4", | ||
"handlebars": "^4.7.6", | ||
"lodash": "^4.17.15", | ||
"lodash.defaultsdeep": "^4.6.1", | ||
"read-pkg-up": "^7.0.1" | ||
}, | ||
"peerDependencies": { | ||
"koa": ">=2.13.0" | ||
}, | ||
"devDependencies": { | ||
"@ctrl/eslint-config": "1.0.3", | ||
"@jest/globals": "26.1.0", | ||
"@ctrl/eslint-config": "1.1.0", | ||
"@jest/globals": "26.4.2", | ||
"@types/koa-router": "7.4.1", | ||
"@types/lodash": "4.14.157", | ||
"@types/node": "14.0.22", | ||
"@types/lodash.defaultsdeep": "4.6.6", | ||
"@types/node": "14.6.2", | ||
"@types/supertest": "2.0.10", | ||
"del-cli": "3.0.1", | ||
"jest": "26.1.0", | ||
"jest": "26.4.2", | ||
"koa": "2.13.0", | ||
"koa-router": "9.1.0", | ||
"koa-router": "9.4.0", | ||
"supertest": "4.0.2", | ||
"swagger-ui-dist": "3.28.0", | ||
"ts-jest": "26.1.2", | ||
"ts-node": "8.10.2", | ||
"typescript": "3.9.6" | ||
"swagger-ui-dist": "3.32.5", | ||
"ts-jest": "26.3.0", | ||
"ts-node": "9.0.0", | ||
"typescript": "4.0.2" | ||
}, | ||
@@ -48,0 +45,0 @@ "release": { |
@@ -52,4 +52,4 @@ # koa2-swagger-ui [![NPM version][npm-image]][npm-url] [![CircleCI](https://circleci.com/gh/scttcper/koa2-swagger-ui.svg?style=svg)](https://circleci.com/gh/scttcper/koa2-swagger-ui) | ||
```javascript | ||
const Koa = require('koa'); | ||
const koaSwagger = require('koa2-swagger-ui'); | ||
import Koa from 'koa'; | ||
import { koaSwagger } from 'koa2-swagger-ui'; | ||
@@ -56,0 +56,0 @@ const app = new Koa(); |
Sorry, the diff of this file is not supported yet
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
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
4
18952
88
+ Addedlodash.defaultsdeep@^4.6.1
+ Addedlodash.defaultsdeep@4.6.1(transitive)
- Removedlodash@^4.17.15
- Removedaccepts@1.3.8(transitive)
- Removedcache-content-type@1.0.1(transitive)
- Removedco@4.6.0(transitive)
- Removedcontent-disposition@0.5.4(transitive)
- Removedcontent-type@1.0.5(transitive)
- Removedcookies@0.9.1(transitive)
- Removeddebug@4.4.0(transitive)
- Removeddeep-equal@1.0.1(transitive)
- Removeddelegates@1.0.0(transitive)
- Removeddepd@1.1.22.0.0(transitive)
- Removeddestroy@1.2.0(transitive)
- Removedee-first@1.1.1(transitive)
- Removedencodeurl@1.0.2(transitive)
- Removedescape-html@1.0.3(transitive)
- Removedfresh@0.5.2(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhttp-assert@1.5.0(transitive)
- Removedhttp-errors@1.8.1(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-generator-function@1.0.10(transitive)
- Removedkeygrip@1.1.0(transitive)
- Removedkoa@2.15.3(transitive)
- Removedkoa-compose@4.2.0(transitive)
- Removedkoa-convert@2.0.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedmedia-typer@0.3.0(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedms@2.1.3(transitive)
- Removednegotiator@0.6.3(transitive)
- Removedon-finished@2.4.1(transitive)
- Removedonly@0.0.2(transitive)
- Removedparseurl@1.3.3(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsetprototypeof@1.2.0(transitive)
- Removedstatuses@1.5.0(transitive)
- Removedtoidentifier@1.0.1(transitive)
- Removedtsscmp@1.0.6(transitive)
- Removedtype-is@1.6.18(transitive)
- Removedvary@1.1.2(transitive)
- Removedylru@1.4.0(transitive)
Updated@types/koa@^2.11.4