1
0
Fork 0
freesewing/src/snippet.js

21 lines
464 B
JavaScript
Raw Normal View History

import attributes from "./attributes";
2018-07-23 11:12:06 +00:00
function snippet(def, anchor, description = "") {
2018-07-23 11:12:06 +00:00
this.def = def;
this.anchor = anchor;
this.description = description;
this.attributes = new attributes();
return this;
}
2018-08-03 14:20:28 +02:00
/** Returns a deep copy of this */
snippet.prototype.clone = function() {
let clone = new snippet(this.def, this.anchor.clone(), this.description);
clone.attributes = this.attributes.clone();
return clone;
};
2018-07-23 11:12:06 +00:00
export default snippet;