Skip to content

Commit a128f03

Browse files
authored
Merge pull request #45 from Nesopie/feat/hybrid
Feat/hybrid
2 parents cd8cb4b + 3d7c00e commit a128f03

File tree

22 files changed

+4552
-2699
lines changed

22 files changed

+4552
-2699
lines changed

.github/workflows/main_ci.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
node-version: [14, 'lts/*']
21+
node-version: [18, 'lts/*']
2222
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2323
steps:
24-
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
24+
- uses: actions/checkout@v3
2525
- name: Use Node.js ${{ matrix.node-version }}
26-
uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
26+
uses: actions/setup-node@v4
2727
with:
2828
node-version: ${{ matrix.node-version }}
2929
registry-url: https://registry.npmjs.org/
@@ -37,8 +37,8 @@ jobs:
3737
coverage:
3838
runs-on: ubuntu-latest
3939
steps:
40-
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
41-
- uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
40+
- uses: actions/checkout@v3
41+
- uses: actions/setup-node@v4
4242
with:
4343
node-version: 'lts/*'
4444
registry-url: https://registry.npmjs.org/
@@ -48,11 +48,21 @@ jobs:
4848
standard:
4949
runs-on: ubuntu-latest
5050
steps:
51-
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
52-
- uses: actions/setup-node@eeb10cff27034e7acf239c5d29f62154018672fd # v3
51+
- uses: actions/checkout@v3
52+
- uses: actions/setup-node@v4
5353
with:
5454
node-version: 'lts/*'
5555
registry-url: https://registry.npmjs.org/
5656
cache: 'npm'
5757
- run: npm ci
5858
- run: npm run standard
59+
gitdiff:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v3
63+
- uses: actions/setup-node@v4
64+
with:
65+
node-version: 18
66+
registry-url: https://registry.npmjs.org/
67+
- run: npm ci
68+
- run: npm run gitdiff

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
node_modules
22
.nyc_output
3+
coverage
4+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A straight forward implementation of base58check extending upon bs58.
1212
## Example
1313

1414
```javascript
15-
var bs58check = require('bs58check')
15+
import bs58check from 'bs58check'
1616

1717
var decoded = bs58check.decode('5Kd3NBUAdUnhyzenEwVLy9pBKxSwXvE9FMPyR4UKZvpe6E3AgLr')
1818

base.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

fixup.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
find src/cjs -type f -name "*.js" -exec bash -c 'mv "$0" "${0%.js}.cjs"' {} \;
4+
5+
replace_in_file() {
6+
local file="$1"
7+
local regex="$2"
8+
local replacement="$3"
9+
10+
sed -i "s/${regex}/${replacement}/g" "$file"
11+
}
12+
13+
search_pattern='__importDefault(require("\([^"]*\)\.js"));'
14+
replace_pattern='__importDefault(require("\1.cjs"));'
15+
16+
find src/cjs -type f -name "*.cjs" | while read -r file; do
17+
replace_in_file "$file" "$search_pattern" "$replace_pattern"
18+
done

index.d.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

index.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)