Commit 67868e9e authored by krlwlfrt's avatar krlwlfrt
Browse files

fix: correct isThing guard

parent bc00f621
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -24,7 +24,11 @@ import {SCThing, SCThingType} from '../Thing';
 * @param {any} something Something to check
 */
export function isThing(something: any): something is SCThing {
  return (something.type && something.type in SCThingType);
  return (
    typeof something === 'object'
    && typeof something.type === 'string'
    && Object.values(SCThingType).indexOf(something.type) >= 0
  );
}

/**