protodef-yaml
Advanced tools
Comparing version 1.0.0 to 1.0.1
const fs = require('fs') | ||
const yaml = require('js-yaml') | ||
const getJSON = (file) => JSON.parse(fs.readFileSync(file, 'utf8')) | ||
const log = () => {} | ||
function detectIndentation(lines) { | ||
@@ -387,3 +390,3 @@ const indentationLevel = 0 | ||
function formFinal(inp, out) { | ||
var j = require(inp || './compiled_proto.json') | ||
var j = getJSON(inp || './compiled_proto.json') | ||
let ret = {} | ||
@@ -399,3 +402,3 @@ for (var entry of j) { | ||
parseYAML(toYAML(inputFile, false), temp) | ||
return require(temp) | ||
return getJSON(temp) | ||
} | ||
@@ -407,3 +410,3 @@ | ||
parseYAML(toYAML(inputFile), temp) | ||
transform(require(temp), out) | ||
transform(getJSON(temp), out) | ||
formFinal(out, outputFile) | ||
@@ -410,0 +413,0 @@ } |
{ | ||
"name": "protodef-yaml", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Transforms YAML-like syntax to ProtoDef JSON schema", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -8,3 +8,3 @@ # protodef-yaml | ||
```sh | ||
npm install -g extremeheat/protodef-yaml | ||
npm install -g protodef-yaml | ||
protodef-yaml <input yaml file> <output json file> | ||
@@ -15,3 +15,3 @@ ``` | ||
``` | ||
npx extremeheat/protodef-yaml input.yml | ||
npx protodef-yaml input.yml | ||
``` | ||
@@ -18,0 +18,0 @@ |
@@ -22,3 +22,3 @@ const { compile } = require('../compiler') | ||
console.info('sha1', hash) | ||
const expected = 'dc910b6e000fbd9a318110f3cc303c16e2d1aaea' | ||
const expected = 'da1054296f6298df78854c044dd9cef881e608b8' | ||
if (hash !== expected) { | ||
@@ -25,0 +25,0 @@ console.error('Unexpected hash: ', hash, '!=', expected) |
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
258490
13
402
3