本文整理匯總了TypeScript中util.types.isBigInt64Array方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript types.isBigInt64Array方法的具體用法?TypeScript types.isBigInt64Array怎麽用?TypeScript types.isBigInt64Array使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類util.types
的用法示例。
在下文中一共展示了types.isBigInt64Array方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: if
import "../node-tests";
import * as util from "util";
//////////////////////////////////////////////////////////
/// Global Tests : https://nodejs.org/api/global.html ///
//////////////////////////////////////////////////////////
{
{
const hrtimeBigint: bigint = process.hrtime.bigint();
}
}
//////////////////////////////////////////////////////////
/// Util Tests ///
//////////////////////////////////////////////////////////
{
{
const value: BigInt64Array | BigUint64Array | number = [] as any;
if (util.types.isBigInt64Array(value)) {
// $ExpectType BigInt64Array
const b = value;
} else if (util.types.isBigUint64Array(value)) {
// $ExpectType BigUint64Array
const b = value;
} else {
// $ExpectType number
const b = value;
}
}
}
示例2: Float32Array
td.decode(new Float32Array(1));
td.decode(new Float64Array(1));
td.decode(new DataView(new Int8Array(1).buffer));
td.decode(new ArrayBuffer(1));
td.decode(null);
td.decode(null, { stream: true });
td.decode(new Int8Array(1), { stream: true });
const decode: string = td.decode(new Int8Array(1));
// util.TextEncoder()
const te = new util.TextEncoder();
const teEncoding: string = te.encoding;
const teEncodeRes: Uint8Array = te.encode("TextEncoder");
// util.types
let b: boolean;
b = util.types.isBigInt64Array(15);
b = util.types.isBigUint64Array(15);
b = util.types.isModuleNamespaceObject(15);
// tslint:disable-next-line:no-construct ban-types
const maybeBoxed: number | Number = new Number(1);
if (util.types.isBoxedPrimitive(maybeBoxed)) {
const boxed: Number = maybeBoxed;
}
const maybeBoxed2: number | Number = 1;
if (!util.types.isBoxedPrimitive(maybeBoxed2)) {
const boxed: number = maybeBoxed2;
}
}
示例3: if
import { types } from 'util';
//////////////////////////////////////////////////////////
/// Global Tests : https://nodejs.org/api/global.html ///
//////////////////////////////////////////////////////////
{
const hrtimeBigint: bigint = process.hrtime.bigint();
process.allowedNodeEnvironmentFlags.has('asdf');
}
// Util Tests
{
const value: BigInt64Array | BigUint64Array | number = [] as any;
if (types.isBigInt64Array(value)) {
// $ExpectType BigInt64Array
const b = value;
} else if (types.isBigUint64Array(value)) {
// $ExpectType BigUint64Array
const b = value;
} else {
// $ExpectType number
const b = value;
}
}
// Global Tests
{
const a = Buffer.alloc(1000);