MCPcopy Index your code
hub / github.com/deepnote/deepnote / errorCodeFromName

Function errorCodeFromName

packages/cli/src/commands/lint.ts:77–84  ·  view source on GitHub ↗

* Derive a stable, snake_case issue code from an error's class name. * e.g. `BigQueryServiceAccountParseError` -> `big_query_service_account_parse_error`, * `SpannerServiceAccountParseError` -> `spanner_service_account_parse_error`.

(errorName: string)

Source from the content-addressed store, hash-verified

75 * `SpannerServiceAccountParseError` -> `spanner_service_account_parse_error`.
76 */
77function errorCodeFromName(errorName: string): string {
78 const code = errorName
79 // Insert separators between case transitions (e.g. "ServiceAccount" -> "Service_Account").
80 .replace(/([a-z0-9])([A-Z])/g, '$1_$2')
81 .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
82 .toLowerCase()
83 return code || 'integration_env_var_error'
84}
85
86/**
87 * Generate the SQL/connection environment variables for the given integrations and surface any

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected