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.12.2 to 0.12.3

12

lib/transform-inline/visitor-utils.js

@@ -8,3 +8,13 @@ "use strict";

function checkIsClass(type, visitorContext) {
if ((ts.ObjectFlags.Class & type.objectFlags) !== 0) {
// Hacky: using internal TypeScript API.
if ('isArrayType' in visitorContext.checker && visitorContext.checker.isArrayType(type)) {
return false;
}
let hasConstructSignatures = false;
if (type.symbol !== undefined && type.symbol.valueDeclaration !== undefined && ts.isVariableDeclaration(type.symbol.valueDeclaration) && type.symbol.valueDeclaration.type) {
const variableDeclarationType = visitorContext.checker.getTypeAtLocation(type.symbol.valueDeclaration.type);
const constructSignatures = variableDeclarationType.getConstructSignatures();
hasConstructSignatures = constructSignatures.length >= 1;
}
if ((ts.ObjectFlags.Class & type.objectFlags) !== 0 || hasConstructSignatures) {
if (visitorContext.options.ignoreClasses) {

@@ -11,0 +21,0 @@ return true;

2

package.json
{
"name": "typescript-is",
"version": "0.12.2",
"version": "0.12.3",
"engines": {

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

@@ -282,4 +282,4 @@ # typescript-is

Done as of version `0.10.0`.
* Support detailed error message when using the decorators `@ValidateClass` and `@AssertType`.
* Detect additional keys. [issue 11](https://github.com/woutervh-/typescript-is/issues/11)
* ~~Support detailed error message when using the decorators `@ValidateClass` and `@AssertType`.~~
* ~~Detect additional keys. [issue 11](https://github.com/woutervh-/typescript-is/issues/11)~~ Done as of version `0.11.0`.
* Promise support. Something like `assertOrReject<Type>(object)` will either `resolve(object)` or `reject(error)`.

@@ -286,0 +286,0 @@ * Optimize the generated conditions. Things like `false || "key" === "key"` can be simplified. Might be more interesting to publish a different library that can transform a TypeScript AST, and then use it here, or use an existing one. Might be out of scope, as there are plenty of minifiers/uglifiers/manglers out there already.

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