mielk-fn 1.0.6 → 1.0.7

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/lib/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  import arrays from './methods/arrays';
2
2
  import objects from './methods/objects';
3
- export { arrays, objects };
3
+ import strings from './methods/strings';
4
+ export { arrays, objects, strings };
package/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.objects = exports.arrays = void 0;
6
+ exports.strings = exports.objects = exports.arrays = void 0;
7
7
  const arrays_1 = __importDefault(require("./methods/arrays"));
8
8
  exports.arrays = arrays_1.default;
9
9
  const objects_1 = __importDefault(require("./methods/objects"));
10
10
  exports.objects = objects_1.default;
11
+ const strings_1 = __importDefault(require("./methods/strings"));
12
+ exports.strings = strings_1.default;
@@ -1,6 +1,9 @@
1
1
  type NumberFunction = (item: any) => number;
2
2
  type StringNumberFunction = (item: any) => string | number;
3
3
  type AnyFunction = (item: any) => any;
4
+ declare const toMap: (items: any[], keyCallback: StringNumberFunction, valueFn?: AnyFunction, ignoreDuplicates?: boolean) => Map<any, any>;
5
+ declare const toIndexedArray: (items: any[], callback: NumberFunction) => any[];
6
+ export { toMap, toIndexedArray };
4
7
  declare const _default: {
5
8
  toMap: (items: any[], keyCallback: StringNumberFunction, valueFn?: AnyFunction, ignoreDuplicates?: boolean) => Map<any, any>;
6
9
  toIndexedArray: (items: any[], callback: NumberFunction) => any[];
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toIndexedArray = exports.toMap = void 0;
3
4
  const toMap = (items, keyCallback, valueFn = (item) => item, ignoreDuplicates = true) => {
4
5
  const map = new Map();
5
6
  items.forEach((item) => {
@@ -13,6 +14,7 @@ const toMap = (items, keyCallback, valueFn = (item) => item, ignoreDuplicates =
13
14
  });
14
15
  return map;
15
16
  };
17
+ exports.toMap = toMap;
16
18
  const toIndexedArray = (items, callback) => {
17
19
  const arr = [];
18
20
  items.forEach((item) => {
@@ -27,4 +29,5 @@ const toIndexedArray = (items, callback) => {
27
29
  });
28
30
  return arr;
29
31
  };
32
+ exports.toIndexedArray = toIndexedArray;
30
33
  exports.default = { toMap, toIndexedArray };
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ clear: (value: string) => string;
3
+ };
4
+ export default _default;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const clear = (value) => {
4
+ const regex = /(^\s|(?<=\s)\s|\s$)/gi;
5
+ return value.replace(regex, '');
6
+ };
7
+ exports.default = { clear };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mielk-fn",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Set of helpful functions",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",