MCPcopy Create free account
hub / github.com/socketstream/socketstream / UpdateCachedDevAssets

Function UpdateCachedDevAssets

lib/client/bundler/proto.js:366–407  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

364 }
365
366 function UpdateCachedDevAssets() {
367 var url = 'assets/'+this.client.name+'/'+this.client.id+'.html';
368 view(ss, this.client, options, function(content) {
369 ss.http.cached.set(url, content, 'text/html; charset=utf-8');
370 });
371
372 var common = {
373 constants: this.constants(),
374 locals: this.locals(),
375 client: this.client.name,
376 clientId: this.client.id
377 };
378
379 this.entries('css').forEach(function(entry) {
380 this.asset(entry, common, function(output) {
381 url = 'assets/'+this.client.name+'/'+this.client.id+'.css?_='+entry.file;
382 ss.http.cached.set(url, output, 'text/css; charset=utf-8');
383 }.bind(this));
384 },this);
385
386 var modules = {};
387
388 this.entries('js').forEach(function(entry) {
389 if (entry.type === 'mod') {
390 this.module(entry.file).forEach(function(mod) {
391 modules[entry.file] = modules[entry.file] || [];
392 modules[entry.file].push(mod.content);
393 });
394 } else {
395 this.asset(entry, common, function(output) {
396 url = 'assets/'+this.client.name+'/'+this.client.id+'.js?_='+entry.file;
397 ss.http.cached.set(url, output, 'text/js; charset=utf-8');
398 }.bind(this));
399 }
400 },this);
401
402 for(var n in modules) {
403 var output = modules[n].join('\n');
404 url = 'assets/'+this.client.name+'/'+this.client.id+'.js?mod='+n;
405 ss.http.cached.set(url, output, 'text/js; charset=utf-8');
406 }
407 }
408
409 /**
410 * @ngdoc method

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected