tson-schema
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -11,2 +11,10 @@ import { BaseSchemaDefinition, TypedSchema } from './common'; | ||
}>; | ||
export { objectType as object }; | ||
interface RecordSchemaDefinition<T> extends BaseSchemaDefinition { | ||
additionalProperties: TypedSchema<T>; | ||
} | ||
interface AnyRecordSchemaDefinition extends BaseSchemaDefinition { | ||
additionalProperties: true; | ||
} | ||
declare function recordType(schema: AnyRecordSchemaDefinition): TypedSchema<Record<string, any>>; | ||
declare function recordType<T>(schema: RecordSchemaDefinition<T>): TypedSchema<Record<string, T>>; | ||
export { objectType as object, recordType as record }; |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -25,2 +36,12 @@ function objectType(schema) { | ||
exports.object = objectType; | ||
function recordType(schema) { | ||
return { | ||
getSchema: function () { return (__assign(__assign({}, schema), { additionalProperties: schema.additionalProperties === true | ||
? true | ||
: schema.additionalProperties.getSchema(), type: 'object' })); }, | ||
// tslint:disable-next-line:no-object-literal-type-assertion | ||
type: {}, | ||
}; | ||
} | ||
exports.record = recordType; | ||
//# sourceMappingURL=object.js.map |
{ | ||
"name": "tson-schema", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "A TypeScript API to create JSON-Schemas and TypeScript types", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
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
25071
341