Skip to content

Commit

Permalink
fixes for workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Egge21M committed Oct 19, 2023
1 parent 496b469 commit 0615c60
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.eslintrc.js
dist/
lib
examples
23 changes: 12 additions & 11 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/usr/bin/env node
/* eslint-disable no-console */
/* eslint-disable import/no-extraneous-dependencies */

const fs = require('fs')
const esbuild = require('esbuild')
const fs = require('fs');
const esbuild = require('esbuild');

let common = {
const common = {
entryPoints: ['src/index.ts'],
bundle: true,
sourcemap: 'external',
}

};

esbuild
.build({
Expand All @@ -18,11 +19,11 @@ esbuild
packages: 'external',
})
.then(() => {
const packageJson = JSON.stringify({ type: 'module' })
fs.writeFileSync(`${__dirname}/lib/esm/package.json`, packageJson, 'utf8')
const packageJson = JSON.stringify({ type: 'module' });
fs.writeFileSync(`${__dirname}/lib/esm/package.json`, packageJson, 'utf8');

console.log('esm build success.')
})
console.log('esm build success.');
});

esbuild
.build({
Expand All @@ -31,7 +32,7 @@ esbuild
format: 'cjs',
packages: 'external',
})
.then(() => console.log('cjs build success.'))
.then(() => console.log('cjs build success.'));

esbuild
.build({
Expand All @@ -45,4 +46,4 @@ esbuild
process: '{"env": {}}',
},
})
.then(() => console.log('standalone build success.'))
.then(() => console.log('standalone build success.'));
19 changes: 12 additions & 7 deletions src/tags.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { Event } from "nostr-tools";
/* eslint-disable import/prefer-default-export */
import { Event } from 'nostr-tools';

export function getTagValue(event: Event, tagIdentifier: string ,valueIndex: number = 1) {
const tag = event.tags.find(tag => tag[0] === tagIdentifier);
if(!tag) {
return undefined
export function getTagValue(
event: Event,
tagIdentifier: string,
valueIndex: number = 1
) {
const tag = event.tags.find((t) => t[0] === tagIdentifier);
if (!tag) {
return undefined;
}
return tag[valueIndex]
}
return tag[valueIndex];
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,6 @@
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */
}
},
"exclude": ["lib", "examples"]
}

0 comments on commit 0615c60

Please sign in to comment.