@nasl/cli 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29198,7 +29198,10 @@ function validateNormalFile(file, nameFromPath, namespace, errors) {
29198
29198
  function composeToString(files) {
29199
29199
  files.sort((a, b) => sorter(a.path, b.path));
29200
29200
  const errors = [];
29201
+ let currentLine = 1;
29201
29202
  const result = files.map((file) => {
29203
+ // 记录这个文件的开始行号
29204
+ file.startLine = currentLine;
29202
29205
  const arr = file.path.split('.');
29203
29206
  const ext = arr.pop();
29204
29207
  const nameFromPath = arr.pop();
@@ -29224,7 +29227,14 @@ function composeToString(files) {
29224
29227
  else if (isThemeCss) {
29225
29228
  content = ` $theme\`${content}\`;`;
29226
29229
  }
29227
- return `namespace ${namespace} {\n${content}\n}\n`;
29230
+ const fileContent = `namespace ${namespace} {\n${content}\n}\n`;
29231
+ // 计算这个文件占用的行数(末尾 \n 导致 split 多一个空元素,减 1 得到实际行数)
29232
+ const lineCount = fileContent.split('\n').length - 1;
29233
+ // 记录这个文件的结束行号
29234
+ file.endLine = currentLine + lineCount - 1;
29235
+ // +1 是 join('\n') 在文件之间插入的换行符
29236
+ currentLine = file.endLine + 2;
29237
+ return fileContent;
29228
29238
  })
29229
29239
  .join('\n');
29230
29240
  if (errors.length > 0) {
@@ -38182,7 +38192,7 @@ async function tryCompile(entry, options) {
38182
38192
  }
38183
38193
  }
38184
38194
 
38185
- var version = "0.2.2";
38195
+ var version = "0.2.3";
38186
38196
  var pkg = {
38187
38197
  version: version};
38188
38198