Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
paiv committed Nov 10, 2024
1 parent 37e1cc5 commit 1e7f693
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,12 @@ jobs:

- name: Install
run: |
npm install --global git+https://github.com/paiv/uklatn.git#wip
npm install --global
- name: Test CLI
run: |
sh -c '[ "$(npm exec -- uklatn -t DSTU_9112_B мрії мої)" = "mriji moji" ]'
- name: Test import
run: |
echo 'const { encode } = require("uklatn"); encode("імпорт");' | node -
build-py:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions js/uklatn.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,6 @@ export function decode(text, table) {
if (tr === undefined) { throw new Error("unknown table " + JSON.stringify(table)); }
return tr.transform(text);
}


export default { encode, decode };
3 changes: 3 additions & 0 deletions tools/gen/gen_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ def _emit_tr(cname, rules, file):
if (tr === undefined) {{ throw new Error("unknown table " + JSON.stringify(table)); }}
return tr.transform(text);
}}
export default {{ encode, decode }};
'''
text = template.format(**context)
return text
Expand Down

0 comments on commit 1e7f693

Please sign in to comment.