Skip to content

Refactor GeneralizedFieldSpec to use a type parameter or unknown for default type #21

Description

@kamarmack

Status quo:

export type GeneralizedFieldSpec = {
	default?: string;
	innerType?: GeneralizedFieldSpec;
	label?: string;
	meta?: GeneralizedFieldSchemaMetadata;
	notOneOf: string[];
	nullable?: boolean;
	oneOf: string[];
	tests: {
		name: 'defined' | 'required';
		params: unknown;
	}[];
	type: 'string' | 'number' | 'boolean' | 'array' | 'mixed';
};

The problem is that default could be any type, so let's use a type parameter or unknown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions