Skip to content

Commit

Permalink
Fixes #3574 (#3575)
Browse files Browse the repository at this point in the history
* Fixes #3574
* Bump version and dist files
  • Loading branch information
matthew-dean committed Dec 18, 2020
1 parent 5423802 commit 283b1b4
Show file tree
Hide file tree
Showing 14 changed files with 236 additions and 54 deletions.
125 changes: 108 additions & 17 deletions dist/less.js
@@ -1,5 +1,5 @@
/**
* Less - Leaner CSS v3.13.0
* Less - Leaner CSS v3.13.1
* http://lesscss.org
*
* Copyright (c) 2009-2020, Alexis Sellier <self@cloudhead.net>
Expand Down Expand Up @@ -217,18 +217,6 @@
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
s += arguments[i].length;
Expand Down Expand Up @@ -914,6 +902,105 @@
ALL: 2
};

/**
* Returns the object type of the given payload
*
* @param {*} payload
* @returns {string}
*/
function getType(payload) {
return Object.prototype.toString.call(payload).slice(8, -1);
}
/**
* Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
*
* @param {*} payload
* @returns {payload is Record<string, any>}
*/
function isPlainObject(payload) {
if (getType(payload) !== 'Object')
return false;
return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;
}
/**
* Returns whether the payload is an array
*
* @param {any} payload
* @returns {payload is any[]}
*/
function isArray(payload) {
return getType(payload) === 'Array';
}

/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
function __spreadArrays$1() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
var propType = {}.propertyIsEnumerable.call(originalObject, key)
? 'enumerable'
: 'nonenumerable';
if (propType === 'enumerable')
carry[key] = newVal;
if (includeNonenumerable && propType === 'nonenumerable') {
Object.defineProperty(carry, key, {
value: newVal,
enumerable: false,
writable: true,
configurable: true,
});
}
}
/**
* Copy (clone) an object and all its props recursively to get rid of any prop referenced of the original object. Arrays are also cloned, however objects inside arrays are still linked.
*
* @export
* @template T
* @param {T} target Target can be anything
* @param {Options} [options={}] Options can be `props` or `nonenumerable`
* @returns {T} the target with replaced values
* @export
*/
function copy(target, options) {
if (options === void 0) {
options = {};
}
if (isArray(target))
return target.map(function (i) { return copy(i, options); });
if (!isPlainObject(target))
return target;
var props = Object.getOwnPropertyNames(target);
var symbols = Object.getOwnPropertySymbols(target);
return __spreadArrays$1(props, symbols).reduce(function (carry, key) {
if (isArray(options.props) && !options.props.includes(key)) {
return carry;
}
var val = target[key];
var newVal = copy(val, options);
assignProp(carry, key, newVal, target, options.nonenumerable);
return carry;
}, {});
}

/* jshint proto: true */
function getLocation(index, inputStream) {
var n = index + 1;
var line = null;
Expand Down Expand Up @@ -951,9 +1038,9 @@
var newObj = obj2 || {};
if (!obj2._defaults) {
newObj = {};
var defaults_1 = __assign({}, obj1);
var defaults_1 = copy(obj1);
newObj._defaults = defaults_1;
var cloned = obj2 ? __assign({}, obj2) : {};
var cloned = obj2 ? copy(obj2) : {};
Object.assign(newObj, defaults_1, cloned);
}
return newObj;
Expand Down Expand Up @@ -9699,8 +9786,12 @@
// adjust the source
inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);
}
// ignore empty content
/**
* ignore empty content, or failsafe
* if contents map is incorrect
*/
if (inputSource === undefined) {
this._css.push(chunk);
return;
}
inputSource = inputSource.substring(0, index);
Expand Down Expand Up @@ -10444,7 +10535,7 @@
* It's not clear what should / must be public and why.
*/
var initial = {
version: [3, 13, 0],
version: [3, 13, 1],
data: data,
tree: tree,
Environment: environment,
Expand Down
4 changes: 2 additions & 2 deletions dist/less.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/less.min.js.map

Large diffs are not rendered by default.

125 changes: 108 additions & 17 deletions packages/less/dist/less.js
@@ -1,5 +1,5 @@
/**
* Less - Leaner CSS v3.13.0
* Less - Leaner CSS v3.13.1
* http://lesscss.org
*
* Copyright (c) 2009-2020, Alexis Sellier <self@cloudhead.net>
Expand Down Expand Up @@ -217,18 +217,6 @@
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
s += arguments[i].length;
Expand Down Expand Up @@ -914,6 +902,105 @@
ALL: 2
};

/**
* Returns the object type of the given payload
*
* @param {*} payload
* @returns {string}
*/
function getType(payload) {
return Object.prototype.toString.call(payload).slice(8, -1);
}
/**
* Returns whether the payload is a plain JavaScript object (excluding special classes or objects with other prototypes)
*
* @param {*} payload
* @returns {payload is Record<string, any>}
*/
function isPlainObject(payload) {
if (getType(payload) !== 'Object')
return false;
return payload.constructor === Object && Object.getPrototypeOf(payload) === Object.prototype;
}
/**
* Returns whether the payload is an array
*
* @param {any} payload
* @returns {payload is any[]}
*/
function isArray(payload) {
return getType(payload) === 'Array';
}

/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
function __spreadArrays$1() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
function assignProp(carry, key, newVal, originalObject, includeNonenumerable) {
var propType = {}.propertyIsEnumerable.call(originalObject, key)
? 'enumerable'
: 'nonenumerable';
if (propType === 'enumerable')
carry[key] = newVal;
if (includeNonenumerable && propType === 'nonenumerable') {
Object.defineProperty(carry, key, {
value: newVal,
enumerable: false,
writable: true,
configurable: true,
});
}
}
/**
* Copy (clone) an object and all its props recursively to get rid of any prop referenced of the original object. Arrays are also cloned, however objects inside arrays are still linked.
*
* @export
* @template T
* @param {T} target Target can be anything
* @param {Options} [options={}] Options can be `props` or `nonenumerable`
* @returns {T} the target with replaced values
* @export
*/
function copy(target, options) {
if (options === void 0) {
options = {};
}
if (isArray(target))
return target.map(function (i) { return copy(i, options); });
if (!isPlainObject(target))
return target;
var props = Object.getOwnPropertyNames(target);
var symbols = Object.getOwnPropertySymbols(target);
return __spreadArrays$1(props, symbols).reduce(function (carry, key) {
if (isArray(options.props) && !options.props.includes(key)) {
return carry;
}
var val = target[key];
var newVal = copy(val, options);
assignProp(carry, key, newVal, target, options.nonenumerable);
return carry;
}, {});
}

/* jshint proto: true */
function getLocation(index, inputStream) {
var n = index + 1;
var line = null;
Expand Down Expand Up @@ -951,9 +1038,9 @@
var newObj = obj2 || {};
if (!obj2._defaults) {
newObj = {};
var defaults_1 = __assign({}, obj1);
var defaults_1 = copy(obj1);
newObj._defaults = defaults_1;
var cloned = obj2 ? __assign({}, obj2) : {};
var cloned = obj2 ? copy(obj2) : {};
Object.assign(newObj, defaults_1, cloned);
}
return newObj;
Expand Down Expand Up @@ -9699,8 +9786,12 @@
// adjust the source
inputSource = inputSource.slice(this._contentsIgnoredCharsMap[fileInfo.filename]);
}
// ignore empty content
/**
* ignore empty content, or failsafe
* if contents map is incorrect
*/
if (inputSource === undefined) {
this._css.push(chunk);
return;
}
inputSource = inputSource.substring(0, index);
Expand Down Expand Up @@ -10444,7 +10535,7 @@
* It's not clear what should / must be public and why.
*/
var initial = {
version: [3, 13, 0],
version: [3, 13, 1],
data: data,
tree: tree,
Environment: environment,
Expand Down
4 changes: 2 additions & 2 deletions packages/less/dist/less.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/less/dist/less.min.js.map

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions packages/less/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/less/package.json
@@ -1,6 +1,6 @@
{
"name": "less",
"version": "3.13.0",
"version": "3.13.1",
"description": "Leaner CSS",
"homepage": "http://lesscss.org",
"author": {
Expand Down Expand Up @@ -61,7 +61,6 @@
"benny": "^3.6.12",
"bootstrap-less-port": "0.3.0",
"chai": "^4.2.0",
"copy-anything": "^2.0.1",
"diff": "^3.2.0",
"eslint": "^6.8.0",
"fs-extra": "^8.1.0",
Expand Down Expand Up @@ -128,6 +127,7 @@
"rawcurrent": "https://raw.github.com/less/less.js/v",
"sourcearchive": "https://github.com/less/less.js/archive/v",
"dependencies": {
"copy-anything": "^2.0.1",
"tslib": "^1.10.0"
}
}
1 change: 0 additions & 1 deletion packages/less/src/less/import-manager.js
Expand Up @@ -121,7 +121,6 @@ export default function(environment) {
} else if (importOptions.inline) {
fileParsedFunc(null, contents, resolvedFilename);
} else {

// import (multiple) parse trees apparently get altered and can't be cached.
// TODO: investigate why this is
if (importManager.files[resolvedFilename]
Expand Down
2 changes: 1 addition & 1 deletion packages/less/src/less/index.js
Expand Up @@ -42,7 +42,7 @@ export default (environment, fileManagers) => {
* It's not clear what should / must be public and why.
*/
const initial = {
version: [3, 13, 0],
version: [3, 13, 1],
data,
tree,
Environment,
Expand Down

0 comments on commit 283b1b4

Please sign in to comment.