@wshcmx/types 13.3.0 → 13.4.0
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/lib/object/index.d.ts +6 -1
- package/package.json +1 -1
package/lib/object/index.d.ts
CHANGED
|
@@ -36,10 +36,15 @@ interface Object {
|
|
|
36
36
|
DeleteOptProperty(key: string): void;
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* Возвращает значение атрибута объекта. Если атрубут отсутствует, выдает undefined.
|
|
39
|
+
* Возвращает значение атрибута объекта. Если атрубут отсутствует, выдает defaultValue или undefined.
|
|
40
40
|
* @param {string} key - Наименование атрибута объекта.
|
|
41
41
|
* @param {unknown} [defaultValue] - Значение по умолчанию, возращаемое в случае отсутствия атрибута.
|
|
42
42
|
*/
|
|
43
|
+
GetOptProperty<O, K extends keyof O & string, D>(
|
|
44
|
+
this: O,
|
|
45
|
+
key: K,
|
|
46
|
+
defaultValue: D
|
|
47
|
+
): Exclude<O[K], undefined> | D;
|
|
43
48
|
GetOptProperty<O, K extends string, D = undefined>(
|
|
44
49
|
this: O,
|
|
45
50
|
key: K,
|