-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathassets.js
24 lines (22 loc) · 997 Bytes
/
assets.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// import this file for static assets
let Obj = {
asda_sda_json:require('./test-assets/asda-sda.json'),asdasda_json:require('./test-assets/asdasda.json'),data_json:require('./test-assets/data.json'),folder:{asd_json:require('./test-assets/folder/asd.json'),qqq_html:require('./test-assets/folder/qqq.html')},image_a_jpg:require('./test-assets/image-a.jpg'),image_a_png:require('./test-assets/image-a.png'),image_b_png:require('./test-assets/image-b.png'),qweqwe_json:require('./test-assets/qweqwe.json'),vcvcvcv_json:require('./test-assets/vcvcvcv.json'),
search: function searchFile(key) {
if (this.hasOwnProperty(key)) {
return this[key];
} else {
return -1;
}
},
format: function searchFileFormat(extension) {
var filteredArray = this.filter(function (assetSlug) {
return assetSlug.includes("-" + extention);
});
if (filteredArray.length) {
return filteredArray;
} else {
return -1;
}
}
}
export default Obj;