@mhmdhammoud/meritt-utils 1.0.5 → 1.0.6

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/dist/lib/cypto.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  /*
4
- Author : Omar Sawwas
4
+ Author : Omar Sawwas https://github.com/omarsawwas
5
5
  Date : 2023-06-17
6
6
  Description : RSA algorithm
7
7
  Version : 1.0
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  /*
4
- Author : Mhmd Hammoud
4
+ Author : Mhmd Hammoud https://github.com/mhmdhammoud
5
5
  Date : 2023-06-17
6
6
  Description : String manipulation
7
7
  Version : 1.0
@@ -23,7 +23,8 @@ class Formatter {
23
23
  if (typeof _ !== 'string')
24
24
  throw new Error('Provide a valid string');
25
25
  if (withSpacing) {
26
- return _.split(' ')
26
+ return _.toLowerCase()
27
+ .split(' ')
27
28
  .map((val) => val.charAt(0).toUpperCase() + val.slice(1))
28
29
  .join(' ')
29
30
  .replace(/ /g, '-')
@@ -31,7 +32,8 @@ class Formatter {
31
32
  .replace(/\./g, '');
32
33
  }
33
34
  else {
34
- return _.split(' ')
35
+ return _.toLowerCase()
36
+ .split(' ')
35
37
  .map((val) => val.charAt(0).toUpperCase() + val.slice(1))
36
38
  .join(' ')
37
39
  .replace(/\//g, '-')
@@ -1,2 +1,3 @@
1
1
  export { default as Crypto } from './cypto';
2
2
  export { default as Formatter } from './formatter';
3
+ export { default as Pdf } from './formatter';
package/dist/lib/index.js CHANGED
@@ -3,8 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Formatter = exports.Crypto = void 0;
6
+ exports.Pdf = exports.Formatter = exports.Crypto = void 0;
7
7
  var cypto_1 = require("./cypto");
8
8
  Object.defineProperty(exports, "Crypto", { enumerable: true, get: function () { return __importDefault(cypto_1).default; } });
9
9
  var formatter_1 = require("./formatter");
10
10
  Object.defineProperty(exports, "Formatter", { enumerable: true, get: function () { return __importDefault(formatter_1).default; } });
11
+ var formatter_2 = require("./formatter");
12
+ Object.defineProperty(exports, "Pdf", { enumerable: true, get: function () { return __importDefault(formatter_2).default; } });
@@ -0,0 +1,15 @@
1
+ declare class Pdf {
2
+ /**
3
+ * @remarks Convert image links into base64 format
4
+ * @param url - The image url
5
+ * @returns string
6
+ * @example
7
+ * ```typescript
8
+ * pdf.getBase64Images('https://fastly.picsum.photos/id/15/200/300.jpg?hmac=lozQletmrLG9PGBV1hTM1PnmvHxKEU0lAZWu8F2oL30')
9
+ * // => 'Hello-World'
10
+ * ```
11
+ * */
12
+ getBase64Images: (url: string) => string;
13
+ }
14
+ declare const pdf: Pdf;
15
+ export default pdf;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /*
4
+ Author : Mustafa Halabi https://github.com/mustafahalabi
5
+ Date : 2023-06-24
6
+ Description : Image to PDF converter
7
+ Version : 1.0
8
+ */
9
+ class Pdf {
10
+ constructor() {
11
+ /**
12
+ * @remarks Convert image links into base64 format
13
+ * @param url - The image url
14
+ * @returns string
15
+ * @example
16
+ * ```typescript
17
+ * pdf.getBase64Images('https://fastly.picsum.photos/id/15/200/300.jpg?hmac=lozQletmrLG9PGBV1hTM1PnmvHxKEU0lAZWu8F2oL30')
18
+ * // => 'Hello-World'
19
+ * ```
20
+ * */
21
+ this.getBase64Images = (url) => {
22
+ return '';
23
+ };
24
+ }
25
+ }
26
+ const pdf = new Pdf();
27
+ exports.default = pdf;
@@ -0,0 +1,2 @@
1
+ declare const axiosInstance: import("axios").AxiosInstance;
2
+ export default axiosInstance;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const axios_1 = __importDefault(require("axios"));
7
+ const axiosInstance = axios_1.default.create({});
8
+ exports.default = axiosInstance;
@@ -0,0 +1 @@
1
+ export { default as AxiosInstance } from './axios';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AxiosInstance = void 0;
7
+ var axios_1 = require("./axios");
8
+ Object.defineProperty(exports, "AxiosInstance", { enumerable: true, get: function () { return __importDefault(axios_1).default; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mhmdhammoud/meritt-utils",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "private": false,
@@ -22,15 +22,18 @@
22
22
  "prepublish": "npm run build"
23
23
  },
24
24
  "devDependencies": {
25
- "ts-node-dev": "^1.1.8",
26
- "typescript": "^4.6.3",
27
25
  "@types/jest": "^27.5.1",
28
26
  "@typescript-eslint/eslint-plugin": "^5.17.0",
29
27
  "@typescript-eslint/parser": "^5.17.0",
30
28
  "eslint": "^8.12.0",
31
29
  "eslint-plugin-tsdoc": "^0.2.14",
32
- "husky": "^8.0.0"
30
+ "husky": "^8.0.0",
31
+ "ts-node-dev": "^1.1.8",
32
+ "typescript": "^4.6.3"
33
33
  },
34
34
  "author": "Mhmdhammoud",
35
- "license": "ISC"
35
+ "license": "ISC",
36
+ "dependencies": {
37
+ "axios": "^1.4.0"
38
+ }
36
39
  }
package/src/lib/cypto.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- Author : Omar Sawwas
2
+ Author : Omar Sawwas https://github.com/omarsawwas
3
3
  Date : 2023-06-17
4
4
  Description : RSA algorithm
5
5
  Version : 1.0
@@ -1,5 +1,5 @@
1
1
  /*
2
- Author : Mhmd Hammoud
2
+ Author : Mhmd Hammoud https://github.com/mhmdhammoud
3
3
  Date : 2023-06-17
4
4
  Description : String manipulation
5
5
  Version : 1.0
@@ -19,14 +19,16 @@ class Formatter {
19
19
  toUpperFirst = (_: string | number, withSpacing = true): string => {
20
20
  if (typeof _ !== 'string') throw new Error('Provide a valid string')
21
21
  if (withSpacing) {
22
- return _.split(' ')
22
+ return _.toLowerCase()
23
+ .split(' ')
23
24
  .map((val: string) => val.charAt(0).toUpperCase() + val.slice(1))
24
25
  .join(' ')
25
26
  .replace(/ /g, '-')
26
27
  .replace(/\//g, '-')
27
28
  .replace(/\./g, '')
28
29
  } else {
29
- return _.split(' ')
30
+ return _.toLowerCase()
31
+ .split(' ')
30
32
  .map((val: string) => val.charAt(0).toUpperCase() + val.slice(1))
31
33
  .join(' ')
32
34
  .replace(/\//g, '-')
package/src/lib/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export {default as Crypto} from './cypto'
2
2
  export {default as Formatter} from './formatter'
3
+ export {default as Pdf} from './formatter'
package/src/lib/pdf.ts ADDED
@@ -0,0 +1,25 @@
1
+ import {AxiosInstance} from '../utilities'
2
+ /*
3
+ Author : Mustafa Halabi https://github.com/mustafahalabi
4
+ Date : 2023-06-24
5
+ Description : Image to PDF converter
6
+ Version : 1.0
7
+ */
8
+ class Pdf {
9
+ /**
10
+ * @remarks Convert image links into base64 format
11
+ * @param url - The image url
12
+ * @returns string
13
+ * @example
14
+ * ```typescript
15
+ * pdf.getBase64Images('https://fastly.picsum.photos/id/15/200/300.jpg?hmac=lozQletmrLG9PGBV1hTM1PnmvHxKEU0lAZWu8F2oL30')
16
+ * // => 'Hello-World'
17
+ * ```
18
+ * */
19
+ getBase64Images = (url: string): string => {
20
+ return ''
21
+ }
22
+ }
23
+
24
+ const pdf = new Pdf()
25
+ export default pdf
@@ -0,0 +1,4 @@
1
+ import axios from 'axios'
2
+
3
+ const axiosInstance = axios.create({})
4
+ export default axiosInstance
@@ -0,0 +1 @@
1
+ export {default as AxiosInstance} from './axios'