mirror of https://github.com/ghostfolio/ghostfolio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
882 B
35 lines
882 B
export function cc(char) {
|
|
return char.charCodeAt(0);
|
|
}
|
|
export function insertToSet(item, set) {
|
|
if (Array.isArray(item)) {
|
|
item.forEach(function (subItem) {
|
|
set.push(subItem);
|
|
});
|
|
}
|
|
else {
|
|
set.push(item);
|
|
}
|
|
}
|
|
export function addFlag(flagObj, flagKey) {
|
|
if (flagObj[flagKey] === true) {
|
|
throw "duplicate flag " + flagKey;
|
|
}
|
|
const x = flagObj[flagKey];
|
|
flagObj[flagKey] = true;
|
|
}
|
|
export function ASSERT_EXISTS(obj) {
|
|
// istanbul ignore next
|
|
if (obj === undefined) {
|
|
throw Error("Internal Error - Should never get here!");
|
|
}
|
|
return true;
|
|
}
|
|
// istanbul ignore next
|
|
export function ASSERT_NEVER_REACH_HERE() {
|
|
throw Error("Internal Error - Should never get here!");
|
|
}
|
|
export function isCharacter(obj) {
|
|
return obj["type"] === "Character";
|
|
}
|
|
//# sourceMappingURL=utils.js.map
|