@trayio/commons
Advanced tools
Comparing version 4.52.0 to 4.52.1
@@ -35,2 +35,6 @@ /// <reference types="node" /> | ||
} | ||
export interface FileContentTypeCheckerInterface { | ||
isFileContentType(value: unknown): value is FileContentType; | ||
} | ||
export declare const FileContentTypeChecker: FileContentTypeCheckerInterface; | ||
export type FileMetadata = { | ||
@@ -37,0 +41,0 @@ name: string; |
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FileDescriptor = exports.fileDescriptorDescriptor = exports.fileMetadataDescriptor = exports.FileContentType = void 0; | ||
exports.FileDescriptor = exports.fileDescriptorDescriptor = exports.fileMetadataDescriptor = exports.FileContentTypeChecker = exports.FileContentType = void 0; | ||
const t = __importStar(require("io-ts")); | ||
@@ -61,2 +61,13 @@ var FileContentType; | ||
})(FileContentType || (exports.FileContentType = FileContentType = {})); | ||
exports.FileContentTypeChecker = { | ||
isFileContentType(value) { | ||
if (typeof value !== 'string') { | ||
return false; | ||
} | ||
const lowerCaseValue = value.toLowerCase(); | ||
return Object.values(FileContentType) | ||
.map((contentType) => contentType.toLowerCase()) | ||
.includes(lowerCaseValue); | ||
}, | ||
}; | ||
const contentTypeDescriptor = t.union([ | ||
@@ -63,0 +74,0 @@ t.literal(FileContentType.Text), |
{ | ||
"name": "@trayio/commons", | ||
"version": "4.52.0", | ||
"version": "4.52.1", | ||
"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
228521
4730