Minor bugfixes

QortalRequest.ts removed because its contents are split into multiple files

printVar now checks if its parameter is null or undefined.
This commit is contained in:
Qortal Dev 2023-10-19 08:54:43 -06:00
parent ed9a419b92
commit 45016e7743
3 changed files with 16 additions and 1 deletions

View File

@ -2,7 +2,6 @@ export * from "./src/Core/Interfaces";
export * from "./src/Core/SendCoin"; export * from "./src/Core/SendCoin";
export * from "./src/Core/Types"; export * from "./src/Core/Types";
export * from "./src/Core/API/Names"; export * from "./src/Core/API/Names";
export * from "./src/Core/API/QortalRequest";
export * from "./src/Core/API/Transactions"; export * from "./src/Core/API/Transactions";
export * from "./src/Numbers/Colors"; export * from "./src/Numbers/Colors";
export * from "./src/Numbers/NumberConversion"; export * from "./src/Numbers/NumberConversion";

View File

@ -1,4 +1,20 @@
export const objectIsNull = (variable: object) => {
return Object.is(variable, null);
};
export const objectIsUndefined = (variable: object) => {
return Object.is(variable, undefined);
};
export const printVar = (variable: object) => { export const printVar = (variable: object) => {
if (objectIsNull(variable)) {
console.log("variable is NULL");
return;
}
if (objectIsUndefined(variable)) {
console.log("variable is UNDEFINED");
return;
}
const [key, value] = Object.entries(variable)[0]; const [key, value] = Object.entries(variable)[0];
console.log(key, " is: ", value); console.log(key, " is: ", value);
}; };