Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
a990c5ca32 | |||
2d4c480c1b | |||
05cd515824 | |||
bd4de36143 | |||
6a1fb1ec50 | |||
930f351626 | |||
9f6ab54a05 |
@ -1,2 +1,11 @@
|
||||
# smartstring
|
||||
handle strings in smart ways.
|
||||
|
||||
## Status
|
||||
[](https://travis-ci.org/pushrocks/smartstring)
|
||||
[](https://david-dm.org/pushrocks/smartstring)
|
||||
[](https://www.bithound.io/github/pushrocks/smartstring/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/pushrocks/smartstring)
|
||||
|
||||
## Usage
|
||||
### Git
|
||||
|
13
dist/index.d.ts
vendored
13
dist/index.d.ts
vendored
@ -1,10 +1,7 @@
|
||||
/// <reference path="typings/main.d.ts" />
|
||||
import SmartstringGit = require("./smartstring.git");
|
||||
import "typings-global";
|
||||
import SmartstringDocker = require("./smartstring.docker");
|
||||
import SmartstringTypescript = require("./smartstring.typescript");
|
||||
declare let smartstring: {
|
||||
git: (stringArg: string, tokenArg?: string) => SmartstringGit.gitRepo;
|
||||
docker: typeof SmartstringDocker;
|
||||
typescript: typeof SmartstringTypescript;
|
||||
};
|
||||
export = smartstring;
|
||||
export { Domain } from "./smartstring.domain";
|
||||
export { GitRepo } from "./smartstring.git";
|
||||
export declare let docker: typeof SmartstringDocker;
|
||||
export declare let typescript: typeof SmartstringTypescript;
|
||||
|
17
dist/index.js
vendored
17
dist/index.js
vendored
@ -1,13 +1,12 @@
|
||||
"use strict";
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var SmartstringGit = require("./smartstring.git");
|
||||
require("typings-global");
|
||||
var SmartstringDocker = require("./smartstring.docker");
|
||||
var SmartstringTypescript = require("./smartstring.typescript");
|
||||
var smartstring = {
|
||||
git: SmartstringGit.git,
|
||||
docker: SmartstringDocker,
|
||||
typescript: SmartstringTypescript
|
||||
};
|
||||
module.exports = smartstring;
|
||||
var smartstring_domain_1 = require("./smartstring.domain");
|
||||
exports.Domain = smartstring_domain_1.Domain;
|
||||
var smartstring_git_1 = require("./smartstring.git");
|
||||
exports.GitRepo = smartstring_git_1.GitRepo;
|
||||
exports.docker = SmartstringDocker;
|
||||
exports.typescript = SmartstringTypescript;
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxjQUFjLFdBQVcsbUJBQW1CLENBQUMsQ0FBQztBQUNyRCxJQUFPLGlCQUFpQixXQUFXLHNCQUFzQixDQUFDLENBQUM7QUFDM0QsSUFBTyxxQkFBcUIsV0FBVywwQkFBMEIsQ0FBQyxDQUFDO0FBRW5FLElBQUksV0FBVyxHQUFHO0lBQ2QsR0FBRyxFQUFHLGNBQWMsQ0FBQyxHQUFHO0lBQ3hCLE1BQU0sRUFBRSxpQkFBaUI7SUFDekIsVUFBVSxFQUFFLHFCQUFxQjtDQUNwQyxDQUFDO0FBRUYsaUJBQVMsV0FBVyxDQUFDIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxuaW1wb3J0IFNtYXJ0c3RyaW5nR2l0ID0gcmVxdWlyZShcIi4vc21hcnRzdHJpbmcuZ2l0XCIpO1xuaW1wb3J0IFNtYXJ0c3RyaW5nRG9ja2VyID0gcmVxdWlyZShcIi4vc21hcnRzdHJpbmcuZG9ja2VyXCIpO1xuaW1wb3J0IFNtYXJ0c3RyaW5nVHlwZXNjcmlwdCA9IHJlcXVpcmUoXCIuL3NtYXJ0c3RyaW5nLnR5cGVzY3JpcHRcIik7XG5cbmxldCBzbWFydHN0cmluZyA9IHtcbiAgICBnaXQgOiBTbWFydHN0cmluZ0dpdC5naXQsXG4gICAgZG9ja2VyOiBTbWFydHN0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0c3RyaW5nVHlwZXNjcmlwdDsiXX0=
|
||||
|
2
dist/smartstring.docker.d.ts
vendored
2
dist/smartstring.docker.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
/// <reference path="typings/main.d.ts" />
|
||||
import "typings-global";
|
||||
/**
|
||||
* converts an erray of env strings from docker remote api to an usable object.
|
||||
* @param envArrayArg
|
||||
|
3
dist/smartstring.docker.js
vendored
3
dist/smartstring.docker.js
vendored
@ -1,4 +1,5 @@
|
||||
"use strict";
|
||||
require("typings-global");
|
||||
/**
|
||||
* converts an erray of env strings from docker remote api to an usable object.
|
||||
* @param envArrayArg
|
||||
@ -15,4 +16,4 @@ exports.makeEnvObject = function (envArrayArg) {
|
||||
return returnObject;
|
||||
};
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3RyaW5nLmRvY2tlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBR0E7Ozs7R0FJRztBQUNRLHFCQUFhLEdBQUcsVUFBUyxXQUFvQjtJQUNwRCxJQUFJLFlBQVksR0FBRyxFQUFFLENBQUM7SUFDdEIsSUFBSSxXQUFXLEdBQUcsV0FBVyxDQUFDO0lBQzlCLEdBQUcsQ0FBQSxDQUFDLElBQUksTUFBTSxJQUFJLFdBQVcsQ0FBQyxDQUFBLENBQUM7UUFDM0IsSUFBSSxZQUFZLEdBQUcsV0FBVyxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQztRQUN6RCxZQUFZLENBQUMsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBQ3BELENBQUM7SUFBQSxDQUFDO0lBQ0YsTUFBTSxDQUFDLFlBQVksQ0FBQztBQUN4QixDQUFDLENBQUMiLCJmaWxlIjoic21hcnRzdHJpbmcuZG9ja2VyLmpzI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SA9IHJlZ2V4TWF0Y2hlc1syXTtcclxuICAgIH07XHJcbiAgICByZXR1cm4gcmV0dXJuT2JqZWN0O1xyXG59OyJdfQ==
|
||||
|
15
dist/smartstring.domain.d.ts
vendored
Normal file
15
dist/smartstring.domain.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
import "typings-global";
|
||||
export declare class Domain {
|
||||
fullName: string;
|
||||
level1: string;
|
||||
level2: string;
|
||||
level3: string;
|
||||
level4: string;
|
||||
level5: string;
|
||||
protocol: string;
|
||||
zoneName: string;
|
||||
topLevel: string;
|
||||
domainName: any;
|
||||
subDomain: any;
|
||||
constructor(domainStringArg: string);
|
||||
}
|
38
dist/smartstring.domain.js
vendored
Normal file
38
dist/smartstring.domain.js
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
require("typings-global");
|
||||
var Domain = (function () {
|
||||
function Domain(domainStringArg) {
|
||||
this.fullName = domainStringArg;
|
||||
var regexMatches = domainRegex(domainStringArg);
|
||||
this.level1 = regexMatches[0];
|
||||
this.level2 = regexMatches[1];
|
||||
this.level3 = regexMatches[2];
|
||||
this.level4 = regexMatches[3];
|
||||
this.level5 = regexMatches[4];
|
||||
this.protocol = protocolRegex(domainStringArg)[1];
|
||||
this.zoneName = this.level2 + "." + this.level1;
|
||||
// aliases
|
||||
this.topLevel = this.level1;
|
||||
this.domainName = this.level2;
|
||||
this.subDomain = this.level3;
|
||||
}
|
||||
return Domain;
|
||||
}());
|
||||
exports.Domain = Domain;
|
||||
var domainRegex = function (stringArg) {
|
||||
var regexString = /([a-zA-Z0-9]*)\.{0,1}([a-zA-Z0-9]*)\.{0,1}([a-zA-Z0-9]*)\.{0,1}([a-zA-Z0-9]*)\.{0,1}([a-zA-Z0-9]*)\.{0,1}$/;
|
||||
var regexMatches = regexString.exec(stringArg);
|
||||
regexMatches.reverse();
|
||||
var regexMatchesFiltered = regexMatches.filter(function (stringArg) {
|
||||
return (stringArg != "");
|
||||
});
|
||||
return regexMatchesFiltered;
|
||||
};
|
||||
var protocolRegex = function (stringArg) {
|
||||
var regexString = /^([a-zA-Z0-9]*):\/\//;
|
||||
var regexMatches = regexString.exec(stringArg);
|
||||
console.log(regexMatches);
|
||||
return regexMatches;
|
||||
};
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3RyaW5nLmRvbWFpbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFDUCxDQUFDLENBRHNCO0FBR3ZCO0lBYUksZ0JBQVksZUFBc0I7UUFDOUIsSUFBSSxDQUFDLFFBQVEsR0FBRyxlQUFlLENBQUM7UUFDaEMsSUFBSSxZQUFZLEdBQUcsV0FBVyxDQUFDLGVBQWUsQ0FBQyxDQUFDO1FBQ2hELElBQUksQ0FBQyxNQUFNLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzlCLElBQUksQ0FBQyxNQUFNLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzlCLElBQUksQ0FBQyxNQUFNLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzlCLElBQUksQ0FBQyxNQUFNLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzlCLElBQUksQ0FBQyxNQUFNLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzlCLElBQUksQ0FBQyxRQUFRLEdBQUcsYUFBYSxDQUFDLGVBQWUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQ2xELElBQUksQ0FBQyxRQUFRLEdBQUcsSUFBSSxDQUFDLE1BQU0sR0FBRyxHQUFHLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQztRQUVoRCxVQUFVO1FBQ1YsSUFBSSxDQUFDLFFBQVEsR0FBRyxJQUFJLENBQUMs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aGVzO1xyXG59Il19
|
5
dist/smartstring.git.d.ts
vendored
5
dist/smartstring.git.d.ts
vendored
@ -1,5 +1,5 @@
|
||||
/// <reference path="typings/main.d.ts" />
|
||||
export declare class gitRepo {
|
||||
import "typings-global";
|
||||
export declare class GitRepo {
|
||||
host: string;
|
||||
user: string;
|
||||
repo: string;
|
||||
@ -8,4 +8,3 @@ export declare class gitRepo {
|
||||
httpsUrl: string;
|
||||
constructor(stringArg: string, tokenArg?: string);
|
||||
}
|
||||
export declare let git: (stringArg: string, tokenArg?: string) => gitRepo;
|
||||
|
19
dist/smartstring.git.js
vendored
19
dist/smartstring.git.js
vendored
File diff suppressed because one or more lines are too long
7
dist/smartstring.plugins.d.ts
vendored
7
dist/smartstring.plugins.d.ts
vendored
@ -1,5 +1,2 @@
|
||||
/// <reference path="typings/main.d.ts" />
|
||||
declare let plugins: {
|
||||
beautylog: any;
|
||||
};
|
||||
export = plugins;
|
||||
import "typings-global";
|
||||
export import beautylog = require("beautylog");
|
||||
|
9
dist/smartstring.plugins.js
vendored
9
dist/smartstring.plugins.js
vendored
@ -1,8 +1,5 @@
|
||||
"use strict";
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
var plugins = {
|
||||
beautylog: require("beautylog")
|
||||
};
|
||||
module.exports = plugins;
|
||||
require("typings-global");
|
||||
exports.beautylog = require("beautylog");
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3RyaW5nLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDRDQUE0QztBQUM1QyxJQUFJLE9BQU8sR0FBRztJQUNWLFNBQVMsRUFBRSxPQUFPLENBQUMsV0FBVyxDQUFDO0NBQ2xDLENBQUM7QUFFRixpQkFBUyxPQUFPLENBQUMiLCJmaWxlIjoic21hcnRzdHJpbmcucGx1Z2lucy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vLyA8cmVmZXJlbmNlIHBhdGg9XCIuL3R5cGluZ3MvbWFpbi5kLnRzXCIgLz5cbmxldCBwbHVnaW5zID0ge1xuICAgIGJlYXV0eWxvZzogcmVxdWlyZShcImJlYXV0eWxvZ1wiKVxufTtcblxuZXhwb3J0ID0gcGx1Z2luczsiXX0=
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3RyaW5nLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBRVAsQ0FBQyxDQUZzQjtBQUVULGlCQUFTLFdBQVcsV0FBVyxDQUFDLENBQUMiLCJmaWxlIjoic21hcnRzdHJpbmcucGx1Z2lucy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBcInR5cGluZ3MtZ2xvYmFsXCJcclxuXHJcbmV4cG9ydCBpbXBvcnQgYmVhdXR5bG9nID0gcmVxdWlyZShcImJlYXV0eWxvZ1wiKTsiXX0=
|
||||
|
1
dist/smartstring.typescript.d.ts
vendored
1
dist/smartstring.typescript.d.ts
vendored
@ -1 +1,2 @@
|
||||
import "typings-global";
|
||||
export declare let regexReferencePath: RegExp;
|
||||
|
3
dist/smartstring.typescript.js
vendored
3
dist/smartstring.typescript.js
vendored
@ -1,4 +1,5 @@
|
||||
"use strict";
|
||||
require("typings-global");
|
||||
exports.regexReferencePath = /\/\/\/\s*<reference\s+path\s*=\s*["|'].*["|']\s*\/>\s*[\\n]?/;
|
||||
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3RyaW5nLnR5cGVzY3JpcHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUVXLDBCQUFrQixHQUFHLDhEQUE4RCxDQUFBIiwiZmlsZSI6InNtYXJ0c3RyaW5nLnR5cGVzY3JpcHQuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgcGx1Z2lucyA9IHJlcXVpcmUoXCIuL3NtYXJ0c3RyaW5nLnBsdWdpbnNcIik7XG5cbmV4cG9ydCBsZXQgcmVnZXhSZWZlcmVuY2VQYXRoID0gL1xcL1xcL1xcL1xccyo8cmVmZXJlbmNlXFxzK3BhdGhcXHMqPVxccypbXCJ8J10uKltcInwnXVxccypcXC8+XFxzKltcXFxcbl0/LyJdfQ==
|
||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3RyaW5nLnR5cGVzY3JpcHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQ1AsQ0FBQyxDQURzQjtBQUdaLDBCQUFrQixHQUFHLDhEQUE4RCxDQUFBIiwiZmlsZSI6InNtYXJ0c3RyaW5nLnR5cGVzY3JpcHQuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgXCJ0eXBpbmdzLWdsb2JhbFwiXHJcbmltcG9ydCBwbHVnaW5zID0gcmVxdWlyZShcIi4vc21hcnRzdHJpbmcucGx1Z2luc1wiKTtcclxuXHJcbmV4cG9ydCBsZXQgcmVnZXhSZWZlcmVuY2VQYXRoID0gL1xcL1xcL1xcL1xccyo8cmVmZXJlbmNlXFxzK3BhdGhcXHMqPVxccypbXCJ8J10uKltcInwnXVxccypcXC8+XFxzKltcXFxcbl0/LyJdfQ==
|
||||
|
3
dist/typings/browser.d.ts
vendored
3
dist/typings/browser.d.ts
vendored
@ -1,3 +0,0 @@
|
||||
/// <reference path="browser/ambient/colors/index.d.ts" />
|
||||
/// <reference path="browser/ambient/mocha/index.d.ts" />
|
||||
/// <reference path="browser/ambient/node/index.d.ts" />
|
126
dist/typings/browser/ambient/colors/index.d.ts
vendored
126
dist/typings/browser/ambient/colors/index.d.ts
vendored
@ -1,126 +0,0 @@
|
||||
// Generated by typings
|
||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/colors/colors.d.ts
|
||||
// Type definitions for Colors.js 0.6.0-1
|
||||
// Project: https://github.com/Marak/colors.js
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "colors" {
|
||||
interface Color {
|
||||
(text: string): string;
|
||||
|
||||
black: Color;
|
||||
red: Color;
|
||||
green: Color;
|
||||
yellow: Color;
|
||||
blue: Color;
|
||||
magenta: Color;
|
||||
cyan: Color;
|
||||
white: Color;
|
||||
gray: Color;
|
||||
grey: Color;
|
||||
|
||||
bgBlack: Color;
|
||||
bgRed: Color;
|
||||
bgGreen: Color;
|
||||
bgYellow: Color;
|
||||
bgBlue: Color;
|
||||
bgMagenta: Color;
|
||||
bgCyan: Color;
|
||||
bgWhite: Color;
|
||||
|
||||
reset: Color;
|
||||
bold: Color;
|
||||
dim: Color;
|
||||
italic: Color;
|
||||
underline: Color;
|
||||
inverse: Color;
|
||||
hidden: Color;
|
||||
strikethrough: Color;
|
||||
|
||||
rainbow: Color;
|
||||
zebra: Color;
|
||||
america: Color;
|
||||
trap: Color;
|
||||
random: Color;
|
||||
zalgo: Color;
|
||||
}
|
||||
|
||||
namespace e {
|
||||
export function setTheme(theme:any): void;
|
||||
|
||||
export var black: Color;
|
||||
export var red: Color;
|
||||
export var green: Color;
|
||||
export var yellow: Color;
|
||||
export var blue: Color;
|
||||
export var magenta: Color;
|
||||
export var cyan: Color;
|
||||
export var white: Color;
|
||||
export var gray: Color;
|
||||
export var grey: Color;
|
||||
|
||||
export var bgBlack: Color;
|
||||
export var bgRed: Color;
|
||||
export var bgGreen: Color;
|
||||
export var bgYellow: Color;
|
||||
export var bgBlue: Color;
|
||||
export var bgMagenta: Color;
|
||||
export var bgCyan: Color;
|
||||
export var bgWhite: Color;
|
||||
|
||||
export var reset: Color;
|
||||
export var bold: Color;
|
||||
export var dim: Color;
|
||||
export var italic: Color;
|
||||
export var underline: Color;
|
||||
export var inverse: Color;
|
||||
export var hidden: Color;
|
||||
export var strikethrough: Color;
|
||||
|
||||
export var rainbow: Color;
|
||||
export var zebra: Color;
|
||||
export var america: Color;
|
||||
export var trap: Color;
|
||||
export var random: Color;
|
||||
}
|
||||
|
||||
export = e;
|
||||
}
|
||||
|
||||
interface String {
|
||||
black: string;
|
||||
red: string;
|
||||
green: string;
|
||||
yellow: string;
|
||||
blue: string;
|
||||
magenta: string;
|
||||
cyan: string;
|
||||
white: string;
|
||||
gray: string;
|
||||
grey: string;
|
||||
|
||||
bgBlack: string;
|
||||
bgRed: string;
|
||||
bgGreen: string;
|
||||
bgYellow: string;
|
||||
bgBlue: string;
|
||||
bgMagenta: string;
|
||||
bgCyan: string;
|
||||
bgWhite: string;
|
||||
|
||||
reset: string;
|
||||
bold: string;
|
||||
dim: string;
|
||||
italic: string;
|
||||
underline: string;
|
||||
inverse: string;
|
||||
hidden: string;
|
||||
strikethrough: string;
|
||||
|
||||
rainbow: string;
|
||||
zebra: string;
|
||||
america: string;
|
||||
trap: string;
|
||||
random: string;
|
||||
}
|
40
dist/typings/browser/ambient/mocha/index.d.ts
vendored
40
dist/typings/browser/ambient/mocha/index.d.ts
vendored
@ -1,40 +0,0 @@
|
||||
// Generated by typings
|
||||
// Source: https://raw.githubusercontent.com/Bartvds/tsd-deftools/master/typings/DefinitelyTyped/mocha/mocha.d.ts
|
||||
// Type definitions for mocha 1.9.0
|
||||
// Project: http://visionmedia.github.io/mocha/
|
||||
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid/>
|
||||
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid/>
|
||||
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare var describe : {
|
||||
(description: string, spec: () => void): void;
|
||||
only(description: string, spec: () => void): void;
|
||||
skip(description: string, spec: () => void): void;
|
||||
timeout(ms: number);
|
||||
}
|
||||
|
||||
declare var it: {
|
||||
(expectation: string, assertion?: () => void): void;
|
||||
(expectation: string, assertion?: (done: () => void) => void): void;
|
||||
only(expectation: string, assertion?: () => void): void;
|
||||
only(expectation: string, assertion?: (done: () => void) => void): void;
|
||||
skip(expectation: string, assertion?: () => void): void;
|
||||
skip(expectation: string, assertion?: (done: () => void) => void): void;
|
||||
timeout(ms: number);
|
||||
};
|
||||
|
||||
declare function before(action: () => void): void;
|
||||
|
||||
declare function before(action: (done: () => void) => void): void;
|
||||
|
||||
declare function aftet(action: () => void): void;
|
||||
|
||||
declare function after(action: (done: () => void) => void): void;
|
||||
|
||||
declare function beforeEach(action: () => void): void;
|
||||
|
||||
declare function beforeEach(action: (done: () => void) => void): void;
|
||||
|
||||
declare function afterEach(action: () => void): void;
|
||||
|
||||
declare function afterEach(action: (done: () => void) => void): void;
|
2346
dist/typings/browser/ambient/node/index.d.ts
vendored
2346
dist/typings/browser/ambient/node/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
3
dist/typings/main.d.ts
vendored
3
dist/typings/main.d.ts
vendored
@ -1,3 +0,0 @@
|
||||
/// <reference path="main/ambient/colors/index.d.ts" />
|
||||
/// <reference path="main/ambient/mocha/index.d.ts" />
|
||||
/// <reference path="main/ambient/node/index.d.ts" />
|
126
dist/typings/main/ambient/colors/index.d.ts
vendored
126
dist/typings/main/ambient/colors/index.d.ts
vendored
@ -1,126 +0,0 @@
|
||||
// Generated by typings
|
||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/colors/colors.d.ts
|
||||
// Type definitions for Colors.js 0.6.0-1
|
||||
// Project: https://github.com/Marak/colors.js
|
||||
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "colors" {
|
||||
interface Color {
|
||||
(text: string): string;
|
||||
|
||||
black: Color;
|
||||
red: Color;
|
||||
green: Color;
|
||||
yellow: Color;
|
||||
blue: Color;
|
||||
magenta: Color;
|
||||
cyan: Color;
|
||||
white: Color;
|
||||
gray: Color;
|
||||
grey: Color;
|
||||
|
||||
bgBlack: Color;
|
||||
bgRed: Color;
|
||||
bgGreen: Color;
|
||||
bgYellow: Color;
|
||||
bgBlue: Color;
|
||||
bgMagenta: Color;
|
||||
bgCyan: Color;
|
||||
bgWhite: Color;
|
||||
|
||||
reset: Color;
|
||||
bold: Color;
|
||||
dim: Color;
|
||||
italic: Color;
|
||||
underline: Color;
|
||||
inverse: Color;
|
||||
hidden: Color;
|
||||
strikethrough: Color;
|
||||
|
||||
rainbow: Color;
|
||||
zebra: Color;
|
||||
america: Color;
|
||||
trap: Color;
|
||||
random: Color;
|
||||
zalgo: Color;
|
||||
}
|
||||
|
||||
namespace e {
|
||||
export function setTheme(theme:any): void;
|
||||
|
||||
export var black: Color;
|
||||
export var red: Color;
|
||||
export var green: Color;
|
||||
export var yellow: Color;
|
||||
export var blue: Color;
|
||||
export var magenta: Color;
|
||||
export var cyan: Color;
|
||||
export var white: Color;
|
||||
export var gray: Color;
|
||||
export var grey: Color;
|
||||
|
||||
export var bgBlack: Color;
|
||||
export var bgRed: Color;
|
||||
export var bgGreen: Color;
|
||||
export var bgYellow: Color;
|
||||
export var bgBlue: Color;
|
||||
export var bgMagenta: Color;
|
||||
export var bgCyan: Color;
|
||||
export var bgWhite: Color;
|
||||
|
||||
export var reset: Color;
|
||||
export var bold: Color;
|
||||
export var dim: Color;
|
||||
export var italic: Color;
|
||||
export var underline: Color;
|
||||
export var inverse: Color;
|
||||
export var hidden: Color;
|
||||
export var strikethrough: Color;
|
||||
|
||||
export var rainbow: Color;
|
||||
export var zebra: Color;
|
||||
export var america: Color;
|
||||
export var trap: Color;
|
||||
export var random: Color;
|
||||
}
|
||||
|
||||
export = e;
|
||||
}
|
||||
|
||||
interface String {
|
||||
black: string;
|
||||
red: string;
|
||||
green: string;
|
||||
yellow: string;
|
||||
blue: string;
|
||||
magenta: string;
|
||||
cyan: string;
|
||||
white: string;
|
||||
gray: string;
|
||||
grey: string;
|
||||
|
||||
bgBlack: string;
|
||||
bgRed: string;
|
||||
bgGreen: string;
|
||||
bgYellow: string;
|
||||
bgBlue: string;
|
||||
bgMagenta: string;
|
||||
bgCyan: string;
|
||||
bgWhite: string;
|
||||
|
||||
reset: string;
|
||||
bold: string;
|
||||
dim: string;
|
||||
italic: string;
|
||||
underline: string;
|
||||
inverse: string;
|
||||
hidden: string;
|
||||
strikethrough: string;
|
||||
|
||||
rainbow: string;
|
||||
zebra: string;
|
||||
america: string;
|
||||
trap: string;
|
||||
random: string;
|
||||
}
|
40
dist/typings/main/ambient/mocha/index.d.ts
vendored
40
dist/typings/main/ambient/mocha/index.d.ts
vendored
@ -1,40 +0,0 @@
|
||||
// Generated by typings
|
||||
// Source: https://raw.githubusercontent.com/Bartvds/tsd-deftools/master/typings/DefinitelyTyped/mocha/mocha.d.ts
|
||||
// Type definitions for mocha 1.9.0
|
||||
// Project: http://visionmedia.github.io/mocha/
|
||||
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid/>
|
||||
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid/>
|
||||
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare var describe : {
|
||||
(description: string, spec: () => void): void;
|
||||
only(description: string, spec: () => void): void;
|
||||
skip(description: string, spec: () => void): void;
|
||||
timeout(ms: number);
|
||||
}
|
||||
|
||||
declare var it: {
|
||||
(expectation: string, assertion?: () => void): void;
|
||||
(expectation: string, assertion?: (done: () => void) => void): void;
|
||||
only(expectation: string, assertion?: () => void): void;
|
||||
only(expectation: string, assertion?: (done: () => void) => void): void;
|
||||
skip(expectation: string, assertion?: () => void): void;
|
||||
skip(expectation: string, assertion?: (done: () => void) => void): void;
|
||||
timeout(ms: number);
|
||||
};
|
||||
|
||||
declare function before(action: () => void): void;
|
||||
|
||||
declare function before(action: (done: () => void) => void): void;
|
||||
|
||||
declare function aftet(action: () => void): void;
|
||||
|
||||
declare function after(action: (done: () => void) => void): void;
|
||||
|
||||
declare function beforeEach(action: () => void): void;
|
||||
|
||||
declare function beforeEach(action: (done: () => void) => void): void;
|
||||
|
||||
declare function afterEach(action: () => void): void;
|
||||
|
||||
declare function afterEach(action: (done: () => void) => void): void;
|
2346
dist/typings/main/ambient/node/index.d.ts
vendored
2346
dist/typings/main/ambient/node/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@ -1,8 +1,9 @@
|
||||
{
|
||||
"name": "smartstring",
|
||||
"version": "1.0.2",
|
||||
"version": "2.0.1",
|
||||
"description": "bundles a bunch of (regex) matching and altering methods.",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"test": "(npmts)"
|
||||
},
|
||||
@ -21,10 +22,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/pushrocks/smartstring#readme",
|
||||
"devDependencies": {
|
||||
"npmts": "^5.0.4",
|
||||
"should": "^8.3.1"
|
||||
"npmts": "^5.1.13",
|
||||
"should": "^8.4.0",
|
||||
"typings-test": "^1.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"beautylog": "^4.1.2"
|
||||
"beautylog": "^5.0.6",
|
||||
"typings-global": "^1.0.3"
|
||||
}
|
||||
}
|
||||
|
4
test/test.d.ts
vendored
4
test/test.d.ts
vendored
@ -1,3 +1 @@
|
||||
/// <reference path="../ts/typings/main.d.ts" />
|
||||
declare let smartstring: any;
|
||||
declare let should: any;
|
||||
import "typings-test";
|
||||
|
37
test/test.js
37
test/test.js
File diff suppressed because one or more lines are too long
34
test/test.ts
34
test/test.ts
@ -1,10 +1,36 @@
|
||||
/// <reference path="../ts/typings/main.d.ts" />
|
||||
let smartstring = require("../dist/index.js");
|
||||
import "typings-test"
|
||||
import * as smartstring from "../dist/index";
|
||||
let should = require("should");
|
||||
|
||||
describe("smartstring",function(){
|
||||
describe(".git()",function(){
|
||||
let testGit = smartstring.git("git+https://github.com/pushrocks/smartstring.git");
|
||||
describe(".Domain class",function(){
|
||||
let testDomain:smartstring.Domain;
|
||||
it("should create a new Domain object",function(){
|
||||
testDomain = new smartstring.Domain("https://level3D.level2D.level1D");
|
||||
testDomain.should.be.instanceof(smartstring.Domain);
|
||||
});
|
||||
it("should have a .topLevel",function(){
|
||||
testDomain.topLevel.should.equal("level1D");
|
||||
});
|
||||
it("should have a .level2",function(){
|
||||
testDomain.level2.should.equal("level2D");
|
||||
});
|
||||
it("should have a .level3",function(){
|
||||
testDomain.level3.should.equal("level3D");
|
||||
});
|
||||
it("should have the correct dns zone name",function(){
|
||||
testDomain.zoneName.should.equal("level2D.level1D");
|
||||
})
|
||||
it ("should have the correct protocol",function(){
|
||||
testDomain.protocol.should.equal("https");
|
||||
})
|
||||
})
|
||||
describe(".Git class",function(){
|
||||
let testGit:smartstring.GitRepo;
|
||||
it("should create a new Git class GitRepo",function(){
|
||||
testGit = new smartstring.GitRepo("git+https://github.com/pushrocks/smartstring.git");
|
||||
testGit.should.be.instanceof(smartstring.GitRepo);
|
||||
})
|
||||
it("should return a .host",function(){
|
||||
testGit.host
|
||||
.should.equal("github.com");
|
||||
|
14
ts/index.ts
14
ts/index.ts
@ -1,12 +1,8 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import SmartstringGit = require("./smartstring.git");
|
||||
import "typings-global"
|
||||
import SmartstringDocker = require("./smartstring.docker");
|
||||
import SmartstringTypescript = require("./smartstring.typescript");
|
||||
|
||||
let smartstring = {
|
||||
git : SmartstringGit.git,
|
||||
docker: SmartstringDocker,
|
||||
typescript: SmartstringTypescript
|
||||
};
|
||||
|
||||
export = smartstring;
|
||||
export {Domain} from "./smartstring.domain";
|
||||
export {GitRepo} from "./smartstring.git";
|
||||
export let docker = SmartstringDocker;
|
||||
export let typescript = SmartstringTypescript;
|
@ -1,4 +1,4 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import "typings-global"
|
||||
import plugins = require("./smartstring.plugins");
|
||||
|
||||
/**
|
||||
|
51
ts/smartstring.domain.ts
Normal file
51
ts/smartstring.domain.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import "typings-global"
|
||||
import plugins = require("./smartstring.plugins");
|
||||
|
||||
export class Domain {
|
||||
fullName:string;
|
||||
level1:string;
|
||||
level2:string;
|
||||
level3:string;
|
||||
level4:string;
|
||||
level5:string;
|
||||
protocol:string;
|
||||
zoneName:string;
|
||||
//aliases
|
||||
topLevel:string;
|
||||
domainName;
|
||||
subDomain;
|
||||
constructor(domainStringArg:string){
|
||||
this.fullName = domainStringArg;
|
||||
let regexMatches = domainRegex(domainStringArg);
|
||||
this.level1 = regexMatches[0];
|
||||
this.level2 = regexMatches[1];
|
||||
this.level3 = regexMatches[2];
|
||||
this.level4 = regexMatches[3];
|
||||
this.level5 = regexMatches[4];
|
||||
this.protocol = protocolRegex(domainStringArg)[1];
|
||||
this.zoneName = this.level2 + "." + this.level1;
|
||||
|
||||
// aliases
|
||||
this.topLevel = this.level1;
|
||||
this.domainName = this.level2;
|
||||
this.subDomain = this.level3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let domainRegex = function(stringArg:string){
|
||||
let regexString = /([a-zA-Z0-9]*)\.{0,1}([a-zA-Z0-9]*)\.{0,1}([a-zA-Z0-9]*)\.{0,1}([a-zA-Z0-9]*)\.{0,1}([a-zA-Z0-9]*)\.{0,1}$/;
|
||||
let regexMatches = regexString.exec(stringArg);
|
||||
regexMatches.reverse();
|
||||
let regexMatchesFiltered = regexMatches.filter(function(stringArg:string){
|
||||
return(stringArg != "");
|
||||
});
|
||||
return regexMatchesFiltered;
|
||||
};
|
||||
|
||||
let protocolRegex = function(stringArg:string){
|
||||
let regexString = /^([a-zA-Z0-9]*):\/\//;
|
||||
let regexMatches = regexString.exec(stringArg);
|
||||
console.log(regexMatches);
|
||||
return regexMatches;
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
import "typings-global"
|
||||
import plugins = require("./smartstring.plugins");
|
||||
|
||||
/* ---------------------------------------------- *
|
||||
* ------------------ classes ------------------- *
|
||||
* ---------------------------------------------- */
|
||||
export class gitRepo {
|
||||
export class GitRepo {
|
||||
host:string;
|
||||
user:string;
|
||||
repo:string;
|
||||
@ -50,12 +50,4 @@ let gitLink = function(hostArg:string, userArg:string, repoArg:string, tokenArg:
|
||||
break;
|
||||
}
|
||||
return returnString;
|
||||
};
|
||||
|
||||
/* ---------------------------------------------- *
|
||||
* ------------------ exports ------------------- *
|
||||
* ---------------------------------------------- */
|
||||
export let git = function(stringArg:string,tokenArg?:string){
|
||||
let localGitRepo = new gitRepo(stringArg,tokenArg);
|
||||
return localGitRepo;
|
||||
};
|
@ -1,6 +1,3 @@
|
||||
/// <reference path="./typings/main.d.ts" />
|
||||
let plugins = {
|
||||
beautylog: require("beautylog")
|
||||
};
|
||||
import "typings-global"
|
||||
|
||||
export = plugins;
|
||||
export import beautylog = require("beautylog");
|
@ -1,3 +1,4 @@
|
||||
import "typings-global"
|
||||
import plugins = require("./smartstring.plugins");
|
||||
|
||||
export let regexReferencePath = /\/\/\/\s*<reference\s+path\s*=\s*["|'].*["|']\s*\/>\s*[\\n]?/
|
Reference in New Issue
Block a user