You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { AWS } from '@serverless/typescript'
import app from '@functions/app` // this is a js/typescript lambda config blob
const sererlessConfig: AWS = {
...
functions: { app },
...
}
Now let’s say I want to do some processing on that app import, for example to inject some environment variables. So I create a function injectEnv that takes a lambda config blob and adds the necessary environment property. The function looks like: const injectEnv = (lambdaConfig) => {…} .
Typescript will want me to type the lambdaConfig argument, since it won't like it to have an implicit any. But how can I do that? @serverless/typescript does not seem to have a type corresponding to the lambda config block.
I can get the whole functions block of the total configuration by doing AWS['functions'], but is there a way to get just the type of the lambda config block?
The text was updated successfully, but these errors were encountered:
Let’s say I have code like this in serverless.ts:
Now let’s say I want to do some processing on that app import, for example to inject some environment variables. So I create a function
injectEnv
that takes a lambda config blob and adds the necessary environment property. The function looks like:const injectEnv = (lambdaConfig) => {…}
.Typescript will want me to type the lambdaConfig argument, since it won't like it to have an implicit any. But how can I do that? @serverless/typescript does not seem to have a type corresponding to the lambda config block.
I can get the whole functions block of the total configuration by doing
AWS['functions']
, but is there a way to get just the type of the lambda config block?The text was updated successfully, but these errors were encountered: