initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
33
github/codeql-action-v2/node_modules/@protobuf-ts/runtime/build/es2015/reflection-scalar-default.js
generated
vendored
Normal file
33
github/codeql-action-v2/node_modules/@protobuf-ts/runtime/build/es2015/reflection-scalar-default.js
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { LongType, ScalarType } from "./reflection-info";
|
||||
import { reflectionLongConvert } from "./reflection-long-convert";
|
||||
import { PbLong, PbULong } from "./pb-long";
|
||||
/**
|
||||
* Creates the default value for a scalar type.
|
||||
*/
|
||||
export function reflectionScalarDefault(type, longType = LongType.STRING) {
|
||||
switch (type) {
|
||||
case ScalarType.BOOL:
|
||||
return false;
|
||||
case ScalarType.UINT64:
|
||||
case ScalarType.FIXED64:
|
||||
return reflectionLongConvert(PbULong.ZERO, longType);
|
||||
case ScalarType.INT64:
|
||||
case ScalarType.SFIXED64:
|
||||
case ScalarType.SINT64:
|
||||
return reflectionLongConvert(PbLong.ZERO, longType);
|
||||
case ScalarType.DOUBLE:
|
||||
case ScalarType.FLOAT:
|
||||
return 0.0;
|
||||
case ScalarType.BYTES:
|
||||
return new Uint8Array(0);
|
||||
case ScalarType.STRING:
|
||||
return "";
|
||||
default:
|
||||
// case ScalarType.INT32:
|
||||
// case ScalarType.UINT32:
|
||||
// case ScalarType.SINT32:
|
||||
// case ScalarType.FIXED32:
|
||||
// case ScalarType.SFIXED32:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue