@tb-dev/utils 1.5.0 → 1.5.2

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/index.cjs CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const regex = require("./regex.cjs");
4
+ const array = require("./array.cjs");
4
5
  function isEmpty(value) {
5
6
  if (isNullish(value)) {
6
7
  return true;
@@ -19,11 +20,16 @@ function isNullish(value) {
19
20
  const noop = () => {
20
21
  };
21
22
  function toPixel(value) {
22
- if (typeof value === "number" || typeof value === "string" && regex.float.test(value)) {
23
+ if (typeof value === "number" || typeof value === "string" && regex.regex.float.test(value)) {
23
24
  return `${value}px`;
24
25
  }
25
26
  return value;
26
27
  }
28
+ exports.regex = regex.regex;
29
+ exports.splitWhitespace = array.splitWhitespace;
30
+ exports.toArray = array.toArray;
31
+ exports.trimArray = array.trimArray;
32
+ exports.upsert = array.upsert;
27
33
  exports.isEmpty = isEmpty;
28
34
  exports.isNullish = isNullish;
29
35
  exports.noop = noop;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export * from './array';
2
+ export * from './regex';
1
3
  /**
2
4
  * Check if a value is empty.
3
5
  *
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
- import { float } from "./regex.js";
1
+ import { regex } from "./regex.js";
2
+ import { splitWhitespace, toArray, trimArray, upsert } from "./array.js";
2
3
  function isEmpty(value) {
3
4
  if (isNullish(value)) {
4
5
  return true;
@@ -17,7 +18,7 @@ function isNullish(value) {
17
18
  const noop = () => {
18
19
  };
19
20
  function toPixel(value) {
20
- if (typeof value === "number" || typeof value === "string" && float.test(value)) {
21
+ if (typeof value === "number" || typeof value === "string" && regex.float.test(value)) {
21
22
  return `${value}px`;
22
23
  }
23
24
  return value;
@@ -26,5 +27,10 @@ export {
26
27
  isEmpty,
27
28
  isNullish,
28
29
  noop,
29
- toPixel
30
+ regex,
31
+ splitWhitespace,
32
+ toArray,
33
+ toPixel,
34
+ trimArray,
35
+ upsert
30
36
  };
package/dist/regex.cjs CHANGED
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const float = /^\d+(?:\.(\d+))?$/;
4
- exports.float = float;
4
+ const regex = {
5
+ float
6
+ };
7
+ exports.regex = regex;
package/dist/regex.d.ts CHANGED
@@ -1 +1,3 @@
1
- export declare const float: RegExp;
1
+ export declare const regex: {
2
+ readonly float: RegExp;
3
+ };
package/dist/regex.js CHANGED
@@ -1,4 +1,7 @@
1
1
  const float = /^\d+(?:\.(\d+))?$/;
2
- export {
2
+ const regex = {
3
3
  float
4
4
  };
5
+ export {
6
+ regex
7
+ };
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@tb-dev/utils",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "TypeScript utils",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "private": false,
8
- "packageManager": "pnpm@8.15.2",
9
8
  "homepage": "https://tb.dev.br/utils/",
10
9
  "author": {
11
10
  "name": "Andrew Ferreira",
@@ -28,21 +27,21 @@
28
27
  "*.{?(c|m)@(j|t)s,vue}": "pnpm run lint"
29
28
  },
30
29
  "dependencies": {
31
- "@tb-dev/utility-types": "^1.2.5"
30
+ "@tb-dev/utility-types": "^1.2.7"
32
31
  },
33
32
  "devDependencies": {
34
33
  "@tb-dev/eslint-config": "^3.4.0",
35
- "@types/node": "^20.12.5",
34
+ "@types/node": "^20.12.7",
36
35
  "eslint": "^8.57.0",
37
36
  "husky": "^9.0.11",
38
37
  "lint-staged": "^15.2.2",
39
38
  "prettier": "^3.2.5",
40
39
  "tslib": "^2.6.2",
41
- "typedoc": "^0.25.12",
42
- "typedoc-plugin-mdn-links": "^3.1.19",
43
- "typescript": "^5.4.4",
44
- "vite": "^5.2.8",
45
- "vite-plugin-dts": "^3.8.1"
40
+ "typedoc": "^0.25.13",
41
+ "typedoc-plugin-mdn-links": "^3.1.23",
42
+ "typescript": "^5.4.5",
43
+ "vite": "^5.2.10",
44
+ "vite-plugin-dts": "^3.9.0"
46
45
  },
47
46
  "files": [
48
47
  "dist"