@dfinity/assets
Version:
JavaScript and TypeScript library to manage assets on the Internet Computer
11 lines • 566 B
JavaScript
const isObjWithKeys = (obj, ...keys) => obj !== null &&
typeof obj === 'object' &&
keys.every(key => key !== null && key !== undefined && key in obj);
export const isReadable = (value) => isObjWithKeys(value, 'fileName', 'contentType', 'length', 'open', 'close', 'slice') &&
typeof value.fileName === 'string' &&
typeof value.contentType === 'string' &&
typeof value.length === 'number' &&
typeof value.open === 'function' &&
typeof value.close === 'function' &&
typeof value.slice === 'function';
//# sourceMappingURL=readable.js.map