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

koa2-swagger-ui

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa2-swagger-ui - npm Package Compare versions

Comparing version 4.0.1 to 5.0.0

5

dist/index.d.ts

@@ -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;

17

dist/index.js
"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

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