mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
[react-packager][streamline oss] Move open sourced JS source to react-native-github
This commit is contained in:
commit
efae175a8e
434 files changed
+44658
No files matched your search
@@ -0,0 +1,34 @@
|
||||
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;
|
||||
Reference in new issue
Block a user