@trayio/commons
Advanced tools
Comparing version 4.45.0 to 4.46.0
@@ -17,2 +17,11 @@ /// <reference types="node" /> | ||
}; | ||
export type FileReference = { | ||
_tag: 'FileReference'; | ||
key: string; | ||
}; | ||
export interface FileReferenceInterface { | ||
fromUnknown(value: unknown): value is FileReference; | ||
fromFile(file: File): FileReference; | ||
} | ||
export declare const FileReference: FileReferenceInterface; | ||
export type SharedUrl = { | ||
@@ -19,0 +28,0 @@ url: string; |
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.fileMetadataDescriptor = void 0; | ||
exports.FileReference = exports.fileMetadataDescriptor = void 0; | ||
const t = __importStar(require("io-ts")); | ||
@@ -33,1 +33,17 @@ exports.fileMetadataDescriptor = t.partial({ | ||
}); | ||
exports.FileReference = { | ||
fromUnknown(value) { | ||
return (typeof value === 'object' && | ||
value !== null && | ||
'_tag' in value && | ||
value._tag === 'FileReference' && | ||
'key' in value && | ||
typeof value.key === 'string'); | ||
}, | ||
fromFile(file) { | ||
return { | ||
_tag: 'FileReference', | ||
key: file.key, | ||
}; | ||
}, | ||
}; |
{ | ||
"name": "@trayio/commons", | ||
"version": "4.45.0", | ||
"version": "4.46.0", | ||
"description": "Extensions to the standard/core libraries and basic features", | ||
@@ -5,0 +5,0 @@ "exports": { |
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
202206
4172