Skip to content

Commit

Permalink
Gettter added (#4)
Browse files Browse the repository at this point in the history
* Add getter

* Add typescript as dependency

* Add non default export for PROVIDERS

* Auto generate type definitions

* Bump version
  • Loading branch information
brachkow authored Jul 19, 2023
1 parent 7042b12 commit b67d76f
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 14 deletions.
19 changes: 9 additions & 10 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
declare type Provider = {
id: string;
url: string;
label: string;
keyword: string;
};

declare const PROVIDERS: Provider[];

export = PROVIDERS;
export const PROVIDERS: {
id: string;
url: string;
label: string;
keywords: string[];
}[];
export function getProvider(id: any): any;
export default PROVIDERS;
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const PROVIDERS = [
export const PROVIDERS = [
{
id: 'GMAIL',
url: 'https://mail.google.com/',
Expand Down Expand Up @@ -39,8 +39,10 @@ const PROVIDERS = [
id: 'APPLE',
url: 'https://www.icloud.com/mail/',
label: 'iCloud Mail',
keyword: ['@icloud'],
keywords: ['@icloud'],
},
];

export const getProvider = (id) => PROVIDERS.find((provider) => provider.id === id);

export default PROVIDERS;
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"name": "@brachkow/email-providers",
"version": "1.0.0",
"version": "1.1.0",
"description": "URLs of popular email providers as JS object",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/brachkow/email-providers.git"
},
"author": "Timur Brachkow",
"license": "MIT"
"license": "MIT",
"devDependencies": {
"typescript": "^5.1.6"
}
}
14 changes: 14 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"include": ["index.js"],
"compilerOptions": {
"allowJs": true,
"declaration": true,
"emitDeclarationOnly": true,
"declarationMap": true
}
}

0 comments on commit b67d76f

Please sign in to comment.