Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

quran-meta

Package Overview
Dependencies
Maintainers
0
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quran-meta - npm Package Compare versions

Comparing version 2.5.3 to 2.5.4-0

28

dist/index.d.ts

@@ -49,4 +49,4 @@ type QuranMeta = {

* Turns String of type "x:y" or "x:y1-y2" to array [x,y] or [x,[y1,y2]] respectively
* @param {*} str String of type "x:y" or "x:y1-y2"
* @returns {array} array [x,y] or [x,[y1,y2]] respectively
* @param str - String of type "x:y" or "x:y1-y2"
* @returns array [x,y] or [x,[y1,y2]] respectively
*/

@@ -136,12 +136,10 @@ declare function ayaStringSplitter(str: string): SurahAyahSegment;

/**
* ALternative deprecated method
* @param {*} pageNum
* Finds a range of ayahs around a given ayah based on the specified mode.
*
* @param surah - The surah number (1-114)
* @param ayah - The ayah number within the surah, or the absolute ayah ID if ayahMode is true
* @param mode - The range mode: "juz", "surah", "ayah", "page", or "all"
* @param ayahMode - If true, treats the ayah parameter as an absolute ayah ID
* @returns A tuple containing the start and end ayah IDs of the range
*/
/**
* Find range containing ayah according to the mode
* @param surah
* @param ayah
* @param {*} mode can be either 'all', 'juz', 'surah', 'ayah', 'page'
* default is all
*/
declare function findRangeAroundAyah(surah: Surah, ayah: AyahNo, mode: "juz" | "surah" | "ayah" | "page" | "all", ayahMode?: boolean): SurahAyah;

@@ -216,7 +214,7 @@

/**
* Retrieves the page metadata for the specified page number.
* Retrieves metadata for a specific page of the Quran.
*
* @param pageNum - The page number to retrieve metadata for.
* @returns The page metadata, including the first and last ayah IDs on the page.
* @throws {RangeError} If the page number is out of the valid range (1 to `meta.numPages`).
* @param pageNum - The page number to retrieve metadata for (1-604)
* @returns An object containing the page number, first ayah, and last ayah on the page
* @throws RangeError If the page number is not between 1 and 604
*/

@@ -223,0 +221,0 @@ declare function pageMeta(pageNum: Page): PageMeta;

/*!
* Quran Meta library 2.5.3
* Quran Meta library 2.5.4-0
*

@@ -4,0 +4,0 @@ * Released under the MIT license

/*!
* Quran Meta library 2.5.3
* Quran Meta library 2.5.4-0
*

@@ -4,0 +4,0 @@ * Released under the MIT license

import { SurahAyahSegment } from "./types";
/**
* Turns String of type "x:y" or "x:y1-y2" to array [x,y] or [x,[y1,y2]] respectively
* @param {*} str String of type "x:y" or "x:y1-y2"
* @returns {array} array [x,y] or [x,[y1,y2]] respectively
* @param str - String of type "x:y" or "x:y1-y2"
* @returns array [x,y] or [x,[y1,y2]] respectively
*/
export declare function ayaStringSplitter(str: string): SurahAyahSegment;
import { AyahNo, Surah, SurahAyah } from "./types";
/**
* ALternative deprecated method
* @param {*} pageNum
* Finds a range of ayahs around a given ayah based on the specified mode.
*
* @param surah - The surah number (1-114)
* @param ayah - The ayah number within the surah, or the absolute ayah ID if ayahMode is true
* @param mode - The range mode: "juz", "surah", "ayah", "page", or "all"
* @param ayahMode - If true, treats the ayah parameter as an absolute ayah ID
* @returns A tuple containing the start and end ayah IDs of the range
*/
/**
* Find range containing ayah according to the mode
* @param surah
* @param ayah
* @param {*} mode can be either 'all', 'juz', 'surah', 'ayah', 'page'
* default is all
*/
export declare function findRangeAroundAyah(surah: Surah, ayah: AyahNo, mode: "juz" | "surah" | "ayah" | "page" | "all", ayahMode?: boolean): SurahAyah;
import { Page, PageMeta } from "./types";
/**
* Retrieves the page metadata for the specified page number.
* Retrieves metadata for a specific page of the Quran.
*
* @param pageNum - The page number to retrieve metadata for.
* @returns The page metadata, including the first and last ayah IDs on the page.
* @throws {RangeError} If the page number is out of the valid range (1 to `meta.numPages`).
* @param pageNum - The page number to retrieve metadata for (1-604)
* @returns An object containing the page number, first ayah, and last ayah on the page
* @throws RangeError If the page number is not between 1 and 604
*/
export declare function pageMeta(pageNum: Page): PageMeta;

@@ -11,3 +11,3 @@ {

],
"version": "2.5.3",
"version": "2.5.4-0",
"license": "MIT",

@@ -89,3 +89,6 @@ "jsdelivr": "dist/index.mjs",

},
"packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b"
"packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b",
"dependencies": {
"eslint-plugin-tsdoc": "^0.3.0"
}
}

