Comparing version 0.4.9 to 0.4.10
@@ -11,2 +11,11 @@ /** | ||
/** | ||
* Create a text node. | ||
* | ||
* @param txt The text for the node. | ||
*/ | ||
function text(txt) { | ||
return document.createTextNode(txt); | ||
} | ||
/** | ||
* Create a wrapped DOM element. | ||
@@ -32,2 +41,3 @@ * | ||
this.air.el = el; | ||
this.air.text = text; | ||
} | ||
@@ -34,0 +44,0 @@ |
@@ -74,6 +74,19 @@ /** | ||
if(this.readyState === 4) { | ||
var res = this.responseText | ||
, info = { | ||
headers: parse(this.getAllResponseHeaders()), status: this.status}; | ||
info.body = res; | ||
if(res && opts.json && (this.status === 200 || this.status === 201)) { | ||
try { | ||
info.body = JSON.parse(res); | ||
}catch(e) { | ||
return done( | ||
e, | ||
info, | ||
this); | ||
} | ||
} | ||
done( | ||
null, | ||
this.responseText, | ||
{headers: parse(this.getAllResponseHeaders()), status: this.status}, | ||
info, | ||
this); | ||
@@ -80,0 +93,0 @@ } |
{ | ||
"name": "air", | ||
"description": "Lightweight, modular DOM library", | ||
"version": "0.4.9", | ||
"version": "0.4.10", | ||
"author": "muji <noop@xpm.io>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
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
45786
45
1187