New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ts-auto-guard

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-auto-guard - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

6

lib/index.js

@@ -457,8 +457,8 @@ "use strict";

}
if (type.isTuple()) {
return tupleCondition(varName, type, addDependency, project, path, arrayDepth, records, outFile, options);
}
if (type.isObject()) {
return objectCondition(varName, type, addDependency, project, path, arrayDepth, records, outFile, options);
}
if (type.isTuple()) {
return tupleCondition(varName, type, addDependency, project, path, arrayDepth, records, outFile, options);
}
if (type.isLiteral()) {

@@ -465,0 +465,0 @@ return literalCondition(varName, type, addDependency);

{
"name": "ts-auto-guard",
"version": "2.2.0",
"version": "2.2.1",
"description": "Generate type guard functions from TypeScript interfaces",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/rhys-vdw/ts-auto-guard",

@@ -1559,1 +1559,27 @@ import test from 'tape'

)
testProcessProject(
'generates tuples',
{
'test.ts': `
export interface A {
b: [number]
}`,
},
{
'test.ts': null,
'test.guard.ts': `
import { A } from "./test";
export function isA(obj: any, _argumentName?: string): obj is A {
return (
(obj !== null &&
typeof obj === "object" ||
typeof obj === "function") &&
Array.isArray(obj.b) &&
typeof obj.b[0] === "number"
)
}`,
},
{ options: { exportAll: true } }
)

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