mute-structs
Version:
NodeJS module providing an implementation of the LogootSplit CRDT algorithm
22 lines • 639 B
JavaScript
// 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)
/**
* 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 var isObject = function (x) {
return typeof x === "object" && x !== null;
};
export function isArrayFromMap(o) {
return Array.isArray(o) && o.length === 2;
}
//# sourceMappingURL=data-validation.js.map