react-util-tools 1.0.25 → 1.0.27
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/README.md +38 -0
- package/dist/index.cjs +404 -78
- package/dist/index.d.cts +45 -1
- package/dist/index.d.ts +45 -1
- package/dist/index.js +359 -76
- package/package.json +1 -1
- package/src/format/index.ts +263 -102
- package/src/index.ts +45 -0
- package/src/string/README.md +441 -0
- package/src/string/index.ts +527 -0
package/dist/index.d.cts
CHANGED
|
@@ -190,4 +190,48 @@ declare function tableToSheet(table: HTMLElement | string, options?: XLSX.Table2
|
|
|
190
190
|
declare function aoaToSheet(data: any[][], options?: XLSX.AOA2SheetOpts): XLSX.WorkSheet;
|
|
191
191
|
declare function sheetToAOA(worksheet: XLSX.WorkSheet, options?: XLSX.Sheet2JSONOpts): any[][];
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
declare function capitalize(str: string): string;
|
|
194
|
+
declare function camelCase(str: string): string;
|
|
195
|
+
declare function pascalCase(str: string): string;
|
|
196
|
+
declare function snakeCase(str: string): string;
|
|
197
|
+
declare function kebabCase(str: string): string;
|
|
198
|
+
declare function truncate(str: string, length: number, suffix?: string): string;
|
|
199
|
+
declare function trim(str: string): string;
|
|
200
|
+
declare function trimStart(str: string): string;
|
|
201
|
+
declare function trimEnd(str: string): string;
|
|
202
|
+
declare function reverse(str: string): string;
|
|
203
|
+
declare function repeat(str: string, count: number): string;
|
|
204
|
+
declare function padStart(str: string, length: number, padStr?: string): string;
|
|
205
|
+
declare function padEnd(str: string, length: number, padStr?: string): string;
|
|
206
|
+
declare function startsWith(str: string, searchString: string): boolean;
|
|
207
|
+
declare function endsWith(str: string, searchString: string): boolean;
|
|
208
|
+
declare function includes(str: string, searchString: string): boolean;
|
|
209
|
+
declare function replaceAll(str: string, search: string | RegExp, replacement: string): string;
|
|
210
|
+
declare function stripHtml(str: string): string;
|
|
211
|
+
declare function escapeHtml(str: string): string;
|
|
212
|
+
declare function unescapeHtml(str: string): string;
|
|
213
|
+
declare function toLowerCase(str: string): string;
|
|
214
|
+
declare function toUpperCase(str: string): string;
|
|
215
|
+
declare function titleCase(str: string): string;
|
|
216
|
+
declare function isEmpty(str: string): boolean;
|
|
217
|
+
declare function isNotEmpty(str: string): boolean;
|
|
218
|
+
declare function length(str: string): number;
|
|
219
|
+
declare function split(str: string, separator: string | RegExp): string[];
|
|
220
|
+
declare function extractNumbers(str: string): number[];
|
|
221
|
+
declare function removeSpaces(str: string): string;
|
|
222
|
+
declare function normalizeSpaces(str: string): string;
|
|
223
|
+
declare function countOccurrences(str: string, searchString: string): number;
|
|
224
|
+
declare function randomString(length: number, chars?: string): string;
|
|
225
|
+
declare function uuid(): string;
|
|
226
|
+
declare function maskPhone(phone: string): string;
|
|
227
|
+
declare function maskIdCard(idCard: string): string;
|
|
228
|
+
declare function maskBankCard(cardNumber: string): string;
|
|
229
|
+
declare function maskName(name: string): string;
|
|
230
|
+
declare function isValidPhone(phone: string): boolean;
|
|
231
|
+
declare function isValidEmail(email: string): boolean;
|
|
232
|
+
declare function isValidUrl(url: string): boolean;
|
|
233
|
+
declare function isValidIdCard(idCard: string): boolean;
|
|
234
|
+
declare function toBase64(str: string): string;
|
|
235
|
+
declare function fromBase64(base64: string): string;
|
|
236
|
+
|
|
237
|
+
export { type CookieOptions, abs, add, addDaysToDate, addDaysUTC, addMonthsToDate, addMonthsUTC, aoaToSheet, camelCase, capitalize, ceil, clearAllCookies, countOccurrences, debounceFn as debounce, divide, endsWith, equals, escapeHtml, exportExcelFile, exportJSONToExcel, extractNumbers, floor, formatDate, formatDateOnly, formatMoney, formatMoneyToChinese, formatNumber, formatPercent, formatRelativeTime, formatTimeOnly, formatUTC, formatUTCDateOnly, formatUTCTimeOnly, fromBase64, fromUTC, getAllCookies, getAllQueryParams, getBrowser, getBrowserEngine, getBrowserVersion, getCookie, getDaysDiff, getDeviceInfo, getDevicePixelRatio, getDeviceType, getEndOfDay, getEndOfMonth, getEndOfWeek, getEndOfYear, getHoursDiff, getMinutesDiff, getOS, getQueryParam, getQueryParamAll, getScreenResolution, getSheet, getSheetNames, getStartOfDay, getStartOfMonth, getStartOfWeek, getStartOfYear, getTimestamp, getTimestampInSeconds, getTimezoneOffset, getTimezoneOffsetHours, getUTCAllWeeksInYear, getUTCDaysDiff, getUTCEndOfDay, getUTCEndOfMonth, getUTCHoursDiff, getUTCMinutesDiff, getUTCNow, getUTCStartOfDay, getUTCStartOfMonth, getUTCTimestamp, getUTCTimestampInSeconds, getUTCWeekEnd, getUTCWeekNumber, getUTCWeekStart, getUTCWeeksInYear, getUTCYearEnd, getUTCYearEndTimestamp, getUTCYearStart, getUTCYearStartTimestamp, getViewportSize, greaterThan, greaterThanOrEqual, hasCookie, includes, isAfterDate, isAndroid, isBeforeDate, isDesktop, isEmpty, isIOS, isMobile, isNotEmpty, isSameDayDate, isTablet, isTouchDevice, isValidDate, isValidEmail, isValidIdCard, isValidPhone, isValidUrl, isWeChat, jsonToWorkbook, kebabCase, length, lessThan, lessThanOrEqual, maskBankCard, maskEmail, maskIdCard, maskName, maskPhone, multiply, negate, normalizeSpaces, padEnd, padStart, parseDate, parseMoney, pascalCase, randomString, read, readExcelFile, readExcelToJSON, readFile, removeCookie, removeSpaces, repeat, replaceAll, reverse, round, setCookie, sheetToAOA, sheetToCSV, sheetToHTML, snakeCase, split, startsWith, stripHtml, subDaysFromDate, subDaysUTC, subMonthsFromDate, subMonthsUTC, subtract, tableToSheet, throttleFn as throttle, titleCase, toBase64, toISOString, toLowerCase, toUTC, toUpperCase, trim, trimEnd, trimStart, truncate, unescapeHtml, unmaskEmail, utils, uuid, workbookToJSON, write, writeFile, writeFileXLSX };
|
package/dist/index.d.ts
CHANGED
|
@@ -190,4 +190,48 @@ declare function tableToSheet(table: HTMLElement | string, options?: XLSX.Table2
|
|
|
190
190
|
declare function aoaToSheet(data: any[][], options?: XLSX.AOA2SheetOpts): XLSX.WorkSheet;
|
|
191
191
|
declare function sheetToAOA(worksheet: XLSX.WorkSheet, options?: XLSX.Sheet2JSONOpts): any[][];
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
declare function capitalize(str: string): string;
|
|
194
|
+
declare function camelCase(str: string): string;
|
|
195
|
+
declare function pascalCase(str: string): string;
|
|
196
|
+
declare function snakeCase(str: string): string;
|
|
197
|
+
declare function kebabCase(str: string): string;
|
|
198
|
+
declare function truncate(str: string, length: number, suffix?: string): string;
|
|
199
|
+
declare function trim(str: string): string;
|
|
200
|
+
declare function trimStart(str: string): string;
|
|
201
|
+
declare function trimEnd(str: string): string;
|
|
202
|
+
declare function reverse(str: string): string;
|
|
203
|
+
declare function repeat(str: string, count: number): string;
|
|
204
|
+
declare function padStart(str: string, length: number, padStr?: string): string;
|
|
205
|
+
declare function padEnd(str: string, length: number, padStr?: string): string;
|
|
206
|
+
declare function startsWith(str: string, searchString: string): boolean;
|
|
207
|
+
declare function endsWith(str: string, searchString: string): boolean;
|
|
208
|
+
declare function includes(str: string, searchString: string): boolean;
|
|
209
|
+
declare function replaceAll(str: string, search: string | RegExp, replacement: string): string;
|
|
210
|
+
declare function stripHtml(str: string): string;
|
|
211
|
+
declare function escapeHtml(str: string): string;
|
|
212
|
+
declare function unescapeHtml(str: string): string;
|
|
213
|
+
declare function toLowerCase(str: string): string;
|
|
214
|
+
declare function toUpperCase(str: string): string;
|
|
215
|
+
declare function titleCase(str: string): string;
|
|
216
|
+
declare function isEmpty(str: string): boolean;
|
|
217
|
+
declare function isNotEmpty(str: string): boolean;
|
|
218
|
+
declare function length(str: string): number;
|
|
219
|
+
declare function split(str: string, separator: string | RegExp): string[];
|
|
220
|
+
declare function extractNumbers(str: string): number[];
|
|
221
|
+
declare function removeSpaces(str: string): string;
|
|
222
|
+
declare function normalizeSpaces(str: string): string;
|
|
223
|
+
declare function countOccurrences(str: string, searchString: string): number;
|
|
224
|
+
declare function randomString(length: number, chars?: string): string;
|
|
225
|
+
declare function uuid(): string;
|
|
226
|
+
declare function maskPhone(phone: string): string;
|
|
227
|
+
declare function maskIdCard(idCard: string): string;
|
|
228
|
+
declare function maskBankCard(cardNumber: string): string;
|
|
229
|
+
declare function maskName(name: string): string;
|
|
230
|
+
declare function isValidPhone(phone: string): boolean;
|
|
231
|
+
declare function isValidEmail(email: string): boolean;
|
|
232
|
+
declare function isValidUrl(url: string): boolean;
|
|
233
|
+
declare function isValidIdCard(idCard: string): boolean;
|
|
234
|
+
declare function toBase64(str: string): string;
|
|
235
|
+
declare function fromBase64(base64: string): string;
|
|
236
|
+
|
|
237
|
+
export { type CookieOptions, abs, add, addDaysToDate, addDaysUTC, addMonthsToDate, addMonthsUTC, aoaToSheet, camelCase, capitalize, ceil, clearAllCookies, countOccurrences, debounceFn as debounce, divide, endsWith, equals, escapeHtml, exportExcelFile, exportJSONToExcel, extractNumbers, floor, formatDate, formatDateOnly, formatMoney, formatMoneyToChinese, formatNumber, formatPercent, formatRelativeTime, formatTimeOnly, formatUTC, formatUTCDateOnly, formatUTCTimeOnly, fromBase64, fromUTC, getAllCookies, getAllQueryParams, getBrowser, getBrowserEngine, getBrowserVersion, getCookie, getDaysDiff, getDeviceInfo, getDevicePixelRatio, getDeviceType, getEndOfDay, getEndOfMonth, getEndOfWeek, getEndOfYear, getHoursDiff, getMinutesDiff, getOS, getQueryParam, getQueryParamAll, getScreenResolution, getSheet, getSheetNames, getStartOfDay, getStartOfMonth, getStartOfWeek, getStartOfYear, getTimestamp, getTimestampInSeconds, getTimezoneOffset, getTimezoneOffsetHours, getUTCAllWeeksInYear, getUTCDaysDiff, getUTCEndOfDay, getUTCEndOfMonth, getUTCHoursDiff, getUTCMinutesDiff, getUTCNow, getUTCStartOfDay, getUTCStartOfMonth, getUTCTimestamp, getUTCTimestampInSeconds, getUTCWeekEnd, getUTCWeekNumber, getUTCWeekStart, getUTCWeeksInYear, getUTCYearEnd, getUTCYearEndTimestamp, getUTCYearStart, getUTCYearStartTimestamp, getViewportSize, greaterThan, greaterThanOrEqual, hasCookie, includes, isAfterDate, isAndroid, isBeforeDate, isDesktop, isEmpty, isIOS, isMobile, isNotEmpty, isSameDayDate, isTablet, isTouchDevice, isValidDate, isValidEmail, isValidIdCard, isValidPhone, isValidUrl, isWeChat, jsonToWorkbook, kebabCase, length, lessThan, lessThanOrEqual, maskBankCard, maskEmail, maskIdCard, maskName, maskPhone, multiply, negate, normalizeSpaces, padEnd, padStart, parseDate, parseMoney, pascalCase, randomString, read, readExcelFile, readExcelToJSON, readFile, removeCookie, removeSpaces, repeat, replaceAll, reverse, round, setCookie, sheetToAOA, sheetToCSV, sheetToHTML, snakeCase, split, startsWith, stripHtml, subDaysFromDate, subDaysUTC, subMonthsFromDate, subMonthsUTC, subtract, tableToSheet, throttleFn as throttle, titleCase, toBase64, toISOString, toLowerCase, toUTC, toUpperCase, trim, trimEnd, trimStart, truncate, unescapeHtml, unmaskEmail, utils, uuid, workbookToJSON, write, writeFile, writeFileXLSX };
|