@typeonly/loader
Advanced tools
Comparing version 0.5.1 to 0.5.2
@@ -177,2 +177,3 @@ // -- API Definitions -- | ||
type: Type | ||
optional: boolean | ||
} | ||
@@ -179,0 +180,0 @@ |
@@ -185,6 +185,7 @@ "use strict"; | ||
createFunctionParameters(rtoNodes) { | ||
return rtoNodes.map(({ name, type }) => { | ||
return rtoNodes.map(({ name, type, optional }) => { | ||
return { | ||
name, | ||
type: type ? this.createType(type) : makeAny() | ||
type: type ? this.createType(type) : makeAny(), | ||
optional: !!optional | ||
}; | ||
@@ -191,0 +192,0 @@ }); |
{ | ||
"name": "@typeonly/loader", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "Brings types and interfaces from TypeScript at runtime.", | ||
@@ -18,10 +18,10 @@ "author": "Paroi", | ||
"devDependencies": { | ||
"@types/jest": "^25.2.3", | ||
"@types/node": "^14.0.12", | ||
"jest": "^26.0.1", | ||
"@types/jest": "^26.0.9", | ||
"@types/node": "^14.0.27", | ||
"jest": "^26.4.0", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "^26.1.0", | ||
"tslint": "^6.1.2", | ||
"typeonly": "^0.3.3", | ||
"typescript": "^3.9.5" | ||
"ts-jest": "^26.2.0", | ||
"tslint": "^6.1.3", | ||
"typeonly": "^0.4.2", | ||
"typescript": "^3.9.7" | ||
}, | ||
@@ -28,0 +28,0 @@ "main": "dist/api.js", |
@@ -215,6 +215,7 @@ import { RtoArrayType, RtoCompositeType, RtoFunctionParameter, RtoFunctionType, RtoGenericInstance, RtoGenericParameter, RtoGenericParameterName, RtoImportedTypeRef, RtoIndexSignature, RtoInterface, RtoKeyofType, RtoLiteralType, RtoLocalTypeRef, RtoMappedIndexSignature, RtoMemberType, RtoModule, RtoNamedType, RtoProperty, RtoTupleType, RtoType, RtoTypeName } from "typeonly" | ||
private createFunctionParameters(rtoNodes: RtoFunctionParameter[]): FunctionParameter[] { | ||
return rtoNodes.map(({ name, type }) => { | ||
return rtoNodes.map(({ name, type, optional }) => { | ||
return { | ||
name, | ||
type: type ? this.createType(type) : makeAny() | ||
type: type ? this.createType(type) : makeAny(), | ||
optional: !!optional | ||
} | ||
@@ -221,0 +222,0 @@ }) |
@@ -140,2 +140,3 @@ export interface Modules { | ||
type: Type | ||
optional: boolean | ||
} | ||
@@ -142,0 +143,0 @@ |
@@ -510,3 +510,3 @@ import { createStandaloneRtoModule, parseTypeOnly } from "typeonly" | ||
const source = ` | ||
export type T1 = <A> (a: string) => number | ||
export type T1 = <A> (a?: string) => number | ||
` | ||
@@ -539,2 +539,3 @@ const modules = await loadModules({ | ||
name: "a", | ||
optional: true, | ||
type: { | ||
@@ -541,0 +542,0 @@ kind: "name", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80691
2117