wishthis/node_modules/less/lib/less/utils.js.map
2023-08-17 11:47:40 +02:00

1 line
No EOL
6.8 KiB
Text

{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/less/utils.js"],"names":[],"mappings":";;;;AAAA,wBAAwB;AACxB,6DAAyC;AACzC,+CAAqC;AAErC,SAAgB,WAAW,CAAC,KAAK,EAAE,WAAW;IAC1C,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;IAClB,IAAI,IAAI,GAAG,IAAI,CAAC;IAChB,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC;IAEhB,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;QAC/C,MAAM,EAAE,CAAC;KACZ;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC3B,IAAI,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;KAClE;IAED,OAAO;QACH,IAAI,MAAA;QACJ,MAAM,QAAA;KACT,CAAC;AACN,CAAC;AAjBD,kCAiBC;AAED,SAAgB,SAAS,CAAC,GAAG;IACzB,IAAI,CAAC,CAAC;IACN,IAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAC1B,IAAM,IAAI,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAE/B,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QACzB,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;KACpB;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AATD,8BASC;AAED,SAAgB,KAAK,CAAC,GAAG;IACrB,IAAM,MAAM,GAAG,EAAE,CAAC;IAClB,KAAK,IAAM,IAAI,IAAI,GAAG,EAAE;QACpB,IAAI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A,WAAW;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,QAAM,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,QAAM,EAAE,CAAC,EAAE,EAAE;QAClD,IAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;YACtB,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;SAC/B;aAAM;YACH,IAAI,KAAK,KAAK,SAAS,EAAE;gBACrB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACtB;SACJ;KACJ;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAZD,oCAYC;AAED,SAAgB,iBAAiB,CAAC,GAAG;IACjC,OAAO,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,CAAA;AAC5C,CAAC;AAFD,8CAEC","sourcesContent":["/* jshint proto: true */\nimport * as Constants from './constants';\nimport { copy } from 'copy-anything';\n\nexport function getLocation(index, inputStream) {\n let n = index + 1;\n let line = null;\n let column = -1;\n\n while (--n >= 0 && inputStream.charAt(n) !== '\\n') {\n column++;\n }\n\n if (typeof index === 'number') {\n line = (inputStream.slice(0, index).match(/\\n/g) || '').length;\n }\n\n return {\n line,\n column\n };\n}\n\nexport function copyArray(arr) {\n let i;\n const length = arr.length;\n const copy = new Array(length);\n\n for (i = 0; i < length; i++) {\n copy[i] = arr[i];\n }\n return copy;\n}\n\nexport function clone(obj) {\n const cloned = {};\n for (const prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n cloned[prop] = obj[prop];\n }\n }\n return cloned;\n}\n\nexport function defaults(obj1, obj2) {\n let newObj = obj2 || {};\n if (!obj2._defaults) {\n newObj = {};\n const defaults = copy(obj1);\n newObj._defaults = defaults;\n const cloned = obj2 ? copy(obj2) : {};\n Object.assign(newObj, defaults, cloned);\n }\n return newObj;\n}\n\nexport function copyOptions(obj1, obj2) {\n if (obj2 && obj2._defaults) {\n return obj2;\n }\n const opts = defaults(obj1, obj2);\n if (opts.strictMath) {\n opts.math = Constants.Math.PARENS;\n }\n // Back compat with changed relativeUrls option\n if (opts.relativeUrls) {\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n }\n if (typeof opts.math === 'string') {\n switch (opts.math.toLowerCase()) {\n case 'always':\n opts.math = Constants.Math.ALWAYS;\n break;\n case 'parens-division':\n opts.math = Constants.Math.PARENS_DIVISION;\n break;\n case 'strict':\n case 'parens':\n opts.math = Constants.Math.PARENS;\n break;\n default:\n opts.math = Constants.Math.PARENS;\n }\n }\n if (typeof opts.rewriteUrls === 'string') {\n switch (opts.rewriteUrls.toLowerCase()) {\n case 'off':\n opts.rewriteUrls = Constants.RewriteUrls.OFF;\n break;\n case 'local':\n opts.rewriteUrls = Constants.RewriteUrls.LOCAL;\n break;\n case 'all':\n opts.rewriteUrls = Constants.RewriteUrls.ALL;\n break;\n }\n }\n return opts;\n}\n\nexport function merge(obj1, obj2) {\n for (const prop in obj2) {\n if (Object.prototype.hasOwnProperty.call(obj2, prop)) {\n obj1[prop] = obj2[prop];\n }\n }\n return obj1;\n}\n\nexport function flattenArray(arr, result = []) {\n for (let i = 0, length = arr.length; i < length; i++) {\n const value = arr[i];\n if (Array.isArray(value)) {\n flattenArray(value, result);\n } else {\n if (value !== undefined) {\n result.push(value);\n }\n }\n }\n return result;\n}\n\nexport function isNullOrUndefined(val) {\n return val === null || val === undefined\n}"]}