How to use the @serverless/utils.is function in @serverless/utils

To help you get started, we’ve selected a few @serverless/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github serverless / serverless-websockets-plugin / src / index.js View on Github external
async deployWebsockets() {
    this.init()
    await this.prepareFunctions()
    if (
      !is(Object, this.serverless.service.functions) ||
      keys(this.serverless.service.functions).length === 0 ||
      isEmpty(this.functions)
    ) {
      return
    }
    this.serverless.cli.log(`Deploying Websockets API named "${this.apiName}"...`)
    await this.createApi()
    // We clear routes before deploying the new routes for idempotency
    // since we lost the idempotency feature of CF
    await this.clearRoutes()
    await this.clearAuthorizers()
    await this.clearIntegrations()
    await this.createAuthorizers()
    await this.createRoutes()
    await this.createDeployment()
    this.serverless.cli.log(
github serverless / serverless-websockets-plugin / src / index.js View on Github external
getWebsocketApiName() {
    if (
      this.serverless.service.provider.websocketApiName &&
      is(String, this.serverless.service.provider.websocketApiName)
    ) {
      return `${this.serverless.service.provider.websocketApiName}`
    }
    return `${this.serverless.service.service}-${this.provider.getStage()}-websockets-api`
  }
github serverless / serverless-websockets-plugin / src / index.js View on Github external
getWebsocketApiRouteSelectionExpression() {
    if (
      this.serverless.service.provider.websocketApiRouteSelectionExpression &&
      is(String, this.serverless.service.provider.websocketApiRouteSelectionExpression)
    ) {
      return `${this.serverless.service.provider.websocketApiRouteSelectionExpression}`
    }
    return `$request.body.action`
  }
github serverless / components / registry / AwsIamRole / src / index.js View on Github external
async define() {
      const policy = resolve(this.policy)
      if (is(AwsIamPolicy.class, policy)) {
        return {
          policy
        }
      }
      return {}
    }
github serverless / components / src / types / AwsIamRole / index.js View on Github external
async define() {
      const policy = resolve(this.policy)
      if (is(AwsIamPolicy.class, policy)) {
        return {
          policy
        }
      }
      return {}
    }