Skip to content

Commit

Permalink
perf(vue-socials): remove useless babel polyfills
Browse files Browse the repository at this point in the history
  • Loading branch information
webistomin committed Apr 24, 2021
1 parent caa9f6e commit b29ac00
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ not Edge < 79
iOS >= 10
Safari >= 10
Android >= 6
Explorer >= 11
Explorer > 11
5 changes: 4 additions & 1 deletion src/vue-socials-esm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import * as components from '@/components';
* Install function executed by Vue.use()
*/
const install: Exclude<Plugin['install'], undefined> = function installVueSocials(app: App) {
Object.entries(components).forEach(([componentName, component]) => {
Object.entries(components).forEach((item) => {
const componentName = item[0];
const component = item[1];

app.component(componentName, component);
});
};
Expand Down
5 changes: 4 additions & 1 deletion src/vue-socials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import plugin, * as components from '@/vue-socials-esm';
*/
type NamedExports = Exclude<typeof components, 'default'>;
type ExtendedPlugin = typeof plugin & NamedExports;
Object.entries(components).forEach(([componentName, component]) => {
Object.entries(components).forEach((item) => {
const componentName = item[0];
const component = item[1];

if (componentName !== 'default') {
const key = componentName as Exclude<keyof NamedExports, 'default'>;
const val = component as Exclude<ExtendedPlugin, typeof plugin>;
Expand Down

0 comments on commit b29ac00

Please sign in to comment.