parse-domain 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jshintignore +17 -17
- package/.jshintrc +47 -47
- package/.npmignore +20 -20
- package/.travis.yml +10 -10
- package/LICENSE +23 -23
- package/lib/build/tld.txt +0 -0
- package/lib/parseDomain.js +1 -1
- package/package.json +3 -3
package/.jshintignore
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
lib-cov
|
|
2
|
-
*.seed
|
|
3
|
-
*.log
|
|
4
|
-
*.csv
|
|
5
|
-
*.dat
|
|
6
|
-
*.out
|
|
7
|
-
*.pid
|
|
8
|
-
*.gz
|
|
9
|
-
|
|
10
|
-
pids
|
|
11
|
-
logs
|
|
12
|
-
results
|
|
13
|
-
|
|
14
|
-
npm-debug.log
|
|
15
|
-
node_modules
|
|
16
|
-
coverage
|
|
17
|
-
examples
|
|
1
|
+
lib-cov
|
|
2
|
+
*.seed
|
|
3
|
+
*.log
|
|
4
|
+
*.csv
|
|
5
|
+
*.dat
|
|
6
|
+
*.out
|
|
7
|
+
*.pid
|
|
8
|
+
*.gz
|
|
9
|
+
|
|
10
|
+
pids
|
|
11
|
+
logs
|
|
12
|
+
results
|
|
13
|
+
|
|
14
|
+
npm-debug.log
|
|
15
|
+
node_modules
|
|
16
|
+
coverage
|
|
17
|
+
examples
|
|
18
18
|
.idea
|
package/.jshintrc
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
{
|
|
2
|
-
"browser": false,
|
|
3
|
-
"node": true,
|
|
4
|
-
"expr": true,
|
|
5
|
-
"predef": [ // Extra globals.
|
|
6
|
-
"describe",
|
|
7
|
-
"it",
|
|
8
|
-
"before",
|
|
9
|
-
"after",
|
|
10
|
-
"beforeEach",
|
|
11
|
-
"afterEach"
|
|
12
|
-
],
|
|
13
|
-
|
|
14
|
-
"curly": true, // Require {} for every new block or scope.
|
|
15
|
-
"eqeqeq": true, // Require triple equals i.e. `===`.
|
|
16
|
-
"forin": true, // Tolerate `for in` loops without `hasOwnPrototype`.
|
|
17
|
-
"immed": true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
|
|
18
|
-
"latedef": false, // Prohibit variable use before definition.
|
|
19
|
-
"newcap": false, // Require capitalization of all constructor functions e.g. `new F()`.
|
|
20
|
-
"noempty": true, // Prohibit use of empty blocks.
|
|
21
|
-
"nonew": false, // Prohibit use of constructors for side-effects.
|
|
22
|
-
"plusplus": false, // Prohibit use of `++` & `--`.
|
|
23
|
-
"undef": true, // Require all non-global variables be declared before they are used.
|
|
24
|
-
"strict": true, // Require `use strict` pragma in every file.
|
|
25
|
-
"trailing": true, // Prohibit trailing whitespaces.
|
|
26
|
-
|
|
27
|
-
"asi": false, // Tolerate Automatic Semicolon Insertion (no semicolons).
|
|
28
|
-
"boss": false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
|
|
29
|
-
"debug": false, // Allow debugger statements e.g. browser breakpoints.
|
|
30
|
-
"eqnull": false, // Tolerate use of `== null`.
|
|
31
|
-
"esnext": false, // Allow ES.next specific features such as `const` and `let`.
|
|
32
|
-
"evil": false, // Tolerate use of `eval`.
|
|
33
|
-
"funcscope": false, // Tolerate declarations of variables inside of control structures while accessing them later from the outside.
|
|
34
|
-
"globalstrict": false, // Allow global "use strict" (also enables 'strict').
|
|
35
|
-
"iterator": false, // Allow usage of __iterator__ property.
|
|
36
|
-
"lastsemic": false, // Tolerat missing semicolons when the it is omitted for the last statement in a one-line block.
|
|
37
|
-
"laxbreak": false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
|
|
38
|
-
"laxcomma": false, // Suppress warnings about comma-first coding style.
|
|
39
|
-
"loopfunc": false, // Allow functions to be defined within loops.
|
|
40
|
-
"multistr": false, // Tolerate multi-line strings.
|
|
41
|
-
"proto": false, // Tolerate __proto__ property. This property is deprecated.
|
|
42
|
-
"scripturl": false, // Tolerate script-targeted URLs.
|
|
43
|
-
"smarttabs": false, // Tolerate mixed tabs and spaces when the latter are used for alignmnent only.
|
|
44
|
-
"shadow": false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
|
|
45
|
-
"sub": true, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
|
|
46
|
-
"supernew": false, // Tolerate `new function () { ... };` and `new Object;`.
|
|
47
|
-
"validthis": false // Tolerate strict violations when the code is running in strict mode and you use this in a non-constructor function
|
|
1
|
+
{
|
|
2
|
+
"browser": false,
|
|
3
|
+
"node": true,
|
|
4
|
+
"expr": true,
|
|
5
|
+
"predef": [ // Extra globals.
|
|
6
|
+
"describe",
|
|
7
|
+
"it",
|
|
8
|
+
"before",
|
|
9
|
+
"after",
|
|
10
|
+
"beforeEach",
|
|
11
|
+
"afterEach"
|
|
12
|
+
],
|
|
13
|
+
|
|
14
|
+
"curly": true, // Require {} for every new block or scope.
|
|
15
|
+
"eqeqeq": true, // Require triple equals i.e. `===`.
|
|
16
|
+
"forin": true, // Tolerate `for in` loops without `hasOwnPrototype`.
|
|
17
|
+
"immed": true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
|
|
18
|
+
"latedef": false, // Prohibit variable use before definition.
|
|
19
|
+
"newcap": false, // Require capitalization of all constructor functions e.g. `new F()`.
|
|
20
|
+
"noempty": true, // Prohibit use of empty blocks.
|
|
21
|
+
"nonew": false, // Prohibit use of constructors for side-effects.
|
|
22
|
+
"plusplus": false, // Prohibit use of `++` & `--`.
|
|
23
|
+
"undef": true, // Require all non-global variables be declared before they are used.
|
|
24
|
+
"strict": true, // Require `use strict` pragma in every file.
|
|
25
|
+
"trailing": true, // Prohibit trailing whitespaces.
|
|
26
|
+
|
|
27
|
+
"asi": false, // Tolerate Automatic Semicolon Insertion (no semicolons).
|
|
28
|
+
"boss": false, // Tolerate assignments inside if, for & while. Usually conditions & loops are for comparison, not assignments.
|
|
29
|
+
"debug": false, // Allow debugger statements e.g. browser breakpoints.
|
|
30
|
+
"eqnull": false, // Tolerate use of `== null`.
|
|
31
|
+
"esnext": false, // Allow ES.next specific features such as `const` and `let`.
|
|
32
|
+
"evil": false, // Tolerate use of `eval`.
|
|
33
|
+
"funcscope": false, // Tolerate declarations of variables inside of control structures while accessing them later from the outside.
|
|
34
|
+
"globalstrict": false, // Allow global "use strict" (also enables 'strict').
|
|
35
|
+
"iterator": false, // Allow usage of __iterator__ property.
|
|
36
|
+
"lastsemic": false, // Tolerat missing semicolons when the it is omitted for the last statement in a one-line block.
|
|
37
|
+
"laxbreak": false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
|
|
38
|
+
"laxcomma": false, // Suppress warnings about comma-first coding style.
|
|
39
|
+
"loopfunc": false, // Allow functions to be defined within loops.
|
|
40
|
+
"multistr": false, // Tolerate multi-line strings.
|
|
41
|
+
"proto": false, // Tolerate __proto__ property. This property is deprecated.
|
|
42
|
+
"scripturl": false, // Tolerate script-targeted URLs.
|
|
43
|
+
"smarttabs": false, // Tolerate mixed tabs and spaces when the latter are used for alignmnent only.
|
|
44
|
+
"shadow": false, // Allows re-define variables later in code e.g. `var x=1; x=2;`.
|
|
45
|
+
"sub": true, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
|
|
46
|
+
"supernew": false, // Tolerate `new function () { ... };` and `new Object;`.
|
|
47
|
+
"validthis": false // Tolerate strict violations when the code is running in strict mode and you use this in a non-constructor function
|
|
48
48
|
}
|
package/.npmignore
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
lib-cov
|
|
2
|
-
*.seed
|
|
3
|
-
*.log
|
|
4
|
-
*.csv
|
|
5
|
-
*.dat
|
|
6
|
-
*.out
|
|
7
|
-
*.pid
|
|
8
|
-
*.gz
|
|
9
|
-
|
|
10
|
-
pids
|
|
11
|
-
logs
|
|
12
|
-
results
|
|
13
|
-
|
|
14
|
-
npm-debug.log
|
|
15
|
-
node_modules
|
|
16
|
-
coverage
|
|
17
|
-
examples
|
|
18
|
-
test
|
|
19
|
-
assets
|
|
20
|
-
.idea
|
|
1
|
+
lib-cov
|
|
2
|
+
*.seed
|
|
3
|
+
*.log
|
|
4
|
+
*.csv
|
|
5
|
+
*.dat
|
|
6
|
+
*.out
|
|
7
|
+
*.pid
|
|
8
|
+
*.gz
|
|
9
|
+
|
|
10
|
+
pids
|
|
11
|
+
logs
|
|
12
|
+
results
|
|
13
|
+
|
|
14
|
+
npm-debug.log
|
|
15
|
+
node_modules
|
|
16
|
+
coverage
|
|
17
|
+
examples
|
|
18
|
+
test
|
|
19
|
+
assets
|
|
20
|
+
.idea
|
package/.travis.yml
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
language: node_js
|
|
2
|
-
node_js:
|
|
3
|
-
- "0.10"
|
|
4
|
-
- "0.11"
|
|
5
|
-
|
|
6
|
-
script:
|
|
7
|
-
- npm test
|
|
8
|
-
after_success:
|
|
9
|
-
- npm install -g istanbul
|
|
10
|
-
- npm install coveralls
|
|
1
|
+
language: node_js
|
|
2
|
+
node_js:
|
|
3
|
+
- "0.10"
|
|
4
|
+
- "0.11"
|
|
5
|
+
|
|
6
|
+
script:
|
|
7
|
+
- npm test
|
|
8
|
+
after_success:
|
|
9
|
+
- npm install -g istanbul
|
|
10
|
+
- npm install coveralls
|
|
11
11
|
- istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
|
package/LICENSE
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
This is free and unencumbered software released into the public domain.
|
|
2
|
-
|
|
3
|
-
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
4
|
-
distribute this software, either in source code form or as a compiled
|
|
5
|
-
binary, for any purpose, commercial or non-commercial, and by any
|
|
6
|
-
means.
|
|
7
|
-
|
|
8
|
-
In jurisdictions that recognize copyright laws, the author or authors
|
|
9
|
-
of this software dedicate any and all copyright interest in the
|
|
10
|
-
software to the public domain. We make this dedication for the benefit
|
|
11
|
-
of the public at large and to the detriment of our heirs and
|
|
12
|
-
successors. We intend this dedication to be an overt act of
|
|
13
|
-
relinquishment in perpetuity of all present and future rights to this
|
|
14
|
-
software under copyright law.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
-
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
20
|
-
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
21
|
-
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
-
OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
-
|
|
1
|
+
This is free and unencumbered software released into the public domain.
|
|
2
|
+
|
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
4
|
+
distribute this software, either in source code form or as a compiled
|
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
|
6
|
+
means.
|
|
7
|
+
|
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
|
9
|
+
of this software dedicate any and all copyright interest in the
|
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
|
11
|
+
of the public at large and to the detriment of our heirs and
|
|
12
|
+
successors. We intend this dedication to be an overt act of
|
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
|
14
|
+
software under copyright law.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
24
|
For more information, please refer to <http://unlicense.org>
|
package/lib/build/tld.txt
CHANGED
|
File without changes
|
package/lib/parseDomain.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var urlParts = /^(https?:\/\/)?(.+@)?(.+?)(:\d{2,5})?(
|
|
3
|
+
var urlParts = /^(https?:\/\/)?(.+@)?(.+?)(:\d{2,5})?([/?].*)?$/,// 1 = protocol, 2 = auth, 3 = domain, 4 = port, 5 = path
|
|
4
4
|
knownTlds = require("./tld.js"),
|
|
5
5
|
dot = /\./g;
|
|
6
6
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parse-domain",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Splits an url into sub-domain, domain and top-level-domain",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Splits an url into sub-domain, domain and effective top-level-domain",
|
|
5
5
|
"main": "./lib/parseDomain.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "mocha -R spec",
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
"dependencies": {},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"chai": "^3.5.0",
|
|
32
|
-
"mocha": "^
|
|
32
|
+
"mocha": "^3.1.0"
|
|
33
33
|
}
|
|
34
34
|
}
|