office-addin-mock
Version:
Provides mocking support for Office-js APIs
15 lines (13 loc) • 387 B
text/typescript
export enum PossibleErrors {
notLoaded = "Error, property was not loaded",
notSync = "Error, context.sync() was not called",
}
export function isValidError(str: string): boolean {
let foundError = false;
Object.values(PossibleErrors).forEach((possibleError: string) => {
if (str === possibleError) {
foundError = true;
}
});
return foundError;
}