mirror of
https://github.com/Qortal/Q-Apps-Utils.git
synced 2025-01-30 14:52:18 +00:00
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:
parent
ed9a419b92
commit
45016e7743
1
index.ts
1
index.ts
@ -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";
|
||||||
|
@ -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);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user