nextemos 6.2.2 → 6.3.0

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.
@@ -1,5 +1,2 @@
1
1
  export { default as fetchRequest } from './fetchRequest';
2
- export { default as toIntArray } from './toIntArray';
3
- export { default as toQueryString } from './toQueryString';
4
- export { default as decodeHTML } from './decodeHTML';
5
2
  export { default as NEXTEMOS_CONFIG } from './getConfigs';
@@ -3,15 +3,9 @@ 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.NEXTEMOS_CONFIG = exports.decodeHTML = exports.toQueryString = exports.toIntArray = exports.fetchRequest = void 0;
6
+ exports.NEXTEMOS_CONFIG = exports.fetchRequest = void 0;
7
7
  /// helpers
8
8
  var fetchRequest_1 = require("./fetchRequest");
9
9
  Object.defineProperty(exports, "fetchRequest", { enumerable: true, get: function () { return __importDefault(fetchRequest_1).default; } });
10
- var toIntArray_1 = require("./toIntArray");
11
- Object.defineProperty(exports, "toIntArray", { enumerable: true, get: function () { return __importDefault(toIntArray_1).default; } });
12
- var toQueryString_1 = require("./toQueryString");
13
- Object.defineProperty(exports, "toQueryString", { enumerable: true, get: function () { return __importDefault(toQueryString_1).default; } });
14
- var decodeHTML_1 = require("./decodeHTML");
15
- Object.defineProperty(exports, "decodeHTML", { enumerable: true, get: function () { return __importDefault(decodeHTML_1).default; } });
16
10
  var getConfigs_1 = require("./getConfigs");
17
11
  Object.defineProperty(exports, "NEXTEMOS_CONFIG", { enumerable: true, get: function () { return __importDefault(getConfigs_1).default; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextemos",
3
- "version": "6.2.2",
3
+ "version": "6.3.0",
4
4
  "description": "For helpers and hooks used in NextJS projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -32,7 +32,5 @@
32
32
  "typescript",
33
33
  "nextemos"
34
34
  ],
35
- "dependencies": {
36
- "html-entities": "^2.5.2"
37
- }
35
+ "dependencies": {}
38
36
  }
@@ -1,2 +0,0 @@
1
- declare const decodeHTML: (html: string) => string;
2
- export default decodeHTML;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const html_entities_1 = require("html-entities");
4
- const decodeHTML = (html) => {
5
- return isHTML(html) ? html : (0, html_entities_1.decode)(html);
6
- };
7
- const isHTML = (string) => {
8
- const htmlPattern = /<\/?[a-z][\s\S]*>/i;
9
- return htmlPattern.test(string);
10
- };
11
- exports.default = decodeHTML;
@@ -1,12 +0,0 @@
1
- /**
2
- * toIntArray Function
3
- *
4
- * @description
5
- * A function that converts a string of numbers separated by a specified separator into an array of integers.
6
- *
7
- * @param {string} str - The input string containing numbers separated by the specified separator.
8
- * @param {string} [separator=','] - The separator used to split the input string. Default is ','.
9
- * @returns {Array} An array of integers extracted from the input string.
10
- */
11
- declare function toIntArray(str: string, separator?: string): number[];
12
- export default toIntArray;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * toIntArray Function
5
- *
6
- * @description
7
- * A function that converts a string of numbers separated by a specified separator into an array of integers.
8
- *
9
- * @param {string} str - The input string containing numbers separated by the specified separator.
10
- * @param {string} [separator=','] - The separator used to split the input string. Default is ','.
11
- * @returns {Array} An array of integers extracted from the input string.
12
- */
13
- function toIntArray(str, separator = ',') {
14
- // Split the input string using the specified separator
15
- const numbers = str.split(separator);
16
- // Convert the array of strings to an array of integers
17
- const intArray = numbers.map((num) => parseInt(num, 10));
18
- return intArray;
19
- }
20
- exports.default = toIntArray;
@@ -1,8 +0,0 @@
1
- /**
2
- * Converts a given object into a query string format.
3
- *
4
- * @param obj - The object to be converted into a query string.
5
- * @returns {string} - The query string representation of the object.
6
- */
7
- declare const toQueryString: (obj: Record<string, any>) => string;
8
- export default toQueryString;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * Converts a given object into a query string format.
5
- *
6
- * @param obj - The object to be converted into a query string.
7
- * @returns {string} - The query string representation of the object.
8
- */
9
- const toQueryString = (obj) => {
10
- if (Object.keys(obj).length === 0)
11
- return '';
12
- const queryString = [];
13
- for (const key in obj) {
14
- if (obj.hasOwnProperty(key)) {
15
- const value = encodeURIComponent(obj[key]);
16
- queryString.push(`${encodeURIComponent(key)}=${value}`);
17
- }
18
- }
19
- return queryString.join('&');
20
- };
21
- exports.default = toQueryString;