Files
react-native/packager/react-packager/src/DependencyResolver/Polyfill.js
Amjad Masad bc28a35bda [react-packager] Use module objects across the codebase (rid of getPlainObject etc)
Summary:
Instead of using plain objects and having to convert to and from them we just use the `Module` class across the codebase.
This seems cleaner and can enforce the type as opposed to fuzzy objects.
2015-08-13 15:52:31 -08:00

39 lines
573 B
JavaScript

'use strict';
const Promise = require('promise');
const Module = require('./Module');
class Polyfill extends Module {
constructor({ path, id, dependencies }) {
super(path);
this._id = id;
this._dependencies = dependencies;
}
isHaste() {
return Promise.resolve(false);
}
getName() {
return Promise.resolve(this._id);
}
getPackage() {
return null;
}
getDependencies() {
return Promise.resolve(this._dependencies);
}
isJSON() {
return false;
}
isPolyfill() {
return true;
}
}
module.exports = Polyfill;