Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kizahasi/ot-string

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kizahasi/ot-string - npm Package Compare versions

Comparing version 0.4.1 to 0.5.0

dist/cjs/internal/operationBuilder/editElement.js

4

dist/cjs/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.deserializeDownOperation = exports.serializeDownOperation = exports.composeDownOperation = exports.invertDownOperation = exports.applyBackAndRestore = exports.applyBack = exports.transformUpOperation = exports.deserializeUpOperation = exports.serializeUpOperation = exports.composeUpOperation = exports.invertUpOperation = exports.applyAndRestore = exports.apply = exports.transformTwoWayOperation = exports.diff = exports.deserizalizeTwoWayOperation = exports.serializeTwoWayOperation = exports.toUpOperation = exports.toDownOperation = exports.stateTooLong = exports.secondTooShort = exports.stateTooShort = exports.secondTooLong = exports.deleteStringNotMatch = exports.insert$ = exports.delete$ = exports.r = exports.d = exports.i = exports.NonEmptyString = exports.PositiveInt = void 0;
exports.OperationBuilder = exports.deserializeDownOperation = exports.serializeDownOperation = exports.composeDownOperation = exports.invertDownOperation = exports.applyBackAndRestore = exports.applyBack = exports.transformUpOperation = exports.deserializeUpOperation = exports.serializeUpOperation = exports.composeUpOperation = exports.invertUpOperation = exports.applyAndRestore = exports.apply = exports.transformTwoWayOperation = exports.diff = exports.deserizalizeTwoWayOperation = exports.serializeTwoWayOperation = exports.toUpOperation = exports.toDownOperation = exports.stateTooLong = exports.secondTooShort = exports.stateTooShort = exports.secondTooLong = exports.deleteStringNotMatch = exports.insert$ = exports.delete$ = exports.r = exports.d = exports.i = exports.NonEmptyString = exports.PositiveInt = void 0;
var positiveInt_1 = require("./internal/positiveInt");

@@ -42,1 +42,3 @@ Object.defineProperty(exports, "PositiveInt", { enumerable: true, get: function () { return positiveInt_1.PositiveInt; } });

Object.defineProperty(exports, "deserializeDownOperation", { enumerable: true, get: function () { return downOperation_1.ofUnit; } });
var operationBuilder_1 = require("./internal/operationBuilder/operationBuilder");
Object.defineProperty(exports, "OperationBuilder", { enumerable: true, get: function () { return operationBuilder_1.OperationBuilder; } });

@@ -9,7 +9,7 @@ "use strict";

