ice/packages/plugin-pha/tests/mockConfig.mjs

34 lines
532 B
JavaScript
Raw Normal View History

2022-06-17 17:54:15 +08:00
const configData = {
home: {
priority: 'low',
},
about: {
defaultFrameIndex: 0,
},
'app/nest': {
frames: [
'/home',
{
url: 'https://m.taobao.com',
},
],
},
}
const config = new Proxy(configData, {
get: function(obj, props) {
if (props in obj) {
const defaultConfig = {
title: `title-${props}`,
};
return {
...defaultConfig,
...(obj[props] || {}),
};
} else {
return undefined;
}
}
})
export default config;