modl-converter
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -36,3 +36,3 @@ "use strict"; | ||
if (node === null) { | ||
return escapedKey + "=000"; | ||
return escapedKey + "=null"; | ||
} | ||
@@ -50,3 +50,3 @@ if (Array.isArray(node)) { | ||
if (node === null) { | ||
return '000'; | ||
return 'null'; | ||
} | ||
@@ -90,3 +90,3 @@ if (typeof node === 'object' && !Array.isArray(node)) { | ||
if (node === null) { | ||
return '000'; | ||
return 'null'; | ||
} | ||
@@ -102,3 +102,3 @@ if (typeof node === 'string') { | ||
if (typeof node === 'boolean') { | ||
return node ? '01' : '00'; | ||
return node ? 'true' : 'false'; | ||
} | ||
@@ -105,0 +105,0 @@ if (typeof node === 'number') { |
@@ -10,3 +10,4 @@ "use strict"; | ||
var graveQuoteIfNecessary = function (s) { | ||
if (s !== null && (exports.shouldBeGraveQuoted.test(s) || s === '' || exports.isNumeric.test(s) || 'true' === s || 'false' === s || 'null' === s)) { | ||
if (s !== null && | ||
(exports.shouldBeGraveQuoted.test(s) || s === '' || (exports.isNumeric.test(s) && s !== '00' && s !== '01' && s !== '000') || 'true' === s || 'false' === s || 'null' === s)) { | ||
return '`' + s + '`'; | ||
@@ -13,0 +14,0 @@ } |
{ | ||
"name": "modl-converter", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "A JSON to MODL library in TypeScript", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -48,3 +48,3 @@ import log from 'loglevel'; | ||
if (node === null) { | ||
return `${escapedKey}=000`; | ||
return `${escapedKey}=null`; | ||
} | ||
@@ -63,3 +63,3 @@ if (Array.isArray(node)) { | ||
if (node === null) { | ||
return '000'; | ||
return 'null'; | ||
} | ||
@@ -111,3 +111,3 @@ if (typeof node === 'object' && !Array.isArray(node)) { | ||
if (node === null) { | ||
return '000'; | ||
return 'null'; | ||
} | ||
@@ -125,3 +125,3 @@ if (typeof node === 'string') { | ||
if (typeof node === 'boolean') { | ||
return node ? '01' : '00'; | ||
return node ? 'true' : 'false'; | ||
} | ||
@@ -128,0 +128,0 @@ // |
@@ -14,3 +14,6 @@ import { createUnicodeEscaper } from './UnicodeEscaper'; | ||
export const graveQuoteIfNecessary = (s: string | null) => { | ||
if (s !== null && (shouldBeGraveQuoted.test(s) || s === '' || isNumeric.test(s) || 'true' === s || 'false' === s || 'null' === s)) { | ||
if ( | ||
s !== null && | ||
(shouldBeGraveQuoted.test(s) || s === '' || (isNumeric.test(s) && s !== '00' && s !== '01' && s !== '000') || 'true' === s || 'false' === s || 'null' === s) | ||
) { | ||
return '`' + s + '`'; | ||
@@ -17,0 +20,0 @@ } else { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
24875
476