jsir 1.1.7 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cmd/ooa.js +8 -7
  2. package/package.json +1 -1
package/cmd/ooa.js CHANGED
@@ -216,13 +216,13 @@ async function fileLine(name) {
216
216
  let watcher = _Chokidar.watch([workFile]);
217
217
 
218
218
  text = trim(text)
219
- let lines = getLines(text)
220
- let line = trim(lines[lines.length - 1])
219
+ let lines = getExeLines(text)
220
+ let line = trim(lines[0])
221
221
  watcher
222
222
  .on('change', async () => {
223
223
  let newText = trim(String(_fs.readFileSync(workFile)))
224
- let newLines = getLines(newText)
225
- let newLine = trim(newLines[newLines.length - 1])
224
+ let newLines = getExeLines(newText)
225
+ let newLine = trim(newLines[0])
226
226
 
227
227
  if (newLine
228
228
  && newLines.length >= lines.length
@@ -251,7 +251,7 @@ async function fileLine(name) {
251
251
  info("fileLine open " + workFile)
252
252
  }
253
253
 
254
- function getLines(text) {
254
+ function getExeLines(text) {
255
255
  let lines = []
256
256
  let nLine = []
257
257
  let cLine = []
@@ -275,6 +275,8 @@ function getLines(text) {
275
275
 
276
276
  if (!line.endsWith('*/')) {
277
277
  nLine.push(line)
278
+ } else {
279
+ lines.push("")
278
280
  }
279
281
  continue
280
282
  }
@@ -284,8 +286,7 @@ function getLines(text) {
284
286
  if (cLine.length > 0) {
285
287
  lines.push(cLine.join('\n'))
286
288
  }
287
-
288
- return lines.slice(1).reverse()
289
+ return lines.slice(1)
289
290
  }
290
291
 
291
292
  async function dealInitData() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsir",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {