New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

select-dom

Package Overview
Dependencies
Maintainers
0
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

select-dom - npm Package Compare versions

Comparing version 9.0.1 to 9.1.0

7

package.json
{
"name": "select-dom",
"version": "9.0.1",
"version": "9.1.0",
"description": "Extra lightweight DOM selector helper",

@@ -20,3 +20,6 @@ "keywords": [

"type": "module",
"exports": "./index.js",
"exports": {
".": "./index.js",
"./strict.js": "./strict.js"
},
"main": "./index.js",

@@ -23,0 +26,0 @@ "types": "./index.d.ts",

@@ -9,4 +9,2 @@ # select-dom [![][badge-gzip]][link-npm] [![npm downloads][badge-downloads]][link-npm]

Version 7+ only supports browsers with [iterable `NodeList`s](https://developer.mozilla.org/en-US/docs/Web/API/NodeList/entries). If you need IE support, stick to [`select-dom@6`](https://github.com/fregante/select-dom/tree/v6.0.4) or lower.
## Install

@@ -19,4 +17,6 @@

```js
// This module is only offered as a ES Module
import {$, $$, lastElement, elementExists} from 'select-dom';
// And a stricter version
import {$, $optional} from 'select-dom/strict.js';
```

@@ -31,3 +31,2 @@

Maps to `baseElement.querySelector(selector)`, except it returns `undefined` if it's not found
```js

@@ -79,2 +78,13 @@ $('.foo a[href=bar]');

## /strict.js
The strict export will throw an error if the element is not found, instead of returning `undefined`. This is also reflected in the types, which are non-nullable:
```ts
import {$, $optional} from 'select-dom/strict.js';
const must: HTMLAnchorElement = $('.foo a[href=bar]'); //
const optional: HTMLAnchorElement | undefined = $optional('.foo a[href=bar]');
```
## Related

@@ -81,0 +91,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc