Comparing version 0.0.4 to 0.0.5
@@ -51,3 +51,3 @@ // Generated by CoffeeScript 1.7.1 | ||
object: function(obj, extratab) { | ||
var handler, indentThis, key, leadIndent, output, val; | ||
var alias, handler, indentThis, key, leadIndent, output, val; | ||
if (extratab == null) { | ||
@@ -67,3 +67,9 @@ extratab = 0; | ||
} | ||
_results.push("" + key + ": " + (handler(val))); | ||
if (type(val) === 'object' && val._alias) { | ||
alias = "&" + val._alias; | ||
delete val._alias; | ||
_results.push("" + key + ": " + alias + (handler(val))); | ||
} else { | ||
_results.push("" + key + ": " + (handler(val))); | ||
} | ||
} | ||
@@ -80,11 +86,10 @@ return _results; | ||
string: function(str) { | ||
var safestr; | ||
if (str.match(/^(true|false|undefined|null)$/)) { | ||
return "\"" + str + "\""; | ||
} | ||
safestr = JSON.stringify(str).replace(/^"|"$/g, ""); | ||
if (safestr.match(/\\n/)) { | ||
return "|\n" + indents(indentLevel + 1) + safestr.replace(/(\\n|\\r)/g, "\n" + indents(indentLevel + 1)); | ||
if (str.match(/\n|\r/)) { | ||
return "|\n" + indents(indentLevel + 1) + str.replace(/(\n|\r)/g, "\n" + indents(indentLevel + 1)); | ||
} else { | ||
return str; | ||
} | ||
return safestr; | ||
}, | ||
@@ -91,0 +96,0 @@ undefined: function() { |
@@ -5,3 +5,3 @@ { | ||
"author": "Awnist <hi@awnist.com> (http://awnist.com)", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"main": "./lib/cson2yaml", | ||
@@ -8,0 +8,0 @@ "repository": { |
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
4111
101