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

@stylable/language-service

Package Overview
Dependencies
Maintainers
5
Versions
165
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stylable/language-service - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

11

cjs/lib/completion-providers.js

@@ -659,3 +659,4 @@ "use strict";

// selectoid is a CSS native pseudo-sclass
core_1.nativePseudoClasses.indexOf(lastSelectoid.replace(':', '')) !== -1 ||
core_1.nativePseudoClasses.indexOf(lastSelectoid.replace(':', '')) !==
-1 ||
allStates.hasOwnProperty(lastSelectoid.replace(':', ''))) &&

@@ -666,9 +667,5 @@ chunkyStates.every(cs => cs !== k)) {

// if (stateDef) {
const stateType = stateDef && typeof stateDef === 'object'
? stateDef.type
: null;
const stateType = stateDef && typeof stateDef === 'object' ? stateDef.type : null;
acc[k] = {
path: meta.source === cur.meta.source
? 'Local file'
: relPath,
path: meta.source === cur.meta.source ? 'Local file' : relPath,
hasParam: !!stateDef,

@@ -675,0 +672,0 @@ type: stateType

@@ -1319,4 +1319,3 @@ "use strict";

meta.mappedSymbols[word].alias) {
imp = stylable.resolver.resolveImport(meta.mappedSymbols[word]
.alias);
imp = stylable.resolver.resolveImport(meta.mappedSymbols[word].alias);
}

@@ -1323,0 +1322,0 @@ else if (meta.mappedSymbols[word]._kind === 'class') {

{
"name": "@stylable/language-service",
"version": "3.0.1",
"version": "3.1.0",
"description": "Stylable Language Services - syntax highlighting, completions, hinting and more for the Stylable CSS preprocessor.",

@@ -15,9 +15,9 @@ "main": "./cjs/index.js",

"dependencies": {
"@file-services/node": "^2.1.0",
"@file-services/typescript": "^2.1.0",
"@stylable/core": "^3.0.0",
"@file-services/node": "^2.1.1",
"@file-services/typescript": "^2.1.2",
"@stylable/core": "^3.1.0",
"css-selector-tokenizer": "^0.7.1",
"postcss": "^7.0.24",
"postcss": "^7.0.25",
"postcss-value-parser": "^4.0.2",
"typescript": "~3.7.3",
"typescript": "~3.7.4",
"vscode-css-languageservice": "^4.0.2",

@@ -41,3 +41,3 @@ "vscode-languageserver": "^5.2.1",

"license": "BSD-3-Clause",
"gitHead": "ed32a3f8cb53d509705f886c14be1edb4de12b4c"
"gitHead": "8a4adb3f4741359c5c9ae4f0b9a1195a78251338"
}

@@ -1098,50 +1098,41 @@ import path from 'path';

const newStates = lastNode.resolved.reduce(
(acc, cur) => {
let relPath = path.relative(path.dirname(meta.source), cur.meta.source);
if (!relPath.startsWith('.')) {
relPath = './' + relPath;
}
const symbol = cur.symbol;
if (symbol._kind === 'class') {
const symbolStates = symbol[valueMapping.states];
const newStates = lastNode.resolved.reduce((acc, cur) => {
let relPath = path.relative(path.dirname(meta.source), cur.meta.source);
if (!relPath.startsWith('.')) {
relPath = './' + relPath;
}
const symbol = cur.symbol;
if (symbol._kind === 'class') {
const symbolStates = symbol[valueMapping.states];
if (symbolStates) {
Object.keys(symbolStates).forEach(k => {
if (
!acc[k] &&
// selectoid is a substring of current state
(k.slice(0, -1).startsWith(lastSelectoid.replace(':', '')) ||
// selectoid is a CSS native pseudo-sclass
nativePseudoClasses.indexOf(
lastSelectoid.replace(':', '')
) !== -1 ||
allStates.hasOwnProperty(lastSelectoid.replace(':', ''))) &&
chunkyStates.every(cs => cs !== k)
) {
const symbolStates = symbol[valueMapping.states];
const stateDef = symbolStates && symbolStates[k];
if (symbolStates) {
Object.keys(symbolStates).forEach(k => {
if (
!acc[k] &&
// selectoid is a substring of current state
(k.slice(0, -1).startsWith(lastSelectoid.replace(':', '')) ||
// selectoid is a CSS native pseudo-sclass
nativePseudoClasses.indexOf(lastSelectoid.replace(':', '')) !==
-1 ||
allStates.hasOwnProperty(lastSelectoid.replace(':', ''))) &&
chunkyStates.every(cs => cs !== k)
) {
const symbolStates = symbol[valueMapping.states];
const stateDef = symbolStates && symbolStates[k];
// if (stateDef) {
const stateType =
stateDef && typeof stateDef === 'object'
? stateDef.type
: null;
acc[k] = {
path:
meta.source === cur.meta.source
? 'Local file'
: relPath,
hasParam: !!stateDef,
type: stateType
};
// }
}
});
}
// if (stateDef) {
const stateType =
stateDef && typeof stateDef === 'object' ? stateDef.type : null;
acc[k] = {
path: meta.source === cur.meta.source ? 'Local file' : relPath,
hasParam: !!stateDef,
type: stateType
};
// }
}
});
}
return acc;
},
{} as { [k: string]: { path: string; hasParam: boolean; type: string | null } }
);
}
return acc;
}, {} as { [k: string]: { path: string; hasParam: boolean; type: string | null } });

@@ -1148,0 +1139,0 @@ const states = Object.keys(newStates).map(k => {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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