// Copyright (c) 2018 Victorien Elvinger // // Licensed under the zlib license (https://opensource.org/licenses/zlib). // // This file is part of replayable-random // (https://github.com/Conaclos/replayable-random) /* tslint:disable */ export type NonFunctionNames = { [k in keyof T]: T[k] extends Function ? never : k }[keyof T] export type Unknown = { [k in NonFunctionNames]?: unknown } /** * Example: * Given `x: unknown` * `isObject<{ p: number }>(x) && typeof x.p === "number"` * enables to test if x is conforms to `{ p: number }`. * * @param x * @param Is `x' a non-null object? */ export const isObject = (x: unknown): x is Unknown => typeof x === "object" && x !== null export function isArrayFromMap (o: unknown): o is [unknown, unknown] { return Array.isArray(o) && o.length === 2 }