leaf-converter
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -5,2 +5,12 @@ # Change Log | ||
<a name="1.1.2"></a> | ||
## [1.1.2](https://github.com/forsigner/leaf-converter/compare/v1.1.1...v1.1.2) (2018-01-03) | ||
### Bug Fixes | ||
* fix md to schema ([2da3e27](https://github.com/forsigner/leaf-converter/commit/2da3e27)) | ||
<a name="1.1.1"></a> | ||
@@ -7,0 +17,0 @@ ## [1.1.1](https://github.com/forsigner/leaf-converter/compare/v1.1.0...v1.1.1) (2018-01-03) |
@@ -33,6 +33,6 @@ 'use strict'; | ||
console.log(start, end, value); | ||
source = source.slice(0, start - 1) + value + source.slice(end - 1); | ||
var readValue = value.split('|').length > 1 ? '"' + value + '"' : value; | ||
source = source.slice(0, start - 1) + readValue + source.slice(end - 1); | ||
}); | ||
return source; | ||
} |
@@ -74,3 +74,3 @@ 'use strict'; | ||
var type = typeOf(object[item]); | ||
var desc = object['// ' + item]; | ||
var desc = getDesc(object['// ' + item]); | ||
var value = '' + object[item] + separator + type + separator + desc; | ||
@@ -101,2 +101,9 @@ obj[item] = makeSchema(value); | ||
function getDesc(desc) { | ||
if (_.isString(desc)) return desc; | ||
if (_.isArray(desc) && desc.length === 2) { | ||
return desc[1][0].replace(/^\/\//, '').trim(); | ||
} | ||
} | ||
function objectToSchema(data) { | ||
@@ -103,0 +110,0 @@ var _iteratorNormalCompletion2 = true; |
{ | ||
"name": "leaf-converter", | ||
"description": "", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "author": { |
24005
667