datagrok-tools 4.12.17 → 4.12.19

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.
@@ -1,8 +1,8 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
- const { parse } = require('@babel/parser');
3
+ const {parse} = require('@babel/parser');
4
4
  const traverse = require('@babel/traverse').default;
5
- const { reservedDecorators, getFuncAnnotation, generateImport, generateExport } = require('../bin/utils/func-generation');
5
+ const {reservedDecorators, getFuncAnnotation, generateImport, generateExport} = require('../bin/utils/func-generation');
6
6
 
7
7
 
8
8
  class FuncGeneratorPlugin {
@@ -28,7 +28,7 @@ class FuncGeneratorPlugin {
28
28
  sourceType: 'module',
29
29
  plugins: ['typescript', [
30
30
  'decorators',
31
- { decoratorsBeforeExport: true },
31
+ {decoratorsBeforeExport: true},
32
32
  ]],
33
33
  });
34
34
  const functions = [];
@@ -43,9 +43,9 @@ class FuncGeneratorPlugin {
43
43
  const content = fs.readFileSync(this.options.outputPath, 'utf-8');
44
44
  const output = content ? this._insertImports(content, imports) : imports.join('\n');
45
45
  fs.writeFileSync(this.options.outputPath, output, 'utf-8');
46
- } else {
46
+ } else
47
47
  fs.writeFileSync(this.options.outputPath, imports.join('\n'), 'utf-8');
48
- }
48
+
49
49
 
50
50
  fs.appendFileSync(this.options.outputPath, functions.join('\n'), 'utf-8');
51
51
  }
@@ -63,11 +63,11 @@ class FuncGeneratorPlugin {
63
63
  const files = fs.readdirSync(dir);
64
64
  for (const file of files) {
65
65
  const fullPath = path.join(dir, file);
66
- if (fs.statSync(fullPath).isDirectory()) {
66
+ if (fs.statSync(fullPath).isDirectory())
67
67
  findFiles(fullPath);
68
- } else if (extPattern.test(file) && !excludedFiles.includes(file)) {
68
+ else if (extPattern.test(file) && !excludedFiles.includes(file))
69
69
  tsFiles.push(fullPath);
70
- }
70
+
71
71
  }
72
72
  }
73
73
 
@@ -127,15 +127,15 @@ class FuncGeneratorPlugin {
127
127
  }
128
128
 
129
129
  _insertImports(content, imports) {
130
- const ast = parse(content, { sourceType: 'module', plugins: ['typescript', 'decorators'] });
130
+ const ast = parse(content, {sourceType: 'module', plugins: ['typescript', 'decorators']});
131
131
  let lastImportLoc = null;
132
132
  traverse(ast, {
133
133
  ImportDeclaration(nodePath) {
134
134
  lastImportLoc = nodePath.node.end + 1;
135
- }
135
+ },
136
136
  });
137
- return lastImportLoc === null ? imports.join('\n') + content
138
- : content.slice(0, lastImportLoc) + imports.join('\n') +
137
+ return lastImportLoc === null ? imports.join('\n') + content :
138
+ content.slice(0, lastImportLoc) + imports.join('\n') +
139
139
  (content[lastImportLoc] === '\n' ? '' : '\n') +
140
140
  content.slice(lastImportLoc, content.length);
141
141
  }
@@ -5,4 +5,4 @@
5
5
  //sample: cars.csv
6
6
  //input: dataframe table [Data table]
7
7
  //output: int count [Number of cells in table]
8
- let count = table.dim()[0] * table.dim()[1];
8
+ const count = table.dim()[0] * table.dim()[1];