Repository: prisma/prisma
File: packages/cli/src/utils/checkpoint.ts (TypeScript)

Code before:
      schemaProvider = schemaContext.datasources[0].provider
    }

    // Example 'prisma-client-js'
    schemaGeneratorsProviders = schemaContext.generators
      // Check that value is defined
      .filter((generator) => generator && generator.provider)
      .map((generator) => parseEnvValue(generator.provider))

    const clientGeneratorProviders = ['prisma-client', 'prisma-client-js']
    const previewFeatures = schemaContext.generators
      .filter((generator) => {
        const provider = generator?.provider ? parseEnvValue(generator.provider) : undefined
        return provider !== undefined && clientGeneratorProviders.includes(provider)
      })
      .flatMap((generator) => generator.previewFeatures ?? [])

    if (previewFeatures.length > 0) {
      const seen = new Set<string>()
      schemaPreviewFeatures = []
      for (const feature of previewFeatures) {
        if (!seen.has(feature)) {
          seen.add(feature)
          schemaPreviewFeatures.push(feature)
        }
      }
    }
  } catch (e) {
    debug(
      'Error from tryToReadDataFromSchema() while processing the schema. This is not a fatal error. It will continue without the processed data.',
    )
    debug(e)
  }

  return {
    schemaProvider,
    schemaPreviewFeatures,
    schemaGeneratorsProviders,
  }
}

/*
 * String options of the CLI
 * Tip: search for `: String,`
 */
export const SENSITIVE_CLI_OPTIONS = [
  // 1. Connection strings
  '--url',
  '--shadow-database-url',
  '--from-url',
  '--to-url',

Review comment (suggestion):
why not
```
schemaPreviewFeatures = Array.from(new Set(previewFeatures))
```

Code after:
      schemaProvider = schemaContext.datasources[0].provider
    }

    // Example 'prisma-client-js'
    schemaGeneratorsProviders = schemaContext.generators
      // Check that value is defined
      .filter((generator) => generator && generator.provider)
      .map((generator) => parseEnvValue(generator.provider))

    const clientGeneratorProviders = ['prisma-client', 'prisma-client-js']
    const previewFeatures = schemaContext.generators
      .filter((generator) => {
        const provider = generator?.provider ? parseEnvValue(generator.provider) : undefined
        return provider !== undefined && clientGeneratorProviders.includes(provider)
      })
      .flatMap((generator) => generator.previewFeatures ?? [])

    if (previewFeatures.length > 0) {
      schemaPreviewFeatures = Array.from(new Set(previewFeatures))
    }
  } catch (e) {
    debug(
      'Error from tryToReadDataFromSchema() while processing the schema. This is not a fatal error. It will continue without the processed data.',
    )
    debug(e)
  }

  return {
    schemaProvider,
    schemaPreviewFeatures,
    schemaGeneratorsProviders,
  }
}

/*
 * String options of the CLI
 * Tip: search for `: String,`
 */
export const SENSITIVE_CLI_OPTIONS = [
  // 1. Connection strings
  '--url',
  '--shadow-database-url',
  '--from-url',
  '--to-url',
  // 2. Paths
  '--schema',
  '--config',
  '--file',
  '--from-schema-datamodel',
  '--to-schema-datamodel',
  '--from-schema-datasource',