Skip to content

Instantly share code, notes, and snippets.

@gmetais
Created July 10, 2016 13:37
Show Gist options
  • Save gmetais/089deeefd5af2d20c845872ab8f12d01 to your computer and use it in GitHub Desktop.
Save gmetais/089deeefd5af2d20c845872ab8f12d01 to your computer and use it in GitHub Desktop.
Very long (infinite?) isSvg()
var isSvg = require('is-svg');
console.log(isSvg("e.__esModule=!0,e.EndTagToken=e.AtomicTagToken=e.StartTagToken=e.TagToken=e.CharsToken=e.CommentToken=e.Token=void 0;var o=n(5),i=(e.Token=function a(t,e){r(this,a),this.type=t,this.length=e,this.text=\"\"},e.CommentToken=function(){function t(e,n){r(this,t),this.type=\"comment\",this.length=n||(e?e.length:0),this.text=\"\",this.content=e}return t.prototype.toString=function(){return\"<!--\"+this.content},t}(),e.CharsToken=function(){function t(e){r(this,t),this.type=\"chars\",this.length=e,this.text=\"\"}return t.prototype.toString=function(){return this.text},t}(),e.TagToken=function(){function t(e,n,o,i,a){r(this,t),this.type=e,this.length=o,this.text=\"\",this.tagName=n,this.attrs=i,this.booleanAttrs=a,this.unary=!1,this.html5Unary=!1}return t.formatTag=function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1],n=\"<\"+t.tagName;for(var r in t.attrs)if(t.attrs.hasOwnProperty(r)){n+=\" \"+r;var i=t.attrs[r];\"undefined\"!=typeof t.booleanAttrs&&\"undefined\"!=typeof t.booleanAttrs[r]||(n+='=\"'+(0,o.escapeQuotes)(i)+'\"')}return t.rest&&(n+=\" \"+t.rest),n+=t.unary&&!t.html5Unary?\"/>\":\">\",void 0!==e&&null!==e&&(n+=e+\"</\"+t.tagName+\">\"),n},t}());e.StartTagToken=function(){function t(e,n,o,i,a,s){r(this,t),this.type=\"startTag\",this.length=n,this.text=\"\",this.tagName=e,this.attrs=o,this.booleanAttrs=i,this.html5Unary=!1,this.unary=a,this.rest=s}return t.prototype.toString=function(){return i.formatTag(this)},t}(),e.AtomicTagToken=function(){function t(e,n,o,i,a){r(this,t),this.type=\"atomicTag\",this.length=n,this.text=\"\",this.tagName=e,this.attrs=o,this.booleanAttrs=i,this.unary=!1,this.html5Unary=!1,this.content=a}return t.prototype.toString=function(){return i.formatTag(this,this.content)},t}(),e.EndTagToken=function(){function t(e,n){r(this,t),this.type=\"endTag\",this.length=n,this.text=\"\",this.tagName=e}return t.prototype.toString=function(){return\"</\"+this.tagName+\">\"},t}()},function(t,e){function n(t){var e=arguments.length<=1||void 0===arguments[1]?\"\":arguments[1];return t?t.replace(/([^\"]*)\"/g,function(t,e){return/\\/.test(e)?e+'\"':e+'\\\"'}):e}e.__esModule=!0,e.escapeQuotes=n},function(t,e){function n(t){return t&&\"startTag\"===t.type&&(t.unary=s.test(t.tagName)||t.unary,t.html5Unary=!/\/>$/.test(t.text)),t}"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment