mirror of
https://github.com/react/react-native.git
synced 2026-10-01 09:47:43 +08:00
- [react-packager] Fix lint errors | Amjad Masad - [react-packager] fix a typo s/pacakge/package | Chengyin Liu - [react-packager] Fix jest tests | Amjad Masad - [Image] Really improve the quality of mis-sized images w/trilinear filtering | James Ide
37 lines
744 B
JavaScript
37 lines
744 B
JavaScript
'use strict';
|
|
|
|
function ModuleDescriptor(fields) {
|
|
if (!fields.id) {
|
|
throw new Error('Missing required fields id');
|
|
}
|
|
this.id = fields.id;
|
|
|
|
if (!fields.path) {
|
|
throw new Error('Missing required fields path');
|
|
}
|
|
this.path = fields.path;
|
|
|
|
if (!fields.dependencies) {
|
|
throw new Error('Missing required fields dependencies');
|
|
}
|
|
this.dependencies = fields.dependencies;
|
|
|
|
this.resolveDependency = fields.resolveDependency;
|
|
|
|
this.entry = fields.entry || false;
|
|
|
|
this.isPolyfill = fields.isPolyfill || false;
|
|
|
|
this._fields = fields;
|
|
}
|
|
|
|
ModuleDescriptor.prototype.toJSON = function() {
|
|
return {
|
|
id: this.id,
|
|
path: this.path,
|
|
dependencies: this.dependencies
|
|
};
|
|
};
|
|
|
|
module.exports = ModuleDescriptor;
|