feat(Types): Improve type spec and ignore signatures that use unknown type
This commit is contained in:
parent
890752a1e7
commit
358f68fbbd
7 changed files with 129 additions and 70 deletions
12
src/core/utils.mjs
Normal file
12
src/core/utils.mjs
Normal file
|
@ -0,0 +1,12 @@
|
|||
/* Returns true if set is a subset of the keys of obj */
|
||||
export function subsetOfKeys(set, obj) {
|
||||
for (const e of set) {
|
||||
if (!(e in obj)) return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
/* Returns a set of all of the types mentioned in a typed-function signature */
|
||||
export function typesOfSignature(signature) {
|
||||
return new Set(signature.split(/[^\w\d]/).filter(s => s.length))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue