Skip to content

Commit c8425b0

Browse files
refactor : from Javascript to Typescript
1 parent 9ed3e4e commit c8425b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+5206
-1830
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
language: node_js
22
node_js:
3-
- '10'
3+
- '18'
44
script: npm run test

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
## Overview
33
Extract and decompose (fuzzy) URLs (including emails, which are conceptually a part of URLs) in texts with robust patterns.
44

5+
- This library is currently being refactored into TypeScript, as it was originally developed in JavaScript.
6+
57
#### URL knife
68
<a href="https://jsfiddle.net/AndrewKang/xtfjn8g3/" target="_blank">LIVE DEMO</a>
79

@@ -13,16 +15,18 @@ For ES5 users,
1315
``` html
1416
<html>
1517
<body>
16-
<p id="content"></p>
1718
<script src="../dist/url-knife.bundle.js"></script>
19+
<--! OR !-->
20+
<script src="https://cdn.jsdelivr.net/gh/patternknife/url-knife@3.2.1/dist/url-knife.bundle.min.js"></script>
21+
1822
<script type="text/javascript">
1923
</script>
2024
</body>
2125
</html>
2226
```
2327

2428
For ES6 npm users, run 'npm install --save url-knife' on console.
25-
(Node v18.20.4)
29+
(**Requred Node v18.20.4**)
2630

2731
``` html
2832
import Pattern from 'url-knife';
@@ -39,14 +43,13 @@ import Pattern from 'url-knife';
3943

4044

4145
#### Chapter 1. Normalize or parse one URL
42-
The following two methods should be used for only one url, not for multiple ones in texts.
43-
(for multiple ones, refer to Chapter 2 & 4)
46+
The following two methods should be used for processing a single URL, not for multiple URLs within a text.
47+
(For handling multiple URLs, refer to Chapters 2 and 4.)
4448

4549
##### normalizeUrl vs parseUrl
46-
If you want to parse a normal url with no typos, it is safe to use <b>parseUrl</b>. However, <b>normalizeUrl</b> is for
47-
parsing urls with possible human errors.
50+
If you need to parse a standard URL without any typos, it is safe to use ``parseUrl``. However, ``normalizeUrl`` is designed to handle URLs that may contain human errors.
4851

49-
* ##### normalizeUrl
52+
* ##### Run ``normalizeUrl``
5053

5154
``` javascript
5255
/**
@@ -58,7 +61,7 @@ var sample2 = Pattern.UrlArea.normalizeUrl("'://abc.jppp:9091 /park/noon'")
5861
var sample3 = Pattern.UrlArea.normalizeUrl("ss hd : /university,.acd. ;jpkp: 9091/adc??abc=.com")
5962

6063
```
61-
###### console.log()
64+
* ##### Results
6265
``` javascript
6366
{
6467
"url": "htp/:/abcgermany.,def;:9094 #park//noon??abc=retry",
@@ -103,7 +106,7 @@ var sample3 = Pattern.UrlArea.normalizeUrl("ss hd : /university,.acd. ;jpkp: 909
103106
}
104107
```
105108

106-
* ##### parseUrl
109+
* ##### Run ``parseUrl``
107110

108111
``` javascript
109112
/**
@@ -512,5 +515,3 @@ var urls = PatternExtractor.XmlArea.extractAllUrls(xmlStr);
512515
.....
513516
]
514517
```
515-
516-
Please inform me of more sophisticated patterns you need by leaving issues or emailing me at studypurpose@naver.com.

0 commit comments

Comments
 (0)