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 1.0.0-alpha.7 to 1.0.0-alpha.8

2

package.json
{
"name": "ts-auto-guard",
"version": "1.0.0-alpha.7",
"version": "1.0.0-alpha.8",
"description": "Generate type guard functions from TypeScript interfaces",

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

@@ -437,2 +437,27 @@ import { each, pull } from 'lodash'

testProcessProject(
'generates type guards for a Pick<> type',
{
'test.ts': `
interface Bar {
foo: number,
bar: number
}
/** @see {isFoo} ts-auto-guard:type-guard */
export type Foo = Pick<Bar, "foo">`,
},
{
'test.guard.ts': `
import { Foo } from "./test";
export function isFoo(obj: any, _argumentName?: string): obj is Foo {
return (
typeof obj === "object" &&
typeof obj.foo === "number"
)
}`,
}
)
testProcessProject(
'generates type guards with a short circuit',

@@ -439,0 +464,0 @@ {

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