currentactivity 1.0.2 → 1.0.3

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.
package/build/index.js CHANGED
@@ -299,8 +299,13 @@ function findLines(lines, target) {
299
299
  return result;
300
300
  }
301
301
  function findFirstLines(lines, target) {
302
- var _a;
303
- return (_a = findLines(lines, target).at(0)) === null || _a === void 0 ? void 0 : _a.content;
302
+ const matchedLines = findLines(lines, target);
303
+ for (const line of matchedLines) {
304
+ if (line.content.indexOf("null") < 0) {
305
+ return line.content;
306
+ }
307
+ }
308
+ return undefined;
304
309
  }
305
310
  function findFirstLineIndex(lines, target) {
306
311
  const firstLine = findLines(lines, target).at(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "currentactivity",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A command line tool to display the current activity for android.",
5
5
  "main": "./build/index.js",
6
6
  "scripts": {
@@ -38,4 +38,4 @@
38
38
  "publishConfig": {
39
39
  "access": "public"
40
40
  }
41
- }
41
+ }
package/src/index.ts CHANGED
@@ -355,7 +355,13 @@ function findFirstLines(
355
355
  lines: Array<string>,
356
356
  target: string
357
357
  ): string | undefined {
358
- return findLines(lines, target).at(0)?.content;
358
+ const matchedLines = findLines(lines, target);
359
+ for (const line of matchedLines) {
360
+ if (line.content.indexOf("null") < 0) {
361
+ return line.content;
362
+ }
363
+ }
364
+ return undefined;
359
365
  }
360
366
 
361
367
  function findFirstLineIndex(lines: Array<string>, target: string): number {