Merge branch 'master' of github.com:yjs/yjs

This commit is contained in:
Kevin Jahns
2020-06-09 00:54:59 +02:00
2 changed files with 26 additions and 1 deletions

View File

@@ -115,6 +115,15 @@ export class YMap extends AbstractType {
return map
}
/**
* Returns the size of the YMap (count of key/value pairs)
*
* @return {number}
*/
get size () {
return [...createMapIterator(this._map)].length
}
/**
* Returns the keys for each element in the YMap Type.
*
@@ -143,7 +152,7 @@ export class YMap extends AbstractType {
}
/**
* Executes a provided function on once on overy key-value pair.
* Executes a provided function on once on every key-value pair.
*
* @param {function(T,string,YMap<T>):void} f A function to execute on every element of this YArray.
*/