From 7ab2e612c7d0aaf86fc9e8ccf68b38ccb25c047a Mon Sep 17 00:00:00 2001 From: Jesse Pence Date: Sat, 14 Oct 2023 17:20:07 -0700 Subject: [PATCH] that should be like ten bytes --- README.md | 4 ++-- core.js | 3 +-- errors.js | 2 -- package.json | 2 +- tests/createElement.html | 7 +++++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ff936c0..f80da1a 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ Rekindle your love for method chaining-- now in a lightweight, type-safe package | Library | Size before gzip | Size after gzip | | --------- | ---------------- | --------------- | | jQuery | 88.3kb | 31.7kb | -| jessquery | 7.38kb | 2.95kb | +| jessquery | 7.23kb | 2.92kb | -![It's only 2.95kb! I swear! This badge proves it.](https://deno.bundlejs.com/badge?q=jessquery@2.2.2) +![It's only 2.92kb! I swear! This badge proves it.](https://deno.bundlejs.com/badge?q=jessquery@2.3.0) [![npm version](https://badge.fury.io/js/jessquery.svg)](https://badge.fury.io/js/jessquery) - [Basic Usage](#basic-usage) diff --git a/core.js b/core.js index ccf7764..ef8f0f2 100644 --- a/core.js +++ b/core.js @@ -14,11 +14,10 @@ function addProxy(type, string, fixed = false) { const element = getDOMElement(string, false, type === "$$") if (!element[0]) { - defaultErrorHandler( + return defaultErrorHandler( new Error(`Error with element.`), giveContext(type, string) ) - return null } return addMethods(type, string, element, fixed) diff --git a/errors.js b/errors.js index 39ff295..a0650fd 100644 --- a/errors.js +++ b/errors.js @@ -4,8 +4,6 @@ export let defaultErrorHandler = (error, context) => { export function setErrorHandler(handler) { defaultErrorHandler = handler - - return defaultErrorHandler } export function giveContext(methodName, selector) { diff --git a/package.json b/package.json index 11d3d96..c036b5f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jessquery", "type": "module", - "version": "2.3.0", + "version": "2.3.1", "description": "Modern JavaScript is pretty good, but typing document.querySelector() is a pain. This is a tiny library that makes DOM manipulation easy. jQuery is around 30kb, while this is only around 5kb (2kb gzipped). Lots of JSDoc comments so it's self-documenting and works great with TypeScript.", "exports": { ".": { diff --git a/tests/createElement.html b/tests/createElement.html index 892705c..2c6f3ef 100644 --- a/tests/createElement.html +++ b/tests/createElement.html @@ -9,9 +9,12 @@
hi