mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Since jest stopped using node-haste a while ago, we are the only client left. This brings back node-haste back to fbsource to allow us to iterate faster. Reviewed By: bestander Differential Revision: D3641341 fbshipit-source-id: a859f8834765723a3515e2cf265581b9dd83997c
46 lines
854 B
JavaScript
46 lines
854 B
JavaScript
'use strict';
|
|
|
|
const Module = require('./Module');
|
|
const getAssetDataFromName = require('./lib/getAssetDataFromName');
|
|
|
|
class AssetModule_DEPRECATED extends Module {
|
|
constructor(args, platforms) {
|
|
super(args);
|
|
const {resolution, name} = getAssetDataFromName(this.path, platforms);
|
|
this.resolution = resolution;
|
|
this.name = name;
|
|
this.platforms = platforms;
|
|
}
|
|
|
|
isHaste() {
|
|
return Promise.resolve(false);
|
|
}
|
|
|
|
getName() {
|
|
return Promise.resolve(`image!${this.name}`);
|
|
}
|
|
|
|
getDependencies() {
|
|
return Promise.resolve([]);
|
|
}
|
|
|
|
hash() {
|
|
return `AssetModule_DEPRECATED : ${this.path}`;
|
|
}
|
|
|
|
isJSON() {
|
|
return false;
|
|
}
|
|
|
|
isAsset_DEPRECATED() {
|
|
return true;
|
|
}
|
|
|
|
resolution() {
|
|
return getAssetDataFromName(this.path, this.platforms).resolution;
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = AssetModule_DEPRECATED;
|