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

postcss-less

Package Overview
Dependencies
Maintainers
1
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.13.0 to 0.14.0

.npmignore

5

CHANGELOG.md

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

## 0.14.0
* fixed parsing of semicolon after mixin without body
## 0.13.0

@@ -26,2 +29,2 @@ * set the default stringifier for Rule

## 0.1
* Initial release.
* Initial release.

2

dist/find-extend-rule.min.js

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

"use strict";function findExtendRule(e){for(var t=arguments.length<=1||void 0===arguments[1]?0:arguments[1],d=[],r=e.length,n=t;r>n;){var u=e[n];if(extendRuleKeyWords.indexOf(u[1])>=0)d.push(u[1]);else if("space"!==u[0])break;n++}for(var l=0;extendRuleKeyWordsCount>l;l++)if(d[l]!==extendRuleKeyWords[l])return null;return e.slice(t,n)}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=findExtendRule;var extendRuleKeyWords=["&",":","extend"],extendRuleKeyWordsCount=extendRuleKeyWords.length;module.exports=exports["default"];
"use strict";function findExtendRule(e){for(var t=arguments.length<=1||void 0===arguments[1]?0:arguments[1],d=[],r=e.length,n=t;n<r;){var u=e[n];if(extendRuleKeyWords.indexOf(u[1])>=0)d.push(u[1]);else if("space"!==u[0])break;n++}for(var l=0;l<extendRuleKeyWordsCount;l++)if(d[l]!==extendRuleKeyWords[l])return null;return e.slice(t,n)}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=findExtendRule;var extendRuleKeyWords=["&",":","extend"],extendRuleKeyWordsCount=extendRuleKeyWords.length;module.exports=exports["default"];

@@ -225,3 +225,2 @@ 'use strict';

if (type === ';') {
var foundEndOfRule = this.processEndOfRule({

@@ -291,4 +290,58 @@ start: start,

/* eslint-enable max-statements, complexity */
/* eslint-enable max-statements */
}, {
key: 'loop',
value: function loop() {
while (this.pos < this.tokens.length) {
var token = this.tokens[this.pos];
switch (token[0]) {
case 'word':
case ':':
this.word();
break;
case '}':
this.end(token);
break;
case 'comment':
this.comment(token);
break;
case 'at-word':
this.atrule(token);
break;
case '{':
this.emptyRule(token);
break;
case ';':
{
var lastNode = this.current && this.current.last;
// mark semicolon, but don't save it
if (lastNode && lastNode.ruleWithoutBody) {
lastNode.raws.semicolon = true;
} else {
this.spaces += token[1];
}
break;
}
default:
this.spaces += token[1];
break;
}
this.pos += 1;
}
this.endFile();
}
/* eslint-enable complexity */
}]);

@@ -295,0 +348,0 @@

