Closed awwong1 closed 5 years ago
looks straightforward to me - is there any kind of test or something that can help guard against regressions - example lets say I change the signature (no plans to, but hypothetically), is there a test that can check that the type matches the function signature, at least on some simple level? or is the onus on the maintainer to keep them in sync?
@dougmoscrop One way that you can verify your types are valid is to just build a typescript application using the types that are defined. Similar to a PR I made here https://github.com/fastify/fastify-react/pull/45
landed via bca797ac752f0b8ff912b833e858790878ed7a7e and released in 1.9.1
@awwong1 this appears to be causing issues for TypeScript users
I've updated the PR such that the type dependency is no longer a dev dependency but is an optional dependency.
I also verified that this works on a new TypeScript application that does not have @types/aws-lambda
installed:
npm init -y
npm install typescript
npm install https://github.com/awwong1/serverless-http
echo "import serverlessHttp from \"serverless-http\";
serverlessHttp(() => { });" > index.ts
npx tsc index.ts
Hopefully this is sufficient?
https://github.com/dougmoscrop/serverless-http/issues/64