1
1
# Mixins
2
2
3
- [ ![ version] ( https://img.shields.io/badge/release-0.7.4 -success )] ( https://github.com/udibo/mixins/tree/0.7.4 )
4
- [ ![ deno doc] ( https://doc.deno.land/badge.svg )] ( https://doc.deno.land/https/deno.land/x/mixins@0.7.4 /mod.ts )
3
+ [ ![ version] ( https://img.shields.io/badge/release-0.8.0 -success )] ( https://github.com/udibo/mixins/tree/0.8.0 )
4
+ [ ![ deno doc] ( https://doc.deno.land/badge.svg )] ( https://doc.deno.land/https/deno.land/x/mixins@0.8.0 /mod.ts )
5
5
[ ![ CI] ( https://github.com/udibo/mixins/workflows/CI/badge.svg )] ( https://github.com/udibo/mixins/actions?query=workflow%3ACI )
6
6
[ ![ codecov] ( https://codecov.io/gh/udibo/mixins/branch/master/graph/badge.svg?token=LIK8G3SMOC )] ( https://codecov.io/gh/udibo/mixins )
7
7
[ ![ license] ( https://img.shields.io/github/license/udibo/mixins )] ( https://github.com/udibo/mixins/blob/master/LICENSE )
@@ -28,9 +28,9 @@ imported directly from GitHub using raw content URLs.
28
28
29
29
``` ts
30
30
// Import from Deno's third party module registry
31
- import { applyMixins } from " https://deno.land/x/mixins@0.7.4 /mod.ts" ;
31
+ import { applyMixins } from " https://deno.land/x/mixins@0.8.0 /mod.ts" ;
32
32
// Import from GitHub
33
- import { applyMixins } " https://raw.githubusercontent.com/udibo/mixins/0.7.4 /mod.ts" ;
33
+ import { applyMixins } " https://raw.githubusercontent.com/udibo/mixins/0.8.0 /mod.ts" ;
34
34
` ` `
35
35
36
36
### Node.js
@@ -41,15 +41,15 @@ If a Node.js package has the type "module" specified in its package.json file,
41
41
the JavaScript bundle can be imported as a ` .js ` file.
42
42
43
43
` ` ` js
44
- import { applyMixins } from " ./mixins_0.7.4 .js" ;
44
+ import { applyMixins } from " ./mixins_0.8.0 .js" ;
45
45
```
46
46
47
47
The default type for Node.js packages is "commonjs". To import the bundle into a
48
48
commonjs package, the file extension of the JavaScript bundle must be changed
49
49
from ` .js ` to ` .mjs ` .
50
50
51
51
``` js
52
- import { applyMixins } from " ./mixins_0.7.4 .mjs" ;
52
+ import { applyMixins } from " ./mixins_0.8.0 .mjs" ;
53
53
```
54
54
55
55
See [ Node.js Documentation] ( https://nodejs.org/api/esm.html ) for more
@@ -68,15 +68,15 @@ modules must have the type attribute set to "module".
68
68
69
69
``` js
70
70
// main.js
71
- import { applyMixins } from " ./mixins_0.7.4 .js" ;
71
+ import { applyMixins } from " ./mixins_0.8.0 .js" ;
72
72
```
73
73
74
74
You can also embed a module script directly into an HTML file by placing the
75
75
JavaScript code within the body of the script tag.
76
76
77
77
``` html
78
78
<script type =" module" >
79
- import { applyMixins } from " ./mixins_0.7.4 .js" ;
79
+ import { applyMixins } from " ./mixins_0.8.0 .js" ;
80
80
</script >
81
81
```
82
82
@@ -96,7 +96,7 @@ Applies properties of mixins to instance.
96
96
Using ` applyMixins ` to add properties to an object:
97
97
98
98
``` ts
99
- import { applyMixins } from " https://deno.land/x/mixins@0.7.4 /mod.ts" ;
99
+ import { applyMixins } from " https://deno.land/x/mixins@0.8.0 /mod.ts" ;
100
100
interface Point {
101
101
x: number ;
102
102
y: number ;
@@ -118,7 +118,7 @@ point3; // { time: 5, x: 2, y: 3, z: 7 }
118
118
Using ` applyMixins ` to add properties to a function:
119
119
120
120
``` ts
121
- import { applyMixins } from " https://deno.land/x/mixins@0.7.4 /mod.ts" ;
121
+ import { applyMixins } from " https://deno.land/x/mixins@0.8.0 /mod.ts" ;
122
122
interface Point {
123
123
x: number ;
124
124
y: number ;
@@ -158,7 +158,7 @@ point3.toString(); // "2, 3, 7, 5"
158
158
Using ` applyMixins ` to add properties to a class:
159
159
160
160
``` ts
161
- import { applyMixins } from " https://deno.land/x/mixins@0.7.4 /mod.ts" ;
161
+ import { applyMixins } from " https://deno.land/x/mixins@0.8.0 /mod.ts" ;
162
162
interface Point {
163
163
x: number ;
164
164
y: number ;
@@ -215,7 +215,7 @@ Applies properties of base class prototypes to instance.
215
215
import {
216
216
applyInstanceMixins ,
217
217
applyMixins ,
218
- } from " https://deno.land/x/mixins@0.7.4 /mod.ts" ;
218
+ } from " https://deno.land/x/mixins@0.8.0 /mod.ts" ;
219
219
class Point {
220
220
constructor (public x : number , public y : number ) {}
221
221
@@ -265,7 +265,7 @@ Applies properties of base class prototypes to class prototype.
265
265
import {
266
266
applyClassMixins ,
267
267
applyMixins ,
268
- } from " https://deno.land/x/mixins@0.7.4 /mod.ts" ;
268
+ } from " https://deno.land/x/mixins@0.8.0 /mod.ts" ;
269
269
class Point {
270
270
constructor (public x : number , public y : number ) {}
271
271
0 commit comments