Huge News!Announcing our $40M Series B led by Abstract Ventures.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.20 to 1.0.0-alpha.21

2

lib/index.js

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

if (debug) {
if (expectedType.startsWith('import')) {
if (expectedType.indexOf('import') > -1) {
expectedType = expectedType.replace(process.cwd(), '.');

@@ -439,0 +439,0 @@ }

{
"name": "ts-auto-guard",
"version": "1.0.0-alpha.20",
"version": "1.0.0-alpha.21",
"description": "Generate type guard functions from TypeScript interfaces",

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

@@ -182,7 +182,8 @@ import { each, pull } from 'lodash'

{
'test.ts': `
[`${process.cwd()}/foo/bar/test.ts`]: `
/** @see {isFoo} ts-auto-guard:type-guard */
export interface Foo {
foo: number,
bar: Bar
bar: Bar,
bars: Array<Bar>
}

@@ -198,3 +199,3 @@

{
'test.guard.ts': `
[`${process.cwd()}/foo/bar/test.guard.ts`.slice(1)]: `
import { Foo, Bar } from "./test";

@@ -223,3 +224,7 @@

evaluate(typeof obj.foo === "number", \`\${argumentName}.foo\`, "number", obj.foo) &&
evaluate(isBar(obj.bar) as boolean, \`\${argumentName}.bar\`, "import(\\"/test\\").Bar", obj.bar)
evaluate(isBar(obj.bar) as boolean, \`\${argumentName}.bar\`, "import(\\"./foo/bar/test\\").Bar", obj.bar) &&
evaluate(Array.isArray(obj.bars) &&
obj.bars.every((e: any) =>
isBar(e) as boolean
), \`\${argumentName}.bars\`, "import(\\"./foo/bar/test\\").Bar[]", obj.bars)
)

@@ -226,0 +231,0 @@ }

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