working rss feed to nostr publish

This commit is contained in:
2023-11-24 00:43:28 -05:00
parent 06edcb57ae
commit 88d2f9cfec
8396 changed files with 783105 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
// maybe.test
/* eslint-env jest */
import {
maybe
} from './maybe.js'
describe('test .maybe() method:', () => {
const plus5 = (x) => x + 5
const minus2 = (x) => x - 2
const isNumber = (x) => Number(x) === x
const toString = (x) => 'The value is ' + String(x)
const getDefault = () => 'This is default value'
test(' check if .maybe() works correctly', () => {
const x1 = maybe(5)
.if(isNumber)
.map(plus5)
.map(minus2)
.map(toString)
.else(getDefault)
.value()
expect(x1).toEqual('The value is 8')
const x2 = maybe('nothing')
.if(isNumber)
.map(plus5)
.map(minus2)
.map(toString)
.else(getDefault)
.value()
expect(x2).toEqual('This is default value')
})
})