Skip to content

Commit

Permalink
release: 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
azaslavsky committed Jan 9, 2015
1 parent 9465621 commit 7f2e4d0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "domjson",
"version": "0.1.0",
"version": "0.1.1",
"description": "Convert DOM trees into compact JSON objects, and vice versa, as fast as possible.",
"main": "dist/domJSON.js",
"license": "MIT",
Expand Down
14 changes: 10 additions & 4 deletions dist/domJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@
var metadata = {
href: win.location.href || null,
userAgent: window.navigator && window.navigator.userAgent ? window.navigator.userAgent : null,
version: "0.1.0"
version: "0.1.1"
};
var defaultsForToJSON = {
absolutePaths: [ "action", "data", "href", "src" ],
attributes: true,
computedStyle: false,
cull: true,
deep: true,
domProperties: true,
filter: false,
htmlOnly: false,
metadata: true,
Expand Down Expand Up @@ -197,7 +198,7 @@
var copy = {};
for (var n in node) {
if (typeof node[n] !== "undefined" && typeof node[n] !== "function" && n.charAt(0).toLowerCase() === n.charAt(0)) {
if (!(node[n] instanceof Object) || node[n] instanceof Array) {
if (typeof node[n] !== "object" || node[n] instanceof Array) {
if (opts.cull) {
if (node[n] || node[n] === 0 || node[n] === false) {
copy[n] = node[n];
Expand Down Expand Up @@ -301,7 +302,11 @@
options.domProperties = boolDiff(unique(options.domProperties, requiring), ignoring);
}
} else {
options.domProperties = [ true ].concat(ignoring);
if (options.domProperties === false) {
options.domProperties = requiring;
} else {
options.domProperties = [ true ].concat(ignoring);
}
}
copy = toJSON(node, options, 0);
if (options.metadata) {
Expand Down Expand Up @@ -376,7 +381,7 @@
return false;
}
for (var x in obj) {
if (!(obj[x] instanceof Object) && x !== "isContentEditable") {
if (typeof obj[x] !== "object" && x !== "isContentEditable" && x !== "childNodes") {
try {
node[x] = obj[x];
} catch (e) {
Expand Down Expand Up @@ -405,6 +410,7 @@
}
options = extend({}, defaultsForToDOM, opts);
node = document.createDocumentFragment();
debugger;
if (options.noMeta) {
toDOM(obj, node, node);
} else {
Expand Down
2 changes: 1 addition & 1 deletion dist/domJSON.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "domjson",
"author": "Alex Zaslavsky <[email protected]>",
"version": "0.1.0",
"version": "0.1.1",
"description": "Convert DOM trees into compact JSON objects, and vice versa, as fast as possible.",
"contributors": [
{
Expand Down
4 changes: 2 additions & 2 deletions src/domJSON.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @fileOverview
* @author Alex Zaslavsky
* @version 0.1.0
* @version 0.1.1
* @license The MIT License: Copyright (c) 2013 Alex Zaslavsky
*/

Expand Down Expand Up @@ -54,7 +54,7 @@
var metadata = {
href: win.location.href || null,
userAgent: window.navigator && window.navigator.userAgent ? window.navigator.userAgent : null,
version: /* version */'0.1.0'/* end-version */
version: /* version */'0.1.1'/* end-version */
};


Expand Down

0 comments on commit 7f2e4d0

Please sign in to comment.