mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-04-12 15:40:30 +08:00
chore: changed type check to use lowdefy helper function
This commit is contained in:
parent
221ba93c9b
commit
44fe51493f
@ -14,9 +14,11 @@
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
import { type } from '@lowdefy/helpers';
|
||||
|
||||
function SetFocus({ globals, params }) {
|
||||
const { document } = globals;
|
||||
if (typeof params !== 'string') {
|
||||
if (!type.isString(params)) {
|
||||
throw new Error('SetFocus parameter must be a string.');
|
||||
}
|
||||
document.getElementById(params)?.focus?.();
|
||||
|
Loading…
x
Reference in New Issue
Block a user