ayiin 2.0.3 → 2.0.4

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.
@@ -0,0 +1,51 @@
1
+ // src/methods/response.ts
2
+ class ResponseApi {
3
+ successResponse = (caption, data, code) => {
4
+ code = code ? Number(String(code) + "7400") : 2007400;
5
+ return {
6
+ responseCode: code,
7
+ responseSuccess: true,
8
+ responseMessage: `[Success] - ${caption}`,
9
+ responseData: data
10
+ };
11
+ };
12
+ badRequestResponse = (caption, title) => {
13
+ return {
14
+ responseCode: 4007400,
15
+ responseSuccess: false,
16
+ responseMessage: `[${title ? title : "Bad Request"}] - ${caption}`
17
+ };
18
+ };
19
+ invalidFieldsResponse = (caption) => {
20
+ return {
21
+ responseCode: 4007401,
22
+ responseSuccess: false,
23
+ responseMessage: `[Invalid Fields] - ${caption}`
24
+ };
25
+ };
26
+ notFoundResponse = (caption) => {
27
+ return {
28
+ responseCode: 4047400,
29
+ responseSuccess: false,
30
+ responseMessage: `[Not Found] - ${caption}`
31
+ };
32
+ };
33
+ unauthorizedResponse = (caption) => {
34
+ return {
35
+ responseCode: 4017400,
36
+ responseSuccess: false,
37
+ responseMessage: `[Unauthorized] - ${caption}`
38
+ };
39
+ };
40
+ internalServerErrorResponse = (caption) => {
41
+ return {
42
+ responseCode: 5007400,
43
+ responseSuccess: false,
44
+ responseMessage: `[Internal Server Error] - ${caption}`
45
+ };
46
+ };
47
+ }
48
+ var response_default = ResponseApi;
49
+ export {
50
+ response_default as default
51
+ };
@@ -1 +1,21 @@
1
- class a{formatMoney=(r,t="id-ID",e={style:"currency",currency:"IDR"})=>new Intl.NumberFormat(t,e).format(r);randomString=(r,t)=>{let n="";for(let o=0;o<r;o++)n+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(Math.random()*62)];return t?t+n:n}}var m=a;export{m as default};
1
+ // src/methods/tools.ts
2
+ class Tools {
3
+ formatMoney = (amount, locales = "id-ID", options = {
4
+ style: "currency",
5
+ currency: "IDR"
6
+ }) => {
7
+ return new Intl.NumberFormat(locales, options).format(amount);
8
+ };
9
+ randomString = (length, prefix) => {
10
+ const alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
11
+ let random = "";
12
+ for (let i = 0;i < length; i++) {
13
+ random += alphabet[Math.floor(Math.random() * alphabet.length)];
14
+ }
15
+ return prefix ? prefix + random : random;
16
+ };
17
+ }
18
+ var tools_default = Tools;
19
+ export {
20
+ tools_default as default
21
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ayiin",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Library Pribadi Yang Gak Ada Isinya",
5
5
  "main": "ayiin/index.js",
6
6
  "scripts": {
package/save CHANGED
@@ -1,26 +1,26 @@
1
- #!/usr/bin/env bash
2
-
3
- date=$(date +"%d-%m-%Y %H:%M:%S")
4
-
5
- # Tanya dulu
6
- read -p "Apakah ingin bump versi package.json? (y/N): " answer
7
-
8
- if [[ "$answer" == "y" || "$answer" == "Y" ]]; then
9
- echo "📦 Bump patch version package.json"
10
- npm version patch --no-git-tag-version
11
- else
12
- echo "ℹ️ Skip bump version"
13
- fi
14
-
15
- echo date: $date
16
-
17
- echo "Adding all files to git"
18
- git add .
19
-
20
- echo "Committing to git"
21
- git commit -m "Ayiin commit on $date"
22
-
23
- echo "Pushing to git"
24
- git push
25
-
1
+ #!/usr/bin/env bash
2
+
3
+ date=$(date +"%d-%m-%Y %H:%M:%S")
4
+
5
+ # Tanya dulu
6
+ read -p "Apakah ingin bump versi package.json? (y/N): " answer
7
+
8
+ if [[ "$answer" == "y" || "$answer" == "Y" ]]; then
9
+ echo "📦 Bump patch version package.json"
10
+ npm version patch --no-git-tag-version
11
+ else
12
+ echo "ℹ️ Skip bump version"
13
+ fi
14
+
15
+ echo date: $date
16
+
17
+ echo "Adding all files to git"
18
+ git add .
19
+
20
+ echo "Committing to git"
21
+ git commit -m "Ayiin commit on $date"
22
+
23
+ echo "Pushing to git"
24
+ git push
25
+
26
26
  echo "Done"
package/tsconfig.json CHANGED
@@ -32,7 +32,8 @@
32
32
  // Some stricter flags (disabled by default)
33
33
  "noUnusedLocals": false,
34
34
  "noUnusedParameters": false,
35
- "noPropertyAccessFromIndexSignature": false
35
+ "noPropertyAccessFromIndexSignature": false,
36
+ "emitDeclarationOnly": true
36
37
  },
37
38
  "include": ["src/**/*"],
38
39
  "exclude": ["node_modules", "**/*.spec.ts"]