@cocreate/crdt
Advanced tools
Comparing version 1.2.6 to 1.3.0
@@ -0,1 +1,8 @@ | ||
# [1.3.0](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.2.6...v1.3.0) (2021-08-18) | ||
### Features | ||
* crdt.getDoc to see if element already has a doc ([8972518](https://github.com/CoCreate-app/CoCreate-crdt/commit/8972518432c8b766eca26663c77308bc9087cd68)) | ||
## [1.2.6](https://github.com/CoCreate-app/CoCreate-crdt/compare/v1.2.5...v1.2.6) (2021-08-16) | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "@cocreate/crdt", | ||
"version": "1.2.6", | ||
"version": "1.3.0", | ||
"description": "CoCreate crdt", | ||
@@ -5,0 +5,0 @@ "author": "CoCreate LLC", |
@@ -373,3 +373,47 @@ import * as Y from 'yjs'; | ||
} | ||
/* | ||
crdt.getText({ | ||
collection: 'module_activities', | ||
document_id: '5e4802ce3ed96d38e71fc7e5', | ||
name: 'name' | ||
}) | ||
*/ | ||
getText(info) { | ||
try{ | ||
let docName = this.generateDocName(info) | ||
let typeName = this.generateTypeName(info) | ||
if (docName) { | ||
return this.docs[docName].doc.getText(typeName).toString(); | ||
} | ||
else return "--"; | ||
} | ||
catch (e) { | ||
console.error(e); | ||
return ""; | ||
} | ||
} | ||
/* | ||
crdt.getDoc({ | ||
collection: 'module_activities', | ||
document_id: '5e4802ce3ed96d38e71fc7e5', | ||
name: 'name' | ||
}) | ||
*/ | ||
getDoc(info) { | ||
try{ | ||
let docName = this.generateDocName(info) | ||
let typeName = this.generateTypeName(info) | ||
if (docName) { | ||
return this.docs[docName].doc.getText(typeName); | ||
} | ||
else return false; | ||
} | ||
catch (e) { | ||
console.error(e); | ||
return false; | ||
} | ||
} | ||
/* | ||
@@ -376,0 +420,0 @@ crdt.getPosition(function(data)) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
131289
1971