@segment/top-domain

WebJar for @segment/top-domain

License

License

MIT
Categories

Categories

Doma Data ORM
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

segment__top-domain
Last Version

Last Version

3.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

@segment/top-domain
WebJar for @segment/top-domain
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/segmentio/top-domain

Download segment__top-domain

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/segment__top-domain/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>segment__top-domain</artifactId>
    <version>3.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/segment__top-domain/
implementation 'org.webjars.npm:segment__top-domain:3.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/segment__top-domain/
implementation ("org.webjars.npm:segment__top-domain:3.0.0")
'org.webjars.npm:segment__top-domain:jar:3.0.0'
<dependency org="org.webjars.npm" name="segment__top-domain" rev="3.0.0">
  <artifact name="segment__top-domain" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='segment__top-domain', version='3.0.0')
)
libraryDependencies += "org.webjars.npm" % "segment__top-domain" % "3.0.0"
[org.webjars.npm/segment__top-domain "3.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : component-cookie jar [1.1.2,2)
org.webjars.npm » component-url jar [0.2.1,0.3)

Project Modules

There are no modules declared in this project.

domain

CircleCI Codecov

Constructs possible levels from a url and attempts to set a cookie "." + domain for each, when it succeeds it returns the top level domain.

This only works on the domain itself, since it attempts to set a cookie.

Installation

$ npm install @segment/top-domain

API

var domain = require('top-domain');

assert('google.com' == domain('http://www.google.com'));
assert('google.co.uk' == domain('http://www.google.co.uk'));
assert('google.co.uk' == domain('http://google.co.uk'));
assert('github.com' == domain('http://gist.github.com/calvinfo/some_file'));
assert('' == domain('http://localhost:3000'));
assert('google.com' == domain('https://google.com:443/stuff'));
assert('' == domain('http://dev:3000'));
assert('' == domain('0.0.0.0'));
assert('' == domain('127.0.0.1'));
org.webjars.npm

Segment

Versions

Version
3.0.0