Skip to content

Commit d455a21

Browse files
committed
Changeset: Make the Builder attribs and pool args optional
1 parent 7828066 commit d455a21

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

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

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

0 commit comments

Comments
 (0)