initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
35
github/codeql-action-v2/node_modules/@protobuf-ts/runtime/build/es2015/assert.js
generated
vendored
Normal file
35
github/codeql-action-v2/node_modules/@protobuf-ts/runtime/build/es2015/assert.js
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/**
|
||||
* assert that condition is true or throw error (with message)
|
||||
*/
|
||||
export function assert(condition, msg) {
|
||||
if (!condition) {
|
||||
throw new Error(msg);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* assert that value cannot exist = type `never`. throw runtime error if it does.
|
||||
*/
|
||||
export function assertNever(value, msg) {
|
||||
throw new Error(msg !== null && msg !== void 0 ? msg : 'Unexpected object: ' + value);
|
||||
}
|
||||
const FLOAT32_MAX = 3.4028234663852886e+38, FLOAT32_MIN = -3.4028234663852886e+38, UINT32_MAX = 0xFFFFFFFF, INT32_MAX = 0X7FFFFFFF, INT32_MIN = -0X80000000;
|
||||
export function assertInt32(arg) {
|
||||
if (typeof arg !== "number")
|
||||
throw new Error('invalid int 32: ' + typeof arg);
|
||||
if (!Number.isInteger(arg) || arg > INT32_MAX || arg < INT32_MIN)
|
||||
throw new Error('invalid int 32: ' + arg);
|
||||
}
|
||||
export function assertUInt32(arg) {
|
||||
if (typeof arg !== "number")
|
||||
throw new Error('invalid uint 32: ' + typeof arg);
|
||||
if (!Number.isInteger(arg) || arg > UINT32_MAX || arg < 0)
|
||||
throw new Error('invalid uint 32: ' + arg);
|
||||
}
|
||||
export function assertFloat32(arg) {
|
||||
if (typeof arg !== "number")
|
||||
throw new Error('invalid float 32: ' + typeof arg);
|
||||
if (!Number.isFinite(arg))
|
||||
return;
|
||||
if (arg > FLOAT32_MAX || arg < FLOAT32_MIN)
|
||||
throw new Error('invalid float 32: ' + arg);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue