UNPKG

mute-structs

Version:

NodeJS module providing an implementation of the LogootSplit CRDT algorithm

25 lines 747 B
"use strict"; // 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) Object.defineProperty(exports, "__esModule", { value: true }); /** * 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? */ exports.isObject = function (x) { return typeof x === "object" && x !== null; }; function isArrayFromMap(o) { return Array.isArray(o) && o.length === 2; } exports.isArrayFromMap = isArrayFromMap; //# sourceMappingURL=data-validation.js.map