gas-entry-generator
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -114,2 +114,5 @@ 'use strict'; | ||
}); | ||
} else if (node.type === 'ExportNamedDeclaration') { | ||
const functionNames = node.specifiers.map(specifier => specifier.local.name); | ||
functionNames.forEach((functionName) => entryPointFunctions.add(functionName)); | ||
} | ||
@@ -164,2 +167,5 @@ } | ||
}); | ||
} else if (node.type === 'ExportNamedDeclaration') { | ||
const functionNames = node.specifiers.map(specifier => specifier.local.name); | ||
functionNames.forEach((functionName) => globalAssignments.add(functionName)); | ||
} | ||
@@ -166,0 +172,0 @@ } |
{ | ||
"name": "gas-entry-generator", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Generator of Google Apps Script entry point function", | ||
@@ -24,6 +24,6 @@ "main": "index.js", | ||
"devDependencies": { | ||
"eslint": "8.13.0", | ||
"eslint": "8.38.0", | ||
"nyc": "15.1.0", | ||
"tap": "16.2.0" | ||
"tap": "16.3.4" | ||
} | ||
} |
export const foo = () => 'foo'; | ||
export const bar = () => 'bar'; |
import { foo } from './esm-exports'; | ||
export { bar } from './esm-exports'; | ||
/** | ||
@@ -4,0 +4,0 @@ * Leading Block Comment for foo. |
@@ -24,3 +24,3 @@ const test = require('tap').test; | ||
test('Can parse ES module syntax', function(t) { | ||
test('generate function generate entry functions from global assignments in ESModule', function(t) { | ||
const source = fs.readFileSync(__dirname + '/fixtures/esm-source.js', {encoding: 'utf8'}); | ||
@@ -33,1 +33,11 @@ const expected = fs.readFileSync(__dirname + '/fixtures/esm-expected.js', {encoding: 'utf8'}); | ||
}); | ||
test('generate function generate entry functions from export with autoGlobalExports', function(t) { | ||
const source = fs.readFileSync(__dirname + '/fixtures/esm-source.js', {encoding: 'utf8'}); | ||
const expected = fs.readFileSync(__dirname + '/fixtures/esm-expected-autoGlobalExports.js', {encoding: 'utf8'}); | ||
const expectedGlobalAssignments = fs.readFileSync(__dirname + '/fixtures/esm-exports-generated-global-assignments-expected.js', {encoding: 'utf8'}); | ||
const output = generate(source, { comment: true, autoGlobalExports: true }); | ||
t.equal(output.entryPointFunctions, expected, 'actual output will match expected'); | ||
t.equal(output.globalAssignments, expectedGlobalAssignments, 'actual output will match expected'); | ||
t.end(); | ||
}); |
Sorry, the diff of this file is not supported yet
16278
17
354