Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng-cache-loader

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-cache-loader - npm Package Compare versions

Comparing version 0.0.23 to 0.0.24

test/webpack2.config.js

29

index.js

@@ -59,3 +59,3 @@ /*

};
var minimizeOpts = this.query.match(/&?minimizeOptions[\s\n]*=[\s\n]*([^&]*)/);
var minimizeOpts;
var moduleId = 'ng';

@@ -71,14 +71,23 @@ var result = [];

// Remove minimizeOptions from query string because JSON is not suitable for query parameter
if (minimizeOpts) {
this.query = this.query.replace(minimizeOpts[0], '');
// webpack1 or webpack2 with legacy query format
if (typeof this.query === 'string') {
// minimizeOpts is JSON inside query string
minimizeOpts = this.query.match(/&?minimizeOptions[\s\n]*=[\s\n]*([^&]*)/);
if (minimizeOpts) {
this.query = this.query.replace(minimizeOpts[0], '');
}
try {
minimizeOpts = minimizeOpts && JSON.parse(minimizeOpts[1]);
} catch (e) {
throw new Error('Invalid value of query parameter minimizeOptions');
}
}
try {
minimizeOpts = minimizeOpts && JSON.parse(minimizeOpts[1]);
} catch (e) {
throw new Error('Invalid value of query parameter minimizeOptions');
}
// Parse query and append minimize options
extend(opts, minimizeOpts, loaderUtils.parseQuery(this.query));
var options = loaderUtils.getOptions ?
loaderUtils.getOptions(this) :
loaderUtils.parseQuery(this.query);
extend(opts, minimizeOpts, options);

@@ -85,0 +94,0 @@ if (opts.minimize) {

@@ -17,3 +17,5 @@ /*

var query = loaderUtils.parseQuery(this.query);
var query = loaderUtils.getOptions ?
loaderUtils.getOptions(this) :
loaderUtils.parseQuery(this.query);
var moduleId = query.module || defaultName;

@@ -20,0 +22,0 @@ var newTemplateId = templateId;

@@ -68,3 +68,5 @@ /*

var query = loaderUtils.parseQuery(this.query);
var query = loaderUtils.getOptions ?
loaderUtils.getOptions(this) :
loaderUtils.parseQuery(this.query);
var pref = query.prefix || '';

@@ -71,0 +73,0 @@ var path = this.resource;

{
"name": "ng-cache-loader",
"version": "0.0.23",
"version": "0.0.24",
"description": "Puts HTML partials in the Angular's $templateCache.",

@@ -27,3 +27,3 @@ "main": "index.js",

"mocha": "^2.3.0",
"webpack": "^1.4.3"
"webpack": "^2.4.1"
},

@@ -34,3 +34,3 @@ "dependencies": {

"html-minifier": "^3.0.2",
"loader-utils": "^0.2.4"
"loader-utils": "^1.1.0"
},

@@ -37,0 +37,0 @@ "directories": {

@@ -31,5 +31,5 @@ /**

if (prefix !== undefined) {
params.query = '?prefix=' + prefix;
}
params.query = prefix !== undefined ?
'?prefix=' + prefix :
'?';
return lib.call(params);

@@ -36,0 +36,0 @@ };

@@ -0,1 +1,3 @@

var path = require('path');
var minimizeOptions = JSON.stringify({

@@ -12,5 +14,6 @@ removeComments: true,

module.exports = {
entry: './test/entry.js',
context: __dirname,
entry: path.resolve(__dirname, 'entry.js'),
output: {
path: './test/out',
path: path.resolve(__dirname, 'out'),
filename: '[name].out.js',

@@ -17,0 +20,0 @@ },

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