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

ts-runtime

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

ts-runtime - npm Package Compare versions

Comparing version 0.1.30 to 0.1.32

lib/ts-runtime.lib.js

6

host.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var path = require("path");
var ts = require("typescript");
var transform_1 = require("./transform");
var Host = /** @class */ (function () {

@@ -23,3 +23,2 @@ function Host(files, compilerOptions, setParentNodes) {

var result = [];
var path = transform_1.getPathModule();
var cwd = process.cwd();

@@ -53,11 +52,8 @@ this.outputs.forEach(function (text, name) {

Host.prototype.getDefaultLibFileName = function (options) {
var path = transform_1.getPathModule();
return path.join(path.resolve(path.dirname(this.defaultLibFileName)), path.basename(this.defaultLibFileName));
};
Host.prototype.getDefaultLibLocation = function () {
var path = transform_1.getPathModule();
return path.resolve(this.defaultLibLocation);
};
Host.prototype.getCurrentDirectory = function () {
var path = transform_1.getPathModule();
return path.resolve(this.currentDirectory);

@@ -64,0 +60,0 @@ };

import * as t from 'flow-runtime';
export declare const lib: any;
export default t;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var t = require("flow-runtime");
// const map: Map<string, any> = new Map();
var voidType = t.void;
var typeOf = t.typeOf;
// const intersect = t.intersect;
// const declare = t.declare;
// const ref = t.ref;
// const decorate = t.decorate;
// t.decorate = (type: any, shouldAssert?: boolean) => {
// return (input: any, propertyName: any, descriptor: any) => {
// const decorator = decorate.bind(t)(type, shouldAssert)(input, propertyName, descriptor);
// if (descriptor) descriptor.writable = true;
// input.writable = true;
// Object.defineProperty(input, propertyName, decorator);
// };
// }
//
// t.declare = (name: string, type: any) => {
// map.set(name, type);
// declare.bind(t)(name, type);
// }
//
// t.ref = (type: any, ...args: any[]) => {
// if (typeof type === 'string') {
// if (map.has(type)) {
// type = map.get(type);
// }
// }
//
// return ref.bind(t)(type, ...args);
// }
// t.intersect = (...args: any[]) => {
// return intersect.bind(t)(...args).unwrap();
// }
//
// t.intersection = (...args: any[]) => {
// return t.intersect(...args);
// }
t.undef = function () {

@@ -91,2 +56,38 @@ return voidType.bind(t)();

};
exports.lib = t;
exports.default = t;
// const map: Map<string, any> = new Map();
// const intersect = t.intersect;
// const declare = t.declare;
// const ref = t.ref;
// const decorate = t.decorate;
// t.decorate = (type: any, shouldAssert?: boolean) => {
// return (input: any, propertyName: any, descriptor: any) => {
// const decorator = decorate.bind(t)(type, shouldAssert)(input, propertyName, descriptor);
// if (descriptor) descriptor.writable = true;
// input.writable = true;
// Object.defineProperty(input, propertyName, decorator);
// };
// }
//
// t.declare = (name: string, type: any) => {
// map.set(name, type);
// declare.bind(t)(name, type);
// }
//
// t.ref = (type: any, ...args: any[]) => {
// if (typeof type === 'string') {
// if (map.has(type)) {
// type = map.get(type);
// }
// }
//
// return ref.bind(t)(type, ...args);
// }
// t.intersect = (...args: any[]) => {
// return intersect.bind(t)(...args).unwrap();
// }
//
// t.intersection = (...args: any[]) => {
// return t.intersect(...args);
// }

@@ -13,5 +13,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var path = require("path");
var ts = require("typescript");
var util = require("../util");
var transform_1 = require("../transform");
var Mutator_1 = require("./Mutator");

@@ -26,3 +26,2 @@ var SourceFileMutator = /** @class */ (function (_super) {

SourceFileMutator.prototype.mutate = function (node) {
var path = transform_1.getPathModule();
var statements = util.arrayFromNodeArray(node.statements);

@@ -29,0 +28,0 @@ var declarations = [];

{
"name": "ts-runtime",
"version": "0.1.30",
"version": "0.1.32",
"description": "Runtime type checks for TypeScript",

@@ -19,3 +19,5 @@ "main": "index.js",

"coveralls": "./node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls",
"build": "./node_modules/.bin/tsc --rootDir src --outDir dist --module CommonJS --target es5 --skipLibCheck && cp package.json dist/package.json && cp README.md dist/README.md && cp LICENSE dist/LICENSE",
"build": "npm run build:tsr && npm run build:lib",
"build:tsr": "./node_modules/.bin/tsc --rootDir src --outDir dist --module CommonJS --target es5 --skipLibCheck && cp package.json dist/package.json && cp README.md dist/README.md && cp LICENSE dist/LICENSE",
"build:lib": "node_modules/.bin/webpack --config src/lib/build/webpack.config.js",
"build:docs": "node_modules/.bin/gulp --gulpfile src/docs/build/gulpfile.js build",

@@ -33,3 +35,2 @@ "build:lkg": "ts-node ./src/bin/index src/index src/lib/index src/bin/index src/bin/process --libDeclarations --moduleAlias --compilerOptions '{\"outDir\": \"lkg\", \"strictNullChecks\": false, \"moduleResolution\": \"Node\", \"module\": \"commonjs\", \"target\": \"ES2015\", \"lib\": [\"ESNext\"]}'"

"ora": "^1.2.0",
"path-browserify": "^0.0.0",
"pretty-time": "^0.2.0",

@@ -71,5 +72,5 @@ "regenerator-runtime": "^0.10.5",

"ts-node": "^3.3.0",
"webpack": "^2.2.0",
"webpack": "^3.5.5",
"worker-loader": "^0.8.1"
}
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var path = require("path");
var ts = require("typescript");
var util = require("./util");
var transform_1 = require("./transform");
var Scanner = /** @class */ (function () {

@@ -125,3 +125,2 @@ function Scanner(program, options) {

Scanner.prototype.pathIsExternal = function (fileName) {
var path = transform_1.getPathModule();
var r = this.program.getCompilerOptions().rootDir;

@@ -194,39 +193,2 @@ var rootDir = !r ? '' : r + path.sep;

this.properties.set(node, typeInfo);
// if (nodeSymbol && nodeSymbol.name === 'FunctionTypeNode') {
// console.log()
// console.log("FunctionTypeNode")
// console.log(ts.SymbolFlags[nodeSymbol.flags])
// console.log(typeInfo.isTsrDeclaration())
// console.log()
//
// console.log('isExternal', typeInfo.isExternal);
// console.log('isExternalModule', typeInfo.isExternalModule);
// console.log('TSR_DECLARATION', (typeInfo as any).TSR_DECLARATION)
// console.log('isAllowedDeclarationSymbol', this.isAllowedDeclarationSymbol(nodeSymbol))
// console.log('isPartOfTypeNode', util.isPartOfTypeNode(node))
// console.log('isInDeclarationFile', typeInfo.isInDeclarationFile);
// console.log(typeInfo.fileNames)
//
// console.log();
// }
// TODO: check why the symbol points to FunctionDeclarationLikeNode in factory.ts
//if (nodeSymbol && nodeSymbol.name === 'FunctionLikeDeclaration') {
// console.log()
// console.log("FunctionLikeDeclaration")
// console.log(ts.SymbolFlags[nodeSymbol.flags])
// console.log(typeInfo.isTsrDeclaration())
// console.log()
// typeInfo.declarations.map(decl => decl.getText())
// console.log()
//
// console.log('isExternal', typeInfo.isExternal);
// console.log('isExternalModule', typeInfo.isExternalModule);
// console.log('TSR_DECLARATION', (typeInfo as any).TSR_DECLARATION)
// console.log('isAllowedDeclarationSymbol', this.isAllowedDeclarationSymbol(nodeSymbol))
// console.log('isPartOfTypeNode', util.isPartOfTypeNode(node))
// console.log('isInDeclarationFile', typeInfo.isInDeclarationFile);
// console.log(typeInfo.fileNames)
//
// console.log();
//}
return node;

@@ -233,0 +195,0 @@ };

@@ -5,3 +5,2 @@ import { FileReflection } from './host';

export declare function transformReflection(rootNames: string | string[], reflections: FileReflection[], options?: Options): FileReflection[];
export declare function getPathModule(): any;
export declare function getOptions(options?: Options): Options;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var path = require("path");
var format = require("pretty-time");

@@ -14,4 +15,2 @@ var rimraf = require("rimraf");

var scanner_1 = require("./scanner");
var pathReflection = require('path-browserify');
var path = require('path');
var start, elapsed;

@@ -23,10 +22,5 @@ function transform(rootNames, options) {

function transformReflection(rootNames, reflections, options) {
path = pathReflection;
return result(transformProgram(rootNames, options, reflections));
}
exports.transformReflection = transformReflection;
function getPathModule() {
return path;
}
exports.getPathModule = getPathModule;
function getOptions(options) {

@@ -33,0 +27,0 @@ if (options === void 0) { options = {}; }

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