X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Funcss%2Fnode_modules%2Fpostcss%2Flib%2Fwarning.js;fp=node_modules%2Funcss%2Fnode_modules%2Fpostcss%2Flib%2Fwarning.js;h=3257e9a7c5acb27b6944edbde98bd4ea71b31057;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/uncss/node_modules/postcss/lib/warning.js b/node_modules/uncss/node_modules/postcss/lib/warning.js new file mode 100644 index 000000000..3257e9a7c --- /dev/null +++ b/node_modules/uncss/node_modules/postcss/lib/warning.js @@ -0,0 +1,46 @@ +'use strict'; + +exports.__esModule = true; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Warning = function () { + function Warning(text) { + var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + _classCallCheck(this, Warning); + + this.type = 'warning'; + + this.text = text; + + if (opts.node && opts.node.source) { + var pos = opts.node.positionBy(opts); + this.line = pos.line; + this.column = pos.column; + } + + for (var opt in opts) { + this[opt] = opts[opt]; + } + } + + Warning.prototype.toString = function toString() { + if (this.node) { + return this.node.error(this.text, { + plugin: this.plugin, + index: this.index, + word: this.word + }).message; + } else if (this.plugin) { + return this.plugin + ': ' + this.text; + } else { + return this.text; + } + }; + + return Warning; +}(); + +exports.default = Warning; +module.exports = exports['default']; \ No newline at end of file