diff options
| author | Alban Auzeill | 2019-12-23 14:38:46 +0100 | 
|---|---|---|
| committer | Elena Vilchik | 2019-12-23 14:38:46 +0100 | 
| commit | e1084ab0bee42625105ff332365b05ab30654d47 (patch) | |
| tree | 56ed1f1d404b378db88e334294f2ba3a5022c72b /sonar-css-plugin/css-bundle/src/server.ts | |
| parent | 0161362db5e83f700dded8ff052b358a3f478640 (diff) | |
| download | sonar-css-e1084ab0bee42625105ff332365b05ab30654d47.tar.bz2 | |
Send file content to NodeJS process if encoding not UFT-8 (#224)
Diffstat (limited to 'sonar-css-plugin/css-bundle/src/server.ts')
| -rw-r--r-- | sonar-css-plugin/css-bundle/src/server.ts | 7 | 
1 files changed, 4 insertions, 3 deletions
| diff --git a/sonar-css-plugin/css-bundle/src/server.ts b/sonar-css-plugin/css-bundle/src/server.ts index 05405c8..93bb6cb 100644 --- a/sonar-css-plugin/css-bundle/src/server.ts +++ b/sonar-css-plugin/css-bundle/src/server.ts @@ -53,9 +53,9 @@ function analyzeWithStylelint(    response: express.Response  ) {    const parsedRequest = request.body as AnalysisInput; -  const { filePath, configFile } = parsedRequest; -  const code = getFileContent(filePath); - +  const { filePath, fileContent, configFile } = parsedRequest; +  const code = +    typeof fileContent == "string" ? fileContent : getFileContent(filePath);    const options = {      code,      codeFilename: filePath, @@ -106,6 +106,7 @@ function getFileContent(filePath: string) {  export interface AnalysisInput {    filePath: string; +  fileContent: string | undefined;    configFile: string;  } | 
