@quranjs/api 1.4.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/api.cjs.development.js +2 -2
- package/dist/api.cjs.development.js.map +1 -1
- package/dist/api.cjs.production.min.js.map +1 -1
- package/dist/api.esm.js +2 -2
- package/dist/api.esm.js.map +1 -1
- package/dist/sdk/utils.d.ts +1 -1
- package/dist/types/ChapterId.d.ts +4 -1
- package/dist/types/HizbNumber.d.ts +4 -1
- package/dist/types/JuzNumber.d.ts +4 -1
- package/dist/types/PageNumber.d.ts +4 -1
- package/dist/types/RubNumber.d.ts +4 -1
- package/dist/types/VerseKey.d.ts +2 -1
- package/dist/types/utils.d.ts +5 -0
- package/package.json +1 -1
- package/src/sdk/utils.ts +2 -2
- package/src/types/ChapterId.ts +4 -115
- package/src/types/HizbNumber.ts +4 -61
- package/src/types/JuzNumber.ts +4 -31
- package/src/types/PageNumber.ts +4 -519
- package/src/types/RubNumber.ts +4 -241
- package/src/types/VerseKey.ts +116 -6236
- package/src/types/utils.ts +24 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-

|
|
2
2
|
A library for fetching quran data from the [quran.com API][qdc-api]. This library also works on both Node.js and the browser.
|
|
3
3
|
|
|
4
4
|
[Checkout Docs][docs]
|
|
@@ -31,10 +31,10 @@ you can visit the [docs][docs] for more details.
|
|
|
31
31
|
|
|
32
32
|
[qdc-api]: https://quran.api-docs.io/
|
|
33
33
|
[docs]: https://quranjs.vercel.app/
|
|
34
|
-
[build-badge]: https://github.com/
|
|
35
|
-
[build]: https://github.com/
|
|
34
|
+
[build-badge]: https://github.com/quran/api-js/workflows/CI/badge.svg
|
|
35
|
+
[build]: https://github.com/quran/api-js/actions?query=workflow%3ACI
|
|
36
36
|
[license-badge]: https://badgen.net/github/license/quranjs/api
|
|
37
|
-
[license]: https://github.com/
|
|
37
|
+
[license]: https://github.com/quran/api-js/blob/master/LICENSE
|
|
38
38
|
[npm]: https://www.npmjs.com/package/@quranjs/api
|
|
39
39
|
[npm-badge]: https://badgen.net/npm/v/@quranjs/api
|
|
40
40
|
[downloads-badge]: https://img.shields.io/npm/dm/@quranjs/api.svg
|
|
@@ -1071,7 +1071,7 @@ var fetcher = /*#__PURE__*/function () {
|
|
|
1071
1071
|
}();
|
|
1072
1072
|
|
|
1073
1073
|
// this maps chapterNumber to verseCount
|
|
1074
|
-
var
|
|
1074
|
+
var versesMapping = {
|
|
1075
1075
|
'1': 7,
|
|
1076
1076
|
'2': 286,
|
|
1077
1077
|
'3': 200,
|
|
@@ -1290,7 +1290,7 @@ var isValidVerseKey = function isValidVerseKey(key) {
|
|
|
1290
1290
|
|
|
1291
1291
|
if (!chapterId || !verseId || !isValidChapterId(chapterId)) return false;
|
|
1292
1292
|
var parsedVerse = Number(verseId);
|
|
1293
|
-
var verseCount =
|
|
1293
|
+
var verseCount = versesMapping[chapterId];
|
|
1294
1294
|
if (!parsedVerse || parsedVerse <= 0 || parsedVerse > verseCount) return false;
|
|
1295
1295
|
return true;
|
|
1296
1296
|
};
|