New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vscode-css-languageservice

Package Overview
Dependencies
Maintainers
5
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-css-languageservice - npm Package Compare versions

Comparing version 5.1.4 to 5.1.5

14

lib/esm/utils/resources.js

@@ -5,6 +5,10 @@ /*---------------------------------------------------------------------------------------------

*--------------------------------------------------------------------------------------------*/
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -20,3 +24,3 @@ import { URI, Utils } from 'vscode-uri';

}
return Utils.joinPath.apply(Utils, __spreadArray([URI.parse(uriString)], paths)).toString();
return Utils.joinPath.apply(Utils, __spreadArray([URI.parse(uriString)], paths, false)).toString();
}

@@ -60,3 +60,3 @@ var __extends = (this && this.__extends) || (function () {

var end = offset + length;
var idx = arrays_1.findFirst(this.children, function (s) { return s.offset > end; });
var idx = (0, arrays_1.findFirst)(this.children, function (s) { return s.offset > end; });
if (idx === 0) {

@@ -63,0 +63,0 @@ // all scopes have offsets larger than our end

@@ -47,3 +47,3 @@ (function (factory) {

this.cssDataManager.getProperties().forEach(function (p) {
var score = strings_1.difference(propertyName, p.name);
var score = (0, strings_1.difference)(propertyName, p.name);
if (score >= propertyName.length / 2 /*score_lim*/) {

@@ -50,0 +50,0 @@ candidates.push({ property: p.name, score: score });

@@ -264,3 +264,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

insertText = entry.name;
if (!objects_1.isDefined(declaration.colonPosition)) {
if (!(0, objects_1.isDefined)(declaration.colonPosition)) {
insertText += ': ';

@@ -833,7 +833,7 @@ retrigger = true;

var declaration = node;
if (!objects_1.isDefined(declaration.colonPosition) || this.offset <= declaration.colonPosition) {
if (!(0, objects_1.isDefined)(declaration.colonPosition) || this.offset <= declaration.colonPosition) {
// complete property
return this.getCompletionsForDeclarationProperty(declaration, result);
}
else if ((objects_1.isDefined(declaration.semicolonPosition) && declaration.semicolonPosition < this.offset)) {
else if (((0, objects_1.isDefined)(declaration.semicolonPosition) && declaration.semicolonPosition < this.offset)) {
if (this.offset === declaration.semicolonPosition + 1) {

@@ -862,3 +862,3 @@ return result; // don't show new properties right after semicolon (see Bug 15421:[intellisense] [css] Be less aggressive when manually typing CSS)

CSSCompletion.prototype.getCompletionsForVariableDeclaration = function (declaration, result) {
if (this.offset && objects_1.isDefined(declaration.colonPosition) && this.offset > declaration.colonPosition) {
if (this.offset && (0, objects_1.isDefined)(declaration.colonPosition) && this.offset > declaration.colonPosition) {
this.getVariableProposals(declaration.getValue(), result);

@@ -953,3 +953,3 @@ }

if (child instanceof nodes.Declaration) {
if (!objects_1.isDefined(child.colonPosition) || this.offset <= child.colonPosition) {
if (!(0, objects_1.isDefined)(child.colonPosition) || this.offset <= child.colonPosition) {
return this.getCompletionsForDeclarationProperty(child, result);

@@ -965,3 +965,3 @@ }

}
if (objects_1.isDefined(supportsCondition.lParent) && this.offset > supportsCondition.lParent && (!objects_1.isDefined(supportsCondition.rParent) || this.offset <= supportsCondition.rParent)) {
if ((0, objects_1.isDefined)(supportsCondition.lParent) && this.offset > supportsCondition.lParent && (!(0, objects_1.isDefined)(supportsCondition.rParent) || this.offset <= supportsCondition.rParent)) {
return this.getCompletionsForDeclarationProperty(null, result);

@@ -1033,4 +1033,4 @@ }

var _a, _b, _c;
if (!objects_1.isDefined(this.supportsMarkdown)) {
if (!objects_1.isDefined(this.lsOptions.clientCapabilities)) {
if (!(0, objects_1.isDefined)(this.supportsMarkdown)) {
if (!(0, objects_1.isDefined)(this.lsOptions.clientCapabilities)) {
this.supportsMarkdown = true;

@@ -1037,0 +1037,0 @@ return this.supportsMarkdown;

@@ -57,3 +57,3 @@ (function (factory) {

*/
if (!strings_1.startsWith(node.getText(), '@')) {
if (!(0, strings_1.startsWith)(node.getText(), '@')) {
hover = {

@@ -151,4 +151,4 @@ contents: this.selectorPrinting.simpleSelectorToMarkedString(node),

CSSHover.prototype.doesSupportMarkdown = function () {
if (!objects_1.isDefined(this.supportsMarkdown)) {
if (!objects_1.isDefined(this.clientCapabilities)) {
if (!(0, objects_1.isDefined)(this.supportsMarkdown)) {
if (!(0, objects_1.isDefined)(this.clientCapabilities)) {
this.supportsMarkdown = true;

@@ -155,0 +155,0 @@ return this.supportsMarkdown;

@@ -199,3 +199,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

}
if (strings_1.startsWith(rawUri, "'") || strings_1.startsWith(rawUri, "\"")) {
if ((0, strings_1.startsWith)(rawUri, "'") || (0, strings_1.startsWith)(rawUri, "\"")) {
rawUri = rawUri.slice(1, -1);

@@ -220,3 +220,3 @@ }

var rawText = candidate.getText();
if (strings_1.startsWith(rawText, "'") || strings_1.startsWith(rawText, "\"")) {
if ((0, strings_1.startsWith)(rawText, "'") || (0, strings_1.startsWith)(rawText, "\"")) {
collect(candidate);

@@ -310,3 +310,3 @@ }

result.push({ label: label, textEdit: cssLanguageTypes_1.TextEdit.replace(range, label) });
var hsl = facts_1.hslFromColor(color);
var hsl = (0, facts_1.hslFromColor)(color);
if (hsl.a === 1) {

@@ -337,6 +337,6 @@ label = "hsl(" + hsl.h + ", " + Math.round(hsl.s * 100) + "%, " + Math.round(hsl.l * 100) + "%)";

ref = ref.substring(1);
if (!strings_1.startsWith(documentUri, 'file://')) return [3 /*break*/, 2];
if (!(0, strings_1.startsWith)(documentUri, 'file://')) return [3 /*break*/, 2];
moduleName = getModuleNameFromPath(ref);
rootFolderUri = documentContext.resolveReference('/', documentUri);
documentFolderUri = resources_1.dirname(documentUri);
documentFolderUri = (0, resources_1.dirname)(documentUri);
return [4 /*yield*/, this.resolvePathToModule(moduleName, documentFolderUri, rootFolderUri)];

@@ -347,3 +347,3 @@ case 1:

pathWithinModule = ref.substring(moduleName.length + 1);
return [2 /*return*/, resources_1.joinPath(modulePath, pathWithinModule)];
return [2 /*return*/, (0, resources_1.joinPath)(modulePath, pathWithinModule)];
}

@@ -363,10 +363,10 @@ _a.label = 2;

case 0:
packPath = resources_1.joinPath(documentFolderUri, 'node_modules', _moduleName, 'package.json');
packPath = (0, resources_1.joinPath)(documentFolderUri, 'node_modules', _moduleName, 'package.json');
return [4 /*yield*/, this.fileExists(packPath)];
case 1:
if (_a.sent()) {
return [2 /*return*/, resources_1.dirname(packPath)];
return [2 /*return*/, (0, resources_1.dirname)(packPath)];
}
else if (rootFolderUri && documentFolderUri.startsWith(rootFolderUri) && (documentFolderUri.length !== rootFolderUri.length)) {
return [2 /*return*/, this.resolvePathToModule(_moduleName, resources_1.dirname(documentFolderUri), rootFolderUri)];
return [2 /*return*/, this.resolvePathToModule(_moduleName, (0, resources_1.dirname)(documentFolderUri), rootFolderUri)];
}

@@ -409,3 +409,3 @@ return [2 /*return*/, undefined];

function getColorInformation(node, document) {
var color = facts_1.getColorValue(node);
var color = (0, facts_1.getColorValue)(node);
if (color) {

@@ -412,0 +412,0 @@ var range = getRange(node, document);

@@ -265,10 +265,10 @@ (function (factory) {

/////////////////////////////////////////////////////////////
var boxModel = lintUtil_1.default(propertyTable);
var boxModel = (0, lintUtil_1.default)(propertyTable);
if (boxModel.width) {
var properties = [];
if (boxModel.right.value) {
properties = arrays_1.union(properties, boxModel.right.properties);
properties = (0, arrays_1.union)(properties, boxModel.right.properties);
}
if (boxModel.left.value) {
properties = arrays_1.union(properties, boxModel.left.properties);
properties = (0, arrays_1.union)(properties, boxModel.left.properties);
}

@@ -286,6 +286,6 @@ if (properties.length !== 0) {

if (boxModel.top.value) {
properties = arrays_1.union(properties, boxModel.top.properties);
properties = (0, arrays_1.union)(properties, boxModel.top.properties);
}
if (boxModel.bottom.value) {
properties = arrays_1.union(properties, boxModel.bottom.properties);
properties = (0, arrays_1.union)(properties, boxModel.bottom.properties);
}

@@ -292,0 +292,0 @@ if (properties.length !== 0) {

@@ -30,3 +30,3 @@ (function (factory) {

if (value) {
if (!arrays_1.includes(state.properties, property)) {
if (!(0, arrays_1.includes)(state.properties, property)) {
state.properties.push(property);

@@ -33,0 +33,0 @@ }

@@ -112,3 +112,3 @@ /*---------------------------------------------------------------------------------------------

suggestions.forEach(function (s) {
if (strings_1.startsWith(s.label, '_') && strings_1.endsWith(s.label, '.scss')) {
if ((0, strings_1.startsWith)(s.label, '_') && (0, strings_1.endsWith)(s.label, '.scss')) {
if (s.textEdit) {

@@ -143,3 +143,3 @@ s.textEdit.newText = s.label.slice(1, -5);

fullValue = stripQuotes(pathValue);
isValueQuoted = strings_1.startsWith(pathValue, "'") || strings_1.startsWith(pathValue, "\"");
isValueQuoted = (0, strings_1.startsWith)(pathValue, "'") || (0, strings_1.startsWith)(pathValue, "\"");
valueBeforeCursor = isValueQuoted

@@ -164,3 +164,3 @@ ? fullValue.slice(0, position.character - (range.start.character + 1))

// Exclude paths that start with `.`
if (name.charCodeAt(0) !== CharCode_dot && (type === cssLanguageTypes_1.FileType.Directory || resources_1.joinPath(parentDir, name) !== currentDocUri)) {
if (name.charCodeAt(0) !== CharCode_dot && (type === cssLanguageTypes_1.FileType.Directory || (0, resources_1.joinPath)(parentDir, name) !== currentDocUri)) {
result.push(createCompletionItem(name, type === cssLanguageTypes_1.FileType.Directory, replaceRange));

@@ -183,3 +183,3 @@ }

function stripQuotes(fullValue) {
if (strings_1.startsWith(fullValue, "'") || strings_1.startsWith(fullValue, "\"")) {
if ((0, strings_1.startsWith)(fullValue, "'") || (0, strings_1.startsWith)(fullValue, "\"")) {
return fullValue.slice(1, -1);

@@ -186,0 +186,0 @@ }

@@ -128,3 +128,3 @@ var __extends = (this && this.__extends) || (function () {

case 0:
if (strings_1.startsWith(ref, 'sass:')) {
if ((0, strings_1.startsWith)(ref, 'sass:')) {
return [2 /*return*/, undefined]; // sass library

@@ -131,0 +131,0 @@ }

@@ -5,6 +5,10 @@ /*---------------------------------------------------------------------------------------------

*--------------------------------------------------------------------------------------------*/
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -33,5 +37,5 @@ (function (factory) {

}
return vscode_uri_1.Utils.joinPath.apply(vscode_uri_1.Utils, __spreadArray([vscode_uri_1.URI.parse(uriString)], paths)).toString();
return vscode_uri_1.Utils.joinPath.apply(vscode_uri_1.Utils, __spreadArray([vscode_uri_1.URI.parse(uriString)], paths, false)).toString();
}
exports.joinPath = joinPath;
});
{
"name": "vscode-css-languageservice",
"version": "5.1.4",
"version": "5.1.5",
"description": "Language service for CSS, LESS and SCSS",

@@ -20,9 +20,9 @@ "main": "./lib/umd/cssLanguageService.js",

"@types/node": "^10.12.21",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"eslint": "^7.27.0",
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"eslint": "^7.32.0",
"mocha": "^8.4.0",
"rimraf": "^3.0.2",
"typescript": "^4.3.2",
"vscode-web-custom-data": "^0.3.4"
"typescript": "^4.4.2",
"vscode-web-custom-data": "^0.3.5"
},

@@ -29,0 +29,0 @@ "dependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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