hsu-utils 0.0.14 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/hsu-utils.js +14 -3
- package/dist/hsu-utils.min.js +1 -1
- package/dist/hsu-utils.min.js.LICENSE.txt +1 -1
- package/es/ArrayIsIncludes/index.d.ts +1 -0
- package/es/ArrayIsIncludes/index.js +8 -0
- package/es/GetStrWidth/index.d.ts +1 -1
- package/es/GetStrWidth/index.js +4 -2
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/lib/ArrayIsIncludes/index.d.ts +1 -0
- package/lib/ArrayIsIncludes/index.js +11 -0
- package/lib/GetStrWidth/index.d.ts +1 -1
- package/lib/GetStrWidth/index.js +4 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +3 -1
- package/package.json +1 -1
package/dist/hsu-utils.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
2
|
*
|
3
|
-
* hsu-utils v0.0.
|
3
|
+
* hsu-utils v0.0.15
|
4
4
|
*
|
5
5
|
* some front-end utils
|
6
6
|
*
|
@@ -58,6 +58,17 @@ eval("/**\n * @licstart The following is the entire license notice for the\n * J
|
|
58
58
|
|
59
59
|
/***/ }),
|
60
60
|
|
61
|
+
/***/ "./tools/ArrayIsIncludes/index.ts":
|
62
|
+
/*!****************************************!*\
|
63
|
+
!*** ./tools/ArrayIsIncludes/index.ts ***!
|
64
|
+
\****************************************/
|
65
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
66
|
+
|
67
|
+
"use strict";
|
68
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nvar __1 = __webpack_require__(/*! .. */ \"./tools/index.ts\");\nfunction array_is_includes(arr1, arr2) {\n var largeArr = arr1.length >= arr2.length ? arr1 : arr2;\n var smallArr = arr1.length < arr2.length ? arr1 : arr2;\n return smallArr.every(function (item) {\n return !!largeArr.find(function (i) { return __1.Equal.ValEqual(item, i); });\n });\n}\nexports[\"default\"] = array_is_includes;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/ArrayIsIncludes/index.ts?");
|
69
|
+
|
70
|
+
/***/ }),
|
71
|
+
|
61
72
|
/***/ "./tools/ConsoleTable/index.ts":
|
62
73
|
/*!*************************************!*\
|
63
74
|
!*** ./tools/ConsoleTable/index.ts ***!
|
@@ -120,7 +131,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
120
131
|
/***/ ((__unused_webpack_module, exports) => {
|
121
132
|
|
122
133
|
"use strict";
|
123
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nfunction get_string_width(str, font) {\n if (font === void 0) { font = {}; }\n var _a = font.style, style = _a === void 0 ? 'normal' : _a, _b = font.variant, variant = _b === void 0 ? 'normal' : _b, _c = font.weight, weight = _c === void 0 ? 'normal' : _c, _d = font.size, size = _d === void 0 ? 12 : _d, _e = font.lineHeight, lineHeight = _e === void 0 ? 1 : _e, _f = font.family, fontFamily = _f === void 0 ? '微软雅黑' : _f;\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n ctx.font = \"\".concat(style, \" \").concat(variant, \" \").concat(weight, \" \").concat(size, \"px/\").concat(lineHeight, \" \").concat(fontFamily);\n var metrics = ctx.measureText(str);\n var width = +(+metrics.width.toFixed(2) + 0.01).toFixed(2);\n return width;\n}\nexports[\"default\"] = get_string_width;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/GetStrWidth/index.ts?");
|
134
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nfunction get_string_width(str, font, letterSpacing) {\n if (font === void 0) { font = {}; }\n if (letterSpacing === void 0) { letterSpacing = 0; }\n var _a = font.style, style = _a === void 0 ? 'normal' : _a, _b = font.variant, variant = _b === void 0 ? 'normal' : _b, _c = font.weight, weight = _c === void 0 ? 'normal' : _c, _d = font.size, size = _d === void 0 ? 12 : _d, _e = font.lineHeight, lineHeight = _e === void 0 ? 1 : _e, _f = font.family, fontFamily = _f === void 0 ? '微软雅黑' : _f;\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n ctx.font = \"\".concat(style, \" \").concat(variant, \" \").concat(weight, \" \").concat(size, \"px/\").concat(lineHeight, \" \").concat(fontFamily);\n var metrics = ctx.measureText(str);\n var width = +(+metrics.width.toFixed(2) + 0.01).toFixed(2);\n var _letterSpacing = (str.length > 0 ? str.length - 1 : 0) * letterSpacing;\n width += _letterSpacing;\n return width;\n}\nexports[\"default\"] = get_string_width;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/GetStrWidth/index.ts?");
|
124
135
|
|
125
136
|
/***/ }),
|
126
137
|
|
@@ -164,7 +175,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nfunc
|
|
164
175
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
165
176
|
|
166
177
|
"use strict";
|
167
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.downloadFile = exports.renderPDF = exports.loadImage = exports.ConvertNumbers = exports.get_string_width = exports.Typeof = exports.Equal = exports.deepCopy = exports.console_table = void 0;\nvar ConsoleTable_1 = __importDefault(__webpack_require__(/*! ./ConsoleTable */ \"./tools/ConsoleTable/index.ts\"));\nexports.console_table = ConsoleTable_1.default;\nvar DeepCopy_1 = __importDefault(__webpack_require__(/*! ./DeepCopy */ \"./tools/DeepCopy/index.ts\"));\nexports.deepCopy = DeepCopy_1.default;\nvar Equal_1 = __importDefault(__webpack_require__(/*! ./Equal */ \"./tools/Equal/index.ts\"));\nexports.Equal = Equal_1.default;\nvar Typeof_1 = __importDefault(__webpack_require__(/*! ./Typeof */ \"./tools/Typeof/index.ts\"));\nexports.Typeof = Typeof_1.default;\nvar GetStrWidth_1 = __importDefault(__webpack_require__(/*! ./GetStrWidth */ \"./tools/GetStrWidth/index.ts\"));\nexports.get_string_width = GetStrWidth_1.default;\nvar ConvertNumbers_1 = __importDefault(__webpack_require__(/*! ./ConvertNumbers */ \"./tools/ConvertNumbers/index.ts\"));\nexports.ConvertNumbers = ConvertNumbers_1.default;\nvar LoadImage_1 = __importDefault(__webpack_require__(/*! ./LoadImage */ \"./tools/LoadImage/index.ts\"));\nexports.loadImage = LoadImage_1.default;\nvar RenderPDF_1 = __importDefault(__webpack_require__(/*! ./RenderPDF */ \"./tools/RenderPDF/index.ts\"));\nexports.renderPDF = RenderPDF_1.default;\nvar DownloadFile_1 = __importDefault(__webpack_require__(/*! ./DownloadFile */ \"./tools/DownloadFile/index.ts\"));\nexports.downloadFile = DownloadFile_1.default;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/index.ts?");
|
178
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.array_is_includes = exports.downloadFile = exports.renderPDF = exports.loadImage = exports.ConvertNumbers = exports.get_string_width = exports.Typeof = exports.Equal = exports.deepCopy = exports.console_table = void 0;\nvar ConsoleTable_1 = __importDefault(__webpack_require__(/*! ./ConsoleTable */ \"./tools/ConsoleTable/index.ts\"));\nexports.console_table = ConsoleTable_1.default;\nvar DeepCopy_1 = __importDefault(__webpack_require__(/*! ./DeepCopy */ \"./tools/DeepCopy/index.ts\"));\nexports.deepCopy = DeepCopy_1.default;\nvar Equal_1 = __importDefault(__webpack_require__(/*! ./Equal */ \"./tools/Equal/index.ts\"));\nexports.Equal = Equal_1.default;\nvar Typeof_1 = __importDefault(__webpack_require__(/*! ./Typeof */ \"./tools/Typeof/index.ts\"));\nexports.Typeof = Typeof_1.default;\nvar GetStrWidth_1 = __importDefault(__webpack_require__(/*! ./GetStrWidth */ \"./tools/GetStrWidth/index.ts\"));\nexports.get_string_width = GetStrWidth_1.default;\nvar ConvertNumbers_1 = __importDefault(__webpack_require__(/*! ./ConvertNumbers */ \"./tools/ConvertNumbers/index.ts\"));\nexports.ConvertNumbers = ConvertNumbers_1.default;\nvar LoadImage_1 = __importDefault(__webpack_require__(/*! ./LoadImage */ \"./tools/LoadImage/index.ts\"));\nexports.loadImage = LoadImage_1.default;\nvar RenderPDF_1 = __importDefault(__webpack_require__(/*! ./RenderPDF */ \"./tools/RenderPDF/index.ts\"));\nexports.renderPDF = RenderPDF_1.default;\nvar DownloadFile_1 = __importDefault(__webpack_require__(/*! ./DownloadFile */ \"./tools/DownloadFile/index.ts\"));\nexports.downloadFile = DownloadFile_1.default;\nvar ArrayIsIncludes_1 = __importDefault(__webpack_require__(/*! ./ArrayIsIncludes */ \"./tools/ArrayIsIncludes/index.ts\"));\nexports.array_is_includes = ArrayIsIncludes_1.default;\n\n\n//# sourceURL=webpack://hsu-utils/./tools/index.ts?");
|
168
179
|
|
169
180
|
/***/ }),
|
170
181
|
|