Comments (5)
All good, no expectation. Just gave the role in case you need to fix anything or I'm taking too long to merge something.
from ts-auto-guard.
Aha - I just noticed that this happens when there's an existing index.guard.ts
file. Deleting the guard file and re-running ts-auto-guard results in the correct code being generated:
export function isRecursiveType(obj: any, _argumentName?: string): obj is RecursiveType {
return (
typeof obj === "object" &&
Array.isArray(obj.children) &&
obj.children.every((e: any) =>
isRecursiveType(e) as boolean
)
)
}
export function isParentType(obj: any, _argumentName?: string): obj is ParentType {
return (
typeof obj === "object" &&
obj.type === "parent" &&
Array.isArray(obj.children) &&
obj.children.every((e: any) =>
isChildType(e) as boolean
)
)
}
export function isChildType(obj: any, _argumentName?: string): obj is ChildType {
return (
typeof obj === "object" &&
obj.type === "child" &&
isParentType(obj.parent) as boolean
)
}
EDIT: Updated the title to reflect this.
from ts-auto-guard.
Woah, that's mystifying... I've just invited you to be a collaborator if you're interested as I am not actively working on this project.
from ts-auto-guard.
@rhys-vdw, cool - can't promise I will have results, but if I have some time, I'll take a look.
from ts-auto-guard.
Thx
from ts-auto-guard.
Related Issues (20)
- Check for string length and number range HOT 5
- Double quoted property names HOT 4
- Type guards not compatible with noImplicitAny HOT 1
- Dependency tracking system uses declared names for imported types/guards/classes HOT 3
- Debug build does not quote the type of Record keys HOT 2
- Is there a way to generate guard with no export? HOT 2
- Doesn't correctly handle T types. HOT 2
- Improvement to usage docs HOT 2
- Support for explicit file extensions when using ESM HOT 4
- Rest elements in Tuple Types to support NonEmptyArray HOT 1
- Paths are not always replaced shortened on Windows
- RangeError: Maximum call stack size exceeded HOT 3
- Throw if file not found HOT 1
- Feature request: add `-r` recursive option HOT 2
- Type aliases produce type guards with TS errors (TS6133) HOT 1
- Incorrect type guard generated when using constant for interface keys HOT 3
- Supply Chain Security Analysis - Socket.Dev HOT 1
- VS Code Integration HOT 1
- Dependabot Integration HOT 1
- Deploy workflow published version 5 without committing changes HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ts-auto-guard.