commonjs import for ramda.

This commit is contained in:
fiatjaf
2021-02-17 17:01:40 -03:00
parent c03f8d1c56
commit 0e1c23a3f9
2 changed files with 4 additions and 3 deletions

View File

@@ -1,8 +1,8 @@
import R from 'ramda'
import {getEventHash, signEvent} from './event' import {getEventHash, signEvent} from './event'
import {relayConnect, normalizeRelayURL} from './relay' import {relayConnect, normalizeRelayURL} from './relay'
const R = require('ramda')
export function relayPool(globalPrivateKey) { export function relayPool(globalPrivateKey) {
const relays = {} const relays = {}
const globalSub = [] const globalSub = []

View File

@@ -1,9 +1,10 @@
import 'websocket-polyfill' import 'websocket-polyfill'
import R from 'ramda'
import {verifySignature} from './event' import {verifySignature} from './event'
import {sha256} from './utils' import {sha256} from './utils'
const R = require('ramda')
export function normalizeRelayURL(url) { export function normalizeRelayURL(url) {
let [host, ...qs] = url.split('?') let [host, ...qs] = url.split('?')
if (host.slice(0, 4) === 'http') host = 'ws' + host.slice(4) if (host.slice(0, 4) === 'http') host = 'ws' + host.slice(4)