Comparing version 1.0.0 to 1.0.1
@@ -63,3 +63,3 @@ /* | ||
var script = this._getScript(); | ||
var data = JSON.parse(script.nextSibling.innerHTML); | ||
var data = App._parseInitialData(script.nextSibling.innerHTML); | ||
this.model.createConnection(data); | ||
@@ -362,1 +362,19 @@ this.emit('model', this.model); | ||
}; | ||
App._parseInitialData = function _parseInitialData(jsonString) { | ||
try { | ||
return JSON.parse(jsonString); | ||
} catch (error) { | ||
var message = error.message || ''; | ||
var match = message.match(/Unexpected token (.) in JSON at position (\d+)/); | ||
if (match) { | ||
var p = parseInt(match[2], 10); | ||
var stringContext = jsonString.substring( | ||
Math.min(0, p - 30), | ||
Math.max(p + 30, jsonString.length - 1) | ||
); | ||
throw new Error('Parse failure: ' + error.message + ' context: \'' + stringContext + '\''); | ||
} | ||
throw error; | ||
} | ||
}; |
{ | ||
"name": "derby", | ||
"description": "MVC framework making it easy to write realtime, collaborative applications that run in both Node.js and browsers.", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"homepage": "http://derbyjs.com/", | ||
@@ -6,0 +6,0 @@ "repository": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
227020
48
5857