import { s } from '../../../json-crdt-patch';
export const type = (sliceType) => Array.isArray(sliceType) ? s.arr(sliceType.map(step)) : s.con(sliceType);
export const step = (sliceStep) => {
    if (Array.isArray(sliceStep)) {
        const tuple = [s.con(sliceStep[0])];
        const length = sliceStep.length;
        if (length > 1)
            tuple.push(s.con(+(sliceStep[1] ?? 0)));
        if (length > 2)
            tuple.push(s.json(sliceStep[2] ?? {}));
        return s.vec(...tuple);
    }
    return s.con(sliceStep);
};
//# sourceMappingURL=schema.js.map