Help us shape the future of Go! Take the 2026 Go Developer Survey

normalize

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package normalize ports the normalize* helpers from @graphql-codegen/plugin-helpers/src/helpers.ts and utils.ts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config(v any) []plugin.ConfiguredPlugin

Config mirrors normalizeConfig: converts a plugin spec (string | []any | map) into a []ConfiguredPlugin.

func ImportExtension

func ImportExtension(emitLegacyCommonJSImports *bool, importExtension string) string

ImportExtension mirrors normalizeImportExtension.

func InstanceOrArray

func InstanceOrArray(v any) []any

normalizeInstanceOrArray wraps a non-array value into a single-element slice, returns an empty slice for nil, and passes arrays through unchanged. Works on any (the decoded YAML value).

func OutputParam

func OutputParam(v any) (*plugin.ConfiguredOutput, error)

OutputParam mirrors normalizeOutputParam: accepts either a bare plugin array (`["typescript", "add"]`) or a full object (`{ plugins: [...], preset: ... }`).

func StringSlice

func StringSlice(v any) []string

StringSlice normalizes a value that may be a string, []string, or []any of strings into a []string.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL