face-api/src/dom/resolveInput.ts

9 lines
200 B
TypeScript
Raw Normal View History

2020-12-19 17:46:41 +01:00
import { env } from '../env/index';
2020-08-18 13:54:53 +02:00
export function resolveInput(arg: string | any) {
if (!env.isNodejs() && typeof arg === 'string') {
2020-12-23 17:26:55 +01:00
return document.getElementById(arg);
2020-08-18 13:54:53 +02:00
}
2020-12-23 17:26:55 +01:00
return arg;
}