2024-07-18 04:04:23 -07:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
|
|
|
export type JsonValue = JsonArray | JsonObject | string | number | boolean | null;
|
|
|
|
export type JsonObject = {[K in string]?: JsonValue};
|
|
|
|
export type JsonArray = JsonValue[];
|
2024-08-09 00:04:41 -07:00
|
|
|
|
|
|
|
export function isJsonObject(value: JsonValue | undefined): value is JsonObject {
|
|
|
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
|
|
}
|