From 002d18c46a979ceeef8f3c1085aa5f5200f27d1a Mon Sep 17 00:00:00 2001 From: Muhammad Yusuf Date: Mon, 6 Nov 2023 11:27:36 +0700 Subject: [PATCH] chore: adjust exports files --- .DS_Store | Bin 6148 -> 0 bytes .gitignore | 6 +++++- dist/index.cjs | 1 - dist/index.esm.js | 1 - dist/index.mjs | 1 - dist/types/index.d.ts | 36 ------------------------------------ package.json | 11 ++++++++--- 7 files changed, 13 insertions(+), 43 deletions(-) delete mode 100644 .DS_Store delete mode 100644 dist/index.cjs delete mode 100644 dist/index.esm.js delete mode 100644 dist/index.mjs delete mode 100644 dist/types/index.d.ts diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 3f4a8f74718c1ab5b1069afa9e463071284dc2ef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5Z-O8O({YS3Oz1(E!fstC|*LXFJMFuDm5`hgE3o@)Er77XMG``#OHBl zcLNr47O^w1`_1oe_JiyXV~kIhL7y?3F=jzSBa0hdWq$mrjrBPO7;wv@D7Su&8wTlk&GX~Q)ZW0gv0{let r=e.z.object({verses:e.z.array(u)}).safeParse(JSON.parse(n.readFileSync("./src/data/quran.json","utf-8")));if(!r.success)throw Error("Failed to parse data");return r.data.verses},o=e=>a().reduce((r,t)=>(e.includes(t.chapter_id)&&r.push(t.id),r),[]),s=e=>{let r=a().find(r=>r.id===e);if(!r)throw Error("Failed to find verse");return r.text_uthmani};function i(){return(i=Object.assign||function(e){for(var r=1;r{if(e.length<5)throw Error("Not enough numbers");let r=Math.floor(Math.random()*(e.length-1)),t=[e[r],e[r+1]],n=e.filter((e,t)=>t!==r&&t!==r+1);if(n.length<3)throw Error("Not enough remaining numbers");let u=[];for(let e=0;e<3;e++){let e=Math.floor(Math.random()*n.length);u.push(n[e]),n.splice(e,1)}return{question:t[0],answer:t[1],options:u}},b=e=>{let{indexOf:r,getter:t}=e,n={question:t(r.question),options:[...r.options.map(e=>({text:t(e),value:0})),{text:t(r.answer),value:1}]};return m(n)},m=e=>{let r=[...e.options];for(let e=r.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1));[r[e],r[t]]=[r[t],r[e]]}return i({},e,{options:r})},c=e=>e.sort((e,r)=>e-r),h=r=>{let t=e.z.object({select:e.z.array(e.z.number({invalid_type_error:"Must be number"}).min(1,"Must be between 1 and 114").max(114,"Must be between 1 and 114")).min(1,"Select at least one chapter"),amount:e.z.number().min(1)}),n=t.parse(r),{select:u,amount:a}=n,i=o(u),m=[];for(let e=0;e{let u=e.object({verses:e.array(r)}).safeParse(_);if(!u.success)throw Error("Failed to parse data");return u.data.verses},m=e=>n().reduce((u,_)=>(e.includes(_.chapter_id)&&u.push(_.id),u),[]),b=e=>n().reduce((u,_)=>(e.includes(_.juz_number)&&u.push(_.id),u),[]),i=e=>{let u=n().find(u=>u.id===e);if(!u)throw Error("Failed to find verse");return u.text_uthmani};function a(){return(a=Object.assign||function(e){for(var u=1;u{if(e.length<5)throw Error("Not enough numbers");let u=Math.floor(Math.random()*(e.length-1)),_=[e[u],e[u+1]],r=e.filter((e,_)=>_!==u&&_!==u+1);if(r.length<3)throw Error("Not enough remaining numbers");let n=[];for(let e=0;e<3;e++){let e=Math.floor(Math.random()*r.length);n.push(r[e]),r.splice(e,1)}return{question:_[0],answer:_[1],options:n}},h=e=>{let{indexOf:u,getter:_}=e,r={question:_(u.question),options:[...u.options.map(e=>({text:_(e),value:0})),{text:_(u.answer),value:1}]};return l(r)},l=e=>{let u=[...e.options];for(let e=u.length-1;e>0;e--){let _=Math.floor(Math.random()*(e+1));[u[e],u[_]]=[u[_],u[e]]}return a({},e,{options:u})},z=e=>e.sort((e,u)=>e-u),s=u=>{let _=e.object({select:e.array(e.number({invalid_type_error:"Must be number"}).min(1,"Must be between 1 and 114").max(114,"Must be between 1 and 114")).min(1,"Select at least one chapter"),amount:e.number().min(1)}),r=_.parse(u),{select:n,amount:b}=r,a=m(n),l=[];for(let e=0;e{let _=e.object({select:e.array(e.number({invalid_type_error:"Must be number"}).min(1,"Must be between 1 and 30").max(30,"Must be between 1 and 30")).min(1,"Select at least one chapter"),amount:e.number().min(1)}),r=_.parse(u),{select:n,amount:m}=r,a=b(n),l=[];for(let e=0;e{let u=e.object({verses:e.array(r)}).safeParse(_);if(!u.success)throw Error("Failed to parse data");return u.data.verses},m=e=>n().reduce((u,_)=>(e.includes(_.chapter_id)&&u.push(_.id),u),[]),b=e=>n().reduce((u,_)=>(e.includes(_.juz_number)&&u.push(_.id),u),[]),i=e=>{let u=n().find(u=>u.id===e);if(!u)throw Error("Failed to find verse");return u.text_uthmani};function a(){return(a=Object.assign||function(e){for(var u=1;u{if(e.length<5)throw Error("Not enough numbers");let u=Math.floor(Math.random()*(e.length-1)),_=[e[u],e[u+1]],r=e.filter((e,_)=>_!==u&&_!==u+1);if(r.length<3)throw Error("Not enough remaining numbers");let n=[];for(let e=0;e<3;e++){let e=Math.floor(Math.random()*r.length);n.push(r[e]),r.splice(e,1)}return{question:_[0],answer:_[1],options:n}},h=e=>{let{indexOf:u,getter:_}=e,r={question:_(u.question),options:[...u.options.map(e=>({text:_(e),value:0})),{text:_(u.answer),value:1}]};return l(r)},l=e=>{let u=[...e.options];for(let e=u.length-1;e>0;e--){let _=Math.floor(Math.random()*(e+1));[u[e],u[_]]=[u[_],u[e]]}return a({},e,{options:u})},z=e=>e.sort((e,u)=>e-u),s=u=>{let _=e.object({select:e.array(e.number({invalid_type_error:"Must be number"}).min(1,"Must be between 1 and 114").max(114,"Must be between 1 and 114")).min(1,"Select at least one chapter"),amount:e.number().min(1)}),r=_.parse(u),{select:n,amount:b}=r,a=m(n),l=[];for(let e=0;e{let _=e.object({select:e.array(e.number({invalid_type_error:"Must be number"}).min(1,"Must be between 1 and 30").max(30,"Must be between 1 and 30")).min(1,"Select at least one chapter"),amount:e.number().min(1)}),r=_.parse(u),{select:n,amount:m}=r,a=b(n),l=[];for(let e=0;e { - data: { - question: string; - options: { - text: string; - value: number; - }[]; - }[]; - meta: { - type: string; - select: number[]; - amount: number; - }; - }; - byJuz: (props: GuessVerse) => { - data: { - question: string; - options: { - text: string; - value: number; - }[]; - }[]; - meta: { - type: string; - select: number[]; - amount: number; - }; - }; -}; - -export { guessVerse }; diff --git a/package.json b/package.json index 8af5588..a8403cb 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,15 @@ "zod": "^3.22.4" }, "exports": { - "module": "./dist/index.esm.js", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs" + ".": { + "module": "./dist/index.esm.js", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + } }, + "files": [ + "dist" + ], "types": "./dist/types/index.d.ts", "scripts": { "build": "bunchee",