Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
depends on just-curry-it. Let's be honest, one must curry sometimes. …
Browse files Browse the repository at this point in the history
…And so /core do not depend on /fusto anymore
  • Loading branch information
ildella committed Aug 15, 2023
1 parent c061931 commit f6f4591
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/fs-utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const {EOL} = require('os')
const {readFile, writeFile, mkdir} = require('fs/promises')
const {curry} = require('../fusto')
const curry = require('just-curry-it')

/*
eslint-disable security/detect-non-literal-fs-filename
Expand Down
4 changes: 4 additions & 0 deletions lnd/lnd-polar-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ const {curry} = require('../fusto')

const polarBasePath = networkNumber => `${homedir()}/.polar/networks/${networkNumber}/volumes/lnd/`

/*
eslint-disable security/detect-non-literal-fs-filename
*/

module.exports = curry((polarNetwork, {
host = 'localhost',
port = '8081',
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "moar-js",
"version": "0.4.3",
"version": "0.5.1",
"description": "Simple JavaScript files I use across projects",
"license": "MIT",
"author": {
Expand All @@ -10,6 +10,8 @@
"JavaScript",
"Library",
"Streams",
"Functional",
"Curry",
"Bitcoin Ligthing Network",
"LND",
"HTTP",
Expand Down Expand Up @@ -54,5 +56,8 @@
"pino-pretty": "10.2.0",
"tracer": "1.1.6",
"ws": "8.13.0"
},
"dependencies": {
"just-curry-it": "5.3.0"
}
}
12 changes: 12 additions & 0 deletions tests/core/fs-utils.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const fs = require('fs/promises')

const {fs: {writeText, readText}} = require('../../core')

afterEach(() => fs.unlink('.test-text'))

test('write text', async () => {
const write = writeText('.test-text')
const result = await write('hello')
expect(result).toEqual('hello')
expect(await readText('.test-text')).toEqual('hello\n')
})
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2754,6 +2754,11 @@ json5@^2.1.3, json5@^2.2.2:
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"
integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==

just-curry-it@5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/just-curry-it/-/just-curry-it-5.3.0.tgz#1463602e932c5beb431a2a384dddcd48bb3c9c42"
integrity sha512-silMIRiFjUWlfaDhkgSzpuAyQ6EX/o09Eu8ZBfmFwQMbax7+LQzeIU2CBrICT6Ne4l86ITCGvUCBpCubWYy0Yw==

kleur@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e"
Expand Down

0 comments on commit f6f4591

Please sign in to comment.