@@ -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 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}}(),_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,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"],r=e[1],i=r.slice(2).replace(blockCommentEndPattern,"");if(this.init(t,e[2],e[3]),t.source.end={line:e[4],column:e[5]},t.raws.content=r,t.raws.begin=r[0]+r[1],t.inline="inline"===e[6],t.block=!t.inline,/^\s*$/.test(i))t.text="",t.raws.left=i,t.raws.right="";else{var s=i.match(/^(\s*)([^]*[^\s])(\s*)$/);t.text=s[2],t.raws.left=s[1]||" ",t.raws.right=s[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 r=this.tokens[this.pos][0];if("space"!==r&&"comment"!==r)break;this.pos-=1}return this.createDeclaration({start:t}),!0}return!1}},{key:"word",value:function(){var e=!1,t=!1,r=null,i=0,s=this.pos,n=(0,_isMixinToken2["default"])(this.tokens[s]),o=Boolean((0,_findExtendRule2["default"])(this.tokens,s)),u=[];for(this.pos+=1;this.pos<this.tokens.length;){var l=this.tokens[this.pos],a=l[0];if("("===a)r||(r=l),i+=1;else if(0===i){if(";"===a){var c=this.processEndOfRule({start:s,params:u,colon:t,isMixin:n,isExtendRule:o});if(c)return;break}if("{"===a)return void this.createRule({start:s,params:u,isMixin:n});if("}"===a){this.pos-=1,e=!0;break}":"===a&&(t=!0)}else")"===a&&(i-=1,0===i&&(r=null));(i||"brackets"===a||u[0])&&u.push(l),this.pos+=1}if(this.pos===this.tokens.length&&(this.pos-=1,e=!0),i>0&&this.unclosedBracket(r),e){var f=this.processEndOfRule({start:s,params:u,colon:t,isMixin:n,isExtendRule:o,isEndOfBlock:!0});if(f)return}this.unknownWord(s)}}]),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 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,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:"word",value:function(){var e=!1,t=!1,s=null,r=0,i=this.pos,n=(0,_isMixinToken2["default"])(this.tokens[i]),o=Boolean((0,_findExtendRule2["default"])(this.tokens,i)),a=[];for(this.pos+=1;this.pos<this.tokens.length;){var u=this.tokens[this.pos],l=u[0];if("("===l)s||(s=u),r+=1;else if(0===r){if(";"===l){var c=this.processEndOfRule({start:i,params:a,colon:t,isMixin:n,isExtendRule:o});if(c)return;break}if("{"===l)return void this.createRule({start:i,params:a,isMixin:n});if("}"===l){this.pos-=1,e=!0;break}":"===l&&(t=!0)}else")"===l&&(r-=1,0===r&&(s=null));(r||"brackets"===l||a[0])&&a.push(u),this.pos+=1}if(this.pos===this.tokens.length&&(this.pos-=1,e=!0),r>0&&this.unclosedBracket(s),e){var h=this.processEndOfRule({start:i,params:a,colon:t,isMixin:n,isExtendRule:o,isEndOfBlock:!0});if(h)return}this.unknownWord(i)}},{key:"loop",value:function(){for(;this.pos<this.tokens.length;){var e=this.tokens[this.pos];switch(e[0]){case"word":case":":this.word();break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;case";":var t=this.current&&this.current.last;t&&t.ruleWithoutBody?t.raws.semicolon=!0:this.spaces+=e[1];break;default:this.spaces+=e[1]}this.pos+=1}this.endFile()}}]),t}(_parser2["default"]);exports["default"]=LessParser,module.exports=exports["default"];

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

"use strict";function findEndOfEscaping(e){for(var s=0,l=-1,o=e.pos+1;o<e.length;o++){var a=e.css.charCodeAt(o),r=e.css.charCodeAt(o-1);if(r!==_globals.backslash&&(a===_globals.singleQuote||a===_globals.doubleQuote||a===_globals.backTick))if(-1===l)l=a,s++;else if(a===l&&(s--,!s))return o}return-1}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=findEndOfEscaping;var _globals=require("./globals");module.exports=exports["default"];
"use strict";function findEndOfEscaping(e){for(var s=0,l=-1,o=e.pos+1;o<e.length;o++){var a=e.css.charCodeAt(o),r=e.css.charCodeAt(o-1);if(r!==_globals.backslash&&(a===_globals.singleQuote||a===_globals.doubleQuote||a===_globals.backTick))if(l===-1)l=a,s++;else if(a===l&&(s--,!s))return o}return-1}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=findEndOfEscaping;var _globals=require("./globals");module.exports=exports["default"];

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

