1
1
# Mixins
2
2
3
- [ ![ version] ( https://img.shields.io/badge/release-v0.5 .0-success )] ( https://github.com/udibo/mixins/tree/v0.5 .0 )
4
- [ ![ deno doc] ( https://img.shields.io/badge/deno-doc-success?logo=deno )] ( https://doc.deno.land/https/deno.land/x/mixins@v0.5 .0/mod.ts )
5
- [ ![ deno version] ( https://img.shields.io/badge/deno-v1.4.0 -success?logo=deno )] ( https://github.com/denoland/deno/tree/v1.4.0 )
3
+ [ ![ version] ( https://img.shields.io/badge/release-v0.6 .0-success )] ( https://github.com/udibo/mixins/tree/v0.6 .0 )
4
+ [ ![ deno doc] ( https://img.shields.io/badge/deno-doc-success?logo=deno )] ( https://doc.deno.land/https/deno.land/x/mixins@v0.6 .0/mod.ts )
5
+ [ ![ deno version] ( https://img.shields.io/badge/deno-v1.4.2 -success?logo=deno )] ( https://github.com/denoland/deno/tree/v1.4.2 )
6
6
[ ![ CI] ( https://github.com/udibo/mixins/workflows/CI/badge.svg )] ( https://github.com/udibo/mixins/actions?query=workflow%3ACI )
7
7
[ ![ license] ( https://img.shields.io/github/license/udibo/mixins )] ( https://github.com/udibo/mixins/blob/master/LICENSE )
8
8
@@ -24,9 +24,9 @@ but can also be imported directly from GitHub using raw content URLs.
24
24
25
25
``` ts
26
26
// Import from Deno's third party module registry
27
- import { applyMixins } from " https://deno.land/x/mixins@v0.5 .0/mod.ts" ;
27
+ import { applyMixins } from " https://deno.land/x/mixins@v0.6 .0/mod.ts" ;
28
28
// Import from GitHub
29
- import { applyMixins } " https://raw.githubusercontent.com/udibo/mixins/v0.5 .0/mod.ts" ;
29
+ import { applyMixins } " https://raw.githubusercontent.com/udibo/mixins/v0.6 .0/mod.ts" ;
30
30
` ` `
31
31
32
32
### Node.js
@@ -36,14 +36,14 @@ Node.js fully supports ES Modules.
36
36
If a Node.js package has the type "module" specified in its package.json file, the JavaScript bundle can be imported as a ` .js ` file.
37
37
38
38
` ` ` js
39
- import { applyMixins } from " ./mixins_v0.5 .0.js" ;
39
+ import { applyMixins } from " ./mixins_v0.6 .0.js" ;
40
40
```
41
41
42
42
The default type for Node.js packages is "commonjs".
43
43
To import the bundle into a commonjs package, the file extension of the JavaScript bundle must be changed from ` .js ` to ` .mjs ` .
44
44
45
45
``` js
46
- import { applyMixins } from " ./mixins_v0.5 .0.mjs" ;
46
+ import { applyMixins } from " ./mixins_v0.6 .0.mjs" ;
47
47
```
48
48
49
49
See [ Node.js Documentation] ( https://nodejs.org/api/esm.html ) for more information.
@@ -61,15 +61,15 @@ Script tags for ES modules must have the type attribute set to "module".
61
61
62
62
``` js
63
63
// main.js
64
- import { applyMixins } from " ./mixins_v0.5 .0.js" ;
64
+ import { applyMixins } from " ./mixins_v0.6 .0.js" ;
65
65
```
66
66
67
67
You can also embed a module script directly into an HTML file by placing the JavaScript code
68
68
within the body of the script tag.
69
69
70
70
``` html
71
71
<script type =" module" >
72
- import { applyMixins } from " ./mixins_v0.5 .0.js" ;
72
+ import { applyMixins } from " ./mixins_v0.6 .0.js" ;
73
73
</script >
74
74
```
75
75
@@ -86,7 +86,7 @@ Applies properties of mixins to instance.
86
86
Using ` applyMixins ` to add properties to an object:
87
87
88
88
``` ts
89
- import { applyMixins } from " https://deno.land/x/mixins@v0.5 .0/mod.ts" ;
89
+ import { applyMixins } from " https://deno.land/x/mixins@v0.6 .0/mod.ts" ;
90
90
interface Point {
91
91
x: number ;
92
92
y: number ;
@@ -108,7 +108,7 @@ point3; // { time: 5, x: 2, y: 3, z: 7 }
108
108
Using ` applyMixins ` to add properties to a function:
109
109
110
110
``` ts
111
- import { applyMixins } from " https://deno.land/x/mixins@v0.5 .0/mod.ts" ;
111
+ import { applyMixins } from " https://deno.land/x/mixins@v0.6 .0/mod.ts" ;
112
112
interface Point {
113
113
x: number ;
114
114
y: number ;
@@ -145,7 +145,7 @@ point3.toString(); // "2, 3, 7, 5"
145
145
Using ` applyMixins ` to add properties to a class:
146
146
147
147
``` ts
148
- import { applyMixins } from " https://deno.land/x/mixins@v0.5 .0/mod.ts" ;
148
+ import { applyMixins } from " https://deno.land/x/mixins@v0.6 .0/mod.ts" ;
149
149
interface Point {
150
150
x: number ;
151
151
y: number ;
@@ -197,7 +197,7 @@ point3.toString(); // "1, 2, 3, 4"
197
197
Applies properties of base class prototypes to instance.
198
198
199
199
``` ts
200
- import { applyMixins , applyInstanceMixins } from " https://deno.land/x/mixins@v0.5 .0/mod.ts" ;
200
+ import { applyMixins , applyInstanceMixins } from " https://deno.land/x/mixins@v0.6 .0/mod.ts" ;
201
201
class Point {
202
202
constructor (public x : number , public y : number ) {}
203
203
@@ -244,7 +244,7 @@ point.toString(); // "2, 3, 7, 5"
244
244
Applies properties of base class prototypes to class prototype.
245
245
246
246
``` ts
247
- import { applyMixins , applyClassMixins } from " https://deno.land/x/mixins@v0.5 .0/mod.ts" ;
247
+ import { applyMixins , applyClassMixins } from " https://deno.land/x/mixins@v0.6 .0/mod.ts" ;
248
248
class Point {
249
249
constructor (public x : number , public y : number ) {}
250
250
0 commit comments