const positiveInt_1 = require("../positiveInt");
const editElement_1 = require("../util/editElement");
const textOperationArrayElement_1 = require("../util/textOperationArrayElement");
const textOperationBuilder_1 = require("../util/textOperationBuilder");
const textOperationElement_1 = require("../util/textOperationElement");
const textOperationUnit_1 = require("../util/textOperationUnit");
const editElement_1 = require("../operationBuilder/editElement");
const operationArrayElement_1 = require("../operationBuilder/operationArrayElement");
const operationBuilder_1 = require("../operationBuilder/operationBuilder");
const operationElement_1 = require("../operationBuilder/operationElement");
const operationUnit_1 = require("../operationBuilder/operationUnit");
const replace = ({ source, start, count, replacement, }) => {

@@ -27,3 +27,3 @@ if (source.length < start + count) {

var _a, _b;
const prevLength = (0, textOperationArrayElement_1.prevLengthOfTextOperationElementArray)(action, getDeleteLength);
const prevLength = (0, operationArrayElement_1.prevLengthOfOperationElementArray)(action, getDeleteLength);
if (state.length < prevLength) {

@@ -39,3 +39,3 @@ return result_1.Result.error({ type: error_1.stateTooShort });

? undefined
: new textOperationBuilder_1.TextOperationBuilder(restoreOption.factory);
: new operationBuilder_1.OperationBuilder(restoreOption.factory);
for (const act of action) {

@@ -90,4 +90,4 @@ switch (act.type) {

const composeCore = ({ first: $first, second: $second, factory, splitDelete: splitDeleteCore, splitInsert: splitInsertCore, }) => {
const nextLengthOfFirst = (0, textOperationUnit_1.nextLengthOfTextOperationUnitArray)($first, factory);
const prevLengthOfSecond = (0, textOperationUnit_1.prevLengthOfTextOperationUnitArray)($second, factory);
const nextLengthOfFirst = (0, operationUnit_1.nextLengthOfOperationUnitArray)($first, factory);
const prevLengthOfSecond = (0, operationUnit_1.prevLengthOfOperationUnitArray)($second, factory);
if (nextLengthOfFirst < prevLengthOfSecond) {

@@ -103,3 +103,3 @@ return result_1.Result.error({ type: error_1.secondTooLong });

let secondShift = undefined;
const builder = new textOperationBuilder_1.TextOperationBuilder(factory);
const builder = new operationBuilder_1.OperationBuilder(factory);
// eslint-disable-next-line no-constant-condition

@@ -238,4 +238,4 @@ while (true) {

const transformCore = ({ first: $first, second: $second, factory, splitDelete: splitDeleteCore, }) => {
const prevLengthOfFirst = (0, textOperationUnit_1.prevLengthOfTextOperationUnitArray)($first, factory);
const prevLengthOfSecond = (0, textOperationUnit_1.prevLengthOfTextOperationUnitArray)($second, factory);
const prevLengthOfFirst = (0, operationUnit_1.prevLengthOfOperationUnitArray)($first, factory);
const prevLengthOfSecond = (0, operationUnit_1.prevLengthOfOperationUnitArray)($second, factory);
if (prevLengthOfFirst < prevLengthOfSecond) {

@@ -251,4 +251,4 @@ return result_1.Result.error({ type: error_1.secondTooLong });

let secondShift = undefined;
const firstPrime = new textOperationBuilder_1.TextOperationBuilder(factory);
const secondPrime = new textOperationBuilder_1.TextOperationBuilder(factory);
const firstPrime = new operationBuilder_1.OperationBuilder(factory);
const secondPrime = new operationBuilder_1.OperationBuilder(factory);
// eslint-disable-next-line no-constant-condition

@@ -412,3 +412,3 @@ while (true) {

headEdit: source.headEdit === undefined ? source.headEdit : (0, editElement_1.invertEditElement)(source.headEdit),
body: source.body.map(body => (0, textOperationElement_1.invertTextOperationElement)(body)),
body: source.body.map(body => (0, operationElement_1.invertOperationElement)(body)),
tailRetain: source.tailRetain,

@@ -415,0 +415,0 @@ };

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -28,4 +32,4 @@ if (k2 === undefined) k2 = k;

const positiveInt_1 = require("../positiveInt");
const factory_1 = require("../util/factory");
const textOperationBuilder_1 = require("../util/textOperationBuilder");
const operationBuilderFactory_1 = require("../operationBuilder/operationBuilderFactory");
const operationBuilder_1 = require("../operationBuilder/operationBuilder");
const TextUpOperation = __importStar(require("./upOperation"));

@@ -55,5 +59,5 @@ const applyBack = ({ nextState, downOperation, }) => {

const result = (0, core_1.composeCore)({
first: Array.from(new textOperationBuilder_1.TextOperationBuilder(factory_1.downFactory, first).toUnits()),
second: Array.from(new textOperationBuilder_1.TextOperationBuilder(factory_1.downFactory, second).toUnits()),
factory: factory_1.downFactory,
first: Array.from(new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.downFactory, first).toUnits()),
second: Array.from(new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.downFactory, second).toUnits()),
factory: operationBuilderFactory_1.downFactory,
splitInsert: (target, deleteCount) => [

@@ -81,3 +85,3 @@ deleteCount,

const toUnit = (source) => {
return Array.from(new textOperationBuilder_1.TextOperationBuilder(factory_1.downFactory, source).toUnits()).map(unit => {
return Array.from(new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.downFactory, source).toUnits()).map(unit => {
switch (unit.type) {

@@ -104,3 +108,3 @@ case const_1.insert$:

const ofUnit = (source) => {
const builder = new textOperationBuilder_1.TextOperationBuilder(factory_1.downFactory);
const builder = new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.downFactory);
for (const unit of source) {

@@ -107,0 +111,0 @@ if (unit == null) {

@@ -10,7 +10,7 @@ "use strict";

const positiveInt_1 = require("../positiveInt");
const factory_1 = require("../util/factory");
const textOperation_1 = require("../util/textOperation");
const textOperationBuilder_1 = require("../util/textOperationBuilder");
const operationBuilderFactory_1 = require("../operationBuilder/operationBuilderFactory");
const operation_1 = require("../operationBuilder/operation");
const operationBuilder_1 = require("../operationBuilder/operationBuilder");
const diff = ({ prevState, nextState, }) => {
const builder = new textOperationBuilder_1.TextOperationBuilder(factory_1.twoWayFactory);
const builder = new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.twoWayFactory);
const dmp = new diff_match_patch_1.diff_match_patch();

@@ -35,5 +35,5 @@ dmp.diff_main(prevState, nextState).forEach(([diffType, diff]) => {

const result = (0, core_1.transformCore)({
first: Array.from(new textOperationBuilder_1.TextOperationBuilder(factory_1.twoWayFactory, first).toUnits()),
second: Array.from(new textOperationBuilder_1.TextOperationBuilder(factory_1.twoWayFactory, second).toUnits()),
factory: factory_1.twoWayFactory,
first: Array.from(new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.twoWayFactory, first).toUnits()),
second: Array.from(new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.twoWayFactory, second).toUnits()),
factory: operationBuilderFactory_1.twoWayFactory,
splitDelete: (target, deleteCount) => [

@@ -55,3 +55,3 @@ new nonEmptyString_1.NonEmptyString(target.value.substring(0, deleteCount.value)),

const toUnit = (source) => {
return Array.from(new textOperationBuilder_1.TextOperationBuilder(factory_1.twoWayFactory, source).toUnits()).map(unit => {
return Array.from(new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.twoWayFactory, source).toUnits()).map(unit => {
switch (unit.type) {

@@ -78,3 +78,3 @@ case const_1.insert$:

const ofUnit = (source) => {
const builder = new textOperationBuilder_1.TextOperationBuilder(factory_1.twoWayFactory);
const builder = new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.twoWayFactory);
for (const unit of source) {

@@ -118,3 +118,3 @@ if (unit == null) {

const toUpOperation = (source) => {
return (0, textOperation_1.mapTextOperation)({
return (0, operation_1.mapOperation)({
source,

@@ -127,3 +127,3 @@ mapInsert: insert => insert,

const toDownOperation = (source) => {
return (0, textOperation_1.mapTextOperation)({
return (0, operation_1.mapOperation)({
source,

@@ -130,0 +130,0 @@ mapInsert: insert => insert.length,

@@ -10,8 +10,8 @@ "use strict";

const positiveInt_1 = require("../positiveInt");
const factory_1 = require("../util/factory");
const textOperationBuilder_1 = require("../util/textOperationBuilder");
const operationBuilderFactory_1 = require("../operationBuilder/operationBuilderFactory");
const operationBuilder_1 = require("../operationBuilder/operationBuilder");
const apply = ({ prevState, upOperation, }) => {
const result = (0, core_1.applyAndRestoreCore)({
state: prevState,
action: Array.from(new textOperationBuilder_1.TextOperationBuilder(factory_1.upFactory, upOperation).toIterable()),
action: Array.from(new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.upFactory, upOperation).toIterable()),
getDeleteLength: del => del,

@@ -29,6 +29,6 @@ mapping: () => option_1.Option.some(undefined),

state: prevState,
action: Array.from(new textOperationBuilder_1.TextOperationBuilder(factory_1.upFactory, upOperation).toIterable()),
action: Array.from(new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.upFactory, upOperation).toIterable()),
getDeleteLength: del => del,
restoreOption: {
factory: factory_1.twoWayFactory,
factory: operationBuilderFactory_1.twoWayFactory,
},

@@ -51,5 +51,5 @@ mapping: ({ actual }) => option_1.Option.some(actual),

const result = (0, core_1.composeCore)({
first: Array.from(new textOperationBuilder_1.TextOperationBuilder(factory_1.upFactory, first).toUnits()),
second: Array.from(new textOperationBuilder_1.TextOperationBuilder(factory_1.upFactory, second).toUnits()),
factory: factory_1.upFactory,
first: Array.from(new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.upFactory, first).toUnits()),
second: Array.from(new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.upFactory, second).toUnits()),
factory: operationBuilderFactory_1.upFactory,
splitInsert: (str, index) => [

@@ -76,5 +76,5 @@ new nonEmptyString_1.NonEmptyString(str.value.substring(0, index.value)),

const result = (0, core_1.transformCore)({
first: Array.from(new textOperationBuilder_1.TextOperationBuilder(factory_1.upFactory, first).toUnits()),
second: Array.from(new textOperationBuilder_1.TextOperationBuilder(factory_1.upFactory, second).toUnits()),
factory: factory_1.upFactory,
first: Array.from(new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.upFactory, first).toUnits()),
second: Array.from(new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.upFactory, second).toUnits()),
factory: operationBuilderFactory_1.upFactory,
splitDelete: (target, deleteCount) => [

@@ -98,3 +98,3 @@ deleteCount,

const toUnit = (source) => {
return Array.from(new textOperationBuilder_1.TextOperationBuilder(factory_1.upFactory, source).toUnits()).map(unit => {
return Array.from(new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.upFactory, source).toUnits()).map(unit => {
switch (unit.type) {

@@ -121,3 +121,3 @@ case const_1.insert$:

const ofUnit = (source) => {
const builder = new textOperationBuilder_1.TextOperationBuilder(factory_1.upFactory);
const builder = new operationBuilder_1.OperationBuilder(operationBuilderFactory_1.upFactory);
for (const unit of source) {

@@ -124,0 +124,0 @@ if (unit == null) {

@@ -8,1 +8,2 @@ export { PositiveInt } from './internal/positiveInt';

export { applyBack, applyBackAndRestore, invert as invertDownOperation, compose as composeDownOperation, toUnit as serializeDownOperation, ofUnit as deserializeDownOperation, } from './internal/operation/downOperation';
export { OperationBuilder } from './internal/operationBuilder/operationBuilder';

@@ -6,7 +6,7 @@ import { Result } from '@kizahasi/result';

import { PositiveInt } from '../positiveInt';
import { invertEditElement } from '../util/editElement';
import { prevLengthOfTextOperationElementArray, } from '../util/textOperationArrayElement';
import { TextOperationBuilder } from '../util/textOperationBuilder';
import { invertTextOperationElement } from '../util/textOperationElement';
import { nextLengthOfTextOperationUnitArray, prevLengthOfTextOperationUnitArray, } from '../util/textOperationUnit';
import { invertEditElement } from '../operationBuilder/editElement';
import { prevLengthOfOperationElementArray, } from '../operationBuilder/operationArrayElement';
import { OperationBuilder } from '../operationBuilder/operationBuilder';
import { invertOperationElement } from '../operationBuilder/operationElement';
import { nextLengthOfOperationUnitArray, prevLengthOfOperationUnitArray, } from '../operationBuilder/operationUnit';
const replace = ({ source, start, count, replacement, }) => {

@@ -24,3 +24,3 @@ if (source.length < start + count) {

var _a, _b;
const prevLength = prevLengthOfTextOperationElementArray(action, getDeleteLength);
const prevLength = prevLengthOfOperationElementArray(action, getDeleteLength);
if (state.length < prevLength) {

@@ -36,3 +36,3 @@ return Result.error({ type: stateTooShort });

? undefined
: new TextOperationBuilder(restoreOption.factory);
: new OperationBuilder(restoreOption.factory);
for (const act of action) {

@@ -86,4 +86,4 @@ switch (act.type) {

export const composeCore = ({ first: $first, second: $second, factory, splitDelete: splitDeleteCore, splitInsert: splitInsertCore, }) => {
const nextLengthOfFirst = nextLengthOfTextOperationUnitArray($first, factory);
const prevLengthOfSecond = prevLengthOfTextOperationUnitArray($second, factory);
const nextLengthOfFirst = nextLengthOfOperationUnitArray($first, factory);
const prevLengthOfSecond = prevLengthOfOperationUnitArray($second, factory);
if (nextLengthOfFirst < prevLengthOfSecond) {

@@ -99,3 +99,3 @@ return Result.error({ type: secondTooLong });

let secondShift = undefined;
const builder = new TextOperationBuilder(factory);
const builder = new OperationBuilder(factory);
// eslint-disable-next-line no-constant-condition

@@ -233,4 +233,4 @@ while (true) {

export const transformCore = ({ first: $first, second: $second, factory, splitDelete: splitDeleteCore, }) => {
const prevLengthOfFirst = prevLengthOfTextOperationUnitArray($first, factory);
const prevLengthOfSecond = prevLengthOfTextOperationUnitArray($second, factory);
const prevLengthOfFirst = prevLengthOfOperationUnitArray($first, factory);
const prevLengthOfSecond = prevLengthOfOperationUnitArray($second, factory);
if (prevLengthOfFirst < prevLengthOfSecond) {

@@ -246,4 +246,4 @@ return Result.error({ type: secondTooLong });

let secondShift = undefined;
const firstPrime = new TextOperationBuilder(factory);
const secondPrime = new TextOperationBuilder(factory);
const firstPrime = new OperationBuilder(factory);
const secondPrime = new OperationBuilder(factory);
// eslint-disable-next-line no-constant-condition

@@ -406,5 +406,5 @@ while (true) {

headEdit: source.headEdit === undefined ? source.headEdit : invertEditElement(source.headEdit),
body: source.body.map(body => invertTextOperationElement(body)),
body: source.body.map(body => invertOperationElement(body)),
tailRetain: source.tailRetain,
};
};

@@ -6,4 +6,4 @@ import { Result } from '@kizahasi/result';

import { PositiveInt } from '../positiveInt';
import { downFactory } from '../util/factory';
import { TextOperationBuilder } from '../util/textOperationBuilder';
import { downFactory } from '../operationBuilder/operationBuilderFactory';
import { OperationBuilder } from '../operationBuilder/operationBuilder';
import * as TextUpOperation from './upOperation';

@@ -31,4 +31,4 @@ export const applyBack = ({ nextState, downOperation, }) => {

const result = composeCore({
first: Array.from(new TextOperationBuilder(downFactory, first).toUnits()),
second: Array.from(new TextOperationBuilder(downFactory, second).toUnits()),
first: Array.from(new OperationBuilder(downFactory, first).toUnits()),
second: Array.from(new OperationBuilder(downFactory, second).toUnits()),
factory: downFactory,

@@ -55,3 +55,3 @@ splitInsert: (target, deleteCount) => [

export const toUnit = (source) => {
return Array.from(new TextOperationBuilder(downFactory, source).toUnits()).map(unit => {
return Array.from(new OperationBuilder(downFactory, source).toUnits()).map(unit => {
switch (unit.type) {

@@ -77,3 +77,3 @@ case insert$:

export const ofUnit = (source) => {
const builder = new TextOperationBuilder(downFactory);
const builder = new OperationBuilder(downFactory);
for (const unit of source) {

@@ -80,0 +80,0 @@ if (unit == null) {

@@ -7,7 +7,7 @@ import { Result } from '@kizahasi/result';

import { PositiveInt } from '../positiveInt';
import { twoWayFactory } from '../util/factory';
import { mapTextOperation } from '../util/textOperation';
import { TextOperationBuilder } from '../util/textOperationBuilder';
import { twoWayFactory } from '../operationBuilder/operationBuilderFactory';
import { mapOperation } from '../operationBuilder/operation';
import { OperationBuilder } from '../operationBuilder/operationBuilder';
export const diff = ({ prevState, nextState, }) => {
const builder = new TextOperationBuilder(twoWayFactory);
const builder = new OperationBuilder(twoWayFactory);
const dmp = new diff_match_patch();

@@ -31,4 +31,4 @@ dmp.diff_main(prevState, nextState).forEach(([diffType, diff]) => {

const result = transformCore({
first: Array.from(new TextOperationBuilder(twoWayFactory, first).toUnits()),
second: Array.from(new TextOperationBuilder(twoWayFactory, second).toUnits()),
first: Array.from(new OperationBuilder(twoWayFactory, first).toUnits()),
second: Array.from(new OperationBuilder(twoWayFactory, second).toUnits()),
factory: twoWayFactory,

@@ -50,3 +50,3 @@ splitDelete: (target, deleteCount) => [

export const toUnit = (source) => {
return Array.from(new TextOperationBuilder(twoWayFactory, source).toUnits()).map(unit => {
return Array.from(new OperationBuilder(twoWayFactory, source).toUnits()).map(unit => {
switch (unit.type) {

@@ -72,3 +72,3 @@ case insert$:

export const ofUnit = (source) => {
const builder = new TextOperationBuilder(twoWayFactory);
const builder = new OperationBuilder(twoWayFactory);
for (const unit of source) {

@@ -111,3 +111,3 @@ if (unit == null) {

export const toUpOperation = (source) => {
return mapTextOperation({
return mapOperation({
source,

@@ -119,3 +119,3 @@ mapInsert: insert => insert,

export const toDownOperation = (source) => {
return mapTextOperation({
return mapOperation({
source,

@@ -122,0 +122,0 @@ mapInsert: insert => insert.length,

@@ -7,8 +7,8 @@ import { Option } from '@kizahasi/option';

import { PositiveInt } from '../positiveInt';
import { upFactory, twoWayFactory } from '../util/factory';
import { TextOperationBuilder } from '../util/textOperationBuilder';
import { upFactory, twoWayFactory } from '../operationBuilder/operationBuilderFactory';
import { OperationBuilder } from '../operationBuilder/operationBuilder';
export const apply = ({ prevState, upOperation, }) => {
const result = applyAndRestoreCore({
state: prevState,
action: Array.from(new TextOperationBuilder(upFactory, upOperation).toIterable()),
action: Array.from(new OperationBuilder(upFactory, upOperation).toIterable()),
getDeleteLength: del => del,

@@ -25,3 +25,3 @@ mapping: () => Option.some(undefined),

state: prevState,
action: Array.from(new TextOperationBuilder(upFactory, upOperation).toIterable()),
action: Array.from(new OperationBuilder(upFactory, upOperation).toIterable()),
getDeleteLength: del => del,

@@ -46,4 +46,4 @@ restoreOption: {

const result = composeCore({
first: Array.from(new TextOperationBuilder(upFactory, first).toUnits()),
second: Array.from(new TextOperationBuilder(upFactory, second).toUnits()),
first: Array.from(new OperationBuilder(upFactory, first).toUnits()),
second: Array.from(new OperationBuilder(upFactory, second).toUnits()),
factory: upFactory,

@@ -70,4 +70,4 @@ splitInsert: (str, index) => [

const result = transformCore({
first: Array.from(new TextOperationBuilder(upFactory, first).toUnits()),
second: Array.from(new TextOperationBuilder(upFactory, second).toUnits()),
first: Array.from(new OperationBuilder(upFactory, first).toUnits()),
second: Array.from(new OperationBuilder(upFactory, second).toUnits()),
factory: upFactory,

@@ -90,3 +90,3 @@ splitDelete: (target, deleteCount) => [

export const toUnit = (source) => {
return Array.from(new TextOperationBuilder(upFactory, source).toUnits()).map(unit => {
return Array.from(new OperationBuilder(upFactory, source).toUnits()).map(unit => {
switch (unit.type) {

@@ -112,3 +112,3 @@ case insert$:

export const ofUnit = (source) => {
const builder = new TextOperationBuilder(upFactory);
const builder = new OperationBuilder(upFactory);
for (const unit of source) {

@@ -115,0 +115,0 @@ if (unit == null) {

@@ -44,1 +44,3 @@ export { PositiveInt } from './internal/positiveInt';

} from './internal/operation/downOperation';
export { OperationBuilder } from './internal/operationBuilder/operationBuilder';
export { OperationBuilderFactory } from './internal/operationBuilder/operationBuilderFactory';

@@ -15,16 +15,16 @@ import { Option } from '@kizahasi/option';

import { PositiveInt } from '../positiveInt';
import { invertEditElement } from '../util/editElement';
import { Factory } from '../util/factory';
import { TextOperation } from '../util/textOperation';
import { invertEditElement } from '../operationBuilder/editElement';
import { OperationBuilderFactory } from '../operationBuilder/operationBuilderFactory';
import { Operation } from '../operationBuilder/operation';
import {
TextOperationArrayElement,
prevLengthOfTextOperationElementArray,
} from '../util/textOperationArrayElement';
import { TextOperationBuilder } from '../util/textOperationBuilder';
import { invertTextOperationElement } from '../util/textOperationElement';
OperationArrayElement,
prevLengthOfOperationElementArray,
} from '../operationBuilder/operationArrayElement';
import { OperationBuilder } from '../operationBuilder/operationBuilder';
import { invertOperationElement } from '../operationBuilder/operationElement';
import {
TextOperationUnit,
nextLengthOfTextOperationUnitArray,
prevLengthOfTextOperationUnitArray,
} from '../util/textOperationUnit';
OperationUnit,
nextLengthOfOperationUnitArray,
prevLengthOfOperationUnitArray,
} from '../operationBuilder/operationUnit';

@@ -60,3 +60,3 @@ const replace = ({

state: string;
action: ReadonlyArray<TextOperationArrayElement<NonEmptyString, TDelete1>>;
action: ReadonlyArray<OperationArrayElement<NonEmptyString, TDelete1>>;
getDeleteLength(del: TDelete1): PositiveInt;

@@ -66,3 +66,3 @@

restoreOption?: {
factory: Factory<NonEmptyString, TDelete2>;
factory: OperationBuilderFactory<NonEmptyString, TDelete2>;
};

@@ -74,6 +74,6 @@

}): Result<
{ newState: string; restored?: TextOperation<NonEmptyString, TDelete2> },
{ newState: string; restored?: Operation<NonEmptyString, TDelete2> },
ApplyError<TDelete1>
> => {
const prevLength = prevLengthOfTextOperationElementArray(action, getDeleteLength);
const prevLength = prevLengthOfOperationElementArray(action, getDeleteLength);
if (state.length < prevLength) {

@@ -91,3 +91,3 @@ return Result.error({ type: stateTooShort });

? undefined
: new TextOperationBuilder<NonEmptyString, TDelete2>(restoreOption.factory);
: new OperationBuilder<NonEmptyString, TDelete2>(restoreOption.factory);

@@ -150,4 +150,4 @@ for (const act of action) {

}: {
first: ReadonlyArray<TextOperationUnit<TInsert, TDelete>>;
second: ReadonlyArray<TextOperationUnit<TInsert, TDelete>>;
first: ReadonlyArray<OperationUnit<TInsert, TDelete>>;
second: ReadonlyArray<OperationUnit<TInsert, TDelete>>;

@@ -164,6 +164,6 @@ // 例:

factory: Factory<TInsert, TDelete>;
}): Result<TextOperation<TInsert, TDelete>, ComposeAndTransformErrorBase> => {
const nextLengthOfFirst = nextLengthOfTextOperationUnitArray($first, factory);
const prevLengthOfSecond = prevLengthOfTextOperationUnitArray($second, factory);
factory: OperationBuilderFactory<TInsert, TDelete>;
}): Result<Operation<TInsert, TDelete>, ComposeAndTransformErrorBase> => {
const nextLengthOfFirst = nextLengthOfOperationUnitArray($first, factory);
const prevLengthOfSecond = prevLengthOfOperationUnitArray($second, factory);
if (nextLengthOfFirst < prevLengthOfSecond) {

@@ -178,6 +178,6 @@ return Result.error({ type: secondTooLong });

const second = Array.from($second);
let firstShift: TextOperationUnit<TInsert, TDelete> | undefined = undefined;
let secondShift: TextOperationUnit<TInsert, TDelete> | undefined = undefined;
let firstShift: OperationUnit<TInsert, TDelete> | undefined = undefined;
let secondShift: OperationUnit<TInsert, TDelete> | undefined = undefined;
const builder = new TextOperationBuilder<TInsert, TDelete>(factory);
const builder = new OperationBuilder<TInsert, TDelete>(factory);

@@ -340,4 +340,4 @@ // eslint-disable-next-line no-constant-condition

}: {
first: ReadonlyArray<TextOperationUnit<TInsert, TDelete>>;
second: ReadonlyArray<TextOperationUnit<TInsert, TDelete>>;
first: ReadonlyArray<OperationUnit<TInsert, TDelete>>;
second: ReadonlyArray<OperationUnit<TInsert, TDelete>>;

@@ -351,12 +351,12 @@ // 例:

factory: Factory<TInsert, TDelete>;
factory: OperationBuilderFactory<TInsert, TDelete>;
}): Result<
{
firstPrime: TextOperation<TInsert, TDelete>;
secondPrime: TextOperation<TInsert, TDelete>;
firstPrime: Operation<TInsert, TDelete>;
secondPrime: Operation<TInsert, TDelete>;
},
ComposeAndTransformErrorBase
> => {
const prevLengthOfFirst = prevLengthOfTextOperationUnitArray($first, factory);
const prevLengthOfSecond = prevLengthOfTextOperationUnitArray($second, factory);
const prevLengthOfFirst = prevLengthOfOperationUnitArray($first, factory);
const prevLengthOfSecond = prevLengthOfOperationUnitArray($second, factory);
if (prevLengthOfFirst < prevLengthOfSecond) {

@@ -371,7 +371,7 @@ return Result.error({ type: secondTooLong });

const second = Array.from($second);
let firstShift: TextOperationUnit<TInsert, TDelete> | undefined = undefined;
let secondShift: TextOperationUnit<TInsert, TDelete> | undefined = undefined;
let firstShift: OperationUnit<TInsert, TDelete> | undefined = undefined;
let secondShift: OperationUnit<TInsert, TDelete> | undefined = undefined;
const firstPrime = new TextOperationBuilder<TInsert, TDelete>(factory);
const secondPrime = new TextOperationBuilder<TInsert, TDelete>(factory);
const firstPrime = new OperationBuilder<TInsert, TDelete>(factory);
const secondPrime = new OperationBuilder<TInsert, TDelete>(factory);

@@ -559,9 +559,9 @@ // eslint-disable-next-line no-constant-condition

export const invertCore = <T1, T2>(source: TextOperation<T1, T2>): TextOperation<T2, T1> => {
export const invertCore = <T1, T2>(source: Operation<T1, T2>): Operation<T2, T1> => {
return {
headEdit:
source.headEdit === undefined ? source.headEdit : invertEditElement(source.headEdit),
body: source.body.map(body => invertTextOperationElement(body)),
body: source.body.map(body => invertOperationElement(body)),
tailRetain: source.tailRetain,
};
};
import { NonEmptyString } from './nonEmptyString';
import { TextOperation } from './util/textOperation';
import { Operation } from './operationBuilder/operation';

@@ -29,4 +29,4 @@ export const deleteStringNotMatch = 'deleteStringNotMatch';

export type ComposeAndTransformError<TInsert, TDelete> = ComposeAndTransformErrorBase & {
first: TextOperation<TInsert, TDelete>;
second: TextOperation<TInsert, TDelete>;
first: Operation<TInsert, TDelete>;
second: Operation<TInsert, TDelete>;
};

@@ -7,9 +7,9 @@ import { Result } from '@kizahasi/result';

import { PositiveInt } from '../positiveInt';
import { downFactory } from '../util/factory';
import { TextOperation } from '../util/textOperation';
import { TextOperationBuilder } from '../util/textOperationBuilder';
import { downFactory } from '../operationBuilder/operationBuilderFactory';
import { Operation } from '../operationBuilder/operation';
import { OperationBuilder } from '../operationBuilder/operationBuilder';
import * as TextTwoWayOperation from './twoWayOperation';
import * as TextUpOperation from './upOperation';
export type DownOperation = TextOperation<PositiveInt, NonEmptyString>;
export type DownOperation = Operation<PositiveInt, NonEmptyString>;
export type DownOperationUnit =

@@ -73,4 +73,4 @@ | {

const result = composeCore({
first: Array.from(new TextOperationBuilder(downFactory, first).toUnits()),
second: Array.from(new TextOperationBuilder(downFactory, second).toUnits()),
first: Array.from(new OperationBuilder(downFactory, first).toUnits()),
second: Array.from(new OperationBuilder(downFactory, second).toUnits()),
factory: downFactory,

@@ -96,7 +96,7 @@ splitInsert: (target, deleteCount) => [

export const invert = (source: DownOperation): TextOperation<NonEmptyString, PositiveInt> =>
export const invert = (source: DownOperation): Operation<NonEmptyString, PositiveInt> =>
invertCore(source);
export const toUnit = (source: DownOperation): DownOperationUnit[] => {
return Array.from(new TextOperationBuilder(downFactory, source).toUnits()).map(unit => {
return Array.from(new OperationBuilder(downFactory, source).toUnits()).map(unit => {
switch (unit.type) {

@@ -125,3 +125,3 @@ case insert$:

): DownOperation => {
const builder = new TextOperationBuilder<PositiveInt, NonEmptyString>(downFactory);
const builder = new OperationBuilder<PositiveInt, NonEmptyString>(downFactory);
for (const unit of source) {

@@ -128,0 +128,0 @@ if (unit == null) {

@@ -8,7 +8,7 @@ import { Result } from '@kizahasi/result';

import { PositiveInt } from '../positiveInt';
import { twoWayFactory } from '../util/factory';
import { TextOperation, mapTextOperation } from '../util/textOperation';
import { TextOperationBuilder } from '../util/textOperationBuilder';
import { twoWayFactory } from '../operationBuilder/operationBuilderFactory';
import { Operation, mapOperation } from '../operationBuilder/operation';
import { OperationBuilder } from '../operationBuilder/operationBuilder';
export type TwoWayOperation = TextOperation<NonEmptyString, NonEmptyString>;
export type TwoWayOperation = Operation<NonEmptyString, NonEmptyString>;
export type TwoWayOperationUnit =

@@ -35,3 +35,3 @@ | {

}): TwoWayOperation => {
const builder = new TextOperationBuilder<NonEmptyString, NonEmptyString>(twoWayFactory);
const builder = new OperationBuilder<NonEmptyString, NonEmptyString>(twoWayFactory);
const dmp = new diff_match_patch();

@@ -65,4 +65,4 @@ dmp.diff_main(prevState, nextState).forEach(([diffType, diff]) => {

const result = transformCore({
first: Array.from(new TextOperationBuilder(twoWayFactory, first).toUnits()),
second: Array.from(new TextOperationBuilder(twoWayFactory, second).toUnits()),
first: Array.from(new OperationBuilder(twoWayFactory, first).toUnits()),
second: Array.from(new OperationBuilder(twoWayFactory, second).toUnits()),
factory: twoWayFactory,

@@ -85,3 +85,3 @@ splitDelete: (target, deleteCount) => [

export const toUnit = (source: TwoWayOperation): TwoWayOperationUnit[] => {
return Array.from(new TextOperationBuilder(twoWayFactory, source).toUnits()).map(unit => {
return Array.from(new OperationBuilder(twoWayFactory, source).toUnits()).map(unit => {
switch (unit.type) {

@@ -108,3 +108,3 @@ case insert$:

export const ofUnit = (source: ReadonlyArray<TwoWayOperationUnit>): TwoWayOperation => {
const builder = new TextOperationBuilder<NonEmptyString, NonEmptyString>(twoWayFactory);
const builder = new OperationBuilder<NonEmptyString, NonEmptyString>(twoWayFactory);
for (const unit of source) {

@@ -147,6 +147,4 @@ if (unit == null) {

export const toUpOperation = (
source: TwoWayOperation
): TextOperation<NonEmptyString, PositiveInt> => {
return mapTextOperation({
export const toUpOperation = (source: TwoWayOperation): Operation<NonEmptyString, PositiveInt> => {
return mapOperation({
source,

@@ -160,4 +158,4 @@ mapInsert: insert => insert,

source: TwoWayOperation
): TextOperation<PositiveInt, NonEmptyString> => {
return mapTextOperation({
): Operation<PositiveInt, NonEmptyString> => {
return mapOperation({
source,

@@ -164,0 +162,0 @@ mapInsert: insert => insert.length,

@@ -8,8 +8,8 @@ import { Option } from '@kizahasi/option';

import { PositiveInt } from '../positiveInt';
import { upFactory, twoWayFactory } from '../util/factory';
import { TextOperation } from '../util/textOperation';
import { TextOperationBuilder } from '../util/textOperationBuilder';
import { upFactory, twoWayFactory } from '../operationBuilder/operationBuilderFactory';
import { Operation } from '../operationBuilder/operation';
import { OperationBuilder } from '../operationBuilder/operationBuilder';
import * as TextTwoWayOperation from './twoWayOperation';
export type UpOperation = TextOperation<NonEmptyString, PositiveInt>;
export type UpOperation = Operation<NonEmptyString, PositiveInt>;
export type UpOperationUnit =

@@ -38,3 +38,3 @@ | {

state: prevState,
action: Array.from(new TextOperationBuilder(upFactory, upOperation).toIterable()),
action: Array.from(new OperationBuilder(upFactory, upOperation).toIterable()),
getDeleteLength: del => del,

@@ -61,3 +61,3 @@ mapping: () => Option.some(undefined),

state: prevState,
action: Array.from(new TextOperationBuilder(upFactory, upOperation).toIterable()),
action: Array.from(new OperationBuilder(upFactory, upOperation).toIterable()),
getDeleteLength: del => del,

@@ -89,4 +89,4 @@ restoreOption: {

const result = composeCore({
first: Array.from(new TextOperationBuilder(upFactory, first).toUnits()),
second: Array.from(new TextOperationBuilder(upFactory, second).toUnits()),
first: Array.from(new OperationBuilder(upFactory, first).toUnits()),
second: Array.from(new OperationBuilder(upFactory, second).toUnits()),
factory: upFactory,

@@ -123,4 +123,4 @@ splitInsert: (str, index) => [

const result = transformCore({
first: Array.from(new TextOperationBuilder(upFactory, first).toUnits()),
second: Array.from(new TextOperationBuilder(upFactory, second).toUnits()),
first: Array.from(new OperationBuilder(upFactory, first).toUnits()),
second: Array.from(new OperationBuilder(upFactory, second).toUnits()),
factory: upFactory,

@@ -142,7 +142,7 @@ splitDelete: (target, deleteCount) => [

export const invert = (source: UpOperation): TextOperation<PositiveInt, NonEmptyString> =>
export const invert = (source: UpOperation): Operation<PositiveInt, NonEmptyString> =>
invertCore(source);
export const toUnit = (source: UpOperation): UpOperationUnit[] => {
return Array.from(new TextOperationBuilder(upFactory, source).toUnits()).map(unit => {
return Array.from(new OperationBuilder(upFactory, source).toUnits()).map(unit => {
switch (unit.type) {

@@ -171,3 +171,3 @@ case insert$:

): UpOperation => {
const builder = new TextOperationBuilder<NonEmptyString, PositiveInt>(upFactory);
const builder = new OperationBuilder<NonEmptyString, PositiveInt>(upFactory);
for (const unit of source) {

@@ -174,0 +174,0 @@ if (unit == null) {

@@ -8,2 +8,4 @@ export { PositiveInt } from './internal/positiveInt';

export { DownOperation, DownOperationUnit, applyBack, applyBackAndRestore, invert as invertDownOperation, compose as composeDownOperation, toUnit as serializeDownOperation, ofUnit as deserializeDownOperation, } from './internal/operation/downOperation';
export { OperationBuilder } from './internal/operationBuilder/operationBuilder';
export { OperationBuilderFactory } from './internal/operationBuilder/operationBuilderFactory';
//# sourceMappingURL=index.d.ts.map

@@ -6,12 +6,12 @@ import { Option } from '@kizahasi/option';

import { PositiveInt } from '../positiveInt';
import { Factory } from '../util/factory';
import { TextOperation } from '../util/textOperation';
import { TextOperationArrayElement } from '../util/textOperationArrayElement';
import { TextOperationUnit } from '../util/textOperationUnit';
import { OperationBuilderFactory } from '../operationBuilder/operationBuilderFactory';
import { Operation } from '../operationBuilder/operation';
import { OperationArrayElement } from '../operationBuilder/operationArrayElement';
import { OperationUnit } from '../operationBuilder/operationUnit';
export declare const applyAndRestoreCore: <TDelete1, TDelete2>({ state, action, getDeleteLength, restoreOption, mapping, }: {
state: string;
action: readonly TextOperationArrayElement<NonEmptyString, TDelete1>[];
action: readonly OperationArrayElement<NonEmptyString, TDelete1>[];
getDeleteLength(del: TDelete1): PositiveInt;
restoreOption?: {
factory: Factory<NonEmptyString, TDelete2>;
factory: OperationBuilderFactory<NonEmptyString, TDelete2>;
} | undefined;

@@ -24,21 +24,21 @@ mapping: (params: {

newState: string;
restored?: TextOperation<NonEmptyString, TDelete2> | undefined;
restored?: Operation<NonEmptyString, TDelete2> | undefined;
}, ApplyError<TDelete1>>;
export declare const composeCore: <TInsert, TDelete>({ first: $first, second: $second, factory, splitDelete: splitDeleteCore, splitInsert: splitInsertCore, }: {
first: readonly TextOperationUnit<TInsert, TDelete>[];
second: readonly TextOperationUnit<TInsert, TDelete>[];
first: readonly OperationUnit<TInsert, TDelete>[];
second: readonly OperationUnit<TInsert, TDelete>[];
splitDelete: (target: TDelete, index: PositiveInt) => [TDelete, TDelete];
splitInsert: (target: TInsert, index: PositiveInt) => [TInsert, TInsert];
factory: Factory<TInsert, TDelete>;
}) => Result<TextOperation<TInsert, TDelete>, ComposeAndTransformErrorBase>;
factory: OperationBuilderFactory<TInsert, TDelete>;
}) => Result<Operation<TInsert, TDelete>, ComposeAndTransformErrorBase>;
export declare const transformCore: <TInsert, TDelete>({ first: $first, second: $second, factory, splitDelete: splitDeleteCore, }: {
first: readonly TextOperationUnit<TInsert, TDelete>[];
second: readonly TextOperationUnit<TInsert, TDelete>[];
first: readonly OperationUnit<TInsert, TDelete>[];
second: readonly OperationUnit<TInsert, TDelete>[];
splitDelete: (target: TDelete, index: PositiveInt) => [TDelete, TDelete];
factory: Factory<TInsert, TDelete>;
factory: OperationBuilderFactory<TInsert, TDelete>;
}) => Result<{
firstPrime: TextOperation<TInsert, TDelete>;
secondPrime: TextOperation<TInsert, TDelete>;
firstPrime: Operation<TInsert, TDelete>;
secondPrime: Operation<TInsert, TDelete>;
}, ComposeAndTransformErrorBase>;
export declare const invertCore: <T1, T2>(source: TextOperation<T1, T2>) => TextOperation<T2, T1>;
export declare const invertCore: <T1, T2>(source: Operation<T1, T2>) => Operation<T2, T1>;
//# sourceMappingURL=index.d.ts.map
import { NonEmptyString } from './nonEmptyString';
import { TextOperation } from './util/textOperation';
import { Operation } from './operationBuilder/operation';
export declare const deleteStringNotMatch = "deleteStringNotMatch";

@@ -8,3 +8,3 @@ export declare const stateTooShort = "stateTooShort";

export declare const secondTooLong = "secondTooLong";
export declare type ApplyError<TDelete> = {
export type ApplyError<TDelete> = {
type: typeof stateTooShort;

@@ -19,9 +19,9 @@ } | {

};
export declare type ComposeAndTransformErrorBase = {
export type ComposeAndTransformErrorBase = {
type: typeof secondTooShort | typeof secondTooLong;
};
export declare type ComposeAndTransformError<TInsert, TDelete> = ComposeAndTransformErrorBase & {
first: TextOperation<TInsert, TDelete>;
second: TextOperation<TInsert, TDelete>;
export type ComposeAndTransformError<TInsert, TDelete> = ComposeAndTransformErrorBase & {
first: Operation<TInsert, TDelete>;
second: Operation<TInsert, TDelete>;
};
//# sourceMappingURL=error.d.ts.map

@@ -6,6 +6,6 @@ import { Result } from '@kizahasi/result';

import { PositiveInt } from '../positiveInt';
import { TextOperation } from '../util/textOperation';
import { Operation } from '../operationBuilder/operation';
import * as TextTwoWayOperation from './twoWayOperation';
export declare type DownOperation = TextOperation<PositiveInt, NonEmptyString>;
export declare type DownOperationUnit = {
export type DownOperation = Operation<PositiveInt, NonEmptyString>;
export type DownOperationUnit = {
t: typeof r;

@@ -35,5 +35,5 @@ r: number;

}) => Result<DownOperation, ComposeAndTransformError<PositiveInt, NonEmptyString>>;
export declare const invert: (source: DownOperation) => TextOperation<NonEmptyString, PositiveInt>;
export declare const invert: (source: DownOperation) => Operation<NonEmptyString, PositiveInt>;
export declare const toUnit: (source: DownOperation) => DownOperationUnit[];
export declare const ofUnit: (source: ReadonlyArray<DownOperationUnit | TextTwoWayOperation.TwoWayOperationUnit>) => DownOperation;
//# sourceMappingURL=downOperation.d.ts.map

@@ -6,5 +6,5 @@ import { Result } from '@kizahasi/result';

import { PositiveInt } from '../positiveInt';
import { TextOperation } from '../util/textOperation';
export declare type TwoWayOperation = TextOperation<NonEmptyString, NonEmptyString>;
export declare type TwoWayOperationUnit = {
import { Operation } from '../operationBuilder/operation';
export type TwoWayOperation = Operation<NonEmptyString, NonEmptyString>;
export type TwoWayOperationUnit = {
t: typeof r;

@@ -32,4 +32,4 @@ r: number;

export declare const ofUnit: (source: ReadonlyArray<TwoWayOperationUnit>) => TwoWayOperation;
export declare const toUpOperation: (source: TwoWayOperation) => TextOperation<NonEmptyString, PositiveInt>;
export declare const toDownOperation: (source: TwoWayOperation) => TextOperation<PositiveInt, NonEmptyString>;
export declare const toUpOperation: (source: TwoWayOperation) => Operation<NonEmptyString, PositiveInt>;
export declare const toDownOperation: (source: TwoWayOperation) => Operation<PositiveInt, NonEmptyString>;
//# sourceMappingURL=twoWayOperation.d.ts.map

@@ -6,6 +6,6 @@ import { Result } from '@kizahasi/result';

import { PositiveInt } from '../positiveInt';
import { TextOperation } from '../util/textOperation';
import { Operation } from '../operationBuilder/operation';
import * as TextTwoWayOperation from './twoWayOperation';
export declare type UpOperation = TextOperation<NonEmptyString, PositiveInt>;
export declare type UpOperationUnit = {
export type UpOperation = Operation<NonEmptyString, PositiveInt>;
export type UpOperationUnit = {
t: typeof r;

@@ -42,5 +42,5 @@ r: number;

}, ComposeAndTransformError<NonEmptyString, PositiveInt>>;
export declare const invert: (source: UpOperation) => TextOperation<PositiveInt, NonEmptyString>;
export declare const invert: (source: UpOperation) => Operation<PositiveInt, NonEmptyString>;
export declare const toUnit: (source: UpOperation) => UpOperationUnit[];
export declare const ofUnit: (source: ReadonlyArray<UpOperationUnit | TextTwoWayOperation.TwoWayOperationUnit>) => UpOperation;
//# sourceMappingURL=upOperation.d.ts.map
import { delete$, insert$, replace$ } from './const';
export declare type Insert<TInsert> = {
export type Insert<TInsert> = {
type: typeof insert$;

@@ -7,3 +7,3 @@ insert: TInsert;

};
export declare type Delete<TDelete> = {
export type Delete<TDelete> = {
type: typeof delete$;

@@ -13,3 +13,3 @@ insert?: undefined;

};
export declare type Replace<TInsert, TDelete> = {
export type Replace<TInsert, TDelete> = {
type: typeof replace$;

@@ -16,0 +16,0 @@ insert: TInsert;

{
"version": "0.4.1",
"version": "0.5.0",
"license": "MIT",

@@ -11,4 +11,5 @@ "main": "dist/cjs/index.js",

"engines": {
"node": ">=12"
"node": ">=14"
},
"packageManager": "pnpm@8.2.0",
"scripts": {

@@ -19,3 +20,3 @@ "build": "rimraf ./dist && copyfiles \"./src/**/*.ts\" ./dist && tsc -p tsconfig.build-cjs.json && tsc -p tsconfig.build-esm.json && tsc -p tsconfig.build-types.json",

"lint": "eslint src test",
"prettier": "yarn prettier:base --write",
"prettier": "pnpm prettier:base --write",
"prettier:base": "prettier \"**/*.{ts,js,json,yml,md}\""

@@ -45,18 +46,18 @@ },

"devDependencies": {
"@commitlint/cli": "16.2.3",
"@commitlint/config-conventional": "16.2.1",
"@commitlint/cli": "17.3.0",
"@commitlint/config-conventional": "17.3.0",
"@types/diff-match-patch": "1.0.32",
"@types/jest": "27.4.1",
"@typescript-eslint/eslint-plugin": "5.8.1",
"@typescript-eslint/parser": "5.8.1",
"copyfiles": "^2.4.1",
"eslint": "8.12.0",
"eslint-config-prettier": "8.3.0",
"fast-check": "2.20.0",
"husky": "7.0.4",
"jest": "27.5.1",
"prettier": "2.5.1",
"@types/jest": "29.2.5",
"@typescript-eslint/eslint-plugin": "5.45.0",
"@typescript-eslint/parser": "5.45.0",
"copyfiles": "2.4.1",
"eslint": "8.28.0",
"eslint-config-prettier": "8.5.0",
"fast-check": "3.4.0",
"husky": "8.0.3",
"jest": "29.3.1",
"prettier": "2.8.7",
"rimraf": "3.0.2",
"ts-jest": "27.1.4",
"typescript": "4.5.5"
"ts-jest": "29.1.0",
"typescript": "4.9.5"
},

@@ -63,0 +64,0 @@ "dependencies": {

@@ -11,2 +11,4 @@ # @kizahasi/ot-string

To use it in a browser directly, you can use [Skypack](https://www.skypack.dev/view/@kizahasi/ot-string).
## Usage

@@ -92,3 +94,3 @@

deserializeTwoWayOperation,
} from '../src';
} from '@kizahasi/ot-string';

@@ -95,0 +97,0 @@ const twoWayOperation = diff({ prevState: 'hour', nextState: 'ours' });

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc