Skip to content

Commit 17bde86

Browse files
authored
fix(error): throw TypeError instead of generic Error (#5)
1 parent 5979c64 commit 17bde86

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ export default (target: Element, options: Options): CustomScrollAction[] => {
218218
typeof boundary === 'function' ? boundary : (node: any) => node !== boundary
219219

220220
if (!isElement(target)) {
221-
// @TODO shorter error "Invalid target", and make it TypeError
222-
throw new Error('Element is required in scrollIntoView')
221+
throw new TypeError('Invalid target')
223222
}
224223

225224
// Used to handle the top most element that can be scrolled

0 commit comments

Comments
 (0)