Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tsun

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsun - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

13

bin/src/service.js
/// <reference path='../typings/node.d.ts' />
/// <reference path='../typings/colors.d.ts' />
/// <reference path='../typings/diff.d.ts' />
"use strict";

@@ -7,2 +8,3 @@ var ts = require('typescript');

var fs = require('fs');
var diff = require('diff');
var DUMMY_FILE = 'TSUN.repl.generated.ts';

@@ -50,3 +52,2 @@ // codes has been accepted by service, as opposed to codes in buffer and user input

var options = optionsRet.options;
console.log(options);
options['noEmitHelpers'] = true;

@@ -228,8 +229,9 @@ options['module'] = ts.ModuleKind.CommonJS;

exports.getDiagnostics = getDiagnostics;
var storedLine = 0;
var lastOutput = '';
function getCurrentCode() {
var emit = service.getEmitOutput(DUMMY_FILE);
var lines = emit.outputFiles[0].text.split('\r\n').filter(function (k) { return !!k; });
var ret = lines.slice(storedLine).join('\n');
storedLine = lines.length;
var output = emit.outputFiles[0].text;
var changes = diff.diffLines(lastOutput, output);
var ret = changes.filter(function (c) { return c.added; }).map(function (c) { return c.value; }).join('\n');
lastOutput = output;
return ret;

@@ -249,3 +251,4 @@ }

exports.acceptedCodes = getInitialCommands();
lastOutput = '';
}
exports.clearHistory = clearHistory;
{
"name": "tsun",
"version": "0.2.2",
"version": "0.2.3",
"description": "TSUN: a repl for TypeScript Upgraded Node",

@@ -8,3 +8,4 @@ "bin": "./bin/tsun",

"colors": "^1.0.3",
"node-color-readline": "git+https://github.com/HerringtonDarkholme/node-color-readline.git",
"diff": "^2.2.3",
"node-color-readline": "^1.0.1",
"optimist": "^0.6.1",

@@ -14,2 +15,5 @@ "temp": "^0.8.1",

},
"files": [
"bin/"
],
"scripts": {

@@ -16,0 +20,0 @@ "prepublish": "tsc -m commonjs --outdir ./bin tsun.ts"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc