From 241bd4609e0e71c2fc6d66e2cf42130162c490dc Mon Sep 17 00:00:00 2001 From: John Hooks Date: Tue, 14 Mar 2023 04:49:35 -0700 Subject: [PATCH] refactor: simplify props function --- src/index.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/index.js b/src/index.js index 14e53ef..2fa2c8b 100644 --- a/src/index.js +++ b/src/index.js @@ -1,8 +1,3 @@ -/** - * Internal dependencies - */ -import getPath from './get-path'; - /** * Function returning a DOM document created by `createHTMLDocument`. The same * document is returned between invocations. @@ -78,8 +73,8 @@ export function prop(selector, name) { match = node.querySelector(selector); } - if (match) { - return getPath(match, name); + if (match && name in match) { + return match[name]; } }; }