@@ -49,3 +49,3 @@ ## Welcome to Quran Meta Project

See [here](https://quran-center.github.io/quran-meta/docs/globals.html) for API documentation
See [here](https://quran-center.github.io/quran-meta/docs/) for API documentation

@@ -74,7 +74,7 @@ ### Examples

|[UMD](https://quran-center.github.io/quran-meta/dist/quran-meta.js)/ [UMD minified](https://quran-center.github.io/quran-meta/dist/quran-meta.min.js) builds can be used directly in the browser via a `<script>` (see [here](https://www.syntaxsuccess.com/viewarticle/iife-vs-umd) about UMD format) | ES5+UMD |
| [CommonJS](https://quran-center.github.io/quran-meta/dist/quran-meta.common.js) for use with older bundlers like browserify or webpack | ES5+CommonJS |
| [ESM](https://quran-center.github.io/quran-meta/dist/quran-meta.esm.js) for use with modern bundlers like webpack 2 or Rollup | ES5+ESM |
| [ESM Browser](https://quran-center.github.io/quran-meta/dist/quran-meta.esm.browser.js)/[ESM Browser minified](https://quran-center.github.io/quran-meta/dist/quran-meta.esm.browser.min.js) for direct imports in modern browsers via `<script type="module">` | ESNext+ESM |
| [CommonJS](https://quran-center.github.io/quran-meta/dist/index.cjs) for use with older bundlers like browserify or webpack | ES5+CommonJS |
| [ESM](https://quran-center.github.io/quran-meta/dist/index.mjs) for use with modern bundlers like webpack 2 or Rollup and for direct imports in modern browsers via `<script type="module">`| ES5+ESM |

@@ -6,4 +6,4 @@ import { AyahNo, SurahAyahSegment } from "./types"

* Turns String of type "x:y" or "x:y1-y2" to array [x,y] or [x,[y1,y2]] respectively
* @param {*} str String of type "x:y" or "x:y1-y2"
* @returns {array} array [x,y] or [x,[y1,y2]] respectively
* @param str - String of type "x:y" or "x:y1-y2"
* @returns array [x,y] or [x,[y1,y2]] respectively
*/

@@ -10,0 +10,0 @@ export function ayaStringSplitter(str: string): SurahAyahSegment {

@@ -12,32 +12,10 @@ import { meta } from "./const"

/**
* ALternative deprecated method
* @param {*} pageNum
* Finds a range of ayahs around a given ayah based on the specified mode.
*
* @param surah - The surah number (1-114)
* @param ayah - The ayah number within the surah, or the absolute ayah ID if ayahMode is true
* @param mode - The range mode: "juz", "surah", "ayah", "page", or "all"
* @param ayahMode - If true, treats the ayah parameter as an absolute ayah ID
* @returns A tuple containing the start and end ayah IDs of the range
*/
// export function pageMetaOld(pageNum: number): any {
// if (pageNum < 1 || pageNum > meta.numPages)
// throw new RangeError("pagenum must be between 1 and " + meta.numPages)
// const [curPage, nextPage] = [
// findSurahByAyaid(PageList[pageNum]),
// findSurahByAyaid(PageList[pageNum + 1]),
// ]
// const [firstSurah, firstAyah, lastSurah, lastAyah] = [
// curPage[0],
// curPage[1],
// nextPage[1] === 1 ? nextPage[0] - 1 : nextPage[0],
// nextPage[1] === 1 ? SuraList[nextPage[0] - 1][1] : nextPage[1] - 1,
// ]
// return {
// pageNum,
// first: [firstSurah, firstAyah],
// last: [lastSurah, lastAyah],
// }
// }
/**
* Find range containing ayah according to the mode
* @param surah
* @param ayah
* @param {*} mode can be either 'all', 'juz', 'surah', 'ayah', 'page'
* default is all
*/
export function findRangeAroundAyah(

@@ -44,0 +22,0 @@ surah: Surah,

@@ -7,7 +7,7 @@ import { meta } from "./const"

/**
* Retrieves the page metadata for the specified page number.
* Retrieves metadata for a specific page of the Quran.
*
* @param pageNum - The page number to retrieve metadata for.
* @returns The page metadata, including the first and last ayah IDs on the page.
* @throws {RangeError} If the page number is out of the valid range (1 to `meta.numPages`).
* @param pageNum - The page number to retrieve metadata for (1-604)
* @returns An object containing the page number, first ayah, and last ayah on the page
* @throws RangeError If the page number is not between 1 and 604
*/

@@ -14,0 +14,0 @@ export function pageMeta(pageNum: Page): PageMeta {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc