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();
2018-07-23 11:12:06 +00:00
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);
2018-08-03 14:20:28 +02:00
clone.attributes = this.attributes.clone();
return clone;
};
export default Snippet;