mirror of
https://github.com/dergigi/boris.git
synced 2025-12-19 23:54:23 +01:00
feat: initialize markr nostr bookmark client
- 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.
This commit is contained in:
79
node_modules/mdast-util-to-markdown/lib/configure.js
generated
vendored
Normal file
79
node_modules/mdast-util-to-markdown/lib/configure.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* @import {Options, State} from './types.js'
|
||||
*/
|
||||
|
||||
const own = {}.hasOwnProperty
|
||||
|
||||
/**
|
||||
* @param {State} base
|
||||
* @param {Options} extension
|
||||
* @returns {State}
|
||||
*/
|
||||
export function configure(base, extension) {
|
||||
let index = -1
|
||||
/** @type {keyof Options} */
|
||||
let key
|
||||
|
||||
// First do subextensions.
|
||||
if (extension.extensions) {
|
||||
while (++index < extension.extensions.length) {
|
||||
configure(base, extension.extensions[index])
|
||||
}
|
||||
}
|
||||
|
||||
for (key in extension) {
|
||||
if (own.call(extension, key)) {
|
||||
switch (key) {
|
||||
case 'extensions': {
|
||||
// Empty.
|
||||
break
|
||||
}
|
||||
|
||||
/* c8 ignore next 4 */
|
||||
case 'unsafe': {
|
||||
list(base[key], extension[key])
|
||||
break
|
||||
}
|
||||
|
||||
case 'join': {
|
||||
list(base[key], extension[key])
|
||||
break
|
||||
}
|
||||
|
||||
case 'handlers': {
|
||||
map(base[key], extension[key])
|
||||
break
|
||||
}
|
||||
|
||||
default: {
|
||||
// @ts-expect-error: matches.
|
||||
base.options[key] = extension[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return base
|
||||
}
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @param {Array<T>} left
|
||||
* @param {Array<T> | null | undefined} right
|
||||
*/
|
||||
function list(left, right) {
|
||||
if (right) {
|
||||
left.push(...right)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @template T
|
||||
* @param {Record<string, T>} left
|
||||
* @param {Record<string, T> | null | undefined} right
|
||||
*/
|
||||
function map(left, right) {
|
||||
if (right) {
|
||||
Object.assign(left, right)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user