f50941389d
* refactor: add and use isJsonObject * fix: readNotification message without body is not working * docs(changelog): WSの`readAllNotifications` メッセージが `body` を持たない場合に動作しない問題 * Update CHANGELOG.md Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> --------- Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com>
13 lines
441 B
TypeScript
13 lines
441 B
TypeScript
/*
|
|
* 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[];
|
|
|
|
export function isJsonObject(value: JsonValue | undefined): value is JsonObject {
|
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
}
|