Skip to content

[RFC] - JsonNode type #59

Closed
Closed
@hardy925

Description

@hardy925

JsonNode type

add a type for JsonNode that consists of the correct types supported by the JSON Notation standard

text (see "3. Values")

Note: if updated please follow the Obsoleted by: tag in the header:
Screen Shot 2020-10-16 at 5 42 04 PM

Motivation

To properly type our strategic directions.

ToJsonStrategy and FromJsonStrategy make use of any, by providing this type we can set up directional strategies.

Design Detail

The supported RFC types should be | (Unioned) into a JsonNode type

/** Functions used when hydrating data */
export type FromJsonStrategy = (value: any) => any;

/** Functions used when dehydrating data */
export type ToJsonStrategy = (value: any) => any;

Becomes

/** Functions used when hydrating data */
export type FromJsonStrategy<T> = (value: JsonNode) => T;

/** Functions used when dehydrating data */
export type ToJsonStrategy <T>= (value: T) => JsonNode;

Metadata

Metadata

Assignees

Labels

HacktoberfestPlease see our CONTRIBUTING.md file as well!enhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions