Skip to content

Commit

Permalink
Merge pull request #8 from lxdao-official/develop
Browse files Browse the repository at this point in the history
fix:  only eip number return null
  • Loading branch information
brucexu-eth authored Dec 10, 2024
2 parents 68aaaf9 + 1849c5a commit b3a4198
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,11 @@ export class AppService {
try {
const result = {};
// eip match
const numbers = content.match(/\d+/g);
const texts = content.match(/\D+/g);
const numbers = content.match(/\d+/g) || [];
const texts = content.match(/\D+/g) || [];
const txt = texts.length ? texts.join(' ').trim() : '';
const eips = [];
let eipCondition = '';
console.log(numbers);
if (numbers && numbers.length) {
numbers.forEach((item) => {
if (Number(item) < 10000) {
Expand All @@ -103,7 +102,7 @@ export class AppService {
}
}

if (eips.length && !txt) {
if (eips?.length && !txt) {
const eipRecords = await this.connection.query(
`SELECT eip, title, type, category FROM "EIPs" WHERE ${eipCondition}`,
);
Expand Down

0 comments on commit b3a4198

Please sign in to comment.