Skip to content

Commit

Permalink
cleanup lodash deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Dec 29, 2019
1 parent dcf3846 commit c9f8df5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
13 changes: 12 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@
"content-type": "^1.0.4",
"js-yaml": "^3.13.1",
"json-schema-ref-parser": "^7.1.2",
"lodash": "^4.17.15",
"lodash.merge": "^4.6.2",
"lodash.uniq": "^4.5.0",
"lodash.zipobject": "^4.1.3",
"media-typer": "^1.1.0",
"multer": "^1.4.2",
"ono": "^6.0.0",
Expand Down
1 change: 0 additions & 1 deletion src/framework/openapi.spec.loader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as _ from 'lodash';
import { OpenAPIFramework } from './index';
import {
OpenAPIFrameworkAPIContext,
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ono from 'ono';
import * as _ from 'lodash';
import * as _uniq from 'lodash.uniq';
import * as middlewares from './middlewares';
import { Application, Response, NextFunction } from 'express';
import { OpenApiContext } from './framework/openapi.context';
Expand Down Expand Up @@ -108,7 +108,7 @@ export class OpenApiValidator {
}

// install param on routes with paths
for (const p of _.uniq(pathParams)) {
for (const p of _uniq(pathParams)) {
app.param(
p,
(
Expand Down
4 changes: 2 additions & 2 deletions src/middlewares/openapi.metadata.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as _ from 'lodash';
import * as _zipObject from 'lodash.zipobject';
import { pathToRegexp } from 'path-to-regexp';
import { Response, NextFunction } from 'express';
import { OpenApiContext } from '../framework/openapi.context';
Expand Down Expand Up @@ -50,7 +50,7 @@ export function applyOpenApiMetadata(
if (matchedRoute) {
const paramKeys = keys.map(k => k.name);
const paramsVals = matchedRoute.slice(1);
const pathParams = _.zipObject(paramKeys, paramsVals);
const pathParams = _zipObject(paramKeys, paramsVals);

return {
schema,
Expand Down

0 comments on commit c9f8df5

Please sign in to comment.