Skip to content

Commit

Permalink
that should be like ten bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzypants1989 committed Oct 15, 2023
1 parent 7dfb13b commit 7ab2e61
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export let defaultErrorHandler = (error, context) => {

export function setErrorHandler(handler) {
defaultErrorHandler = handler

return defaultErrorHandler
}

export function giveContext(methodName, selector) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
".": {
Expand Down
7 changes: 5 additions & 2 deletions tests/createElement.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
<div id="testContainer">hi</div>

<script type="module">
import { $, $$ } from "../index.js"
import { $, $$, setErrorHandler } from "../index.js"

$(`<h1>je</h1>`).moveTo("#testContainer", { position: "before" })
setErrorHandler((err) => {
alert(err)
})
$().moveTo("#testContainer", { position: "before" })
</script>
</body>
</html>

0 comments on commit 7ab2e61

Please sign in to comment.