notes/node_modules/postcss-less/dist/less-stringifier.min.js

1 line
1.9 KiB
JavaScript
Executable File

"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),_stringifier=require("postcss/lib/stringifier"),_stringifier2=_interopRequireDefault(_stringifier),LessStringifier=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,Object.getPrototypeOf(t).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"comment",value:function(e){var t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");e.inline?this.builder("//"+t+e.text+r,e):this.builder("/*"+t+e.text+r+"*/",e)}},{key:"block",value:function(e,t){var r=e.ruleWithoutBody,i=this.raw(e,"between","beforeOpen"),n="";r?this.builder(t+i,e,"start"):this.builder(t+i+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),r||this.builder("}",e,"end")}}]),t}(_stringifier2["default"]);exports["default"]=LessStringifier,module.exports=exports["default"];