Skip to content

Commit 60fb010

Browse files
authored
Merge pull request #2 from sashafirsov/develop
1.0.11
2 parents ef7d4e0 + c7fdfbc commit 60fb010

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

CssChain.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ const nop = ()=>''
1212
, isFn = a => isT(a, 'function')
1313
, isNode = n => n && n.nodeType
1414
, inWC = n => n.getRootNode().host
15-
, hasAssigned = n=> inWC(n) && n.assignedElements
15+
, hasAssigned = n=> inWC(n) && n.assignedNodes
1616
, each = (arr, cb )=> (arr.forEach(cb),arr)
1717
, clear = n => hasAssigned(n)
18-
? n.assignedElements().forEach( a => a.remove() )
18+
? n.assignedNodes().forEach( a => a.remove() )
1919
: n.innerHTML='' ;
2020

21-
const node2text = { 1: n=>n.assignedElements
22-
? collectionText(n.assignedElements()) || collectionText(n.childNodes)
23-
: ['SCRIPT','AUDIO','STYLE','CANVAS','DATALIST','EMBED','OBJECT','PICTURE','IFRAME','METER','NOSCRIPT'
24-
,'SELECT','OPTGROUP','PROGRESS','TEMPLATE','VIDEO']
25-
.includes(n.nodeName) ? ''
26-
: n.innerText //collectionText(n.children)
21+
const node2text = { 1: n=>n.assignedNodes
22+
? collectionText(n.assignedNodes()) || collectionText(n.childNodes)
23+
: [ 'SCRIPT','AUDIO','STYLE','CANVAS','DATALIST','EMBED','OBJECT'
24+
, 'PICTURE','IFRAME','METER','NOSCRIPT'
25+
, 'SELECT','OPTGROUP','PROGRESS','TEMPLATE','VIDEO'
26+
].includes(n.nodeName)? '' : n.innerText //collectionText(n.children)
2727
, 3: n=>n.nodeValue
2828
, 11:n=>collectionText(n.children)
2929
};
@@ -79,7 +79,7 @@ CssChainLocal extends Array
7979
push(...args){ Array.prototype.push.apply(this,args); return this; }
8080
querySelector(css){ return new CssChainLocal().push( this.querySelectorAll(css)[0] ) }
8181
querySelectorAll(css){ return this.reduce( ($,el)=> $.push(...el.querySelectorAll(css) ), new CssChainLocal()) }
82-
$(...args){ return this.querySelectorAll(...args) }
82+
$(...args){ return args.length ? this.querySelectorAll(...args) : this; }
8383
parent(css)
8484
{ const s = new Set()
8585
, add = n=> s.has(n) ? 0 : (s.add(n), n)

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ _HTML template/slot and DOM manipulation library_
44
_Collection API inherits the element API and Array._
55

66
[![git][github-image] GitHub](https://github.com/sashafirsov/css-chain)
7-
| Demo: [css-chain](https://unpkg.com/[email protected].10/dist/demo.html)
7+
| Demo: [css-chain](https://unpkg.com/[email protected].11/dist/demo.html)
88
| [tests project](https://github.com/sashafirsov/css-chain-test)
99

1010
[![NPM version][npm-image]][npm-url] [![coverage][coverage-image]][coverage-url]
@@ -151,7 +151,7 @@ ApiChain( [a,b] ).f1().f2() // would reuse API generated in previous call
151151
[github-image]: https://cdnjs.cloudflare.com/ajax/libs/octicons/8.5.0/svg/mark-github.svg
152152
[npm-image]: https://img.shields.io/npm/v/css-chain.svg
153153
[npm-url]: https://npmjs.org/package/css-chain
154-
[coverage-image]: https://unpkg.com/[email protected].10/coverage/coverage.svg
155-
[coverage-url]: https://unpkg.com/[email protected].10/coverage/lcov-report/index.html
156-
[PokeApi-explorer-image]: https://unpkg.com/[email protected].10/src/PokeApi-Explorer.png
157-
[PokeApi-explorer-url]: https://unpkg.com/[email protected].10/src/PokeApi-Explorer.html
154+
[coverage-image]: https://unpkg.com/[email protected].11/coverage/coverage.svg
155+
[coverage-url]: https://unpkg.com/[email protected].11/coverage/lcov-report/index.html
156+
[PokeApi-explorer-image]: https://unpkg.com/[email protected].11/src/PokeApi-Explorer.png
157+
[PokeApi-explorer-url]: https://unpkg.com/[email protected].11/src/PokeApi-Explorer.html

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "css-chain",
3-
"version": "1.0.10",
3+
"version": "1.0.11",
44
"description": "ApiChain and CssChain JS. Collection API inherits the Array and element API.",
55
"main": "CssChain.js",
66
"browser": "CssChain.js",

0 commit comments

Comments
 (0)