diff --git a/packages/collection/src/index.ts b/packages/collection/src/index.ts index 8a6aaea6a..e984370bf 100644 --- a/packages/collection/src/index.ts +++ b/packages/collection/src/index.ts @@ -41,7 +41,7 @@ export class Collection extends Map { */ public ensure(key: K, defaultValueGenerator: (key: K, collection: this) => V): V { if (this.has(key)) return this.get(key)!; - if (typeof defaultValueGenerator !== 'function') throw new TypeError(`${defaultValueGenerator} is not a function.`); + if (typeof defaultValueGenerator !== 'function') throw new TypeError(`${defaultValueGenerator} is not a function`); const defaultValue = defaultValueGenerator(key, this); this.set(key, defaultValue); return defaultValue;