Skip to content

Commit

Permalink
Bumped version to 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiospampinato committed Mar 22, 2019
1 parent 1e2c317 commit 9b74348
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 12 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### Version 3.1.0
- Improved support for running selectors inside documents
- Ensuring Cash collections are iterable
- Added an extra reference implementation for shorthand event methods
- Added an extra reference implementation for `$.getScript`
- Readme: mentioning the extra methods

### Version 3.0.0
- Added a changelog
- Migration guide: mentioning the `zoom` property
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ If you're migrating from jQuery be sure to read our [migration guide](https://gi

## Usage

Get Cash from [CloudFlare](https://cdnjs.cloudflare.com/ajax/libs/cash/3.0.0/cash.min.js) or [jsDelivr](https://cdn.jsdelivr.net/npm/cash-dom@3.0.0/dist/cash.min.js) and use it like this:
Get Cash from [CloudFlare](https://cdnjs.cloudflare.com/ajax/libs/cash/3.1.0/cash.min.js) or [jsDelivr](https://cdn.jsdelivr.net/npm/cash-dom@3.1.0/dist/cash.min.js) and use it like this:

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/cash/3.0.0/cash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/cash/3.1.0/cash.min.js"></script>
<script>
$(function () {
$('html').addClass ( 'dom-loaded' );
Expand Down
5 changes: 4 additions & 1 deletion dist/cash.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const doc = document, win = window, div = doc.createElement('div'), { filter, in
const idRe = /^#[\w-]*$/, classRe = /^\.[\w-]*$/, htmlRe = /<.+>/, tagRe = /^\w+$/;
// @require ./variables.ts
function find(selector, context = doc) {
return context !== doc && context.nodeType !== 1
return context !== doc && context.nodeType !== 1 && context.nodeType !== 9
? []
: classRe.test(selector)
? context.getElementsByClassName(selector.slice(1))
Expand Down Expand Up @@ -48,6 +48,9 @@ const cash = Cash.prototype.init;
cash.fn = cash.prototype = Cash.prototype; // Ensuring that `cash () instanceof cash`
Cash.prototype.length = 0;
Cash.prototype.splice = splice; // Ensuring a cash collection gets printed as array-like in Chrome
if (typeof Symbol === 'function') {
Cash.prototype[Symbol['iterator']] = Array.prototype[Symbol['iterator']];
}
Cash.prototype.get = function (index) {
if (index === undefined)
return slice.call(this);
Expand Down
6 changes: 5 additions & 1 deletion dist/cash.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function find(selector, context) {
context = doc;
}

return context !== doc && context.nodeType !== 1 ? [] : classRe.test(selector) ? context.getElementsByClassName(selector.slice(1)) : tagRe.test(selector) ? context.getElementsByTagName(selector) : context.querySelectorAll(selector);
return context !== doc && context.nodeType !== 1 && context.nodeType !== 9 ? [] : classRe.test(selector) ? context.getElementsByClassName(selector.slice(1)) : tagRe.test(selector) ? context.getElementsByTagName(selector) : context.querySelectorAll(selector);
} // @require ./find.ts
// @require ./variables.ts

Expand Down Expand Up @@ -70,6 +70,10 @@ cash.fn = cash.prototype = Cash.prototype; // Ensuring that `cash () instanceof
Cash.prototype.length = 0;
Cash.prototype.splice = splice; // Ensuring a cash collection gets printed as array-like in Chrome

if (typeof Symbol === 'function') {
Cash.prototype[Symbol['iterator']] = Array.prototype[Symbol['iterator']];
}

Cash.prototype.get = function (index) {
if (index === undefined) return slice.call(this);
return this[index < 0 ? index + this.length : index];
Expand Down
12 changes: 6 additions & 6 deletions dist/cash.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion dist/cash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const idRe = /^#[\w-]*$/,

function find ( selector: string, context: Context = doc ) {

return context !== doc && context.nodeType !== 1
return context !== doc && context.nodeType !== 1 && context.nodeType !== 9
? []
: classRe.test ( selector )
? context.getElementsByClassName ( selector.slice ( 1 ) )
Expand Down Expand Up @@ -103,6 +103,10 @@ cash.fn = cash.prototype = Cash.prototype; // Ensuring that `cash () instanceof
Cash.prototype.length = 0;
Cash.prototype.splice = splice; // Ensuring a cash collection gets printed as array-like in Chrome

if ( typeof Symbol === 'function' ) {
Cash.prototype[Symbol['iterator']] = Array.prototype[Symbol['iterator']];
}


// @require core/cash.ts
// @require core/variables.ts
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": "cash-dom",
"description": "An absurdly small jQuery alternative for modern browsers.",
"version": "3.0.0",
"version": "3.1.0",
"license": "MIT",
"main": "./dist/cash.js",
"module": "./dist/cash.esm.js",
Expand Down

0 comments on commit 9b74348

Please sign in to comment.