1
0
Fork 0

💥 pattern.with() is nowy pattern.use()

This commit is contained in:
Joost De Cock 2018-12-22 10:27:05 +01:00
parent d07067e593
commit 6ad8cb6cb0
5 changed files with 6 additions and 6 deletions

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "freesewing",
"version": "0.24.0",
"version": "0.25.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -1,6 +1,6 @@
{
"name": "freesewing",
"version": "0.24.0",
"version": "0.25.0",
"description": "A library for creating made-to-measure sewing patterns",
"author": "Joost De Cock <joost@decock.org> (https://github.com/joostdecock)",
"homepage": "https://freesewing.org/",

View file

@ -333,7 +333,7 @@ Pattern.prototype.on = function(hook, method, data) {
this.hooks[hook].push({ method, data });
};
Pattern.prototype.with = function(plugin, data = false) {
Pattern.prototype.use = function(plugin, data = false) {
this.debug({
type: "success",
label: "🔌 Plugin loaded",

View file

@ -39,7 +39,7 @@ it("Should register and run a macro", () => {
}
}
};
pattern.with(plugin);
pattern.use(plugin);
let part = new pattern.Part();
let macro = part.macroClosure();
macro("test", { x: 123, y: 456 });

View file

@ -284,7 +284,7 @@ it("Should register a hook from a plugin", () => {
}
}
};
pattern.with(plugin);
pattern.use(plugin);
pattern.draft();
expect(count).to.equal(1);
});
@ -307,7 +307,7 @@ it("Should register multiple methods on a single hook", () => {
]
}
};
pattern.with(plugin);
pattern.use(plugin);
pattern.draft();
expect(count).to.equal(2);
});