From 4c7b870af642100233547ea56f7c6b1feaf550cc Mon Sep 17 00:00:00 2001 From: Eric Cornelissen Date: Mon, 22 Nov 2021 20:56:10 +0100 Subject: [PATCH] Remove `.get` from package's default export (#6820) * Remove `.get` from package's default export * Update TypeScript definitions * Updated index.js test suite --- index.d.ts | 4 ---- scripts/build/templates/index.js | 7 ------- tests/index.test.js | 8 -------- 3 files changed, 19 deletions(-) diff --git a/index.d.ts b/index.d.ts index 44c8bfe2e..409df601e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -15,10 +15,6 @@ export interface SimpleIcon { } declare const icons: Record & { - /** - * @deprecated use .Get instead - */ - get(name: string): SimpleIcon; Get(name: string): SimpleIcon; }; diff --git a/scripts/build/templates/index.js b/scripts/build/templates/index.js index 6038995dc..b627a4dd4 100644 --- a/scripts/build/templates/index.js +++ b/scripts/build/templates/index.js @@ -7,11 +7,4 @@ Object.defineProperty(icons, "Get", { } }); -Object.defineProperty(icons, "get", { - enumerable: false, - value: function(targetName) { - return this.Get(targetName); - } -}); - module.exports = icons; diff --git a/tests/index.test.js b/tests/index.test.js index 90d78e60f..4f6611a60 100644 --- a/tests/index.test.js +++ b/tests/index.test.js @@ -12,14 +12,6 @@ icons.forEach((icon) => { expect(found.hex).toEqual(icon.hex); expect(found.source).toEqual(icon.source); }); - - test(`'get' ${icon.title} by its slug`, () => { - const found = simpleIcons.get(slug); - expect(found).toBeDefined(); - expect(found.title).toEqual(icon.title); - expect(found.hex).toEqual(icon.hex); - expect(found.source).toEqual(icon.source); - }); }); test(`Iterating over simpleIcons only exposes icons`, () => {