clientside-require
Advanced tools
Comparing version 3.10.1 to 3.10.2
@@ -446,4 +446,4 @@ (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){ | ||
var status_string = this.status + ""; | ||
if(status_string[0] == "4") return reject(new Error(this.status)); | ||
if(status_string[0] == "5") return reject(new Error(this.status)); | ||
if(status_string[0] == "4") return reject(generate_xhr_error(this.status, destination_path)); | ||
if(status_string[0] == "5") return reject(generate_xhr_error(this.status, destination_path)); | ||
resolve(this.responseText) | ||
@@ -453,3 +453,3 @@ }; | ||
if(typeof error == "undefined") error = this.statusText; // if error is not defined, atleast resolve with status text | ||
if(error.code == "ENOENT") return reject(new Error("404")); // maps not found node file:/// requests to 404 response | ||
if(error.code == "ENOENT") return reject(generate_xhr_error(404, destination_path)); // maps not found node file:/// requests to 404 response | ||
return reject(error); | ||
@@ -476,2 +476,14 @@ }; | ||
/* | ||
helper function | ||
*/ | ||
var generate_xhr_error = function(status_code, path){ | ||
var message = "Request Error : 404 : " + path; | ||
var code = status_code; | ||
var error = new Error(message); | ||
error.code = code; | ||
return error; | ||
} | ||
},{}],6:[function(require,module,exports){ | ||
@@ -536,2 +548,3 @@ (function (process){ | ||
frame.contentWindow.clientside_require = window.clientside_require; // pass by reference the clientside_require object | ||
frame.contentWindow.root_window = window; // pass the root window (browser window) to the module so it can use it if needed | ||
}, | ||
@@ -538,0 +551,0 @@ browser_variables : function(frame){ // browser environment variables (those not present in iframes) |
{ | ||
"name": "clientside-require", | ||
"version": "3.10.1", | ||
"version": "3.10.2", | ||
"description": "Node.js style require() statements in the browser. Load npm modules, js, html, css, json without any bundling required.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
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
112875
1286