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

typescript-is

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-is - npm Package Compare versions

Comparing version 0.16.0 to 0.16.1

1

index.d.ts

@@ -170,2 +170,3 @@ /**

public readonly reason: Reason;
public readonly input: unknown;
}

@@ -172,0 +173,0 @@

@@ -11,8 +11,23 @@ let defaultGetErrorObject = undefined;

function inputObjectAtPath(path, inputObject) {
let subField = inputObject;
for (const key of path.slice(1)) {
subField = subField[
key.startsWith("[") ? parseInt(key.replace("[", "").replace("]", "")) : key
];
}
return subField;
}
function appendInputToErrorMessage(message, path, inputObject) {
return message + ', found: ' + JSON.stringify(inputObjectAtPath(path, inputObject));
}
class TypeGuardError extends Error {
constructor(errorObject) {
super(errorObject.message);
constructor(errorObject, inputObject) {
super(appendInputToErrorMessage(errorObject.message, errorObject.path, inputObject));
this.name = 'TypeGuardError';
this.path = errorObject.path;
this.reason = errorObject.reason;
this.input = inputObject
}

@@ -41,3 +56,3 @@ }

if (errorObject !== null) {
throw new errorConstructor(errorObject);
throw new errorConstructor(errorObject, args[i]);
}

@@ -64,3 +79,3 @@ }

} else {
throw new TypeGuardError(errorObject);
throw new TypeGuardError(errorObject, obj);
}

@@ -67,0 +82,0 @@ }

2

lib/transform-inline/transform-node.js

@@ -44,3 +44,3 @@ "use strict";

function extractVariableName(node) {
return node != null && ts.isIdentifier(node) ? node.escapedText.toString() : '$';
return node !== undefined && ts.isIdentifier(node) ? node.escapedText.toString() : '$';
}

@@ -47,0 +47,0 @@ function transformNode(node, visitorContext) {

{
"name": "typescript-is",
"version": "0.16.0",
"version": "0.16.1",
"engines": {

@@ -5,0 +5,0 @@ "node": ">=6.14.4"

Sorry, the diff of this file is not supported yet

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