ol 10.6.2-dev.1753992384159 → 10.6.2-dev.1754054564182

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Collection.d.ts CHANGED
@@ -186,7 +186,7 @@ declare class Collection<T> extends BaseObject {
186
186
  /**
187
187
  * @private
188
188
  * @param {T} elem Element.
189
- * @param {number} [ignoreStartingAt] Optional indexes to ignore.
189
+ * @param {number} [except] Optional index to ignore.
190
190
  */
191
191
  private assertUnique_;
192
192
  }
package/Collection.js CHANGED
@@ -311,12 +311,12 @@ class Collection extends BaseObject {
311
311
  /**
312
312
  * @private
313
313
  * @param {T} elem Element.
314
- * @param {number} [ignoreStartingAt] Optional indexes to ignore.
314
+ * @param {number} [except] Optional index to ignore.
315
315
  */
316
- assertUnique_(elem, ignoreStartingAt) {
316
+ assertUnique_(elem, except) {
317
317
  const array = this.array_;
318
- for (let i = 0, ii = ignoreStartingAt ?? array.length; i < ii; ++i) {
319
- if (array[i] === elem) {
318
+ for (let i = 0, ii = array.length; i < ii; ++i) {
319
+ if (array[i] === elem && i !== except) {
320
320
  throw new Error('Duplicate item added to a unique collection');
321
321
  }
322
322
  }