Documentation - v0.0.0
    Preparing search index...

    Function flattenToScreamingSnakeCase

    • Flatten a nested object into a single level object using 'SCREAMING_SNAKE_CASE'.

      Type Parameters

      • ObjT
      • OptionsT extends
            | FlattenToScreamingSnakeCaseOptions
            | ExactObject<FlattenToScreamingSnakeCaseOptions, OptionsT> = { nestedDelimiter: "__" }

      Parameters

      • obj: ObjT

        input object.

      • Optionaloptions: OptionsT

        output options.

      Returns ScreamingSnakeCaseProperties<FlattenObject<ObjT, OptionsT["nestedDelimiter"]>>

      const obj = {
      ccu: {
      django: {
      allowedHosts: '*',
      csrfCookieSecure: false,
      },
      },
      sentry: {
      traceExcludeUrls: ['one', 'two', 'three'],
      },
      }
      const result = convertToScreamingSnakeCase(obj, { nestedDelimiter: '__' })
      console.log(result)
      // {
      // CCU__DJANGO__ALLOWED_HOSTS: '*',
      // CCU__DJANGO__CSRF_COOKIE_SECURE: false,
      // SENTRY__TRACE_EXCLUDE_URLS: 'one,two,three',
      // }