mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
Address feedback
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { CSSData } from 'vscode-css-languageservice';
|
||||
|
||||
export function parseCSSData(source: string): CSSData {
|
||||
let rawData: any;
|
||||
|
||||
try {
|
||||
rawData = JSON.parse(source);
|
||||
} catch (err) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return {
|
||||
properties: rawData.properties || [],
|
||||
atDirectives: rawData.atdirectives || [],
|
||||
pseudoClasses: rawData.pseudoclasses || [],
|
||||
pseudoElements: rawData.pseudoelements || []
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user