Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-less

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-less - npm Package Compare versions

Comparing version 0.16.0 to 0.16.1

3

dist/less-parser.js

@@ -277,3 +277,4 @@ 'use strict';

if (end) {
// dont process an end of rule if there's only one token and it's unknown (#64)
if (end && this.tokens.length > 1) {
var _foundEndOfRule = this.processEndOfRule({

@@ -280,0 +281,0 @@ start: start,

@@ -1,1 +0,1 @@

"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 s=0;s<t.length;s++){var r=t[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,s,r){return s&&e(t.prototype,s),r&&e(t,r),t}}(),_comment=require("postcss/lib/comment"),_comment2=_interopRequireDefault(_comment),_parser=require("postcss/lib/parser"),_parser2=_interopRequireDefault(_parser),_rule=require("./rule"),_rule2=_interopRequireDefault(_rule),_findExtendRule=require("./find-extend-rule"),_findExtendRule2=_interopRequireDefault(_findExtendRule),_isMixinToken=require("./is-mixin-token"),_isMixinToken2=_interopRequireDefault(_isMixinToken),_lessTokenize=require("./less-tokenize"),_lessTokenize2=_interopRequireDefault(_lessTokenize),blockCommentEndPattern=/\*\/$/,LessParser=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"tokenize",value:function(){this.tokens=(0,_lessTokenize2["default"])(this.input)}},{key:"rule",value:function(e){e.pop();var t=new _rule2["default"];this.init(t,e[0][2],e[0][3]),t.raws.between=this.spacesFromEnd(e),this.raw(t,"selector",e),this.current=t}},{key:"comment",value:function(e){var t=new _comment2["default"],s=e[1],r=s.slice(2).replace(blockCommentEndPattern,"");if(this.init(t,e[2],e[3]),t.source.end={line:e[4],column:e[5]},t.raws.content=s,t.raws.begin=s[0]+s[1],t.inline="inline"===e[6],t.block=!t.inline,/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{var i=r.match(/^(\s*)([^]*[^\s])(\s*)$/);t.text=i[2],t.raws.left=i[1]||" ",t.raws.right=i[3]||" "}}},{key:"createRule",value:function(e){this.rule(this.tokens.slice(e.start,this.pos+1)),e.params[0]&&(e.isMixin||e.isExtendRule)&&this.raw(this.current,"params",e.params)}},{key:"createDeclaration",value:function(e){this.decl(this.tokens.slice(e.start,this.pos+1))}},{key:"ruleWithoutBody",value:function(e){this.createRule(e),this.current.ruleWithoutBody=!0,delete this.current.nodes,this.current.extendRule=this.current.selector.indexOf("&:extend")>=0,this.current.important=this.current.selector.indexOf("!important")>=0,this.pos--,this.end(this.tokens[this.pos])}},{key:"processEndOfRule",value:function(e){var t=e.start;if(e.isExtendRule||e.isMixin)return this.ruleWithoutBody(e),!0;if(e.colon){if(e.isEndOfBlock)for(;this.pos>t;){var s=this.tokens[this.pos][0];if("space"!==s&&"comment"!==s)break;this.pos-=1}return this.createDeclaration({start:t}),!0}return!1}},{key:"other",value:function(){var e=!1,t=!1,s=null,r=[],i=this.pos;if("brackets"===this.tokens[i][0])return void(this.spaces+=this.tokens[i][1]);var n=(0,_isMixinToken2["default"])(this.tokens[i]),o=Boolean((0,_findExtendRule2["default"])(this.tokens,i)),u=[];for(this.pos+=1;this.pos<this.tokens.length;){var l=this.tokens[this.pos],a=l[0];if("("===a||"["===a)s||(s=l),r.push("("===a?")":"]");else if(0===r.length){if(";"===a){var c=this.processEndOfRule({start:i,params:u,colon:t,isMixin:n,isExtendRule:o});if(c)return;break}if("{"===a)return void this.createRule({start:i,params:u,isMixin:n});if("}"===a){this.pos-=1,e=!0;break}":"===a&&(t=!0)}else a===r[r.length-1]&&(r.pop(),0===r.length&&(s=null));(r.length>0||"brackets"===a||u[0])&&u.push(l),this.pos+=1}if(this.pos===this.tokens.length&&(this.pos-=1,e=!0),r.length>0&&this.unclosedBracket(s),e){var f=this.processEndOfRule({start:i,params:u,colon:t,isMixin:n,isExtendRule:o,isEndOfBlock:!0});if(f)return}this.unknownWord(i)}}]),t}(_parser2["default"]);exports["default"]=LessParser,module.exports=exports["default"];
"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 s=0;s<t.length;s++){var n=t[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,s,n){return s&&e(t.prototype,s),n&&e(t,n),t}}(),_comment=require("postcss/lib/comment"),_comment2=_interopRequireDefault(_comment),_parser=require("postcss/lib/parser"),_parser2=_interopRequireDefault(_parser),_rule=require("./rule"),_rule2=_interopRequireDefault(_rule),_findExtendRule=require("./find-extend-rule"),_findExtendRule2=_interopRequireDefault(_findExtendRule),_isMixinToken=require("./is-mixin-token"),_isMixinToken2=_interopRequireDefault(_isMixinToken),_lessTokenize=require("./less-tokenize"),_lessTokenize2=_interopRequireDefault(_lessTokenize),blockCommentEndPattern=/\*\/$/,LessParser=function(e){function t(){return _classCallCheck(this,t),_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return _inherits(t,e),_createClass(t,[{key:"tokenize",value:function(){this.tokens=(0,_lessTokenize2["default"])(this.input)}},{key:"rule",value:function(e){e.pop();var t=new _rule2["default"];this.init(t,e[0][2],e[0][3]),t.raws.between=this.spacesFromEnd(e),this.raw(t,"selector",e),this.current=t}},{key:"comment",value:function(e){var t=new _comment2["default"],s=e[1],n=s.slice(2).replace(blockCommentEndPattern,"");if(this.init(t,e[2],e[3]),t.source.end={line:e[4],column:e[5]},t.raws.content=s,t.raws.begin=s[0]+s[1],t.inline="inline"===e[6],t.block=!t.inline,/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{var r=n.match(/^(\s*)([^]*[^\s])(\s*)$/);t.text=r[2],t.raws.left=r[1]||" ",t.raws.right=r[3]||" "}}},{key:"createRule",value:function(e){this.rule(this.tokens.slice(e.start,this.pos+1)),e.params[0]&&(e.isMixin||e.isExtendRule)&&this.raw(this.current,"params",e.params)}},{key:"createDeclaration",value:function(e){this.decl(this.tokens.slice(e.start,this.pos+1))}},{key:"ruleWithoutBody",value:function(e){this.createRule(e),this.current.ruleWithoutBody=!0,delete this.current.nodes,this.current.extendRule=this.current.selector.indexOf("&:extend")>=0,this.current.important=this.current.selector.indexOf("!important")>=0,this.pos--,this.end(this.tokens[this.pos])}},{key:"processEndOfRule",value:function(e){var t=e.start;if(e.isExtendRule||e.isMixin)return this.ruleWithoutBody(e),!0;if(e.colon){if(e.isEndOfBlock)for(;this.pos>t;){var s=this.tokens[this.pos][0];if("space"!==s&&"comment"!==s)break;this.pos-=1}return this.createDeclaration({start:t}),!0}return!1}},{key:"other",value:function(){var e=!1,t=!1,s=null,n=[],r=this.pos;if("brackets"===this.tokens[r][0])return void(this.spaces+=this.tokens[r][1]);var i=(0,_isMixinToken2["default"])(this.tokens[r]),o=Boolean((0,_findExtendRule2["default"])(this.tokens,r)),u=[];for(this.pos+=1;this.pos<this.tokens.length;){var l=this.tokens[this.pos],a=l[0];if("("===a||"["===a)s||(s=l),n.push("("===a?")":"]");else if(0===n.length){if(";"===a){var c=this.processEndOfRule({start:r,params:u,colon:t,isMixin:i,isExtendRule:o});if(c)return;break}if("{"===a)return void this.createRule({start:r,params:u,isMixin:i});if("}"===a){this.pos-=1,e=!0;break}":"===a&&(t=!0)}else a===n[n.length-1]&&(n.pop(),0===n.length&&(s=null));(n.length>0||"brackets"===a||u[0])&&u.push(l),this.pos+=1}if(this.pos===this.tokens.length&&(this.pos-=1,e=!0),n.length>0&&this.unclosedBracket(s),e&&this.tokens.length>1){var h=this.processEndOfRule({start:r,params:u,colon:t,isMixin:i,isExtendRule:o,isEndOfBlock:!0});if(h)return}this.unknownWord(r)}}]),t}(_parser2["default"]);exports["default"]=LessParser,module.exports=exports["default"];
{
"name": "postcss-less",
"version": "0.16.0",
"version": "0.16.1",
"description": "LESS parser for PostCSS",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc