New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

scrat-swig

Package Overview
Dependencies
Maintainers
4
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scrat-swig - npm Package Compare versions

Comparing version 1.1.0-pwa6 to 1.1.0

6

CHANGELOG.md

@@ -0,1 +1,7 @@

1.1.0 / 2018-03-05
==================
* feat: support service-worker (#21)
1.1.0-pwa6 / 2018-01-17

@@ -2,0 +8,0 @@ ==================

2

index.js

@@ -13,3 +13,3 @@ 'use strict';

exports.setServiceWorkerRegistrationJS = Resource.setServiceWorkerRegistrationJS;
exports.setCombo = Resource.setCombo;
// exports.setCombo = Resource.setCombo;
exports.filters = exports.filters || filters;

@@ -16,0 +16,0 @@

@@ -83,11 +83,6 @@ 'use strict';

Resource.setServiceWorkerRegistrationJS = js => {
Resource.setServiceWorkerRegistrationJS = function(js) {
serviceWorkerRegistrationJS = js;
};
// 运行时动态设置combo开关
// Resource.setCombo = combo => {
// options.combo = combo;
// };
/**

@@ -166,23 +161,2 @@ * script标签占位

/**
* 处理uri,当在运行时从combo模式切换到非combo模式下,替换静态资源serving地址,默认是和主应用同域名
* @param {Array} collect 资源集合
* @param {String} uri 资源uri
*/
function pushUri(collect, uri) {
const escapeRegExp = function(string) {
return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
};
const stripKeys = Object.keys(options.stripPrefixMulti || {});
if (!options.combo && stripKeys.length) {
uri = uri.replace(
new RegExp('^(' + stripKeys.map(escapeRegExp).join('|') + ')'),
function(m) { return options.stripPrefixMulti[m]; }
);
}
collect.push(uri);
}
/**
* 收集资源

@@ -216,3 +190,3 @@ * @param {String} id 资源ID

}
pushUri(_collect[res.type], res.uri);
_collect[res.type].push(res.uri);
return true;

@@ -272,3 +246,3 @@ }

pushUri(collect, res.uri);
collect.push(res.uri);
} else {

@@ -275,0 +249,0 @@ logger.error('unable to load resource [' + file + ']');

{
"name": "scrat-swig",
"version": "1.1.0-pwa6",
"version": "1.1.0",
"description": "Extensions of swig for scrat",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc