1.4.0
Overview
This release introduces several new features and improvements across various modules, including Array, FormData, Map, Element, URL, and Date. To ensure a smooth transition for future releases, some functions are marked for deprecation. Additionally, bugs related to URL query handling and date formatting have been fixed.
String
New Features
- Function
copy()replaces$copy();
Will Deprecate (2.*.*)
- Function
$copy();
Number
New Features
- Function
$gonereturns a relative time description in Chinese or English based on the language setting;
Array
New Features
- Function
_(value: any | any[], index?: number)enhanced:- Adds an optional
indexparameter to specify the insertion position; - Supports inserting an element or array at a specific index;
- If
indexis not provided, the default behavior of adding elements to the end of the array remains;
- Adds an optional
Resolved Issues
- Function
$_(index: number)now correctly removes the element at the specified index and returns the updated array;
Object
New Features
- Function
forEach(value?: (key: string, val: any) => void)replaces$forEach(value?: (key: string, val: any) => void);
Will Deprecate (2.*.*)
- Function
$forEach(value?: (key: string, val: any) => void);
Map
New Features
- Function
$jsonreplaces$obj; - Function
$_(key?: any)removes the element with the specified key and returns the updatedMap; - Function
$$(value: any)checks if theMapcontains the specified value;
Will Deprecate (2.*.*)
- Function
$obj;
FormData
New Features
- Function
$mapreturns aMap<string, any>; - Function
$jsonreturns an object{ [key: string]: any };
Date
New Features
- Function
$Sreturns centiseconds; - Function
$SSreturns deciseconds; - Function
$SSSreturns milliseconds; - Function
$ddddreturns the full name of the day (e.g., 'Sunday'); - Function
$dddreturns the abbreviated day name (e.g., 'Sun'); - Function
$formatnow supports the formats 'S', 'SS', 'SSS', 'ddd', 'dddd';
Resolved Issues
- Function
$ddnow correctly returns a two-letter abbreviation (e.g., 'Su'); - Function
$ynow returns a format consistent with$yy;
URL
Resolved Issues
- Function
$queryAllnow correctly processes query parameters;
Element
New Features
-
Function
_padding(top?: number | string, right?: number | string, bottom?: number | string, left?: number | string)replaces_p(top?: number | string, right?: number | string, bottom?: number | string, left?: number | string); -
Function
_paddingTop(value?: number | string)replaces_pt(value?: number | string); -
Function
_paddingLeft(value?: number | string)replaces_pl(value?: number | string); -
Function
_paddingBottom(value?: number | string)replaces_pb(value?: number | string); -
Function
_paddingRight(value?: number | string)replaces_pr(value?: number | string); -
Function
_margin(top?: number | string, right?: number | string, bottom?: number | string, left?: number | string)replaces_m(top?: number | string, right?: number | string, bottom?: number | string, left?: number | string); -
Function
_marginTop(value?: number | string)replaces_mt(value?: number | string); -
Function
_marginLeft(value?: number | string)replaces_ml(value?: number | string); -
Function
_marginBottom(value?: number | string)replaces_mb(value?: number | string); -
Function
_marginRight(value?: number | string)replaces_mr(value?: number | string); -
Function
$formData- Returns
FormDatafor<form>elements; - Returns
undefinedfor non-<form>elements;
- Returns
-
Function
$map- Processes
$formDataresults; - Returns a
Map<string, any>orundefined;
- Processes
-
Function
$json- Processes
$formDataresults; - Returns an object
{ [key: string]: any }orundefined;
- Processes
Will Deprecate (2.*.*)
- Function
_p(top?: number | string, right?: number | string, bottom?: number | string, left?: number | string); - Function
_pt(value?: number | string); - Function
_pl(value?: number | string); - Function
_pb(value?: number | string); - Function
_pr(value?: number | string); - Function
_m(top?: number | string, right?: number | string, bottom?: number | string, left?: number | string); - Function
_mt(value?: number | string); - Function
_ml(value?: number | string); - Function
_mb(value?: number | string); - Function
_mr(value?: number | string);
概述
此版本引入了多個模組的新功能和改進,包括 Array、FormData、Map、Element、URL 和 Date。為了確保未來版本的順利過渡,一些函數被標記為即將棄用。此外,還修復了 URL 查詢處理和日期格式化方面的錯誤。
String
新功能
- 函數
copy()取代$copy();
即將棄用 (2.*.*)
- 函數
$copy();
Number
新功能
- 函數
$gone根據語言設定,返回相對時間的中文或英文描述;
Array
新功能
- 函數
_(value: any | any[], index?: number)增強功能:- 新增可選參數
index,用於指定插入位置; - 支援在指定索引處插入元素或數組;
- 當不提供
index時,保持在數組末尾添加元素的行為;
- 新增可選參數
修正問題
- 函數
$_(index: number)現在可以正確移除指定索引的元素並返回更新後的數組;
Object
新功能
- 函數
forEach(value?: (key: string, val: any) => void)取代$forEach(value?: (key: string, val: any) => void);
即將棄用 (2.*.*)
- 函數
$forEach(value?: (key: string, val: any) => void);
Map
新功能
- 函數
$json取代$obj; - 函數
$_(key?: any)刪除指定鍵並返回更新的Map; - 函數
$$(value: any)檢查Map是否包含指定值;
即將棄用 (2.*.*)
- 函數
$obj;
FormData
新功能
- 函數
$map返回Map<string, any>; - 函數
$json返回物件{ [key: string]: any };
Date
新功能
- 函數
$S返回百毫秒; - 函數
$SS返回十毫秒; - 函數
$SSS返回毫秒; - 函數
$dddd返回完整星期名稱 (如 'Sunday'); - 函數
$ddd返回星期縮寫 (如 'Sun'); - 函數
$format現支援 'S'、'SS'、'SSS'、'ddd'、'dddd' 格式;
修正問題
- 函數
$dd現正確返回兩字母縮寫 (如 'Su'); - 函數
$y現返回與$yy一致的格式;
URL
修正問題
- 函數
$queryAll現正確處理查詢參數;
Element
新功能
-
函數
_padding(top?: number | string, right?: number | string, bottom?: number | string, left?: number | string)取代_p(top?: number | string, right?: number | string, bottom?: number | string, left?: number | string); -
函數
_paddingTop(value?: number | string)取代_pt(value?: number | string); -
函數
_paddingLeft(value?: number | string)取代_pl(value?: number | string); -
函數
_paddingBottom(value?: number | string)取代_pb(value?: number | string); -
函數
_paddingRight(value?: number | string)取代_pr(value?: number | string); -
函數
_margin(top?: number | string, right?: number | string, bottom?: number | string, left?: number | string)取代_m(top?: number | string, right?: number | string, bottom?: number | string, left?: number | string); -
函數
_marginTop(value?: number | string)取代_mt(value?: number | string); -
函數
_marginLeft(value?: number | string)取代_ml(value?: number | string); -
函數
_marginBottom(value?: number | string)取代_mb(value?: number | string); -
函數
_marginRight(value?: number | string)取代_mr(value?: number | string); -
函數
$formData- 對
<form>元素返回FormData; - 非
<form>元素返回undefined;
- 對
-
函數
$map- 處理
$formData結果; - 返回
Map<string, any>或undefined;
- 處理
-
函數
$json- 處理
$formData結果; - 返回物件
{ [key: string]: any }或undefined;
- 處理
即將棄用 (2.*.*)
- 函數
_p(top?: number | string, right?: number | string, bottom?: number | string, left?: number | string); - 函數
_pt(value?: number | string); - 函數
_pl(value?: number | string); - 函數
_pb(value?: number | string); - 函數
_pr(value?: number | string); - 函數
_m(top?: number | string, right?: number | string, bottom?: number | string, left?: number | string); - 函數
_mt(value?: number | string); - 函數
_ml(value?: number | string); - 函數
_mb(value?: number | string); - 函數
_mr(value?: number | string);