node-iframe
Advanced tools
Comparing version 1.4.5 to 1.4.6
@@ -5,3 +5,13 @@ "use strict"; | ||
var config_1 = require("../config"); | ||
var appCache; | ||
var model = { | ||
get: function (_) { | ||
return; | ||
}, | ||
set: function (_, __) { | ||
return false; | ||
}, | ||
options: {}, | ||
data: {} | ||
}; | ||
var appCache = model; | ||
exports.appCache = appCache; | ||
@@ -17,3 +27,3 @@ function createCache() { | ||
if (options.disabled) { | ||
exports.appCache = appCache = undefined; | ||
exports.appCache = appCache = model; | ||
} | ||
@@ -25,5 +35,2 @@ var enableCache = config_1.cacheConfig.disabled && !options.disabled; | ||
if (!config_1.cacheConfig.disabled) { | ||
if (!appCache) { | ||
exports.appCache = appCache = {}; | ||
} | ||
appCache.options = Object.assign({}, appCache === null || appCache === void 0 ? void 0 : appCache.options, options); | ||
@@ -30,0 +37,0 @@ } |
@@ -118,7 +118,6 @@ "use strict"; | ||
} | ||
if (!(!config_1.cacheConfig.disabled && (cache_1.appCache === null || cache_1.appCache === void 0 ? void 0 : cache_1.appCache.get))) return [3, 4]; | ||
_c.label = 1; | ||
case 1: | ||
_c.trys.push([1, 3, , 4]); | ||
return [4, (cache_1.appCache === null || cache_1.appCache === void 0 ? void 0 : cache_1.appCache.get(url))]; | ||
return [4, cache_1.appCache.get(url)]; | ||
case 2: | ||
@@ -168,5 +167,3 @@ cachedHtml = _c.sent(); | ||
}); | ||
if (!config_1.cacheConfig.disabled && (cache_1.appCache === null || cache_1.appCache === void 0 ? void 0 : cache_1.appCache.set)) { | ||
cache_1.appCache.set(url, $html_1.html()); | ||
} | ||
cache_1.appCache.set(url, $html_1.html()); | ||
if (server) { | ||
@@ -173,0 +170,0 @@ $html_1.status = 200; |
{ | ||
"name": "node-iframe", | ||
"version": "1.4.5", | ||
"version": "1.4.6", | ||
"description": "create a iframe on your server to bypass CORS issues. ( reverse engineer security issues )", | ||
@@ -5,0 +5,0 @@ "main": "dist/iframe.js", |
@@ -0,1 +1,2 @@ | ||
import type NodeCache from "node-cache"; | ||
import type { Options } from "node-cache"; | ||
@@ -5,4 +6,9 @@ interface AppCache extends Options { | ||
} | ||
declare let appCache: any; | ||
declare let appCache: { | ||
get(_: any): string | undefined; | ||
set(_: any, __: any): boolean; | ||
options: NodeCache.Options; | ||
data: NodeCache.Data; | ||
}; | ||
declare function configureCacheControl(options: AppCache): void; | ||
export { appCache, configureCacheControl }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
630
40936