mirror of
https://github.com/Mibew/simple-icons.git
synced 2025-05-02 17:16:42 +03:00
Remove .get
from package's default export (#6820)
* Remove `.get` from package's default export * Update TypeScript definitions * Updated index.js test suite
This commit is contained in:
parent
a94f8dd1cf
commit
4c7b870af6
4
index.d.ts
vendored
4
index.d.ts
vendored
@ -15,10 +15,6 @@ export interface SimpleIcon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
declare const icons: Record<string, SimpleIcon> & {
|
declare const icons: Record<string, SimpleIcon> & {
|
||||||
/**
|
|
||||||
* @deprecated use .Get instead
|
|
||||||
*/
|
|
||||||
get(name: string): SimpleIcon;
|
|
||||||
Get(name: string): SimpleIcon;
|
Get(name: string): SimpleIcon;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -7,11 +7,4 @@ Object.defineProperty(icons, "Get", {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Object.defineProperty(icons, "get", {
|
|
||||||
enumerable: false,
|
|
||||||
value: function(targetName) {
|
|
||||||
return this.Get(targetName);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = icons;
|
module.exports = icons;
|
||||||
|
@ -12,14 +12,6 @@ icons.forEach((icon) => {
|
|||||||
expect(found.hex).toEqual(icon.hex);
|
expect(found.hex).toEqual(icon.hex);
|
||||||
expect(found.source).toEqual(icon.source);
|
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`, () => {
|
test(`Iterating over simpleIcons only exposes icons`, () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user