Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(options: { type: Class, mime?: string, name?: string, lastModified?: number }) {
// Note: can't use Infinity as it will be forwarded to the writableHighWaterMark option
super(Number.MAX_SAFE_INTEGER);
// $FlowIKnow Use of Object.prototype
if (!options || typeof options !== 'object' || Object.getPrototypeOf(options) !== Object.prototype)
throw new InvalidArgument('options', 'object', options);
const { type, mime, name, lastModified } = options;
assertDataTypeClass(type, 'options.type');
if (mime && typeof mime !== 'string')
throw new InvalidArgument('options.mime', 'string', mime);
if (name && typeof name !== 'string')
throw new InvalidArgument('options.name', 'string', name);
if (lastModified && typeof lastModified !== 'number')
throw new InvalidArgument('options.lastModified', 'number', lastModified);
this._options = options;
}