Skip to content

Commit 431ccaf

Browse files
committed
Changeset: Make the Builder attribs and pool args optional
1 parent ce6941d commit 431ccaf

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
@@ -1935,13 +1935,13 @@ class Builder {
19351935
* @param {number} N - Number of characters to keep.
19361936
* @param {number} L - Number of newlines among the `N` characters. If positive, the last
19371937
* character must be a newline.
1938-
* @param {(string|Attribute[])} attribs - Either [[key1,value1],[key2,value2],...] or '*0*1...'
1938+
* @param {(string|Attribute[])} [attribs] - Either [[key1,value1],[key2,value2],...] or '*0*1...'
19391939
* (no pool needed in latter case).
1940-
* @param {?AttributePool} pool - Attribute pool, only required if `attribs` is a list of
1940+
* @param {?AttributePool} [pool] - Attribute pool, only required if `attribs` is a list of
19411941
* attribute key, value pairs.
19421942
* @returns {Builder} this
19431943
*/
1944-
keep(N, L, attribs, pool) {
1944+
keep(N, L, attribs = '', pool = null) {
19451945
const o = new Op('=');
19461946
o.attribs = typeof attribs === 'string'
19471947
? attribs : new AttributeMap(pool).update(attribs || []).toString();
@@ -1953,26 +1953,26 @@ class Builder {
19531953

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

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

0 commit comments

Comments
 (0)