Skip to content

Commit 79f7412

Browse files
committed
Changeset: Make the Builder attribs and pool args optional
1 parent 6be6e01 commit 79f7412

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/static/js/Changeset.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1933,13 +1933,13 @@ class Builder {
19331933
* @param {number} N - Number of characters to keep.
19341934
* @param {number} L - Number of newlines among the `N` characters. If positive, the last
19351935
* character must be a newline.
1936-
* @param {(string|Attribute[])} attribs - Either [[key1,value1],[key2,value2],...] or '*0*1...'
1936+
* @param {(string|Attribute[])} [attribs] - Either [[key1,value1],[key2,value2],...] or '*0*1...'
19371937
* (no pool needed in latter case).
1938-
* @param {?AttributePool} pool - Attribute pool, only required if `attribs` is a list of
1938+
* @param {?AttributePool} [pool] - Attribute pool, only required if `attribs` is a list of
19391939
* attribute key, value pairs.
19401940
* @returns {Builder} this
19411941
*/
1942-
keep(N, L, attribs, pool) {
1942+
keep(N, L, attribs = '', pool = null) {
19431943
const o = new Op('=');
19441944
o.attribs = typeof attribs === 'string'
19451945
? attribs : new AttributeMap(pool).update(attribs || []).toString();
@@ -1951,26 +1951,26 @@ class Builder {
19511951

19521952
/**
19531953
* @param {string} text - Text to keep.
1954-
* @param {(string|Attribute[])} attribs - Either [[key1,value1],[key2,value2],...] or '*0*1...'
1954+
* @param {(string|Attribute[])} [attribs] - Either [[key1,value1],[key2,value2],...] or '*0*1...'
19551955
* (no pool needed in latter case).
1956-
* @param {?AttributePool} pool - Attribute pool, only required if `attribs` is a list of
1956+
* @param {?AttributePool} [pool] - Attribute pool, only required if `attribs` is a list of
19571957
* attribute key, value pairs.
19581958
* @returns {Builder} this
19591959
*/
1960-
keepText(text, attribs, pool) {
1960+
keepText(text, attribs = '', pool = null) {
19611961
this._ops.push(...opsFromText('=', text, attribs, pool));
19621962
return this;
19631963
}
19641964

19651965
/**
19661966
* @param {string} text - Text to insert.
1967-
* @param {(string|Attribute[])} attribs - Either [[key1,value1],[key2,value2],...] or '*0*1...'
1967+
* @param {(string|Attribute[])} [attribs] - Either [[key1,value1],[key2,value2],...] or '*0*1...'
19681968
* (no pool needed in latter case).
1969-
* @param {?AttributePool} pool - Attribute pool, only required if `attribs` is a list of
1969+
* @param {?AttributePool} [pool] - Attribute pool, only required if `attribs` is a list of
19701970
* attribute key, value pairs.
19711971
* @returns {Builder} this
19721972
*/
1973-
insert(text, attribs, pool) {
1973+
insert(text, attribs = '', pool = null) {
19741974
this._ops.push(...opsFromText('+', text, attribs, pool));
19751975
this._charBank.append(text);
19761976
return this;

0 commit comments

Comments
 (0)