Skip to content

Commit

Permalink
Bumped version to 4.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiospampinato committed May 13, 2019
1 parent d3128ad commit 8bfbbda
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### Version 4.1.1
- Raising bundle size limit to 5.5kB
- Test: replaced iOS 9.3 with iOS 11.0
- Test: using setAttribute instead of the dataset API
- Migration guide: mentioning the `:scope` CSS pseudo-class
- Migration guide: mentioning inserting plain text
- TypeScript: typing events more loosely
- TypeScript: typing collection elements more loosely

### Version 4.1.0
- Added $.isWindow
- Made the TypeScript type system stricter
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/4.1.0/cash.min.js) or [jsDelivr](https://cdn.jsdelivr.net/npm/[email protected].0/dist/cash.min.js) and use it like this:
Get Cash from [CloudFlare](https://cdnjs.cloudflare.com/ajax/libs/cash/4.1.1/cash.min.js) or [jsDelivr](https://cdn.jsdelivr.net/npm/[email protected].1/dist/cash.min.js) and use it like this:

```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/cash/4.1.0/cash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/cash/4.1.1/cash.min.js"></script>
<script>
$(function () {
$('html').addClass ( 'dom-loaded' );
Expand Down
10 changes: 3 additions & 7 deletions dist/cash.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
interface Cash {
[index: number]: Ele;
[index: number]: EleAll;
length: number;
splice(start: number, deleteCount?: number): Ele[];
splice(start: number, deleteCount: number, ...items: Ele[]): Ele[];
Expand All @@ -12,16 +12,12 @@ declare type plainObject = {
};
declare type falsy = undefined | null | false | 0 | '';
declare type Ele = Window | Document | HTMLElement | Element | Node;
declare type EleAll = Window & Document & HTMLElement & Element & Node;
declare type Selector = falsy | string | Function | HTMLCollection | NodeList | Ele | Ele[] | ArrayLike<Ele> | Cash;
declare type Comparator = string | Ele | Cash | ((this: Ele, index: number, ele: Ele) => boolean);
declare type Context = Document | HTMLElement | Element;
declare type EventObj = Event & {
__delegate?: boolean;
namespace?: string;
data?: any;
};
declare type EventCallback = {
(event: EventObj, data?: any): any;
(event: any, data?: any): any;
guid?: number;
};
declare class Cash {
Expand Down
2 changes: 1 addition & 1 deletion dist/cash.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ function on(eventFullName, selector, callback, _one) {
while (!matches(target, selector)) { //TSC
if (target === ele)
return;
target = target['parentNode'];
target = target.parentNode;
if (!target)
return;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/cash.js
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ function on(eventFullName, selector, callback, _one) {
while (!matches(target, selector)) {
//TSC
if (target === ele) return;
target = target['parentNode'];
target = target.parentNode;
if (!target) return;
}

Expand Down
17 changes: 6 additions & 11 deletions dist/cash.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

interface Cash {
[index: number]: Ele;
[index: number]: EleAll;
length: number;
splice ( start: number, deleteCount?: number ): Ele[];
splice ( start: number, deleteCount: number, ...items: Ele[] ): Ele[];
Expand All @@ -14,18 +14,13 @@ type plainObject = { [index: string]: any };
type falsy = undefined | null | false | 0 | '';

type Ele = Window | Document | HTMLElement | Element | Node;
type EleAll = Window & Document & HTMLElement & Element & Node; //UGLY: Trick to remove some kind-of useless type errors //URL: https://github.com/kenwheeler/cash/issues/278
type Selector = falsy | string | Function | HTMLCollection | NodeList | Ele | Ele[] | ArrayLike<Ele> | Cash;
type Comparator = string | Ele | Cash | (( this: Ele, index: number, ele: Ele ) => boolean);
type Context = Document | HTMLElement | Element;

type EventObj = Event & {
__delegate?: boolean,
namespace?: string,
data?: any
};

type EventCallback = {
( event: EventObj, data?: any ): any,
( event: any, data?: any ): any,
guid?: number
};

Expand Down Expand Up @@ -1318,7 +1313,7 @@ function on ( this: Cash, eventFullName: string | plainObject, selector?: string

this.each ( ( i, ele ) => {

const finalCallback = function ( event: EventObj ) {
const finalCallback = function ( event ) {

if ( event.namespace && !hasNamespaces ( namespaces, event.namespace.split ( eventsNamespacesSeparator ) ) ) return;

Expand All @@ -1330,7 +1325,7 @@ function on ( this: Cash, eventFullName: string | plainObject, selector?: string

while ( !matches ( target, selector as string ) ) { //TSC
if ( target === ele ) return;
target = target['parentNode'];
target = target.parentNode;
if ( !target ) return;
}

Expand Down Expand Up @@ -1441,7 +1436,7 @@ interface Cash {

Cash.prototype.trigger = function ( this: Cash, eventFullName: Event | string, data?: any ) {

let evt: EventObj;
let evt;

if ( isString ( eventFullName ) ) {

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": "4.1.0",
"version": "4.1.1",
"license": "MIT",
"main": "./dist/cash.js",
"module": "./dist/cash.esm.js",
Expand Down

0 comments on commit 8bfbbda

Please sign in to comment.