@@ -25,2 +25,14 @@ /** | ||
| }, | ||
| 'numeric-variable-name': { | ||
| description: 'Variable names beginning with a number are deprecated and will be removed in Less 5.x.' | ||
| }, | ||
| 'dash-only-variable-name': { | ||
| description: 'The dash-only variable names @- and @{-} are deprecated and will be removed in Less 5.x.' | ||
| }, | ||
| 'dash-only-mixin-name': { | ||
| description: 'The dash-only mixin names .-() and #-() are deprecated and will be removed in Less 5.x.' | ||
| }, | ||
| 'dynamic-charset': { | ||
| description: 'Dynamic @charset interpolation is deprecated and will be removed in Less 5.x.' | ||
| }, | ||
| 'property-in-unknown-value': { | ||
@@ -27,0 +39,0 @@ description: '$property in custom property values is treated as literal text.' |
@@ -270,21 +270,31 @@ // @ts-check | ||
| const allArgsCnt = (args && args.length) || 0; | ||
| let len; | ||
| const optionalParameters = this.optionalParameters; | ||
| const requiredArgsCnt = !args ? 0 : args.reduce(function (/** @type {number} */ count, /** @type {MixinArg} */ p) { | ||
| if (optionalParameters.indexOf(p.name) < 0) { | ||
| return count + 1; | ||
| } else { | ||
| return count; | ||
| const evaldArguments = new Array(this.params.length); | ||
| const positionalArgs = []; | ||
| let positionalIndex = 0; | ||
| for (let i = 0; i < allArgsCnt; i++) { | ||
| const arg = /** @type {MixinArg[]} */ (args)[i]; | ||
| if (!arg.name) { | ||
| positionalArgs.push(arg); | ||
| continue; | ||
| } | ||
| }, 0); | ||
| if (!this.variadic) { | ||
| if (requiredArgsCnt < this.required) { | ||
| const paramIndex = this.params.findIndex((param, index) => param.name === arg.name && !evaldArguments[index]); | ||
| if (paramIndex < 0) { | ||
| return false; | ||
| } | ||
| if (allArgsCnt > this.params.length) { | ||
| return false; | ||
| evaldArguments[paramIndex] = arg; | ||
| } | ||
| for (let i = 0; i < this.params.length; i++) { | ||
| if (evaldArguments[i]) { | ||
| continue; | ||
| } | ||
| } else { | ||
| if (requiredArgsCnt < (this.required - 1)) { | ||
| if (this.params[i].variadic) { | ||
| positionalIndex = positionalArgs.length; | ||
| continue; | ||
| } | ||
| if (positionalIndex < positionalArgs.length) { | ||
| evaldArguments[i] = positionalArgs[positionalIndex++]; | ||
| } else if (!this.params[i].name || !this.params[i].value) { | ||
| return false; | ||
@@ -294,8 +304,10 @@ } | ||
| if (positionalIndex < positionalArgs.length) { | ||
| return false; | ||
| } | ||
| // check patterns | ||
| len = Math.min(requiredArgsCnt, this.arity); | ||
| for (let i = 0; i < len; i++) { | ||
| for (let i = 0; i < this.arity; i++) { | ||
| if (!this.params[i].name && !this.params[i].variadic) { | ||
| if (/** @type {MixinArg[]} */ (args)[i].value.eval(context).toCSS(/** @type {EvalContext} */ ({})) != /** @type {Node} */ (this.params[i].value).eval(context).toCSS(/** @type {EvalContext} */ ({}))) { | ||
| if (evaldArguments[i].value.eval(context).toCSS(/** @type {EvalContext} */ ({})) != /** @type {Node} */ (this.params[i].value).eval(context).toCSS(/** @type {EvalContext} */ ({}))) { | ||
| return false; | ||
@@ -302,0 +314,0 @@ } |
+1
-1
| { | ||
| "name": "less", | ||
| "version": "4.7.0", | ||
| "version": "4.8.0", | ||
| "description": "Leaner CSS", | ||
@@ -5,0 +5,0 @@ "homepage": "http://lesscss.org", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
3182947
0.98%53765
0.71%