Skip to content

Commit e0dc43a

Browse files
committed
🐛 fix makejs not found error and release 1.0.7
1 parent 9778ef3 commit e0dc43a

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Change log
22

3-
## 1.0.6 - 23.12.2017
3+
## 1.0.7 - 23.12.2017
44

55
1. old compress becomes makejs
66
2. new compress does compression only

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "echarts-mapmaker",
3-
"version": "1.0.6",
3+
"version": "1.0.7",
44
"description": "Make maps for echarts",
55
"scripts": {
66
"test": "echo \"Error: no test specified\" && exit 1"
77
},
88
"bin": {
9+
"makejs": "./src/makejs.js",
910
"compress": "./src/compress.js",
1011
"property": "./src/property.js",
1112
"decompress": "./src/decompress.js",

src/maker.js

+16-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ const path = require('path');
44
const mapTool = require('./map-tool');
55
const parser = require('./parseGeoJson');
66

7+
var geoJsonToCompressed = (jsonFile, jsFile, registryName) => {
8+
9+
data = fs.readFileSync(jsonFile, 'utf8');
10+
11+
var geojson = JSON.parse(data);
12+
13+
if(!geojson.UTF8Encoding){
14+
mapTool.compress(geojson);
15+
}
16+
fs.writeFileSync(jsFile, JSON.stringify(geojson));
17+
18+
};
19+
720
var geoJsonToCompressedJs = (jsonFile, jsFile, registryName) => {
821

922
data = fs.readFileSync(jsonFile, 'utf8');
@@ -141,10 +154,11 @@ function merge(geojson, geojsonToBeMerged){
141154

142155

143156
module.exports = {
144-
compress: geoJsonToCompressedJs,
157+
compress: geoJsonToCompressed,
145158
inspect: geoJsonListProperties,
146159
rename: geoJsonRenameAProperty,
147160
mergeProperty: geoJsonMergeTwoPropertiesAsOne,
148161
merge: merge,
149-
decompress: jsToGeoJson
162+
decompress: jsToGeoJson,
163+
makeJs: geoJsonToCompressedJs
150164
}

0 commit comments

Comments
 (0)