debut des details de la page. Vu que c'est le troisieme (euh quatrieme?) composant, c'etait un peu plus rapide, mais heureusement que claude est la pour repasser derriere mes erreurs prcq en solo je n'y arriverais pas du tout!

This commit is contained in:
camille
2026-03-27 17:49:26 +01:00
parent 24e85c4471
commit 43589e583e
92 changed files with 12959 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
# bianco.dom-to-array
[![Build Status][ci-image]][ci-url]
[![NPM version][npm-version-image]][npm-url]
[![NPM downloads][npm-downloads-image]][npm-url]
[![MIT License][license-image]][license-url]
## Usage
```js
import domToArray from 'bianco.dom-to-array'
var div = document.createElement('div')
div.innerHTML = `
<ul>
<li>one</li>
<li>two</li>
</ul>
`
body.appendChild(div)
// It can convert node list
const lis = document.querySelectorAll('li')
const $lis = domToArray(lis)
$lis.length // => 2
Array.isArray($lis) // => true
// It can convert a single node
const li = document.querySelector('li')
const $li = domToArray(li)
$li.length // => 1
Array.isArray($li) // => true
```
[ci-image]:https://img.shields.io/github/workflow/status/biancojs/dom-to-array/test?style=flat-square
[ci-url]:https://github.com/biancojs/dom-to-array/actions
[license-image]: http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
[license-url]: LICENSE.txt
[npm-version-image]: http://img.shields.io/npm/v/bianco.dom-to-array.svg?style=flat-square
[npm-downloads-image]: http://img.shields.io/npm/dm/bianco.dom-to-array.svg?style=flat-square
[npm-url]: https://npmjs.org/package/bianco.dom-to-array
## API
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
#### Table of Contents
- [domToArray](#domtoarray)
- [Parameters](#parameters)
### domToArray
Converts any DOM node/s to a loopable array
#### Parameters
- `els` **([HTMLElement](https://developer.mozilla.org/docs/Web/HTML/Element) \| [NodeList](https://developer.mozilla.org/docs/Web/API/NodeList))** single html element or a node list
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** always a loopable object