How to use ts2gas - 1 common examples

To help you get started, we’ve selected a few ts2gas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github google / clasp / src / files.ts View on Github external
.map((name, i) => {
        const normalizedName = path.normalize(name);

        let type = getAPIFileType(name);

        // File source
        let source = fs.readFileSync(name).toString();
        if (type === 'TS') {
          // Transpile TypeScript to Google Apps Script
          // @see github.com/grant/ts2gas
          source = ts2gas(source, userConf);
          type = 'SERVER_JS';
        }

        // Formats rootDir/appsscript.json to appsscript.json.
        // Preserves subdirectory names in rootDir
        // (rootDir/foo/Code.js becomes foo/Code.js)
        const formattedName = getAppsScriptFileName(rootDir, name);

        // If the file is valid, return the file in a format suited for the Apps Script API.
        if (isValidFileName(name, type, rootDir, normalizedName, filesToIgnore)) {
          nonIgnoredFilePaths.push(name);
          const file: AppsScriptFile = {
            name: formattedName, // the file base name
            type, // the file extension
            source, // the file contents
          };

ts2gas

A function that transpiles TypeScript to Google Apps Script.

MIT
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis

Popular ts2gas functions

Similar packages