MCPcopy Create free account
hub / github.com/totaljs/framework / compile_content

Function compile_content

index.js:6947–6971  ·  view source on GitHub ↗
(extension, content, filename)

Source from the content-addressed store, hash-verified

6945}
6946
6947function compile_content(extension, content, filename) {
6948
6949 if (filename && REG_NOCOMPRESS.test(filename))
6950 return content;
6951
6952 switch (extension) {
6953 case 'js':
6954 case 'mjs':
6955 return CONF.allow_compile_script ? framework_internal.compile_javascript(content, filename) : content;
6956
6957 case 'css':
6958 content = CONF.allow_compile_style ? framework_internal.compile_css(content, filename) : content;
6959 var matches = content.match(REG_COMPILECSS);
6960 if (matches) {
6961 for (var i = 0, length = matches.length; i < length; i++) {
6962 var key = matches[i];
6963 var url = key.substring(4, key.length - 1);
6964 content = content.replace(key, 'url(' + F.$version(url, true) + ')');
6965 }
6966 }
6967 return content;
6968 }
6969
6970 return content;
6971}
6972
6973F.restore = function(filename, target, callback, filter) {
6974

Callers 2

compile_fileFunction · 0.85
compile_mergeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected