Update to latest jsonld.js.
authorDave Longley <dlongley@digitalbazaar.com>
Fri, 15 Feb 2013 16:38:30 -0500
changeset 1281 f488d0be05f7
parent 1280 ccad6356390a
child 1282 884231056eb4
Update to latest jsonld.js.
playground/jsonld.js
--- a/playground/jsonld.js	Fri Feb 15 16:25:04 2013 -0500
+++ b/playground/jsonld.js	Fri Feb 15 16:38:30 2013 -0500
@@ -36,8 +36,8 @@
 (function() {
 
 // determine if in-browser or using node.js
-var _nodejs = (typeof module !== 'undefined');
-var _browser = !_nodejs;
+var _nodejs = (typeof module === 'object' && module.exports);
+var _browser = !_nodejs && window;
 
 // attaches jsonld API to the given object
 var wrapper = function(jsonld) {
@@ -6152,7 +6152,7 @@
   module.exports = factory;
 }
 // export AMD API
-if(typeof define === 'function' && define.amd) {
+else if(typeof define === 'function' && define.amd) {
   define('jsonld', [], function() {
     return factory;
   });