mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 11:25:17 +00:00
fix: Attribute.JSON type matches RFC 4627 (#18683)
This commit is contained in:
parent
50ae047484
commit
d30e85155f
@ -9,6 +9,14 @@ export type JSON = Attribute.OfType<'json'> &
|
||||
Attribute.VisibleOption &
|
||||
Attribute.DefaultOption<JsonValue>;
|
||||
|
||||
export type JsonValue<T extends object = object> = T;
|
||||
type JSONValue = string | number | boolean | null | JSONObject | JSONArray;
|
||||
|
||||
type JSONArray = Array<JSONValue>;
|
||||
|
||||
interface JSONObject {
|
||||
[key: string]: JSONValue;
|
||||
}
|
||||
|
||||
export type JsonValue<T extends JSONValue = JSONValue> = T;
|
||||
|
||||
export type GetJsonValue<T extends Attribute.Attribute> = T extends JSON ? JsonValue : never;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user