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.6.6 to 0.6.7

20

lib/transform-inline/visitor.js

@@ -169,2 +169,18 @@ "use strict";

}
function visitNonPrimitive(type, accessor, visitorContext) {
const intrinsicName = type.intrinsicName;
let conditions;
if (intrinsicName === 'object') {
conditions = [
ts.createStrictInequality(ts.createTypeOf(accessor), ts.createStringLiteral('boolean')),
ts.createStrictInequality(ts.createTypeOf(accessor), ts.createStringLiteral('number')),
ts.createStrictInequality(ts.createTypeOf(accessor), ts.createStringLiteral('string'))
];
}
else {
throw new Error(`Unsupported non-primitive with intrinsic name: ${intrinsicName}.`);
}
// Using internal TypeScript API, hacky.
return conditions.reduce((condition, expression) => ts.createBinary(condition, ts.SyntaxKind.AmpersandAmpersandToken, expression));
}
function visitTypeParameter(type, accessor, visitorContext) {

@@ -230,2 +246,6 @@ const typeMapper = visitorContext.typeMapperStack[visitorContext.typeMapperStack.length - 1];

}
else if ((ts.TypeFlags.NonPrimitive & type.flags) !== 0) {
// Non-primitive such as object
return visitNonPrimitive(type, accessor, visitorContext);
}
else {

@@ -232,0 +252,0 @@ throw new Error('Unsupported type with flags: ' + type.flags);

2

package.json
{
"name": "typescript-is",
"version": "0.6.6",
"version": "0.6.7",
"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