ethstats-server/web-app/.meteor/local/build/programs/server/packages/webapp-hashing.js.map

1 line
1.6 KiB
Plaintext
Raw Normal View History

2015-08-14 19:22:53 +02:00
{"version":3,"sources":["webapp-hashing/webapp-hashing.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mC;;AAEA,mB;;AAEA,iE;AACA,qE;AACA,gB;AACA,E;AACA,+D;AACA,mE;AACA,2D;AACA,gB;;AAEA,mC;AACA,6D;AACA,uC;;AAEA,oE;AACA,qC;AACA,oD;AACA,yD;AACA,kC;;AAEA,8B;AACA,uC;AACA,G;;AAEA,kD;;AAEA,wC;AACA,8D;AACA,2E;AACA,iC;AACA,iC;AACA,K;AACA,K;AACA,4B;AACA,E","file":"/packages/webapp-hashing.js","sourcesContent":["var crypto = Npm.require(\"crypto\");\n\nWebAppHashing = {};\n\n// Calculate a hash of all the client resources downloaded by the\n// browser, including the application HTML, runtime config, code, and\n// static files.\n//\n// This hash *must* change if any resources seen by the browser\n// change, and ideally *doesn't* change for any server-only changes\n// (but the second is a performance enhancement, not a hard\n// requirement).\n\nWebAppHashing.calculateClientHash =\n function (manifest, includeFilter, runtimeConfigOverride) {\n var hash = crypto.createHash('sha1');\n\n // Omit the old hashed client values in the new hash. These may be\n // modified in the new boilerplate.\n var runtimeCfg = _.omit(__meteor_runtime_config__,\n ['autoupdateVersion', 'autoupdateVersionRefreshable',\n 'autoupdateVersionCordova']);\n\n if (runtimeConfigOverride) {\n runtimeCfg = runtimeConfigOverride;\n }\n\n hash.update(JSON.stringify(runtimeCfg, 'utf8'));\n\n _.each(manifest, function (resource) {\n if ((! includeFilter || includeFilter(resource.type)) &&\n (resource.where === 'client' || resource.where === 'internal')) {\n hash.update(resource.path);\n hash.update(resource.hash);\n }\n });\n return hash.digest('hex');\n};\n\n"]}