@tb-dev/utils 1.2.9 → 1.3.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 +4 -3
- package/dist/index.js +4 -3
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -41,9 +41,10 @@ function repeat(amount, fn) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
function toPixel(value) {
|
|
44
|
-
if (typeof value === "string")
|
|
45
|
-
return value
|
|
46
|
-
|
|
44
|
+
if (typeof value === "number" || typeof value === "string" && /^\d+(?:\.(\d+))?$/.test(value)) {
|
|
45
|
+
return `${value}px`;
|
|
46
|
+
}
|
|
47
|
+
return value;
|
|
47
48
|
}
|
|
48
49
|
exports.isEmpty = isEmpty;
|
|
49
50
|
exports.isNullish = isNullish;
|
package/dist/index.js
CHANGED
|
@@ -39,9 +39,10 @@ function repeat(amount, fn) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
function toPixel(value) {
|
|
42
|
-
if (typeof value === "string")
|
|
43
|
-
return value
|
|
44
|
-
|
|
42
|
+
if (typeof value === "number" || typeof value === "string" && /^\d+(?:\.(\d+))?$/.test(value)) {
|
|
43
|
+
return `${value}px`;
|
|
44
|
+
}
|
|
45
|
+
return value;
|
|
45
46
|
}
|
|
46
47
|
export {
|
|
47
48
|
isEmpty,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tb-dev/utils",
|
|
3
|
-
"version": "1.2
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "TypeScript utils",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -28,20 +28,20 @@
|
|
|
28
28
|
"*.{?(c|m)@(j|t)s,vue}": "pnpm run lint"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@tb-dev/utility-types": "^1.
|
|
31
|
+
"@tb-dev/utility-types": "^1.2.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@tb-dev/eslint-config": "^2.
|
|
35
|
-
"@types/node": "^20.11.
|
|
34
|
+
"@tb-dev/eslint-config": "^3.2.0",
|
|
35
|
+
"@types/node": "^20.11.30",
|
|
36
36
|
"eslint": "^8.57.0",
|
|
37
37
|
"husky": "^9.0.11",
|
|
38
38
|
"lint-staged": "^15.2.2",
|
|
39
39
|
"prettier": "^3.2.5",
|
|
40
40
|
"tslib": "^2.6.2",
|
|
41
|
-
"typedoc": "^0.25.
|
|
42
|
-
"typedoc-plugin-mdn-links": "^3.1.
|
|
43
|
-
"typescript": "5.
|
|
44
|
-
"vite": "^5.1.
|
|
41
|
+
"typedoc": "^0.25.12",
|
|
42
|
+
"typedoc-plugin-mdn-links": "^3.1.18",
|
|
43
|
+
"typescript": "5.4.2",
|
|
44
|
+
"vite": "^5.1.6",
|
|
45
45
|
"vite-plugin-dts": "^3.7.3"
|
|
46
46
|
},
|
|
47
47
|
"files": [
|