提交 1ab78203 编写于 作者: X xdmal

Keep the Types class consistent with d.ts

Change the class name Types to types

issue: https://gitee.com/openharmony/docs/issues/I51UELSigned-off-by: Nxdmal <maxiaodong16@huawei.com>
上级 a794a05f
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
This module provides common utility functions, such as **TextEncoder** and **TextDecoder** for string encoding and decoding, **RationalNumber** for rational number operations, **LruBuffer** for buffer management, **Scope** for range determination, **Base64** for Base64 encoding and decoding, and **Types** for checks of built-in object types. This module provides common utility functions, such as **TextEncoder** and **TextDecoder** for string encoding and decoding, **RationalNumber** for rational number operations, **LruBuffer** for buffer management, **Scope** for range determination, **Base64** for Base64 encoding and decoding, and **types** for checks of built-in object types.
## Modules to Import ## Modules to Import
...@@ -1614,20 +1614,20 @@ Decodes the input content asynchronously. ...@@ -1614,20 +1614,20 @@ Decodes the input content asynchronously.
``` ```
## Types<sup>8+</sup> ## types<sup>8+</sup>
### constructor<sup>8+</sup> ### constructor<sup>8+</sup>
constructor() constructor()
A constructor used to create a **Types** object. A constructor used to create a **types** object.
**System capability**: SystemCapability.Utils.Lang **System capability**: SystemCapability.Utils.Lang
**Example** **Example**
``` ```
var type = new util.Types(); var type = new util.types();
``` ```
...@@ -1651,7 +1651,7 @@ Checks whether the input value is of the **ArrayBuffer** type. ...@@ -1651,7 +1651,7 @@ Checks whether the input value is of the **ArrayBuffer** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isAnyArrayBuffer(new ArrayBuffer([])); var result = that.isAnyArrayBuffer(new ArrayBuffer([]));
``` ```
...@@ -1678,7 +1678,7 @@ Checks whether the input value is of the **ArrayBufferView** type. ...@@ -1678,7 +1678,7 @@ Checks whether the input value is of the **ArrayBufferView** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isArrayBufferView(new Int8Array([])); var result = that.isArrayBufferView(new Int8Array([]));
``` ```
...@@ -1703,7 +1703,7 @@ Checks whether the input value is of the **arguments** type. ...@@ -1703,7 +1703,7 @@ Checks whether the input value is of the **arguments** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
function foo() { function foo() {
var result = that.isArgumentsObject(arguments); var result = that.isArgumentsObject(arguments);
} }
...@@ -1731,7 +1731,7 @@ Checks whether the input value is of the **ArrayBuffer** type. ...@@ -1731,7 +1731,7 @@ Checks whether the input value is of the **ArrayBuffer** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isArrayBuffer(new ArrayBuffer([])); var result = that.isArrayBuffer(new ArrayBuffer([]));
``` ```
...@@ -1756,7 +1756,7 @@ Checks whether the input value is an asynchronous function. ...@@ -1756,7 +1756,7 @@ Checks whether the input value is an asynchronous function.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isAsyncFunction(async function foo() {}); var result = that.isAsyncFunction(async function foo() {});
``` ```
...@@ -1781,7 +1781,7 @@ Checks whether the input value is of the **Boolean** type. ...@@ -1781,7 +1781,7 @@ Checks whether the input value is of the **Boolean** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isBooleanObject(new Boolean(true)); var result = that.isBooleanObject(new Boolean(true));
``` ```
...@@ -1806,7 +1806,7 @@ Checks whether the input value is of the **Boolean**, **Number**, **String**, or ...@@ -1806,7 +1806,7 @@ Checks whether the input value is of the **Boolean**, **Number**, **String**, or
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isBoxedPrimitive(new Boolean(false)); var result = that.isBoxedPrimitive(new Boolean(false));
``` ```
...@@ -1831,7 +1831,7 @@ Checks whether the input value is of the **DataView** type. ...@@ -1831,7 +1831,7 @@ Checks whether the input value is of the **DataView** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
const ab = new ArrayBuffer(20); const ab = new ArrayBuffer(20);
var result = that.isDataView(new DataView(ab)); var result = that.isDataView(new DataView(ab));
``` ```
...@@ -1857,7 +1857,7 @@ Checks whether the input value is of the **Date** type. ...@@ -1857,7 +1857,7 @@ Checks whether the input value is of the **Date** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isDate(new Date()); var result = that.isDate(new Date());
``` ```
...@@ -1882,7 +1882,7 @@ Checks whether the input value is of the **native external** type. ...@@ -1882,7 +1882,7 @@ Checks whether the input value is of the **native external** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
const data = util.createExternalType(); const data = util.createExternalType();
var result = that.isExternal(data); var result = that.isExternal(data);
``` ```
...@@ -1908,7 +1908,7 @@ Checks whether the input value is of the **Float32Array** type. ...@@ -1908,7 +1908,7 @@ Checks whether the input value is of the **Float32Array** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isFloat32Array(new Float32Array()); var result = that.isFloat32Array(new Float32Array());
``` ```
...@@ -1933,7 +1933,7 @@ Checks whether the input value is of the **Float64Array** type. ...@@ -1933,7 +1933,7 @@ Checks whether the input value is of the **Float64Array** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isFloat64Array(new Float64Array()); var result = that.isFloat64Array(new Float64Array());
``` ```
...@@ -1958,7 +1958,7 @@ Checks whether the input value is a generator function. ...@@ -1958,7 +1958,7 @@ Checks whether the input value is a generator function.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isGeneratorFunction(function* foo() {}); var result = that.isGeneratorFunction(function* foo() {});
``` ```
...@@ -1983,7 +1983,7 @@ Checks whether the input value is a generator object. ...@@ -1983,7 +1983,7 @@ Checks whether the input value is a generator object.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
function* foo() {} function* foo() {}
const generator = foo(); const generator = foo();
var result = that.isGeneratorObject(generator); var result = that.isGeneratorObject(generator);
...@@ -2010,7 +2010,7 @@ Checks whether the input value is of the **Int8Array** type. ...@@ -2010,7 +2010,7 @@ Checks whether the input value is of the **Int8Array** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isInt8Array(new Int8Array([])); var result = that.isInt8Array(new Int8Array([]));
``` ```
...@@ -2035,7 +2035,7 @@ Checks whether the input value is of the **Int16Array** type. ...@@ -2035,7 +2035,7 @@ Checks whether the input value is of the **Int16Array** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isInt16Array(new Int16Array([])); var result = that.isInt16Array(new Int16Array([]));
``` ```
...@@ -2060,7 +2060,7 @@ Checks whether the input value is of the **Int32Array** type. ...@@ -2060,7 +2060,7 @@ Checks whether the input value is of the **Int32Array** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isInt32Array(new Int32Array([])); var result = that.isInt32Array(new Int32Array([]));
``` ```
...@@ -2085,7 +2085,7 @@ Checks whether the input value is of the **Map** type. ...@@ -2085,7 +2085,7 @@ Checks whether the input value is of the **Map** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isMap(new Map()); var result = that.isMap(new Map());
``` ```
...@@ -2110,7 +2110,7 @@ Checks whether the input value is of the **MapIterator** type. ...@@ -2110,7 +2110,7 @@ Checks whether the input value is of the **MapIterator** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
const map = new Map(); const map = new Map();
var result = that.isMapIterator(map.keys()); var result = that.isMapIterator(map.keys());
``` ```
...@@ -2136,7 +2136,7 @@ Checks whether the input value is of the **Error** type. ...@@ -2136,7 +2136,7 @@ Checks whether the input value is of the **Error** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isNativeError(new TypeError()); var result = that.isNativeError(new TypeError());
``` ```
...@@ -2161,7 +2161,7 @@ Checks whether the input value is a number object. ...@@ -2161,7 +2161,7 @@ Checks whether the input value is a number object.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isNumberObject(new Number(0)); var result = that.isNumberObject(new Number(0));
``` ```
...@@ -2186,7 +2186,7 @@ Checks whether the input value is a promise. ...@@ -2186,7 +2186,7 @@ Checks whether the input value is a promise.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isPromise(Promise.resolve(1)); var result = that.isPromise(Promise.resolve(1));
``` ```
...@@ -2211,7 +2211,7 @@ Checks whether the input value is a proxy. ...@@ -2211,7 +2211,7 @@ Checks whether the input value is a proxy.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
const target = {}; const target = {};
const proxy = new Proxy(target, {}); const proxy = new Proxy(target, {});
var result = that.isProxy(proxy); var result = that.isProxy(proxy);
...@@ -2238,7 +2238,7 @@ Checks whether the input value is of the **RegExp** type. ...@@ -2238,7 +2238,7 @@ Checks whether the input value is of the **RegExp** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isRegExp(new RegExp('abc')); var result = that.isRegExp(new RegExp('abc'));
``` ```
...@@ -2263,7 +2263,7 @@ Checks whether the input value is of the **Set** type. ...@@ -2263,7 +2263,7 @@ Checks whether the input value is of the **Set** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isSet(new Set()); var result = that.isSet(new Set());
``` ```
...@@ -2288,7 +2288,7 @@ Checks whether the input value is of the **SetIterator** type. ...@@ -2288,7 +2288,7 @@ Checks whether the input value is of the **SetIterator** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
const set = new Set(); const set = new Set();
var result = that.isSetIterator(set.keys()); var result = that.isSetIterator(set.keys());
``` ```
...@@ -2314,7 +2314,7 @@ Checks whether the input value is a string object. ...@@ -2314,7 +2314,7 @@ Checks whether the input value is a string object.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isStringObject(new String('foo')); var result = that.isStringObject(new String('foo'));
``` ```
...@@ -2339,7 +2339,7 @@ Checks whether the input value is a symbol object. ...@@ -2339,7 +2339,7 @@ Checks whether the input value is a symbol object.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
const symbols = Symbol('foo'); const symbols = Symbol('foo');
var result = that.isSymbolObject(Object(symbols)); var result = that.isSymbolObject(Object(symbols));
``` ```
...@@ -2367,7 +2367,7 @@ Checks whether the input value is of the **TypedArray** type. ...@@ -2367,7 +2367,7 @@ Checks whether the input value is of the **TypedArray** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isTypedArray(new Float64Array([])); var result = that.isTypedArray(new Float64Array([]));
``` ```
...@@ -2392,7 +2392,7 @@ Checks whether the input value is of the **Uint8Array** type. ...@@ -2392,7 +2392,7 @@ Checks whether the input value is of the **Uint8Array** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isUint8Array(new Uint8Array([])); var result = that.isUint8Array(new Uint8Array([]));
``` ```
...@@ -2417,7 +2417,7 @@ Checks whether the input value is of the **Uint8ClampedArray** type. ...@@ -2417,7 +2417,7 @@ Checks whether the input value is of the **Uint8ClampedArray** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isUint8ClampedArray(new Uint8ClampedArray([])); var result = that.isUint8ClampedArray(new Uint8ClampedArray([]));
``` ```
...@@ -2442,7 +2442,7 @@ Checks whether the input value is of the **Uint16Array** type. ...@@ -2442,7 +2442,7 @@ Checks whether the input value is of the **Uint16Array** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isUint16Array(new Uint16Array([])); var result = that.isUint16Array(new Uint16Array([]));
``` ```
...@@ -2467,7 +2467,7 @@ Checks whether the input value is of the **Uint32Array** type. ...@@ -2467,7 +2467,7 @@ Checks whether the input value is of the **Uint32Array** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isUint32Array(new Uint32Array([])); var result = that.isUint32Array(new Uint32Array([]));
``` ```
...@@ -2492,7 +2492,7 @@ Checks whether the input value is of the **WeakMap** type. ...@@ -2492,7 +2492,7 @@ Checks whether the input value is of the **WeakMap** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isWeakMap(new WeakMap()); var result = that.isWeakMap(new WeakMap());
``` ```
...@@ -2517,6 +2517,6 @@ Checks whether the input value is of the **WeakSet** type. ...@@ -2517,6 +2517,6 @@ Checks whether the input value is of the **WeakSet** type.
**Example** **Example**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isWeakSet(new WeakSet()); var result = that.isWeakSet(new WeakSet());
``` ```
...@@ -1614,7 +1614,7 @@ decode(src: Uint8Array | string): Promise&lt;Uint8Array&gt; ...@@ -1614,7 +1614,7 @@ decode(src: Uint8Array | string): Promise&lt;Uint8Array&gt;
``` ```
## Types<sup>8+</sup> ## types<sup>8+</sup>
### constructor<sup>8+</sup> ### constructor<sup>8+</sup>
...@@ -1627,7 +1627,7 @@ Types的构造函数。 ...@@ -1627,7 +1627,7 @@ Types的构造函数。
**示例:** **示例:**
``` ```
var type = new util.Types(); var type = new util.types();
``` ```
...@@ -1651,7 +1651,7 @@ isAnyArrayBuffer(value: Object): boolean ...@@ -1651,7 +1651,7 @@ isAnyArrayBuffer(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isAnyArrayBuffer(new ArrayBuffer([])); var result = that.isAnyArrayBuffer(new ArrayBuffer([]));
``` ```
...@@ -1678,7 +1678,7 @@ ArrayBufferView辅助类型包括:Int8Array、Int16Array、Int32Array、Uint8A ...@@ -1678,7 +1678,7 @@ ArrayBufferView辅助类型包括:Int8Array、Int16Array、Int32Array、Uint8A
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isArrayBufferView(new Int8Array([])); var result = that.isArrayBufferView(new Int8Array([]));
``` ```
...@@ -1703,7 +1703,7 @@ isArgumentsObject(value: Object): boolean ...@@ -1703,7 +1703,7 @@ isArgumentsObject(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
function foo() { function foo() {
var result = that.isArgumentsObject(arguments); var result = that.isArgumentsObject(arguments);
} }
...@@ -1731,7 +1731,7 @@ isArrayBuffer(value: Object): boolean ...@@ -1731,7 +1731,7 @@ isArrayBuffer(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isArrayBuffer(new ArrayBuffer([])); var result = that.isArrayBuffer(new ArrayBuffer([]));
``` ```
...@@ -1756,7 +1756,7 @@ isAsyncFunction(value: Object): boolean ...@@ -1756,7 +1756,7 @@ isAsyncFunction(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isAsyncFunction(async function foo() {}); var result = that.isAsyncFunction(async function foo() {});
``` ```
...@@ -1781,7 +1781,7 @@ isBooleanObject(value: Object): boolean ...@@ -1781,7 +1781,7 @@ isBooleanObject(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isBooleanObject(new Boolean(true)); var result = that.isBooleanObject(new Boolean(true));
``` ```
...@@ -1806,7 +1806,7 @@ isBoxedPrimitive(value: Object): boolean ...@@ -1806,7 +1806,7 @@ isBoxedPrimitive(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isBoxedPrimitive(new Boolean(false)); var result = that.isBoxedPrimitive(new Boolean(false));
``` ```
...@@ -1831,7 +1831,7 @@ isDataView(value: Object): boolean ...@@ -1831,7 +1831,7 @@ isDataView(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
const ab = new ArrayBuffer(20); const ab = new ArrayBuffer(20);
var result = that.isDataView(new DataView(ab)); var result = that.isDataView(new DataView(ab));
``` ```
...@@ -1857,7 +1857,7 @@ isDate(value: Object): boolean ...@@ -1857,7 +1857,7 @@ isDate(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isDate(new Date()); var result = that.isDate(new Date());
``` ```
...@@ -1882,7 +1882,7 @@ isExternal(value: Object): boolean ...@@ -1882,7 +1882,7 @@ isExternal(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
const data = util.createExternalType(); const data = util.createExternalType();
var result = that.isExternal(data); var result = that.isExternal(data);
``` ```
...@@ -1908,7 +1908,7 @@ isFloat32Array(value: Object): boolean ...@@ -1908,7 +1908,7 @@ isFloat32Array(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isFloat32Array(new Float32Array()); var result = that.isFloat32Array(new Float32Array());
``` ```
...@@ -1933,7 +1933,7 @@ isFloat64Array(value: Object): boolean ...@@ -1933,7 +1933,7 @@ isFloat64Array(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isFloat64Array(new Float64Array()); var result = that.isFloat64Array(new Float64Array());
``` ```
...@@ -1958,7 +1958,7 @@ isGeneratorFunction(value: Object): boolean ...@@ -1958,7 +1958,7 @@ isGeneratorFunction(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isGeneratorFunction(function* foo() {}); var result = that.isGeneratorFunction(function* foo() {});
``` ```
...@@ -1983,7 +1983,7 @@ isGeneratorObject(value: Object): boolean ...@@ -1983,7 +1983,7 @@ isGeneratorObject(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
function* foo() {} function* foo() {}
const generator = foo(); const generator = foo();
var result = that.isGeneratorObject(generator); var result = that.isGeneratorObject(generator);
...@@ -2010,7 +2010,7 @@ isInt8Array(value: Object): boolean ...@@ -2010,7 +2010,7 @@ isInt8Array(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isInt8Array(new Int8Array([])); var result = that.isInt8Array(new Int8Array([]));
``` ```
...@@ -2035,7 +2035,7 @@ isInt16Array(value: Object): boolean ...@@ -2035,7 +2035,7 @@ isInt16Array(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isInt16Array(new Int16Array([])); var result = that.isInt16Array(new Int16Array([]));
``` ```
...@@ -2060,7 +2060,7 @@ isInt32Array(value: Object): boolean ...@@ -2060,7 +2060,7 @@ isInt32Array(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isInt32Array(new Int32Array([])); var result = that.isInt32Array(new Int32Array([]));
``` ```
...@@ -2085,7 +2085,7 @@ isMap(value: Object): boolean ...@@ -2085,7 +2085,7 @@ isMap(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isMap(new Map()); var result = that.isMap(new Map());
``` ```
...@@ -2110,7 +2110,7 @@ isMapIterator(value: Object): boolean ...@@ -2110,7 +2110,7 @@ isMapIterator(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
const map = new Map(); const map = new Map();
var result = that.isMapIterator(map.keys()); var result = that.isMapIterator(map.keys());
``` ```
...@@ -2136,7 +2136,7 @@ isNativeError(value: Object): boolean ...@@ -2136,7 +2136,7 @@ isNativeError(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isNativeError(new TypeError()); var result = that.isNativeError(new TypeError());
``` ```
...@@ -2161,7 +2161,7 @@ isNumberObject(value: Object): boolean ...@@ -2161,7 +2161,7 @@ isNumberObject(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isNumberObject(new Number(0)); var result = that.isNumberObject(new Number(0));
``` ```
...@@ -2186,7 +2186,7 @@ isPromise(value: Object): boolean ...@@ -2186,7 +2186,7 @@ isPromise(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isPromise(Promise.resolve(1)); var result = that.isPromise(Promise.resolve(1));
``` ```
...@@ -2211,7 +2211,7 @@ isProxy(value: Object): boolean ...@@ -2211,7 +2211,7 @@ isProxy(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
const target = {}; const target = {};
const proxy = new Proxy(target, {}); const proxy = new Proxy(target, {});
var result = that.isProxy(proxy); var result = that.isProxy(proxy);
...@@ -2238,7 +2238,7 @@ isRegExp(value: Object): boolean ...@@ -2238,7 +2238,7 @@ isRegExp(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isRegExp(new RegExp('abc')); var result = that.isRegExp(new RegExp('abc'));
``` ```
...@@ -2263,7 +2263,7 @@ isSet(value: Object): boolean ...@@ -2263,7 +2263,7 @@ isSet(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isSet(new Set()); var result = that.isSet(new Set());
``` ```
...@@ -2288,7 +2288,7 @@ isSetIterator(value: Object): boolean ...@@ -2288,7 +2288,7 @@ isSetIterator(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
const set = new Set(); const set = new Set();
var result = that.isSetIterator(set.keys()); var result = that.isSetIterator(set.keys());
``` ```
...@@ -2314,7 +2314,7 @@ isStringObject(value: Object): boolean ...@@ -2314,7 +2314,7 @@ isStringObject(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isStringObject(new String('foo')); var result = that.isStringObject(new String('foo'));
``` ```
...@@ -2339,7 +2339,7 @@ isSymbolObject(value: Object): boolean ...@@ -2339,7 +2339,7 @@ isSymbolObject(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
const symbols = Symbol('foo'); const symbols = Symbol('foo');
var result = that.isSymbolObject(Object(symbols)); var result = that.isSymbolObject(Object(symbols));
``` ```
...@@ -2367,7 +2367,7 @@ TypedArray类型的辅助类型,包括Int8Array、Int16Array、Int32Array、Ui ...@@ -2367,7 +2367,7 @@ TypedArray类型的辅助类型,包括Int8Array、Int16Array、Int32Array、Ui
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isTypedArray(new Float64Array([])); var result = that.isTypedArray(new Float64Array([]));
``` ```
...@@ -2392,7 +2392,7 @@ isUint8Array(value: Object): boolean ...@@ -2392,7 +2392,7 @@ isUint8Array(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isUint8Array(new Uint8Array([])); var result = that.isUint8Array(new Uint8Array([]));
``` ```
...@@ -2417,7 +2417,7 @@ isUint8ClampedArray(value: Object): boolean ...@@ -2417,7 +2417,7 @@ isUint8ClampedArray(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isUint8ClampedArray(new Uint8ClampedArray([])); var result = that.isUint8ClampedArray(new Uint8ClampedArray([]));
``` ```
...@@ -2442,7 +2442,7 @@ isUint16Array(value: Object): boolean ...@@ -2442,7 +2442,7 @@ isUint16Array(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isUint16Array(new Uint16Array([])); var result = that.isUint16Array(new Uint16Array([]));
``` ```
...@@ -2467,7 +2467,7 @@ isUint32Array(value: Object): boolean ...@@ -2467,7 +2467,7 @@ isUint32Array(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isUint32Array(new Uint32Array([])); var result = that.isUint32Array(new Uint32Array([]));
``` ```
...@@ -2492,7 +2492,7 @@ isWeakMap(value: Object): boolean ...@@ -2492,7 +2492,7 @@ isWeakMap(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isWeakMap(new WeakMap()); var result = that.isWeakMap(new WeakMap());
``` ```
...@@ -2517,6 +2517,6 @@ isWeakSet(value: Object): boolean ...@@ -2517,6 +2517,6 @@ isWeakSet(value: Object): boolean
**示例:** **示例:**
``` ```
var that = new util.Types(); var that = new util.types();
var result = that.isWeakSet(new WeakSet()); var result = that.isWeakSet(new WeakSet());
``` ```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册