@node-steam/vdf
Advanced tools
Comparing version 2.0.0 to 2.0.1
const vdf = require('@node-steam/vdf'); | ||
const object = { | ||
description: 'This is a example object!', | ||
boolean: true, | ||
number: 529, | ||
}; | ||
const string = | ||
`"string" "string" | ||
"false" "false" | ||
"true" "true" | ||
"number" "1234" | ||
"float" "12.34" | ||
"null" "null" | ||
"undefined" "undefined" | ||
"nested" | ||
{ | ||
"string" "string" | ||
"deep" | ||
{ | ||
"string" "string" | ||
} | ||
}`; | ||
const x = vdf.stringify(object, true); | ||
return x; | ||
vdf.parse(string); |
@@ -75,5 +75,6 @@ "use strict"; | ||
} | ||
return dump(object, 0); | ||
return create(object); | ||
}; | ||
var dump = function (object, level) { | ||
var create = function (object, level) { | ||
if (level === void 0) { level = 0; } | ||
if (typeof object !== 'object') { | ||
@@ -90,3 +91,3 @@ throw new TypeError('VDF | Stringify: A key has value of type other than string or object'); | ||
if (typeof object[key] === 'object' && object[key] !== null) { | ||
result += [indent, '"', key, '"\n', indent, '{\n', dump(object[key], level + 1), indent, '}\n'].join(''); | ||
result += [indent, '"', key, '"\n', indent, '{\n', create(object[key], level + 1), indent, '}\n'].join(''); | ||
} | ||
@@ -93,0 +94,0 @@ else { |
{ | ||
"name": "@node-steam/vdf", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Module to convert Valve's KeyValue format to JSON and back", | ||
@@ -67,7 +67,4 @@ "main": "lib/index.js", | ||
"babel-register": "^6.26.0", | ||
"eslint": "^4.12.0", | ||
"eslint-config-google": "^0.9.1", | ||
"typescript": "^2.6.1", | ||
"typescript-eslint-parser": "^9.0.0" | ||
"typescript": "^2.6.1" | ||
} | ||
} |
@@ -15,3 +15,5 @@ [![Chat](https://img.shields.io/gitter/room/node-steam/vdf.svg?style=flat-square)](https://gitter.im/node-steam/vdf) | ||
> | ||
> (`<= v2.0.0` can be used as a drop-in replacement) | ||
> (`< v2.0.0` can be used as a drop-in replacement) | ||
> | ||
> [Differences](#differences-from-simple-vdf) | ||
@@ -18,0 +20,0 @@ ## Installation |
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
10726
7
117
181