Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

modl-converter

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modl-converter - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

8

dist/JsonToModl.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc