symbol.js 889 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  3. typeof define === 'function' && define.amd ? define(factory) :
  4. (global.SpriteSymbol = factory());
  5. }(this, (function () { 'use strict';
  6. var SpriteSymbol = function SpriteSymbol(ref) {
  7. var id = ref.id;
  8. var viewBox = ref.viewBox;
  9. var content = ref.content;
  10. this.id = id;
  11. this.viewBox = viewBox;
  12. this.content = content;
  13. };
  14. /**
  15. * @return {string}
  16. */
  17. SpriteSymbol.prototype.stringify = function stringify () {
  18. return this.content;
  19. };
  20. /**
  21. * @return {string}
  22. */
  23. SpriteSymbol.prototype.toString = function toString () {
  24. return this.stringify();
  25. };
  26. SpriteSymbol.prototype.destroy = function destroy () {
  27. var this$1 = this;
  28. ['id', 'viewBox', 'content'].forEach(function (prop) { return delete this$1[prop]; });
  29. };
  30. return SpriteSymbol;
  31. })));