@yihuangdb/storage-object
Version:
A Node.js storage object layer library using Redis OM
28 lines • 901 B
JavaScript
/**
* @module types/storage-system
* @description TypeScript type definitions for the StorageSystem API
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.isStorageSchema = isStorageSchema;
exports.isSchemaConfig = isSchemaConfig;
/**
* Type guard to check if a value is a StorageSchema
*/
function isStorageSchema(value) {
return value &&
typeof value === 'object' &&
typeof value.validate === 'function' &&
typeof value.getFields === 'function';
}
/**
* Type guard to check if a value is a SchemaConfig
*/
function isSchemaConfig(value) {
return value &&
typeof value === 'object' &&
!isStorageSchema(value) &&
Object.values(value).every(field => typeof field === 'string' ||
(typeof field === 'object' && field !== null && 'type' in field));
}
//# sourceMappingURL=storage-system.js.map
;