From 5bd6b28b3ebfced1cb9d23e83bd7c0def7a12404 Mon Sep 17 00:00:00 2001 From: Almeida Date: Mon, 4 Jul 2022 16:40:33 +0100 Subject: [PATCH] fix(Collection): make error messages consistent (#8224) --- packages/collection/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;