You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I define a schema with a field of type Function, an unclear error is thrown.
/.../schemas/node_modules/typescript-json-schema/typescript-json-schema.js:421
var indexSignatures = clazz.members.filter(function (x) { return x.kind === ts.SyntaxKind.IndexSignature; });
^
TypeError: Cannot read property 'filter' of undefined
This only occurs for recent versions of the library, introduced in #117. Without that change, I get a definition produced like this:
"Function": {
"additionalProperties": false,
"description": "Creates a new function.",
"properties": {
"__@hasInstance": {
"additionalProperties": false,
"description": "Determines whether the given value inherits from this function if this function was used\nas a constructor function.\n\nA constructor function can control which objects are recognized as its instances by\n'instanceof' by overriding this method.",
"type": "object"
},
"apply": {
"additionalProperties": false,
"description": "Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.",
"type": "object"
},
"arguments": {
},
"bind": {
"additionalProperties": false,
"description": "For a given function, creates a bound function that has the same body as the original function.\nThe this object of the bound function is associated with the specified object, and has the specified initial parameters.",
"type": "object"
},
"call": {
"additionalProperties": false,
"description": "Calls a method of an object, substituting another object for the current object.",
"type": "object"
},
"caller": {
"$ref": "#/definitions/Function"
},
"length": {
"type": "number"
},
"name": {
"description": "Returns the name of the function. Function names are read-only and can not be changed.",
"type": "string"
},
"prototype": {
},
"toString": {
"additionalProperties": false,
"description": "Returns a string representation of a function.",
"type": "object"
}
},
"required": [
"__@hasInstance",
"apply",
"arguments",
"bind",
"call",
"caller",
"length",
"name",
"prototype",
"toString"
],
"type": "object"
},
Not sure if Functions are really supported, see #110. But the message should at least be clearer.
The text was updated successfully, but these errors were encountered:
If I define a schema with a field of type
Function
, an unclear error is thrown.This only occurs for recent versions of the library, introduced in #117. Without that change, I get a definition produced like this:
Not sure if Functions are really supported, see #110. But the message should at least be clearer.
The text was updated successfully, but these errors were encountered: