2.4.3:更新文档
							parent
							
								
									e91ce6387a
								
							
						
					
					
						commit
						22bb09a407
					
				|  | @ -1,3 +1,8 @@ | |||
| 2.4.3 / 2024-09-29 | ||||
| ================== | ||||
|   * 修复`Object.defineProperty`定义声明 | ||||
|   * 增加`Promise.withResolvers` | ||||
| 
 | ||||
| 2.4.2 / 2024-09-12 | ||||
| ================== | ||||
|   * 优化字符串转义 | ||||
|  |  | |||
|  | @ -7,8 +7,8 @@ | |||
| 
 | ||||
| ```js | ||||
| ├── Obejct | ||||
| │   └── .empty(any)    // 判断对象是否为空对象 | ||||
| │   └── .groupBy(arr, fn)    // 数组分组, 返回分组后的对象 | ||||
| │   ├── .empty(any)    // 判断对象是否为空对象 | ||||
| │   ├── .groupBy(arr, fn)    // 数组分组, 返回分组后的对象 | ||||
| │   └── .hasOwn(any, key)    // 安全版的 Object.prototype.hasOwnProperty() | ||||
| ├── Obejct.prototype | ||||
| │   └── .toParams()    // 把对象转为 key1=value1&key2=value2 格式 | ||||
|  | @ -64,10 +64,11 @@ | |||
| │   ├── .parse(str)    // 将安全范围内的数字字符串转为数字类型 | ||||
| │   └── .fromString(str)    // 将字符串转为数字类型 | ||||
| ├── Number.prototype | ||||
| │   ├── .toFixed(digits)    // 修正版的toFixed | ||||
| │   └── .toFixed(digits)    // 修正版的toFixed | ||||
| │ | ||||
| └── Promise | ||||
|     └── .defer()    // 创建一个延迟的Promise对象 | ||||
|     ├── .defer()    // 创建一个延迟的Promise对象 | ||||
|     └── .withResolvers()    // 创建一个延迟的Promise对象, 同defer | ||||
| ``` | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -101,9 +101,10 @@ if (!Set.prototype.union) { | |||
| } | ||||
| 
 | ||||
| // 判断2个集合是否一致(仅元素相同, 无关顺序)
 | ||||
| Object.defineProperty(Set.prototype, 'equals', { | ||||
|   value(other) { | ||||
|     return this.size === other.size && this.isSubsetOf(other) | ||||
|   }, | ||||
|   writable: true | ||||
| }) | ||||
| if (!Set.prototype.equals) { | ||||
|   Object.defineProperty(Set.prototype, 'equals', { | ||||
|     value(other) { | ||||
|       return this.size === other.size && this.isSubsetOf(other) | ||||
|     } | ||||
|   }) | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue