0.0.4 • Published 8 years ago

typescript-urlmaki v0.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

typescript-urlmaki

Typescript library ( used for Angular 2 projects ) with basic url parse and tools.
Note: this solutions is not production ready, it's in a very basic alpha state and have basic methods implemented, in a very short time will update with more tools and features.

Installation

npm install typescript-urlmaki

Example

import {URLTools} from 'typescript-urlmaki/typescript-urlmaki';

@Component({
    selector: 'my-app',
    template: `
    ....
    `,
    providers: [URLTools]
})
export class AppComponent {
    

    constructor(public urltools: URLTools) {
        if (this.urltools.isURL("www.google.com")){
            console.log("esiste ");
        }
        //OR
        this.urltool.join("www.google.com","test","miao.html");
        // return www.google.com/test/miao.html
    }
}

API Docs

URLTools

Methods:

  • isURL(url: string): boolean: parse the string anc check if is am URL or not
  • join(...args): string: Join the arguments passed and return a formatted url

License

MIT