mirror of
https://github.com/dergigi/boris.git
synced 2025-12-25 10:34:28 +01:00
- Add project structure with TypeScript, React, and Vite - Implement nostr authentication using browser extension (NIP-07) - Add NIP-51 compliant bookmark fetching and display - Create minimal UI with login and bookmark components - Integrate applesauce-core and applesauce-react libraries - Add responsive styling with dark/light mode support - Include comprehensive README with setup instructions This is a minimal MVP for a nostr bookmark client that allows users to view their bookmarks according to NIP-51 specification.
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import { toDecodedMap, toEncodedMap } from '@jridgewell/gen-mapping';
|
|
|
|
import type { GenMapping } from '@jridgewell/gen-mapping';
|
|
import type { DecodedSourceMap, EncodedSourceMap, Options } from './types';
|
|
|
|
/**
|
|
* A SourceMap v3 compatible sourcemap, which only includes fields that were
|
|
* provided to it.
|
|
*/
|
|
export default class SourceMap {
|
|
declare file?: string | null;
|
|
declare mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings'];
|
|
declare sourceRoot?: string;
|
|
declare names: string[];
|
|
declare sources: (string | null)[];
|
|
declare sourcesContent?: (string | null)[];
|
|
declare version: 3;
|
|
declare ignoreList: number[] | undefined;
|
|
|
|
constructor(map: GenMapping, options: Options) {
|
|
const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map);
|
|
this.version = out.version; // SourceMap spec says this should be first.
|
|
this.file = out.file;
|
|
this.mappings = out.mappings as SourceMap['mappings'];
|
|
this.names = out.names as SourceMap['names'];
|
|
this.ignoreList = out.ignoreList as SourceMap['ignoreList'];
|
|
this.sourceRoot = out.sourceRoot;
|
|
|
|
this.sources = out.sources as SourceMap['sources'];
|
|
if (!options.excludeContent) {
|
|
this.sourcesContent = out.sourcesContent as SourceMap['sourcesContent'];
|
|
}
|
|
}
|
|
|
|
toString(): string {
|
|
return JSON.stringify(this);
|
|
}
|
|
}
|