"use strict";function findEndOfExpression(e,s,r){for(var l=0,a=0;s>r;++r){var o=e[r].charCodeAt(0);if(!(l||a||o!==_globals.semicolon&&o!==_globals.closedCurlyBracket))return r-1;switch(o){case _globals.openedCurlyBracket:a++;break;case _globals.closedCurlyBracket:a--;break;case _globals.openedParenthesis:l++;break;case _globals.closedParenthesis:l--}}return-1}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=findEndOfExpression;var _globals=require("./globals");module.exports=exports["default"];
"use strict";function findEndOfExpression(e,s,r){for(var l=0,a=0;r<s;++r){var o=e[r].charCodeAt(0);if(!(l||a||o!==_globals.semicolon&&o!==_globals.closedCurlyBracket))return r-1;switch(o){case _globals.openedCurlyBracket:a++;break;case _globals.closedCurlyBracket:a--;break;case _globals.openedParenthesis:l++;break;case _globals.closedParenthesis:l--}}return-1}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=findEndOfExpression;var _globals=require("./globals");module.exports=exports["default"];

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var singleQuote=exports.singleQuote="'".charCodeAt(0),doubleQuote=exports.doubleQuote='"'.charCodeAt(0),backslash=exports.backslash="\\".charCodeAt(0),backTick=exports.backTick="`".charCodeAt(0),slash=exports.slash="/".charCodeAt(0),newline=exports.newline="\n".charCodeAt(0),space=exports.space=" ".charCodeAt(0),feed=exports.feed="\f".charCodeAt(0),tab=exports.tab=" ".charCodeAt(0),carriageReturn=exports.carriageReturn="\r".charCodeAt(0),openedParenthesis=exports.openedParenthesis="(".charCodeAt(0),closedParenthesis=exports.closedParenthesis=")".charCodeAt(0),openedCurlyBracket=exports.openedCurlyBracket="{".charCodeAt(0),closedCurlyBracket=exports.closedCurlyBracket="}".charCodeAt(0),semicolon=exports.semicolon=";".charCodeAt(0),asterisk=exports.asterisk="*".charCodeAt(0),colon=exports.colon=":".charCodeAt(0),comma=exports.comma=",".charCodeAt(0),dot=exports.dot=".".charCodeAt(0),atRule=exports.atRule="@".charCodeAt(0),tilde=exports.tilde="~".charCodeAt(0),hash=exports.hash="#".charCodeAt(0),atEndPattern=exports.atEndPattern=/[ \n\t\r\f\{\(\)'"`\\;\/]/g,wordEndPattern=exports.wordEndPattern=/[ \n\t\r\f\(\)\{\}:,;@!'"`\\#]|\/(?=\*)/g,badBracketPattern=exports.badBracketPattern=/.[\\\/\("'\n]/,variablePattern=exports.variablePattern=/^@[^:\(\{]+:/,hashColorPattern=exports.hashColorPattern=/^#[0-9a-fA-F]{6}$|^#[0-9a-fA-F]{3}$/;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var singleQuote=exports.singleQuote="'".charCodeAt(0),doubleQuote=exports.doubleQuote='"'.charCodeAt(0),backslash=exports.backslash="\\".charCodeAt(0),backTick=exports.backTick="`".charCodeAt(0),slash=exports.slash="/".charCodeAt(0),newline=exports.newline="\n".charCodeAt(0),space=exports.space=" ".charCodeAt(0),feed=exports.feed="\f".charCodeAt(0),tab=exports.tab="\t".charCodeAt(0),carriageReturn=exports.carriageReturn="\r".charCodeAt(0),openedParenthesis=exports.openedParenthesis="(".charCodeAt(0),closedParenthesis=exports.closedParenthesis=")".charCodeAt(0),openedCurlyBracket=exports.openedCurlyBracket="{".charCodeAt(0),closedCurlyBracket=exports.closedCurlyBracket="}".charCodeAt(0),semicolon=exports.semicolon=";".charCodeAt(0),asterisk=exports.asterisk="*".charCodeAt(0),colon=exports.colon=":".charCodeAt(0),comma=exports.comma=",".charCodeAt(0),dot=exports.dot=".".charCodeAt(0),atRule=exports.atRule="@".charCodeAt(0),tilde=exports.tilde="~".charCodeAt(0),hash=exports.hash="#".charCodeAt(0),atEndPattern=exports.atEndPattern=/[ \n\t\r\f\{\(\)'"`\\;\/]/g,wordEndPattern=exports.wordEndPattern=/[ \n\t\r\f\(\)\{\}:,;@!'"`\\#]|\/(?=\*)/g,badBracketPattern=exports.badBracketPattern=/.[\\\/\("'\n]/,variablePattern=exports.variablePattern=/^@[^:\(\{]+:/,hashColorPattern=exports.hashColorPattern=/^#[0-9a-fA-F]{6}$|^#[0-9a-fA-F]{3}$/;

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

"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function tokenizeAtRule(e){e.css.charCodeAt(e.pos+1)===_globals.openedCurlyBracket?(e.nextPos=e.css.indexOf("}",e.pos+2),-1===e.nextPos&&(0,_unclosed2["default"])(e,"interpolation"),e.cssPart=e.css.slice(e.pos,e.nextPos+1),e.lines=e.cssPart.split("\n"),e.lastLine=e.lines.length-1,e.lastLine>0?(e.nextLine=e.line+e.lastLine,e.nextOffset=e.nextPos-e.lines[e.lastLine].length):(e.nextLine=e.line,e.nextOffset=e.offset),e.tokens.push(["word",e.cssPart,e.line,e.pos-e.offset,e.nextLine,e.nextPos-e.nextOffset]),e.offset=e.nextOffset,e.line=e.nextLine):(_globals.atEndPattern.lastIndex=e.pos+1,_globals.atEndPattern.test(e.css),0===_globals.atEndPattern.lastIndex?e.nextPos=e.css.length-1:e.nextPos=_globals.atEndPattern.lastIndex-2,e.cssPart=e.css.slice(e.pos,e.nextPos+1),e.token="at-word",_globals.variablePattern.test(e.cssPart)&&(_globals.wordEndPattern.lastIndex=e.pos+1,_globals.wordEndPattern.test(e.css),0===_globals.wordEndPattern.lastIndex?e.nextPos=e.css.length-1:e.nextPos=_globals.wordEndPattern.lastIndex-2,e.cssPart=e.css.slice(e.pos,e.nextPos+1),e.token="word"),e.tokens.push([e.token,e.cssPart,e.line,e.pos-e.offset,e.line,e.nextPos-e.offset])),e.pos=e.nextPos}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=tokenizeAtRule;var _globals=require("./globals"),_unclosed=require("./unclosed"),_unclosed2=_interopRequireDefault(_unclosed);module.exports=exports["default"];
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function tokenizeAtRule(e){e.css.charCodeAt(e.pos+1)===_globals.openedCurlyBracket?(e.nextPos=e.css.indexOf("}",e.pos+2),e.nextPos===-1&&(0,_unclosed2["default"])(e,"interpolation"),e.cssPart=e.css.slice(e.pos,e.nextPos+1),e.lines=e.cssPart.split("\n"),e.lastLine=e.lines.length-1,e.lastLine>0?(e.nextLine=e.line+e.lastLine,e.nextOffset=e.nextPos-e.lines[e.lastLine].length):(e.nextLine=e.line,e.nextOffset=e.offset),e.tokens.push(["word",e.cssPart,e.line,e.pos-e.offset,e.nextLine,e.nextPos-e.nextOffset]),e.offset=e.nextOffset,e.line=e.nextLine):(_globals.atEndPattern.lastIndex=e.pos+1,_globals.atEndPattern.test(e.css),0===_globals.atEndPattern.lastIndex?e.nextPos=e.css.length-1:e.nextPos=_globals.atEndPattern.lastIndex-2,e.cssPart=e.css.slice(e.pos,e.nextPos+1),e.token="at-word",_globals.variablePattern.test(e.cssPart)&&(_globals.wordEndPattern.lastIndex=e.pos+1,_globals.wordEndPattern.test(e.css),0===_globals.wordEndPattern.lastIndex?e.nextPos=e.css.length-1:e.nextPos=_globals.wordEndPattern.lastIndex-2,e.cssPart=e.css.slice(e.pos,e.nextPos+1),e.token="word"),e.tokens.push([e.token,e.cssPart,e.line,e.pos-e.offset,e.line,e.nextPos-e.offset])),e.pos=e.nextPos}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=tokenizeAtRule;var _globals=require("./globals"),_unclosed=require("./unclosed"),_unclosed2=_interopRequireDefault(_unclosed);module.exports=exports["default"];

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

"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function tokenizeDefault(e){var n=e.css.charCodeAt(e.pos+1);if(e.symbolCode===_globals.slash&&n===_globals.asterisk)(0,_tokenizeMultilineComment2["default"])(e);else if(e.symbolCode===_globals.slash&&n===_globals.slash)(0,_tokenizeInlineComment2["default"])(e);else{if((0,_isEscaping2["default"])(e)){var t=(0,_findEndOfEscaping2["default"])(e);0>t?(0,_unclosed2["default"])(e,"escaping"):e.nextPos=t}else _globals.wordEndPattern.lastIndex=e.pos+1,_globals.wordEndPattern.test(e.css),0===_globals.wordEndPattern.lastIndex?e.nextPos=e.css.length-1:e.nextPos=_globals.wordEndPattern.lastIndex-2;e.cssPart=e.css.slice(e.pos,e.nextPos+1),e.tokens.push(["word",e.cssPart,e.line,e.pos-e.offset,e.line,e.nextPos-e.offset]),e.pos=e.nextPos}}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=tokenizeDefault;var _globals=require("./globals"),_findEndOfEscaping=require("./find-end-of-escaping"),_findEndOfEscaping2=_interopRequireDefault(_findEndOfEscaping),_isEscaping=require("./is-escaping"),_isEscaping2=_interopRequireDefault(_isEscaping),_tokenizeInlineComment=require("./tokenize-inline-comment"),_tokenizeInlineComment2=_interopRequireDefault(_tokenizeInlineComment),_tokenizeMultilineComment=require("./tokenize-multiline-comment"),_tokenizeMultilineComment2=_interopRequireDefault(_tokenizeMultilineComment),_unclosed=require("./unclosed"),_unclosed2=_interopRequireDefault(_unclosed);module.exports=exports["default"];
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function tokenizeDefault(e){var n=e.css.charCodeAt(e.pos+1);if(e.symbolCode===_globals.slash&&n===_globals.asterisk)(0,_tokenizeMultilineComment2["default"])(e);else if(e.symbolCode===_globals.slash&&n===_globals.slash)(0,_tokenizeInlineComment2["default"])(e);else{if((0,_isEscaping2["default"])(e)){var t=(0,_findEndOfEscaping2["default"])(e);t<0?(0,_unclosed2["default"])(e,"escaping"):e.nextPos=t}else _globals.wordEndPattern.lastIndex=e.pos+1,_globals.wordEndPattern.test(e.css),0===_globals.wordEndPattern.lastIndex?e.nextPos=e.css.length-1:e.nextPos=_globals.wordEndPattern.lastIndex-2;e.cssPart=e.css.slice(e.pos,e.nextPos+1),e.tokens.push(["word",e.cssPart,e.line,e.pos-e.offset,e.line,e.nextPos-e.offset]),e.pos=e.nextPos}}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=tokenizeDefault;var _globals=require("./globals"),_findEndOfEscaping=require("./find-end-of-escaping"),_findEndOfEscaping2=_interopRequireDefault(_findEndOfEscaping),_isEscaping=require("./is-escaping"),_isEscaping2=_interopRequireDefault(_isEscaping),_tokenizeInlineComment=require("./tokenize-inline-comment"),_tokenizeInlineComment2=_interopRequireDefault(_tokenizeInlineComment),_tokenizeMultilineComment=require("./tokenize-multiline-comment"),_tokenizeMultilineComment2=_interopRequireDefault(_tokenizeMultilineComment),_unclosed=require("./unclosed"),_unclosed2=_interopRequireDefault(_unclosed);module.exports=exports["default"];

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

"use strict";function tokenizeInlineComment(e){e.nextPos=e.css.indexOf("\n",e.pos+2)-1,-2===e.nextPos&&(e.nextPos=e.css.length-1),e.tokens.push(["comment",e.css.slice(e.pos,e.nextPos+1),e.line,e.pos-e.offset,e.line,e.nextPos-e.offset,"inline"]),e.pos=e.nextPos}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=tokenizeInlineComment,module.exports=exports["default"];
"use strict";function tokenizeInlineComment(e){e.nextPos=e.css.indexOf("\n",e.pos+2)-1,e.nextPos===-2&&(e.nextPos=e.css.length-1),e.tokens.push(["comment",e.css.slice(e.pos,e.nextPos+1),e.line,e.pos-e.offset,e.line,e.nextPos-e.offset,"inline"]),e.pos=e.nextPos}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=tokenizeInlineComment,module.exports=exports["default"];

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

"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function findClosedParenthesisPosition(e,s,o){for(var t=0,n=o;s>n;n++){var l=e[n];if("("===l)t++;else if(")"===l&&(t--,!t))return n}return-1}function tokenizeOpenedParenthesis(e){var s=e.css.charCodeAt(e.pos+1),o=e.tokens.length,t=o?e.tokens[o-1][1]:"";if("url"===t&&s!==_globals.singleQuote&&s!==_globals.doubleQuote&&s!==_globals.space&&s!==_globals.newline&&s!==_globals.tab&&s!==_globals.feed&&s!==_globals.carriageReturn){e.nextPos=e.pos;do for(e.escaped=!1,e.nextPos=e.css.indexOf(")",e.nextPos+1),-1===e.nextPos&&(0,_unclosed2["default"])(e,"bracket"),e.escapePos=e.nextPos;e.css.charCodeAt(e.escapePos-1)===_globals.backslash;)e.escapePos-=1,e.escaped=!e.escaped;while(e.escaped);e.tokens.push(["brackets",e.css.slice(e.pos,e.nextPos+1),e.line,e.pos-e.offset,e.line,e.nextPos-e.offset]),e.pos=e.nextPos}else{e.nextPos=findClosedParenthesisPosition(e.css,e.length,e.pos),e.cssPart=e.css.slice(e.pos,e.nextPos+1);var n=e.cssPart.indexOf("@")>=0,l=/['"]/.test(e.cssPart);if(0===e.cssPart.length||"..."===e.cssPart||n&&!l)-1===e.nextPos&&(0,_unclosed2["default"])(e,"bracket"),e.tokens.push([e.symbol,e.symbol,e.line,e.pos-e.offset]);else{var a=_globals.badBracketPattern.test(e.cssPart);-1===e.nextPos||a?e.tokens.push([e.symbol,e.symbol,e.line,e.pos-e.offset]):(e.tokens.push(["brackets",e.cssPart,e.line,e.pos-e.offset,e.line,e.nextPos-e.offset]),e.pos=e.nextPos)}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=tokenizeOpenedParenthesis;var _globals=require("./globals"),_unclosed=require("./unclosed"),_unclosed2=_interopRequireDefault(_unclosed);module.exports=exports["default"];
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function findClosedParenthesisPosition(e,s,o){for(var t=0,n=o;n<s;n++){var l=e[n];if("("===l)t++;else if(")"===l&&(t--,!t))return n}return-1}function tokenizeOpenedParenthesis(e){var s=e.css.charCodeAt(e.pos+1),o=e.tokens.length,t=o?e.tokens[o-1][1]:"";if("url"===t&&s!==_globals.singleQuote&&s!==_globals.doubleQuote&&s!==_globals.space&&s!==_globals.newline&&s!==_globals.tab&&s!==_globals.feed&&s!==_globals.carriageReturn){e.nextPos=e.pos;do for(e.escaped=!1,e.nextPos=e.css.indexOf(")",e.nextPos+1),e.nextPos===-1&&(0,_unclosed2["default"])(e,"bracket"),e.escapePos=e.nextPos;e.css.charCodeAt(e.escapePos-1)===_globals.backslash;)e.escapePos-=1,e.escaped=!e.escaped;while(e.escaped);e.tokens.push(["brackets",e.css.slice(e.pos,e.nextPos+1),e.line,e.pos-e.offset,e.line,e.nextPos-e.offset]),e.pos=e.nextPos}else{e.nextPos=findClosedParenthesisPosition(e.css,e.length,e.pos),e.cssPart=e.css.slice(e.pos,e.nextPos+1);var n=e.cssPart.indexOf("@")>=0,l=/['"]/.test(e.cssPart);if(0===e.cssPart.length||"..."===e.cssPart||n&&!l)e.nextPos===-1&&(0,_unclosed2["default"])(e,"bracket"),e.tokens.push([e.symbol,e.symbol,e.line,e.pos-e.offset]);else{var a=_globals.badBracketPattern.test(e.cssPart);e.nextPos===-1||a?e.tokens.push([e.symbol,e.symbol,e.line,e.pos-e.offset]):(e.tokens.push(["brackets",e.cssPart,e.line,e.pos-e.offset,e.line,e.nextPos-e.offset]),e.pos=e.nextPos)}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=tokenizeOpenedParenthesis;var _globals=require("./globals"),_unclosed=require("./unclosed"),_unclosed2=_interopRequireDefault(_unclosed);module.exports=exports["default"];

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

"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function tokenizeQuotes(e){e.nextPos=e.pos;do for(e.escaped=!1,e.nextPos=e.css.indexOf(e.symbol,e.nextPos+1),-1===e.nextPos&&(0,_unclosed2["default"])(e,"quote"),e.escapePos=e.nextPos;e.css.charCodeAt(e.escapePos-1)===_globals.backslash;)e.escapePos-=1,e.escaped=!e.escaped;while(e.escaped);e.tokens.push(["string",e.css.slice(e.pos,e.nextPos+1),e.line,e.pos-e.offset,e.line,e.nextPos-e.offset]),e.pos=e.nextPos}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=tokenizeQuotes;var _globals=require("./globals"),_unclosed=require("./unclosed"),_unclosed2=_interopRequireDefault(_unclosed);module.exports=exports["default"];
"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function tokenizeQuotes(e){e.nextPos=e.pos;do for(e.escaped=!1,e.nextPos=e.css.indexOf(e.symbol,e.nextPos+1),e.nextPos===-1&&(0,_unclosed2["default"])(e,"quote"),e.escapePos=e.nextPos;e.css.charCodeAt(e.escapePos-1)===_globals.backslash;)e.escapePos-=1,e.escaped=!e.escaped;while(e.escaped);e.tokens.push(["string",e.css.slice(e.pos,e.nextPos+1),e.line,e.pos-e.offset,e.line,e.nextPos-e.offset]),e.pos=e.nextPos}Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=tokenizeQuotes;var _globals=require("./globals"),_unclosed=require("./unclosed"),_unclosed2=_interopRequireDefault(_unclosed);module.exports=exports["default"];
{
"name": "postcss-less",
"version": "0.13.0",
"version": "0.14.0",
"description": "LESS parser for PostCSS",

@@ -35,3 +35,3 @@ "keywords": [

"dependencies": {
"postcss": "^5.0.19"
"postcss": "^5.0.21"
},

@@ -38,0 +38,0 @@ "devDependencies": {

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