From 723ca968b24fc47f755a43840af369e2046b041c Mon Sep 17 00:00:00 2001 From: Burak Ozdemir Date: Wed, 3 Apr 2019 21:44:17 +0300 Subject: [PATCH] v2.0, change default encoding and decoding behaviour of Morsify to make it compatible with other tools around the web, split the string into words instead of characters. --- .editorconfig | 1 + .gitignore | 2 - .npmignore | 2 - .travis.yml | 1 - LICENSE | 2 +- README.md | 18 ++-- dist/morsify.js | 17 ++- dist/morsify.min.js | 2 +- package.json | 10 +- src/morsify.js | 14 +-- test/morsify.js | 248 ++++++++++++++++++++++---------------------- 11 files changed, 163 insertions(+), 154 deletions(-) diff --git a/.editorconfig b/.editorconfig index 0f09989..8951c39 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,6 +4,7 @@ root = true [*] indent_style = space indent_size = 2 +tab_width = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true diff --git a/.gitignore b/.gitignore index 64d1a01..0fa6951 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,3 @@ coverage/ node_modules/ npm-debug.log package-lock.json -yarn-error.log -yarn.lock diff --git a/.npmignore b/.npmignore index 8ca8434..4ba028d 100644 --- a/.npmignore +++ b/.npmignore @@ -1,6 +1,4 @@ coverage/ npm-debug.log package-lock.json -yarn-error.log -yarn.lock .idea diff --git a/.travis.yml b/.travis.yml index 83a15a7..0323edf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ language: node_js node_js: - node - 6 - - 4 after_script: - npm run test-cov diff --git a/LICENSE b/LICENSE index b6fde66..797e77d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) Burak Özdemir +Copyright (c) 2019 Burak Özdemir Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index bae1f2d..e45726f 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ $ yarn add morsify ```js const morsify = require('morsify'); -const encoded = morsify.encode('SOS'); // .../---/... -const decoded = morsify.decode('.../---/...'); // S O S +const encoded = morsify.encode('SOS'); // ... --- ... +const decoded = morsify.decode('... --- ...'); // SOS const characters = morsify.characters(); // {'1': {'A': '.-', ...}, ..., '11': {'ㄱ': '.-..', ...}} const audio = morsify.audio('SOS'); audio.play(); // play audio @@ -39,8 +39,8 @@ Or alternatively, you can also use the library directly with including the sourc ```html