MCPcopy Index your code
hub / github.com/totaljs/framework / compile_check

Function compile_check

index.js:6886–6924  ·  view source on GitHub ↗
(res)

Source from the content-addressed store, hash-verified

6884};
6885
6886function compile_check(res) {
6887
6888 var req = res.req;
6889 var uri = req.uri;
6890
6891 if (F.routes.merge[uri.pathname]) {
6892 compile_merge(res);
6893 return;
6894 }
6895
6896 fsFileExists(res.options.filename, function(e, size, sfile, stats) {
6897
6898 if (e) {
6899
6900 if (!res.noCompress && COMPRESSIONSPECIAL[req.extension] && CONF.allow_compile && !REG_NOCOMPRESS.test(res.options.filename))
6901 return compile_file(res);
6902
6903 var tmp = [res.options.filename, size, stats.mtime.toUTCString()];
6904 if (CONF.allow_gzip && COMPRESSION[U.getContentType(req.extension)]) {
6905 compile_gzip(tmp, function(tmp) {
6906 F.temporary.path[req.$key] = tmp;
6907 res.$file();
6908 delete F.temporary.processing[req.$key];
6909 });
6910 } else {
6911 F.temporary.path[req.$key] = tmp;
6912 res.$file();
6913 delete F.temporary.processing[req.$key];
6914 }
6915
6916 } else if (F.isVirtualDirectory)
6917 F.compile_virtual(res);
6918 else {
6919 F.temporary.notfound[req.$key] = true;
6920 delete F.temporary.processing[req.$key];
6921 res.$file();
6922 }
6923 });
6924}
6925
6926function compile_gzip(arr, callback) {
6927

Callers 1

extend_responseFunction · 0.85

Calls 4

compile_mergeFunction · 0.85
fsFileExistsFunction · 0.85
compile_fileFunction · 0.85
compile_gzipFunction · 0.85

Tested by

no test coverage detected