Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const expectType = (obj: Object, type: Object) => expect(getConstructor(obj)).to.equal(type);
const expectSameType = (a: Object, b: Object) => expect(getConstructor(a)).to.equal(getConstructor(b));
const expectSameType = (a: Object, b: Object) => expect(getConstructor(a)).to.equal(getConstructor(b));
const expectDeepEqual = (a: Object, b: Object) => {
export const extractOutputOptions = (options: Object, input?: Data): OutputOptions => {
if (!isObject(options))
throw new InvalidArgument('options', '{ type: Class, mime?: string, name?: string, lastModified?: number }', options);
let outputType;
if (options.type) {
outputType = options.type;
} else if (input) {
outputType = getConstructor(input);
} else {
throw new InternalError('Assertion error: called extractOutputOptions without a type or input');
}
const outputOptions = {};
outputOptions.type = outputType;
if (globalThis.Blob && input instanceof globalThis.Blob) {
outputOptions.mime = input.type;
}
if (globalThis.File && input instanceof globalThis.File) {
outputOptions.name = input.name;
outputOptions.lastModified = input.lastModified;
}
if (typeof options.mime === 'string') {