original

WebJar for original

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

original
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

original
WebJar for original
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/unshiftio/original

Download original

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : url-parse jar [1.4.3,2)

Project Modules

There are no modules declared in this project.

origin(al)

Made by unshiftVersion npmBuild StatusDependenciesCoverage StatusIRC channel

Original generates the origin URL for a given URL or URL object. In addition to that it also comes with a simple same function to check if two URL's have the same origin.

Install

This module is browserify and node compatible and is therefor release in the npm registry and can be installed using:

npm install --save original

Usage

In all the examples we assume that the module is loaded using:

'use strict';

var origin = require('original');

To get the origin of a given URL simply call origin function with any given URL to get origin.

var o = origin('https://google.com/foo/bar?path');

// o = https://google.com

To compare if two URL's share the same origin you can call the same method.

if (origin.same('https://google.com/foo', 'https://primus.io')) {
  console.log('same');
} else {
  console.log('guess what, google.com and primus.io are not the same origin');
}

And that's it.

License

MIT

org.webjars.npm

Versions

Version
1.0.2
1.0.1
1.0.0
0.0.5