Skip to content

Commit

Permalink
chore: add readme file with examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-ahmadbilal committed Aug 30, 2024
1 parent aa927aa commit 540604f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 5 deletions.
42 changes: 42 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "islam.js",
"version": "1.0.0",
"description": "This is the initial commit.",
"main": "index.js",
"scripts": {
"lint": "eslint",
"lint:fix": "eslint --fix",
"start": "npx ts-node src/test.ts",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/dev-ahmadbilal/islam.js.git"
},
"keywords": [
"islam.js",
"islam",
"quran",
"hadith",
"prayer",
"azkar"
],
"author": "Ahmad Bilal",
"license": "MIT",
"bugs": {
"url": "https://github.com/dev-ahmadbilal/islam.js/issues"
},
"homepage": "https://github.com/dev-ahmadbilal/islam.js#readme",
"devDependencies": {
"@eslint/js": "^9.9.1",
"@types/node": "^22.5.0",
"eslint": "^9.9.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"globals": "^15.9.0",
"prettier": "3.3.3",
"ts-node": "^10.9.2",
"typescript": "^5.5.4",
"typescript-eslint": "^8.3.0"
}
}
4 changes: 2 additions & 2 deletions src/calander/hijri-calander.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class HijriCalendar {
if (!response.ok) {
throw new Error(`Failed to fetch Hijri date by location: ${response.statusText}`);
}
const data: PrayerApiResponse = await response.json();
const data = (await response.json()) as PrayerApiResponse;
return data.data.date.hijri;
} catch (error) {
console.error(error);
Expand All @@ -50,7 +50,7 @@ export class HijriCalendar {
if (!response.ok) {
throw new Error(`Failed to fetch Hijri date by city: ${response.statusText}`);
}
const data: PrayerApiResponse = await response.json();
const data = (await response.json()) as PrayerApiResponse;
return data.data.date.hijri;
} catch (error) {
console.error(error);
Expand Down
4 changes: 2 additions & 2 deletions src/quran/quran.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export class Quran {

/**
* Get a Chapter by its name.
* @param name - The name of the Chapter in Arabic.
* @param name - The name of the Chapter in English.
* @returns The Chapter object or undefined if not found.
*/
public getChapterByName(name: string): Chapter | undefined {
return this.quran.find((obj) => obj.name === name);
return this.quran.find((obj) => obj.englishName === name);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/types/dialect.enum.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export enum DialectEnum {
Hafs = 'hafs',
Watsh = 'warsh',
Warsh = 'warsh',
}

0 comments on commit 540604f

Please sign in to comment.