{"_id":"quill-delta","_rev":"3758119","name":"quill-delta","description":"Format for representing rich text documents and changes.","dist-tags":{"latest":"5.1.0"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"time":{"modified":"2025-03-20T13:19:20.000Z","created":"2016-10-13T00:28:38.949Z","5.1.0":"2023-05-22T03:12:41.977Z","5.0.0":"2022-03-10T08:04:46.770Z","4.2.2":"2020-04-15T03:51:55.191Z","4.2.1":"2019-04-10T23:14:16.080Z","4.2.0":"2019-02-12T00:58:40.174Z","4.1.0":"2018-10-09T05:05:33.734Z","4.0.1":"2018-09-16T06:25:30.228Z","4.0.0":"2018-09-16T00:33:47.860Z","3.6.3":"2018-08-01T00:50:04.162Z","3.6.2":"2017-09-17T21:46:30.186Z","3.6.1":"2017-09-04T01:39:30.134Z","3.6.0":"2017-09-04T00:53:11.057Z","3.5.0":"2017-03-17T22:37:59.421Z","3.4.3":"2016-10-27T01:17:51.411Z","3.4.2":"2016-10-24T20:03:02.402Z","3.4.1":"2016-10-23T21:58:19.026Z","3.4.0":"2016-10-19T23:32:58.505Z","3.3.0":"2016-10-18T22:52:59.054Z","3.2.0":"2016-10-13T00:28:38.949Z"},"users":{"vincentlau":true,"shanewholloway":true},"author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"versions":{"5.1.0":{"name":"quill-delta","version":"5.1.0","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"dist/Delta.js","dependencies":{"fast-diff":"^1.3.0","lodash.clonedeep":"^4.5.0","lodash.isequal":"^4.5.0"},"devDependencies":{"@types/jasmine":"^3.10.3","@types/lodash.clonedeep":"^4.5.6","@types/lodash.isequal":"^4.5.5","@types/node":"^17.0.21","@typescript-eslint/eslint-plugin":"^5.14.0","@typescript-eslint/parser":"^5.14.0","eslint":"^8.10.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","jasmine":"^4.0.2","nyc":"^15.1.0","prettier":"^2.5.1","ts-node":"^10.7.0","typescript":"^4.6.2"},"engines":{"node":">= 12.0.0"},"license":"MIT","scripts":{"build":"tsc","prepare":"npm run build","lint":"eslint 'src/**/*.ts'","test":"jasmine --config=jasmine.json","test:coverage":"nyc npm run test","test:coverage:report":"nyc report --reporter=lcov"},"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["plugin:@typescript-eslint/recommended","plugin:prettier/recommended"],"parserOptions":{"ecmaVersion":6,"sourceType":"module"},"rules":{"@typescript-eslint/no-namespace":"off"}},"prettier":{"singleQuote":true,"trailingComma":"all"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"types":"./dist/Delta.d.ts","gitHead":"9b98644d3e9707fc6c8383dace49c40e851e20dc","_id":"quill-delta@5.1.0","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"shasum":"1c4bc08f7c8e5cc4bdc88a15a1a70c1cc72d2b48","size":21006,"noattachment":false,"key":"/quill-delta/-/quill-delta-5.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-5.1.0.tgz"},"_npmUser":{"name":"luin","email":"i@zihua.li"},"directories":{},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quill-delta_5.1.0_1684725161831_0.40215360812327994"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-05-22T03:12:41.977Z","publish_time":1684725161977,"_source_registry_name":"default","_cnpm_publish_time":1684725161977},"5.0.0":{"name":"quill-delta","version":"5.0.0","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"dist/Delta.js","dependencies":{"fast-diff":"1.2.0","lodash.clonedeep":"^4.5.0","lodash.isequal":"^4.5.0"},"devDependencies":{"@types/jasmine":"^3.10.3","@types/lodash.clonedeep":"^4.5.6","@types/lodash.isequal":"^4.5.5","@types/node":"^17.0.21","@typescript-eslint/eslint-plugin":"^5.14.0","@typescript-eslint/parser":"^5.14.0","eslint":"^8.10.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.0.0","jasmine":"^4.0.2","nyc":"^15.1.0","prettier":"^2.5.1","ts-node":"^10.7.0","typescript":"^4.6.2"},"engines":{"node":">= 12.0.0"},"license":"MIT","scripts":{"build":"tsc","prepare":"npm run build","lint":"eslint 'src/**/*.ts'","test":"jasmine --config=jasmine.json","test:coverage":"nyc npm run test","test:coverage:report":"nyc report --reporter=lcov"},"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["plugin:@typescript-eslint/recommended","plugin:prettier/recommended"],"parserOptions":{"ecmaVersion":6,"sourceType":"module"},"rules":{"@typescript-eslint/no-namespace":"off"}},"prettier":{"singleQuote":true,"trailingComma":"all"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"types":"./dist/Delta.d.ts","gitHead":"b99aac6ba8dfe0f17fca72a1228bda1c48c0b2a2","_id":"quill-delta@5.0.0","_nodeVersion":"16.14.0","_npmVersion":"8.3.1","dist":{"shasum":"bde8d53e0e40587d0c2c0fdc1422b544da962444","size":21003,"noattachment":false,"key":"/quill-delta/-/quill-delta-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-5.0.0.tgz"},"_npmUser":{"name":"luin","email":"i@zihua.li"},"directories":{},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quill-delta_5.0.0_1646899486589_0.35538982678778464"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-03-10T08:04:51.937Z","publish_time":1646899486770,"_cnpm_publish_time":1646899486770},"4.2.2":{"name":"quill-delta","version":"4.2.2","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"dist/Delta.js","dependencies":{"fast-diff":"1.2.0","lodash.clonedeep":"^4.5.0","lodash.isequal":"^4.5.0"},"devDependencies":{"@types/lodash.clonedeep":"^4.5.0","@types/lodash.isequal":"^4.5.0","@typescript-eslint/eslint-plugin":"^2.28.0","@typescript-eslint/parser":"^2.28.0","coveralls":"^3.0.11","eslint":"^6.8.0","eslint-config-prettier":"^6.10.1","eslint-plugin-prettier":"^3.1.2","istanbul":"~0.4.5","jasmine":"^3.5.0","prettier":"^2.0.4","typescript":"^3.8.3"},"license":"MIT","scripts":{"build":"tsc","prepare":"npm run build","lint":"eslint 'src/**/*.ts'","test":"npm run build; jasmine test/*.js test/**/*.js","test:coverage":"istanbul cover jasmine test/*.js test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"eslintConfig":{"parser":"@typescript-eslint/parser","extends":["plugin:@typescript-eslint/recommended","prettier/@typescript-eslint","plugin:prettier/recommended"],"parserOptions":{"ecmaVersion":6,"sourceType":"module"},"rules":{"@typescript-eslint/ban-ts-ignore":"off","@typescript-eslint/no-explicit-any":"off","@typescript-eslint/no-namespace":"off","@typescript-eslint/no-unused-vars":["error",{"argsIgnorePattern":"^_"}]}},"prettier":{"singleQuote":true,"trailingComma":"all"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"e5517726f6665e293e851457b1cc0c7a17576e50","_id":"quill-delta@4.2.2","_nodeVersion":"10.15.1","_npmVersion":"6.14.4","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"dist":{"shasum":"015397d046e0a3bed087cd8a51f98c11a1b8f351","size":19791,"noattachment":false,"key":"/quill-delta/-/quill-delta-4.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-4.2.2.tgz"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quill-delta_4.2.2_1586922715019_0.4759045988038235"},"_hasShrinkwrap":false,"publish_time":1586922715191,"_cnpm_publish_time":1586922715191},"4.2.1":{"name":"quill-delta","version":"4.2.1","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"dist/Delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.2","fast-diff":"1.2.0"},"devDependencies":{"@types/deep-equal":"^1.0.1","@types/extend":"^3.0.0","coveralls":"^3.0.2","istanbul":"~0.4.5","jasmine":"^3.3.1","prettier":"^1.16.4","tslint":"^5.12.1","tslint-config-prettier":"^1.18.0","tslint-plugin-prettier":"^2.0.1","typescript":"^3.3.3"},"license":"MIT","scripts":{"build":"tsc","prepare":"npm run build","lint":"tslint 'src/**/*.ts'","test":"npm run build; jasmine test/*.js test/**/*.js","test:coverage":"istanbul cover jasmine test/*.js test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"prettier":{"singleQuote":true,"trailingComma":"all"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"06ca777f67905ea6533272b2f88189ee06bb4197","_id":"quill-delta@4.2.1","_nodeVersion":"10.15.1","_npmVersion":"6.8.0","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"dist":{"shasum":"ad4f191cdf3be5079c5dc3991b9603a5cc0db69a","size":19858,"noattachment":false,"key":"/quill-delta/-/quill-delta-4.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-4.2.1.tgz"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quill-delta_4.2.1_1554938055915_0.6193897389073282"},"_hasShrinkwrap":false,"publish_time":1554938056080,"_cnpm_publish_time":1554938056080},"4.2.0":{"name":"quill-delta","version":"4.2.0","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"dist/Delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.2","fast-diff":"1.2.0"},"devDependencies":{"@types/deep-equal":"^1.0.1","@types/extend":"^3.0.0","coveralls":"^3.0.2","istanbul":"~0.4.5","jasmine":"^3.3.1","prettier":"^1.16.4","tslint":"^5.12.1","tslint-config-prettier":"^1.18.0","tslint-plugin-prettier":"^2.0.1","typescript":"^3.3.3"},"license":"MIT","scripts":{"build":"tsc","prepare":"npm run build","lint":"tslint 'src/**/*.ts'","test":"npm run build; jasmine test/*.js test/**/*.js","test:coverage":"istanbul cover jasmine test/*.js test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"prettier":{"singleQuote":true,"trailingComma":"all"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"967fe84dfd6634c02be9bb3c46642f1e59384657","_id":"quill-delta@4.2.0","_npmVersion":"6.5.0","_nodeVersion":"8.11.3","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"dist":{"shasum":"3972689b1077d05065730bb036aff79937e5632b","size":19834,"noattachment":false,"key":"/quill-delta/-/quill-delta-4.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-4.2.0.tgz"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quill-delta_4.2.0_1549933120028_0.36581160267946244"},"_hasShrinkwrap":false,"publish_time":1549933120174,"_cnpm_publish_time":1549933120174},"4.1.0":{"name":"quill-delta","version":"4.1.0","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"dist/Delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.2","fast-diff":"1.2.0"},"devDependencies":{"@types/deep-equal":"^1.0.1","@types/extend":"^3.0.0","coveralls":"^3.0.2","istanbul":"~0.4.5","jasmine":"^3.2.0","prettier":"^1.14.2","tslint":"^5.11.0","tslint-config-prettier":"^1.15.0","tslint-plugin-prettier":"^1.3.0","typescript":"^3.0.0"},"license":"MIT","scripts":{"build":"tsc","prepare":"npm run build","lint":"tslint 'src/**/*.ts'","test":"npm run build; jasmine test/*.js test/**/*.js","test:coverage":"istanbul cover jasmine test/*.js test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"prettier":{"singleQuote":true,"trailingComma":"all"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"10e5cb7ecb4bb0325dba3858fffb818da4857a39","_id":"quill-delta@4.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.0.0","_npmUser":{"name":"dgreensp","email":"davidgreenspan@gmail.com"},"dist":{"shasum":"f250bfc86eafb70aa07835c7e03777ef5a75da5d","size":18581,"noattachment":false,"key":"/quill-delta/-/quill-delta-4.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-4.1.0.tgz"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quill-delta_4.1.0_1539061533551_0.23768932893215267"},"_hasShrinkwrap":false,"publish_time":1539061533734,"_cnpm_publish_time":1539061533734},"4.0.1":{"name":"quill-delta","version":"4.0.1","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"dist/Delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.2","fast-diff":"1.1.2"},"devDependencies":{"@types/deep-equal":"^1.0.1","@types/extend":"^3.0.0","@types/fast-diff":"^1.1.0","coveralls":"^3.0.2","istanbul":"~0.4.5","jasmine":"^3.2.0","prettier":"^1.14.2","tslint":"^5.11.0","tslint-config-prettier":"^1.15.0","tslint-plugin-prettier":"^1.3.0","typescript":"^3.0.0"},"license":"MIT","scripts":{"build":"tsc","prepare":"npm run build","lint":"tslint 'src/**/*.ts'","test":"npm run build; jasmine test/*.js test/**/*.js","test:coverage":"istanbul cover jasmine test/*.js test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"prettier":{"singleQuote":true,"trailingComma":"all"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"d6df27b35136981e4a9f03298aa5123de641cf80","_id":"quill-delta@4.0.1","_npmVersion":"6.4.0","_nodeVersion":"8.11.3","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"dist":{"shasum":"21c8f166dffc6cd9a12051f964f7574fc237a167","size":18498,"noattachment":false,"key":"/quill-delta/-/quill-delta-4.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-4.0.1.tgz"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quill-delta_4.0.1_1537079130040_0.3075684329768169"},"_hasShrinkwrap":false,"publish_time":1537079130228,"_cnpm_publish_time":1537079130228},"4.0.0":{"name":"quill-delta","version":"4.0.0","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"dist/Delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.2","fast-diff":"1.1.2"},"devDependencies":{"@types/deep-equal":"^1.0.1","@types/extend":"^3.0.0","@types/fast-diff":"^1.1.0","coveralls":"^3.0.2","istanbul":"~0.4.5","jasmine":"^3.2.0","prettier":"^1.14.2","tslint":"^5.11.0","tslint-config-prettier":"^1.15.0","tslint-plugin-prettier":"^1.3.0","typescript":"^3.0.0"},"license":"MIT","scripts":{"build":"tsc","prepare":"npm run build","lint":"tslint 'src/**/*.ts'","test":"npm run build; jasmine test/*.js test/**/*.js","test:coverage":"istanbul cover jasmine test/*.js test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"prettier":{"singleQuote":true,"trailingComma":"all"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"9f2d71f1e6de03132217ec69f7f985a72d0c3c4a","_id":"quill-delta@4.0.0","_npmVersion":"6.4.0","_nodeVersion":"8.11.3","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"dist":{"shasum":"fdb9b620fcd7f013b895ac1cdba991e0cc906d83","size":18920,"noattachment":false,"key":"/quill-delta/-/quill-delta-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-4.0.0.tgz"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quill-delta_4.0.0_1537058027618_0.3115624389992222"},"_hasShrinkwrap":false,"publish_time":1537058027860,"_cnpm_publish_time":1537058027860},"3.6.3":{"name":"quill-delta","version":"3.6.3","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"lib/delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.2","fast-diff":"1.1.2"},"devDependencies":{"coveralls":"^3.0.2","istanbul":"~0.4.5","jasmine":"^3.1.0"},"engines":{"node":">=0.10"},"license":"MIT","scripts":{"test":"jasmine test/*.js test/**/*.js","test:coverage":"istanbul cover jasmine test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"4ff080953475026c0f880ff09538cd297831d82b","_id":"quill-delta@3.6.3","_npmVersion":"6.2.0","_nodeVersion":"8.11.3","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"dist":{"shasum":"b19fd2b89412301c60e1ff213d8d860eac0f1032","size":13740,"noattachment":false,"key":"/quill-delta/-/quill-delta-3.6.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-3.6.3.tgz"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quill-delta_3.6.3_1533084603834_0.1146526490267128"},"_hasShrinkwrap":false,"publish_time":1533084604162,"_cnpm_publish_time":1533084604162},"3.6.2":{"name":"quill-delta","version":"3.6.2","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"lib/delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.1","fast-diff":"1.1.2"},"devDependencies":{"coveralls":"^2.13.1","istanbul":"~0.4.5","jasmine":"^2.8.0"},"engines":{"node":">=0.10"},"license":"MIT","scripts":{"test":"jasmine test/**/*.js","test:coverage":"istanbul cover jasmine test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"dafd991d7d1afa4e0fa3ecbe6bb81f063d18f32c","_id":"quill-delta@3.6.2","_npmVersion":"5.4.2","_nodeVersion":"8.2.1","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"dist":{"shasum":"76eed0163b8b09a076fba6ade29307c42b40b8d8","size":8839,"noattachment":false,"key":"/quill-delta/-/quill-delta-3.6.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-3.6.2.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quill-delta-3.6.2.tgz_1505684790070_0.6287770438939333"},"directories":{},"publish_time":1505684790186,"_hasShrinkwrap":false,"_cnpm_publish_time":1505684790186},"3.6.1":{"name":"quill-delta","version":"3.6.1","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"lib/delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.1","fast-diff":"1.1.1"},"devDependencies":{"coveralls":"^2.13.1","istanbul":"~0.4.5","jasmine":"^2.7.0"},"engines":{"node":">=0.10"},"license":"MIT","scripts":{"test":"jasmine test/**/*.js","test:coverage":"istanbul cover jasmine test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"f00969dc08fdec136c402cec46c3d9b95a80cb55","_id":"quill-delta@3.6.1","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"dist":{"shasum":"8f8f89ac1fb7b0b52ed3a31cf6554b1c4291b64d","size":13317,"noattachment":false,"key":"/quill-delta/-/quill-delta-3.6.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-3.6.1.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quill-delta-3.6.1.tgz_1504489169679_0.7097206625621766"},"directories":{},"publish_time":1504489170134,"_hasShrinkwrap":false,"_cnpm_publish_time":1504489170134},"3.6.0":{"name":"quill-delta","version":"3.6.0","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"lib/delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.1","fast-diff":"1.1.1"},"devDependencies":{"coveralls":"^2.13.1","istanbul":"~0.4.5","jasmine":"^2.7.0"},"engines":{"node":">=0.10"},"license":"MIT","scripts":{"test":"jasmine test/**/*.js","test:coverage":"istanbul cover jasmine test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"242caca80b1692cf948581ce70192901773ba67b","_id":"quill-delta@3.6.0","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"dist":{"shasum":"d6ed0c3ec04c1891e55eac493303f060cf2f0da2","size":13325,"noattachment":false,"key":"/quill-delta/-/quill-delta-3.6.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-3.6.0.tgz"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quill-delta-3.6.0.tgz_1504486390957_0.26276010647416115"},"directories":{},"publish_time":1504486391057,"_hasShrinkwrap":false,"_cnpm_publish_time":1504486391057},"3.5.0":{"name":"quill-delta","version":"3.5.0","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"lib/delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.0","fast-diff":"1.1.1"},"devDependencies":{"coveralls":"^2.11.14","istanbul":"~0.4.5","jasmine":"^2.5.2"},"engines":{"node":">=0.10"},"license":"MIT","scripts":{"test":"jasmine test/**/*.js","test:coverage":"istanbul cover jasmine test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"5e423a2c30443225a0afa970123d024b9c20cb3d","_id":"quill-delta@3.5.0","_shasum":"5b67e685da60c34eabed4449c416c74aab89157b","_from":".","_npmVersion":"3.10.8","_nodeVersion":"7.0.0","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"dist":{"shasum":"5b67e685da60c34eabed4449c416c74aab89157b","size":13272,"noattachment":false,"key":"/quill-delta/-/quill-delta-3.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-3.5.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/quill-delta-3.5.0.tgz_1489790277567_0.878202086314559"},"directories":{},"publish_time":1489790279421,"_cnpm_publish_time":1489790279421,"_hasShrinkwrap":false},"3.4.3":{"name":"quill-delta","version":"3.4.3","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"lib/delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.0","fast-diff":"1.1.1"},"devDependencies":{"coveralls":"^2.11.14","istanbul":"~0.4.5","jasmine":"^2.5.2"},"engines":{"node":">=0.10"},"license":"MIT","scripts":{"test":"jasmine test/**/*.js","test:coverage":"istanbul cover jasmine test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"6425a208611f67aa54b2369ae47f4bb66548dc46","_id":"quill-delta@3.4.3","_shasum":"2b8cc300f8c98d5b179ef3fd1ff4b522f857a1d3","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.1","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"dist":{"shasum":"2b8cc300f8c98d5b179ef3fd1ff4b522f857a1d3","size":12936,"noattachment":false,"key":"/quill-delta/-/quill-delta-3.4.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-3.4.3.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/quill-delta-3.4.3.tgz_1477531068922_0.9631211631931365"},"directories":{},"publish_time":1477531071411,"_cnpm_publish_time":1477531071411,"_hasShrinkwrap":false},"3.4.2":{"name":"quill-delta","version":"3.4.2","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"lib/delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.0","fast-diff":"1.1.1"},"devDependencies":{"coveralls":"^2.11.14","istanbul":"~0.4.5","jasmine":"^2.5.2"},"engines":{"node":">=0.10"},"license":"MIT","scripts":{"test":"jasmine test/**/*.js","test:coverage":"istanbul cover jasmine test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"9f54786fcd15f0cb368e3ffd77257eff6cb10a6b","_id":"quill-delta@3.4.2","_shasum":"177e11a6c88d2a04fa34cabb333f556278d96848","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.1","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"dist":{"shasum":"177e11a6c88d2a04fa34cabb333f556278d96848","size":12935,"noattachment":false,"key":"/quill-delta/-/quill-delta-3.4.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-3.4.2.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/quill-delta-3.4.2.tgz_1477339379460_0.26944817090407014"},"directories":{},"publish_time":1477339382402,"_cnpm_publish_time":1477339382402,"_hasShrinkwrap":false},"3.4.1":{"name":"quill-delta","version":"3.4.1","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"lib/delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.0","fast-diff":"1.1.1"},"devDependencies":{"coveralls":"^2.11.14","istanbul":"~0.4.5","jasmine":"^2.5.2"},"engines":{"node":">=0.10"},"license":"MIT","scripts":{"test":"jasmine test/**/*.js","test:coverage":"istanbul cover jasmine test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"ec3b6aaeaf3f195da899dd77a66547c4f59b6684","_id":"quill-delta@3.4.1","_shasum":"be66b4f47e467b8a7d60cce1d82d9b92022b004e","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.1","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"dist":{"shasum":"be66b4f47e467b8a7d60cce1d82d9b92022b004e","size":12898,"noattachment":false,"key":"/quill-delta/-/quill-delta-3.4.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-3.4.1.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/quill-delta-3.4.1.tgz_1477259898797_0.23107059253379703"},"directories":{},"publish_time":1477259899026,"_cnpm_publish_time":1477259899026,"_hasShrinkwrap":false},"3.4.0":{"name":"quill-delta","version":"3.4.0","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"lib/delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.0","fast-diff":"^1.1.0"},"devDependencies":{"coveralls":"^2.11.14","istanbul":"~0.4.5","jasmine":"^2.5.2"},"engines":{"node":">=0.10"},"license":"MIT","scripts":{"test":"jasmine test/**/*.js","test:coverage":"istanbul cover jasmine test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"dc00559088ae7ea1ae9dc7d2625ddfe18c702596","_id":"quill-delta@3.4.0","_shasum":"5a5c92f0d549801b39a4f1cca4a61444da7d2f86","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.1","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"dist":{"shasum":"5a5c92f0d549801b39a4f1cca4a61444da7d2f86","size":12893,"noattachment":false,"key":"/quill-delta/-/quill-delta-3.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-3.4.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/quill-delta-3.4.0.tgz_1476919978288_0.7570194057188928"},"directories":{},"publish_time":1476919978505,"_cnpm_publish_time":1476919978505,"_hasShrinkwrap":false},"3.3.0":{"name":"quill-delta","version":"3.3.0","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"lib/delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.0","fast-diff":"^1.0.1"},"devDependencies":{"coveralls":"^2.11.14","istanbul":"~0.4.5","jasmine":"^2.5.2"},"engines":{"node":">=0.10"},"license":"MIT","scripts":{"test":"jasmine test/**/*.js","test:coverage":"istanbul cover jasmine test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"04dc8c9cbe1811c530f683ad68cb59cadbd464f1","_id":"quill-delta@3.3.0","_shasum":"e7eb7062b56597e0e9e3ee26a1de13fa2ae4d33d","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.1","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"dist":{"shasum":"e7eb7062b56597e0e9e3ee26a1de13fa2ae4d33d","size":12809,"noattachment":false,"key":"/quill-delta/-/quill-delta-3.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-3.3.0.tgz"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/quill-delta-3.3.0.tgz_1476831177179_0.34736858191899955"},"directories":{},"publish_time":1476831179054,"_cnpm_publish_time":1476831179054,"_hasShrinkwrap":false},"3.2.0":{"name":"quill-delta","version":"3.2.0","description":"Format for representing rich text documents and changes.","author":{"name":"Jason Chen","email":"jhchen7@gmail.com"},"homepage":"https://github.com/quilljs/delta","main":"lib/delta.js","dependencies":{"deep-equal":"^1.0.1","extend":"^3.0.0","fast-diff":"^1.0.1"},"devDependencies":{"coveralls":"^2.11.14","istanbul":"~0.4.5","jasmine":"^2.5.2"},"engines":{"node":">=0.10"},"license":"MIT","scripts":{"test":"jasmine test/**/*.js","test:coverage":"istanbul cover jasmine test/**/*.js","test:coverage:report":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js"},"repository":{"type":"git","url":"git+https://github.com/quilljs/delta.git"},"bugs":{"url":"https://github.com/quilljs/delta/issues"},"keywords":["rich text","ot","operational transform","delta"],"gitHead":"7096647e26e577b08bd7b068746a3d257e5c8ba7","_id":"quill-delta@3.2.0","_shasum":"617041bb364d686ceea337bfda76a70b9ad639a2","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.1","_npmUser":{"name":"jhchen","email":"jhchen7@gmail.com"},"maintainers":[{"name":"jhchen","email":"jhchen7@gmail.com"},{"name":"luin","email":"i@zihua.li"}],"dist":{"shasum":"617041bb364d686ceea337bfda76a70b9ad639a2","size":12537,"noattachment":false,"key":"/quill-delta/-/quill-delta-3.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/quill-delta/download/quill-delta-3.2.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/quill-delta-3.2.0.tgz_1476318518726_0.5692548765800893"},"directories":{},"publish_time":1476318518949,"_cnpm_publish_time":1476318518949,"_hasShrinkwrap":false}},"readme":"# Delta [![Build Status](https://github.com/quilljs/delta/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/quilljs/delta/actions?query=branch%3Amaster) [![Coverage Status](https://img.shields.io/coveralls/quilljs/delta.svg)](https://coveralls.io/r/quilljs/delta)\n\nDeltas are a simple, yet expressive format that can be used to describe contents and changes. The format is JSON based, and is human readable, yet easily parsible by machines. Deltas can describe any rich text document, includes all text and formatting information, without the ambiguity and complexity of HTML.\n\nA Delta is made up of an [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) of Operations, which describe changes to a document. They can be an [`insert`](#insert-operation), [`delete`](#delete-operation) or [`retain`](#retain-operation). Note operations do not take an index. They always describe the change at the current index. Use retains to \"keep\" or \"skip\" certain parts of the document.\n\nDon’t be confused by its name Delta&mdash;Deltas represents both documents and changes to documents. If you think of Deltas as the instructions from going from one document to another, the way Deltas represent a document is by expressing the instructions starting from an empty document.\n\n\n## Quick Example\n\n```js\n// Document with text \"Gandalf the Grey\"\n// with \"Gandalf\" bolded, and \"Grey\" in grey\nconst delta = new Delta([\n  { insert: 'Gandalf', attributes: { bold: true } },\n  { insert: ' the ' },\n  { insert: 'Grey', attributes: { color: '#ccc' } }\n]);\n\n// Change intended to be applied to above:\n// Keep the first 12 characters, insert a white 'White'\n// and delete the next four characters ('Grey')\nconst death = new Delta().retain(12)\n                         .insert('White', { color: '#fff' })\n                         .delete(4);\n// {\n//   ops: [\n//     { retain: 12 },\n//     { insert: 'White', attributes: { color: '#fff' } },\n//     { delete: 4 }\n//   ]\n// }\n\n// Applying the above:\nconst restored = delta.compose(death);\n// {\n//   ops: [\n//     { insert: 'Gandalf', attributes: { bold: true } },\n//     { insert: ' the ' },\n//     { insert: 'White', attributes: { color: '#fff' } }\n//   ]\n// }\n\n```\n\nThis README describes Deltas in its general form and API functionality. Additional information on the way Quill specifically uses Deltas can be found on its own [Delta docs](http://quilljs.com/docs/delta/). A walkthough of the motivation and design thinking behind Deltas are on [Designing the Delta Format](http://quilljs.com/guides/designing-the-delta-format/).\n\nThis format is suitable for [Operational Transform](https://en.wikipedia.org/wiki/Operational_transformation) and defines several functions to support this use case.\n\n\n## Contents\n\n#### Operations\n\n- [`insert`](#insert-operation)\n- [`delete`](#delete-operation)\n- [`retain`](#retain-operation)\n\n#### Construction\n\n- [`constructor`](#constructor)\n- [`insert`](#insert)\n- [`delete`](#delete)\n- [`retain`](#retain)\n\n#### Documents\n\nThese methods called on or with non-document Deltas will result in undefined behavior.\n\n- [`concat`](#concat)\n- [`diff`](#diff)\n- [`eachLine`](#eachline)\n- [`invert`](#invert)\n\n#### Utility\n\n- [`filter`](#filter)\n- [`forEach`](#foreach)\n- [`length`](#length)\n- [`map`](#map)\n- [`partition`](#partition)\n- [`reduce`](#reduce)\n- [`slice`](#slice)\n\n#### Operational Transform\n\n- [`compose`](#compose)\n- [`transform`](#transform)\n- [`transformPosition`](#transformposition)\n\n\n## Operations\n\n### Insert Operation\n\nInsert operations have an `insert` key defined. A String value represents inserting text. Any other type represents inserting an embed (however only one level of object comparison will be performed for equality).\n\nIn both cases of text and embeds, an optional `attributes` key can be defined with an Object to describe additonal formatting information. Formats can be changed by the [retain](#retain) operation.\n\n```js\n// Insert a bolded \"Text\"\n{ insert: \"Text\", attributes: { bold: true } }\n\n// Insert a link\n{ insert: \"Google\", attributes: { link: 'https://www.google.com' } }\n\n// Insert an embed\n{\n  insert: { image: 'https://octodex.github.com/images/labtocat.png' },\n  attributes: { alt: \"Lab Octocat\" }\n}\n\n// Insert another embed\n{\n  insert: { video: 'https://www.youtube.com/watch?v=dMH0bHeiRNg' },\n  attributes: {\n    width: 420,\n    height: 315\n  }\n}\n```\n\n### Delete Operation\n\nDelete operations have a Number `delete` key defined representing the number of characters to delete. All embeds have a length of 1.\n\n```js\n// Delete the next 10 characters\n{ delete: 10 }\n```\n\n### Retain Operation\n\nRetain operations have a Number `retain` key defined representing the number of characters to keep (other libraries might use the name keep or skip). An optional `attributes` key can be defined with an Object to describe formatting changes to the character range. A value of `null` in the `attributes` Object represents removal of that key.\n\n*Note: It is not necessary to retain the last characters of a document as this is implied.*\n\n```js\n// Keep the next 5 characters\n{ retain: 5 }\n\n// Keep and bold the next 5 characters\n{ retain: 5, attributes: { bold: true } }\n\n// Keep and unbold the next 5 characters\n// More specifically, remove the bold key in the attributes Object\n// in the next 5 characters\n{ retain: 5, attributes: { bold: null } }\n```\n\n\n## Construction\n\n### constructor\n\nCreates a new Delta object.\n\n#### Methods\n\n- `new Delta()`\n- `new Delta(ops)`\n- `new Delta(delta)`\n\n#### Parameters\n\n- `ops` - Array of operations\n- `delta` - Object with an `ops` key set to an array of operations\n\n*Note: No validity/sanity check is performed when constructed with ops or delta. The new delta's internal ops array will also be assigned from ops or delta.ops without deep copying.*\n\n#### Example\n\n```js\nconst delta = new Delta([\n  { insert: 'Hello World' },\n  { insert: '!', attributes: { bold: true }}\n]);\n\nconst packet = JSON.stringify(delta);\n\nconst other = new Delta(JSON.parse(packet));\n\nconst chained = new Delta().insert('Hello World').insert('!', { bold: true });\n```\n\n---\n\n### insert()\n\nAppends an insert operation. Returns `this` for chainability.\n\n#### Methods\n\n- `insert(text, attributes)`\n- `insert(embed, attributes)`\n\n#### Parameters\n\n- `text` - String representing text to insert\n- `embed` - Object representing embed type to insert\n- `attributes` - Optional attributes to apply\n\n#### Example\n\n```js\ndelta.insert('Text', { bold: true, color: '#ccc' });\ndelta.insert({ image: 'https://octodex.github.com/images/labtocat.png' });\n```\n\n---\n\n### delete()\n\nAppends a delete operation. Returns `this` for chainability.\n\n#### Methods\n\n- `delete(length)`\n\n#### Parameters\n\n- `length` - Number of characters to delete\n\n#### Example\n\n```js\ndelta.delete(5);\n```\n\n---\n\n### retain()\n\nAppends a retain operation. Returns `this` for chainability.\n\n#### Methods\n\n- `retain(length, attributes)`\n\n#### Parameters\n\n- `length` - Number of characters to retain\n- `attributes` - Optional attributes to apply\n\n#### Example\n\n```js\ndelta.retain(4).retain(5, { color: '#0c6' });\n```\n\n## Documents\n\n### concat()\n\nReturns a new Delta representing the concatenation of this and another document Delta's operations.\n\n#### Methods\n\n- `concat(other)`\n\n#### Parameters\n\n- `other` - Document Delta to concatenate\n\n#### Returns\n\n- `Delta` - Concatenated document Delta\n\n#### Example\n\n```js\nconst a = new Delta().insert('Hello');\nconst b = new Delta().insert('!', { bold: true });\n\n\n// {\n//   ops: [\n//     { insert: 'Hello' },\n//     { insert: '!', attributes: { bold: true } }\n//   ]\n// }\nconst concat = a.concat(b);\n```\n\n---\n\n### diff()\n\nReturns a Delta representing the difference between two documents. Optionally, accepts a suggested index where change took place, often representing a cursor position *before* change.\n\n#### Methods\n\n- `diff(other)`\n- `diff(other, index)`\n\n#### Parameters\n\n- `other` - Document Delta to diff against\n- `index` - Suggested index where change took place\n\n#### Returns\n\n- `Delta` - difference between the two documents\n\n#### Example\n\n```js\nconst a = new Delta().insert('Hello');\nconst b = new Delta().insert('Hello!');\n\nconst diff = a.diff(b);  // { ops: [{ retain: 5 }, { insert: '!' }] }\n                         // a.compose(diff) == b\n\n```\n\n---\n\n### eachLine()\n\nIterates through document Delta, calling a given function with a Delta and attributes object, representing the line segment.\n\n#### Methods\n\n- `eachLine(predicate, newline)`\n\n#### Parameters\n\n- `predicate` - function to call on each line group\n- `newline` - newline character, defaults to `\\n`\n\n#### Example\n\n```js\nconst delta = new Delta().insert('Hello\\n\\n')\n                         .insert('World')\n                         .insert({ image: 'octocat.png' })\n                         .insert('\\n', { align: 'right' })\n                         .insert('!');\n\ndelta.eachLine((line, attributes, i) => {\n  console.log(line, attributes, i);\n  // Can return false to exit loop early\n});\n// Should log:\n// { ops: [{ insert: 'Hello' }] }, {}, 0\n// { ops: [] }, {}, 1\n// { ops: [{ insert: 'World' }, { insert: { image: 'octocat.png' } }] }, { align: 'right' }, 2\n// { ops: [{ insert: '!' }] }, {}, 3\n```\n\n---\n\n### invert()\n\nReturned an inverted delta that has the opposite effect of against a base document delta. That is `base.compose(delta).compose(inverted) === base`.\n\n#### Methods\n\n- `invert(base)`\n\n#### Parameters\n\n- `base` - Document delta to invert against\n\n#### Returns\n\n- `Delta` - inverted delta against the base delta\n\n#### Example\n\n```js\nconst base = new Delta().insert('Hello\\n')\n                        .insert('World');\nconst delta = new Delta().retain(6, { bold: true }).insert('!').delete(5);\n\nconst inverted = delta.invert(base);  // { ops: [\n                                      //   { retain: 6, attributes: { bold: null } },\n                                      //   { insert: 'World' },\n                                      //   { delete: 1 }\n                                      // ]}\n                                      // base.compose(delta).compose(inverted) === base\n```\n\n\n## Utility\n\n### filter()\n\nReturns an array of operations that passes a given function.\n\n#### Methods\n\n- `filter(predicate)`\n\n#### Parameters\n\n- `predicate` - Function to test each operation against. Return `true` to keep the operation, `false` otherwise.\n\n#### Returns\n\n- `Array` - Filtered resulting array\n\n#### Example\n\n```js\nconst delta = new Delta().insert('Hello', { bold: true })\n                         .insert({ image: 'https://octodex.github.com/images/labtocat.png' })\n                         .insert('World!');\n\nconst text = delta\n  .filter((op) => typeof op.insert === 'string')\n  .map((op) => op.insert)\n  .join('');\n```\n\n---\n\n### forEach()\n\nIterates through operations, calling the provided function for each operation.\n\n#### Methods\n\n- `forEach(predicate)`\n\n#### Parameters\n\n- `predicate` - Function to call during iteration, passing in the current operation.\n\n#### Example\n\n```js\ndelta.forEach((op) => {\n  console.log(op);\n});\n```\n\n---\n\n### length()\n\nReturns length of a Delta, which is the sum of the lengths of its operations.\n\n#### Methods\n\n- `length()`\n\n#### Example\n\n```js\nnew Delta().insert('Hello').length();  // Returns 5\n\nnew Delta().insert('A').retain(2).delete(1).length(); // Returns 4\n```\n\n---\n\n### map()\n\nReturns a new array with the results of calling provided function on each operation.\n\n#### Methods\n\n- `map(predicate)`\n\n#### Parameters\n\n- `predicate` - Function to call, passing in the current operation, returning an element of the new array to be returned\n\n#### Returns\n\n- `Array` - A new array with each element being the result of the given function.\n\n#### Example\n\n```js\nconst delta = new Delta().insert('Hello', { bold: true })\n                         .insert({ image: 'https://octodex.github.com/images/labtocat.png' })\n                         .insert('World!');\n\nconst text = delta\n  .map((op) => {\n    if (typeof op.insert === 'string') {\n      return op.insert;\n    } else {\n      return '';\n    }\n  })\n  .join('');\n```\n\n---\n\n### partition()\n\nCreate an array of two arrays, the first with operations that pass the given function, the other that failed.\n\n#### Methods\n\n- `partition(predicate)`\n\n#### Parameters\n\n- `predicate` - Function to call, passing in the current operation, returning whether that operation passed\n\n#### Returns\n\n- `Array` - A new array of two Arrays, the first with passed operations, the other with failed operations\n\n#### Example\n\n```js\nconst delta = new Delta().insert('Hello', { bold: true })\n                         .insert({ image: 'https://octodex.github.com/images/labtocat.png' })\n                         .insert('World!');\n\nconst results = delta.partition((op) => typeof op.insert === 'string');\nconst passed = results[0];  // [{ insert: 'Hello', attributes: { bold: true }},\n                            //  { insert: 'World'}]\nconst failed = results[1];  // [{ insert: { image: 'https://octodex.github.com/images/labtocat.png' }}]\n```\n\n---\n\n### reduce()\n\nApplies given function against an accumulator and each operation to reduce to a single value.\n\n#### Methods\n\n- `reduce(predicate, initialValue)`\n\n#### Parameters\n\n- `predicate` - Function to call per iteration, returning an accumulated value\n- `initialValue` - Initial value to pass to first call to predicate\n\n#### Returns\n\n- `any` - the accumulated value\n\n#### Example\n\n```js\nconst delta = new Delta().insert('Hello', { bold: true })\n                         .insert({ image: 'https://octodex.github.com/images/labtocat.png' })\n                         .insert('World!');\n\nconst length = delta.reduce((length, op) => (\n  length + (op.insert.length || 1);\n), 0);\n```\n\n---\n\n### slice()\n\nReturns copy of delta with subset of operations.\n\n#### Methods\n\n- `slice()`\n- `slice(start)`\n- `slice(start, end)`\n\n#### Parameters\n\n- `start` - Start index of subset, defaults to 0\n- `end` - End index of subset, defaults to rest of operations\n\n#### Example\n\n```js\nconst delta = new Delta().insert('Hello', { bold: true }).insert(' World');\n\n// {\n//   ops: [\n//     { insert: 'Hello', attributes: { bold: true } },\n//     { insert: ' World' }\n//   ]\n// }\nconst copy = delta.slice();\n\n// { ops: [{ insert: 'World' }] }\nconst world = delta.slice(6);\n\n// { ops: [{ insert: ' ' }] }\nconst space = delta.slice(5, 6);\n```\n\n\n## Operational Transform\n\n### compose()\n\nReturns a Delta that is equivalent to applying the operations of own Delta, followed by another Delta.\n\n#### Methods\n\n- `compose(other)`\n\n#### Parameters\n\n- `other` - Delta to compose\n\n#### Example\n\n```js\nconst a = new Delta().insert('abc');\nconst b = new Delta().retain(1).delete(1);\n\nconst composed = a.compose(b);  // composed == new Delta().insert('ac');\n\n```\n\n---\n\n### transform()\n\nTransform given Delta against own operations.\n\n#### Methods\n\n- `transform(other, priority = false)`\n- `transform(index, priority = false)` - Alias for [`transformPosition`](#tranformposition)\n\n#### Parameters\n\n- `other` - Delta to transform\n- `priority` - Boolean used to break ties. If `true`, then `this` takes priority\n  over `other`, that is, its actions are considered to happen \"first.\"\n\n#### Returns\n\n- `Delta` - transformed Delta\n\n#### Example\n\n```js\nconst a = new Delta().insert('a');\nconst b = new Delta().insert('b').retain(5).insert('c');\n\na.transform(b, true);  // new Delta().retain(1).insert('b').retain(5).insert('c');\na.transform(b, false); // new Delta().insert('b').retain(6).insert('c');\n```\n\n---\n\n### transformPosition()\n\nTransform an index against the delta. Useful for representing cursor/selection positions.\n\n#### Methods\n\n- `transformPosition(index, priority = false)`\n\n#### Parameters\n\n- `index` - index to transform\n\n#### Returns\n\n- `Number` - transformed index\n\n#### Example\n\n```js\nconst delta = new Delta().retain(5).insert('a');\ndelta.transformPosition(4); // 4\ndelta.transformPosition(5); // 6\n```\n","_attachments":{},"homepage":"https://github.com/quilljs/delta","bugs":{"url":"https://github.com/quilljs/delta/issues"},"license":"MIT"}