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
1
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 0.1.2 to 0.1.3

33

lib/resource.js

@@ -5,2 +5,3 @@ 'use strict'

var fs = require('fs')
var DEFAULT_COMBO_PATTERN = '/co??%s'

@@ -77,3 +78,3 @@ /**

this.combo = options.combo
this.comboPattern = options.comboPattern || '/co??'
this.comboPattern = options.comboPattern
}

@@ -186,3 +187,3 @@

Resource.prototype.makeComboURI = function(collect){
var url = this.comboPattern || '/co??'
var url = this.getComboPattern()
var self = this, combo = ''

@@ -192,5 +193,9 @@ collect.forEach(function(uri){

})
return url + combo.substring(1)
return url.replace('%s', combo.substring(1))
}
Resource.prototype.getComboPattern = function(){
return this.comboPattern || DEFAULT_COMBO_PATTERN
}
/**

@@ -216,5 +221,4 @@ *

}
if(used.length){
html += '<script>pagelet.used(["' + used.join('","') + '"])</script>\n';
}
var code = 'pagelet.init(' + (this.combo ? 1 : 0) + ',"' + this.getComboPattern() + '",["' + used.join('","') + '"]);';
html += '<script>' + code + '</script>\n';
if(this._script.length){

@@ -255,6 +259,19 @@ if(this.combo){

if(this._usePagelet){
var js = this._collect.js || []
var css = this._collect.css || []
var self = this
if(this.combo && js.length){
js.forEach(function(uri, index){
js[index] = self.comboURI(uri)
})
}
if(this.combo && css.length){
css.forEach(function(uri, index){
css[index] = self.comboURI(uri)
})
}
out = JSON.stringify({
html : this._pagelets,
js : this._collect.js || [],
css : this._collect.css || [],
js : js,
css : css,
title : this._title,

@@ -261,0 +278,0 @@ script: this._script

{
"name": "scrat-swig",
"version": "0.1.2",
"version": "0.1.3",
"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