Skip to content

Commit

Permalink
feat: optimize static types and make them dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedriad1 committed Apr 6, 2022
1 parent 0fd6c8a commit 2848ff5
Show file tree
Hide file tree
Showing 7 changed files with 160 additions and 7,203 deletions.
119 changes: 4 additions & 115 deletions src/types/ChapterId.ts
Original file line number Diff line number Diff line change
@@ -1,115 +1,4 @@
export type ChapterId =
| '1'
| '2'
| '3'
| '4'
| '5'
| '6'
| '7'
| '8'
| '9'
| '10'
| '11'
| '12'
| '13'
| '14'
| '15'
| '16'
| '17'
| '18'
| '19'
| '20'
| '21'
| '22'
| '23'
| '24'
| '25'
| '26'
| '27'
| '28'
| '29'
| '30'
| '31'
| '32'
| '33'
| '34'
| '35'
| '36'
| '37'
| '38'
| '39'
| '40'
| '41'
| '42'
| '43'
| '44'
| '45'
| '46'
| '47'
| '48'
| '49'
| '50'
| '51'
| '52'
| '53'
| '54'
| '55'
| '56'
| '57'
| '58'
| '59'
| '60'
| '61'
| '62'
| '63'
| '64'
| '65'
| '66'
| '67'
| '68'
| '69'
| '70'
| '71'
| '72'
| '73'
| '74'
| '75'
| '76'
| '77'
| '78'
| '79'
| '80'
| '81'
| '82'
| '83'
| '84'
| '85'
| '86'
| '87'
| '88'
| '89'
| '90'
| '91'
| '92'
| '93'
| '94'
| '95'
| '96'
| '97'
| '98'
| '99'
| '100'
| '101'
| '102'
| '103'
| '104'
| '105'
| '106'
| '107'
| '108'
| '109'
| '110'
| '111'
| '112'
| '113'
| '114';
import { NumberRange, NumberUnionToString } from './utils';

type _ChapterId = NumberRange<1, 115>;
export type ChapterId = _ChapterId | NumberUnionToString<_ChapterId>;
65 changes: 4 additions & 61 deletions src/types/HizbNumber.ts
Original file line number Diff line number Diff line change
@@ -1,61 +1,4 @@
export type HizbNumber =
| '1'
| '2'
| '3'
| '4'
| '5'
| '6'
| '7'
| '8'
| '9'
| '10'
| '11'
| '12'
| '13'
| '14'
| '15'
| '16'
| '17'
| '18'
| '19'
| '20'
| '21'
| '22'
| '23'
| '24'
| '25'
| '26'
| '27'
| '28'
| '29'
| '30'
| '31'
| '32'
| '33'
| '34'
| '35'
| '36'
| '37'
| '38'
| '39'
| '40'
| '41'
| '42'
| '43'
| '44'
| '45'
| '46'
| '47'
| '48'
| '49'
| '50'
| '51'
| '52'
| '53'
| '54'
| '55'
| '56'
| '57'
| '58'
| '59'
| '60';
import { NumberRange, NumberUnionToString } from './utils';

type _HizbNumber = NumberRange<1, 61>;
export type HizbNumber = _HizbNumber | NumberUnionToString<_HizbNumber>;
35 changes: 4 additions & 31 deletions src/types/JuzNumber.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,4 @@
export type JuzNumber =
| '1'
| '2'
| '3'
| '4'
| '5'
| '6'
| '7'
| '8'
| '9'
| '10'
| '11'
| '12'
| '13'
| '14'
| '15'
| '16'
| '17'
| '18'
| '19'
| '20'
| '21'
| '22'
| '23'
| '24'
| '25'
| '26'
| '27'
| '28'
| '29'
| '30';
import { NumberRange, NumberUnionToString } from './utils';

type _JuzNumber = NumberRange<1, 31>;
export type JuzNumber = _JuzNumber | NumberUnionToString<_JuzNumber>;
Loading

2 comments on commit 2848ff5

@vercel
Copy link

@vercel vercel bot commented on 2848ff5 Apr 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

quranjs-docs – ./docs

quranjs-docs-git-master-ahmed-riad.vercel.app
quranjs-docs.vercel.app
quranjs-docs-ahmed-riad.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 2848ff5 Apr 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

api – ./docs

quranjs.vercel.app
api-quranjs.vercel.app
api-git-master-quranjs.vercel.app

Please sign in to comment.