Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
05cd515824 | |||
bd4de36143 | |||
6a1fb1ec50 | |||
930f351626 | |||
9f6ab54a05 |
@ -1,2 +1,11 @@
|
|||||||
# smartstring
|
# smartstring
|
||||||
handle strings in smart ways.
|
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 "typings-global";
|
||||||
import SmartstringGit = require("./smartstring.git");
|
|
||||||
import SmartstringDocker = require("./smartstring.docker");
|
import SmartstringDocker = require("./smartstring.docker");
|
||||||
import SmartstringTypescript = require("./smartstring.typescript");
|
import SmartstringTypescript = require("./smartstring.typescript");
|
||||||
declare let smartstring: {
|
export { Domain } from "./smartstring.domain";
|
||||||
git: (stringArg: string, tokenArg?: string) => SmartstringGit.gitRepo;
|
export { GitRepo } from "./smartstring.git";
|
||||||
docker: typeof SmartstringDocker;
|
export declare let docker: typeof SmartstringDocker;
|
||||||
typescript: typeof SmartstringTypescript;
|
export declare let typescript: typeof SmartstringTypescript;
|
||||||
};
|
|
||||||
export = smartstring;
|
|
||||||
|
17
dist/index.js
vendored
17
dist/index.js
vendored
@ -1,13 +1,12 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
/// <reference path="./typings/main.d.ts" />
|
require("typings-global");
|
||||||
var SmartstringGit = require("./smartstring.git");
|
|
||||||
var SmartstringDocker = require("./smartstring.docker");
|
var SmartstringDocker = require("./smartstring.docker");
|
||||||
var SmartstringTypescript = require("./smartstring.typescript");
|
var SmartstringTypescript = require("./smartstring.typescript");
|
||||||
var smartstring = {
|
var smartstring_domain_1 = require("./smartstring.domain");
|
||||||
git: SmartstringGit.git,
|
exports.Domain = smartstring_domain_1.Domain;
|
||||||
docker: SmartstringDocker,
|
var smartstring_git_1 = require("./smartstring.git");
|
||||||
typescript: SmartstringTypescript
|
exports.GitRepo = smartstring_git_1.GitRepo;
|
||||||
};
|
exports.docker = SmartstringDocker;
|
||||||
module.exports = smartstring;
|
exports.typescript = SmartstringTypescript;
|
||||||
|
|
||||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSw0Q0FBNEM7QUFDNUMsSUFBTyxjQUFjLFdBQVcsbUJBQW1CLENBQUMsQ0FBQztBQUNyRCxJQUFPLGlCQUFpQixXQUFXLHNCQUFzQixDQUFDLENBQUM7QUFDM0QsSUFBTyxxQkFBcUIsV0FBVywwQkFBMEIsQ0FBQyxDQUFDO0FBRW5FLElBQUksV0FBVyxHQUFHO0lBQ2QsR0FBRyxFQUFHLGNBQWMsQ0FBQyxHQUFHO0lBQ3hCLE1BQU0sRUFBRSxpQkFBaUI7SUFDekIsVUFBVSxFQUFFLHFCQUFxQjtDQUNwQyxDQUFDO0FBRUYsaUJBQVMsV0FBVyxDQUFDIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8vIDxyZWZlcmVuY2UgcGF0aD1cIi4vdHlwaW5ncy9tYWluLmQudHNcIiAvPlxuaW1wb3J0IFNtYXJ0c3RyaW5nR2l0ID0gcmVxdWlyZShcIi4vc21hcnRzdHJpbmcuZ2l0XCIpO1xuaW1wb3J0IFNtYXJ0c3RyaW5nRG9ja2VyID0gcmVxdWlyZShcIi4vc21hcnRzdHJpbmcuZG9ja2VyXCIpO1xuaW1wb3J0IFNtYXJ0c3RyaW5nVHlwZXNjcmlwdCA9IHJlcXVp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nJvbSBcIi4vc21hcnRzdHJpbmcuZ2l0XCI7XHJcbmV4cG9ydCBsZXQgZG9ja2VyID0gU21hcnRzdHJpbmdEb2NrZXI7XHJcbmV4cG9ydCBsZXQgdHlwZXNjcmlwdCA9IFNtYXJ0c3RyaW5nVHlwZXNjcmlwdDsiXX0=
|
||||||
|
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.
|
* converts an erray of env strings from docker remote api to an usable object.
|
||||||
* @param envArrayArg
|
* @param envArrayArg
|
||||||
|
3
dist/smartstring.docker.js
vendored
3
dist/smartstring.docker.js
vendored
@ -1,4 +1,5 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
require("typings-global");
|
||||||
/**
|
/**
|
||||||
* converts an erray of env strings from docker remote api to an usable object.
|
* converts an erray of env strings from docker remote api to an usable object.
|
||||||
* @param envArrayArg
|
* @param envArrayArg
|
||||||
@ -15,4 +16,4 @@ exports.makeEnvObject = function (envArrayArg) {
|
|||||||
return returnObject;
|
return returnObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3RyaW5nLmRvY2tlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBR0E7Ozs7R0FJRztBQUNRLHFCQUFhLEdBQUcsVUFBUyxXQUFvQjtJQUNwRCxJQUFJLFlBQVksR0FBRyxFQUFFLENBQUM7SUFDdEIsSUFBSSxXQUFXLEdBQUcsV0FBVyxDQUFDO0lBQzlCLEdBQUcsQ0FBQSxDQUFDLElBQUksTUFBTSxJQUFJLFdBQVcsQ0FBQyxDQUFBLENBQUM7UUFDM0IsSUFBSSxZQUFZLEdBQUcsV0FBVyxDQUFDLElBQUks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BsZXQgcmV0dXJuT2JqZWN0ID0ge307XHJcbiAgICBsZXQgcmVnZXhTdHJpbmcgPSAvKC4qKT0oLiopLztcclxuICAgIGZvcihsZXQgZW52S2V5IGluIGVudkFycmF5QXJnKXtcclxuICAgICAgICBsZXQgcmVnZXhNYXRjaGVzID0gcmVnZXhTdHJpbmcuZXhlYyhlbnZBcnJheUFyZ1tlbnZLZXldKTtcclxuICAgICAgICByZXR1cm5PYmplY3RbcmVnZXhNYXRjaGVzWzFdXSA9IHJlZ2V4TWF0Y2hlc1syXTtcclxuICAgIH07XHJcbiAgICByZXR1cm4gcmV0dXJuT2JqZWN0O1xyXG59OyJdfQ==
|
||||||
|
14
dist/smartstring.domain.d.ts
vendored
Normal file
14
dist/smartstring.domain.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import "typings-global";
|
||||||
|
export declare class Domain {
|
||||||
|
fullName: string;
|
||||||
|
level1: string;
|
||||||
|
level2: string;
|
||||||
|
level3: string;
|
||||||
|
level4: string;
|
||||||
|
level5: string;
|
||||||
|
protocol: string;
|
||||||
|
topLevel: string;
|
||||||
|
domainName: any;
|
||||||
|
subDomain: any;
|
||||||
|
constructor(domainStringArg: string);
|
||||||
|
}
|
30
dist/smartstring.domain.js
vendored
Normal file
30
dist/smartstring.domain.js
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
"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];
|
||||||
|
// 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;
|
||||||
|
};
|
||||||
|
|
||||||
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNtYXJ0c3RyaW5nLmRvbWFpbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsUUFBTyxnQkFDUCxDQUFDLENBRHNCO0FBR3ZCO0lBWUksZ0JBQVksZUFBc0I7UUFDOUIsSUFBSSxDQUFDLFFBQVEsR0FBRyxlQUFlLENBQUM7UUFDaEMsSUFBSSxZQUFZLEdBQUcsV0FBVyxDQUFDLGVBQWUsQ0FBQyxDQUFDO1FBQ2hELElBQUksQ0FBQyxNQUFNLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzlCLElBQUksQ0FBQyxNQUFNLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzlCLElBQUksQ0FBQyxNQUFNLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzlCLElBQUksQ0FBQyxNQUFNLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzlCLElBQUksQ0FBQyxNQUFNLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzlCLFVBQVU7UUFDVixJQUFJLENBQUMsUUFBUSxHQUF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dHJpbmcuZXhlYyhzdHJpbmdBcmcpO1xyXG4gICAgcmVnZXhNYXRjaGVzLnJldmVyc2UoKTtcclxuICAgIGxldCByZWdleE1hdGNoZXNGaWx0ZXJlZCA9IHJlZ2V4TWF0Y2hlcy5maWx0ZXIoZnVuY3Rpb24oc3RyaW5nQXJnOnN0cmluZyl7XHJcbiAgICAgICAgcmV0dXJuKHN0cmluZ0FyZyAhPSBcIlwiKTtcclxuICAgIH0pO1xyXG4gICAgcmV0dXJuIHJlZ2V4TWF0Y2hlc0ZpbHRlcmVkO1xyXG59OyJdfQ==
|
5
dist/smartstring.git.d.ts
vendored
5
dist/smartstring.git.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
/// <reference path="typings/main.d.ts" />
|
import "typings-global";
|
||||||
export declare class gitRepo {
|
export declare class GitRepo {
|
||||||
host: string;
|
host: string;
|
||||||
user: string;
|
user: string;
|
||||||
repo: string;
|
repo: string;
|
||||||
@ -8,4 +8,3 @@ export declare class gitRepo {
|
|||||||
httpsUrl: string;
|
httpsUrl: string;
|
||||||
constructor(stringArg: string, tokenArg?: 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" />
|
import "typings-global";
|
||||||
declare let plugins: {
|
export import beautylog = require("beautylog");
|
||||||
beautylog: any;
|
|
||||||
};
|
|
||||||
export = plugins;
|
|
||||||
|
9
dist/smartstring.plugins.js
vendored
9
dist/smartstring.plugins.js
vendored
@ -1,8 +1,5 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
/// <reference path="./typings/main.d.ts" />
|
require("typings-global");
|
||||||
var plugins = {
|
exports.beautylog = require("beautylog");
|
||||||
beautylog: require("beautylog")
|
|
||||||
};
|
|
||||||
module.exports = plugins;
|
|
||||||
|
|
||||||
//# 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;
|
export declare let regexReferencePath: RegExp;
|
||||||
|
3
dist/smartstring.typescript.js
vendored
3
dist/smartstring.typescript.js
vendored
@ -1,4 +1,5 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
require("typings-global");
|
||||||
exports.regexReferencePath = /\/\/\/\s*<reference\s+path\s*=\s*["|'].*["|']\s*\/>\s*[\\n]?/;
|
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",
|
"name": "smartstring",
|
||||||
"version": "1.0.2",
|
"version": "2.0.0",
|
||||||
"description": "bundles a bunch of (regex) matching and altering methods.",
|
"description": "bundles a bunch of (regex) matching and altering methods.",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
"typings": "dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(npmts)"
|
"test": "(npmts)"
|
||||||
},
|
},
|
||||||
@ -21,10 +22,12 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/pushrocks/smartstring#readme",
|
"homepage": "https://github.com/pushrocks/smartstring#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"npmts": "^5.0.4",
|
"npmts": "^5.1.13",
|
||||||
"should": "^8.3.1"
|
"should": "^8.4.0",
|
||||||
|
"typings-test": "^1.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"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" />
|
import "typings-test";
|
||||||
declare let smartstring: any;
|
|
||||||
declare let should: any;
|
|
||||||
|
31
test/test.js
31
test/test.js
File diff suppressed because one or more lines are too long
28
test/test.ts
28
test/test.ts
@ -1,10 +1,30 @@
|
|||||||
/// <reference path="../ts/typings/main.d.ts" />
|
import "typings-test"
|
||||||
let smartstring = require("../dist/index.js");
|
import * as smartstring from "../dist/index";
|
||||||
let should = require("should");
|
let should = require("should");
|
||||||
|
|
||||||
describe("smartstring",function(){
|
describe("smartstring",function(){
|
||||||
describe(".git()",function(){
|
describe(".Domain class",function(){
|
||||||
let testGit = smartstring.git("git+https://github.com/pushrocks/smartstring.git");
|
let testDomain:smartstring.Domain;
|
||||||
|
it("should create a new Domain object",function(){
|
||||||
|
testDomain = new smartstring.Domain("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");
|
||||||
|
});
|
||||||
|
})
|
||||||
|
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(){
|
it("should return a .host",function(){
|
||||||
testGit.host
|
testGit.host
|
||||||
.should.equal("github.com");
|
.should.equal("github.com");
|
||||||
|
14
ts/index.ts
14
ts/index.ts
@ -1,12 +1,8 @@
|
|||||||
/// <reference path="./typings/main.d.ts" />
|
import "typings-global"
|
||||||
import SmartstringGit = require("./smartstring.git");
|
|
||||||
import SmartstringDocker = require("./smartstring.docker");
|
import SmartstringDocker = require("./smartstring.docker");
|
||||||
import SmartstringTypescript = require("./smartstring.typescript");
|
import SmartstringTypescript = require("./smartstring.typescript");
|
||||||
|
|
||||||
let smartstring = {
|
export {Domain} from "./smartstring.domain";
|
||||||
git : SmartstringGit.git,
|
export {GitRepo} from "./smartstring.git";
|
||||||
docker: SmartstringDocker,
|
export let docker = SmartstringDocker;
|
||||||
typescript: SmartstringTypescript
|
export let typescript = SmartstringTypescript;
|
||||||
};
|
|
||||||
|
|
||||||
export = smartstring;
|
|
@ -1,4 +1,4 @@
|
|||||||
/// <reference path="./typings/main.d.ts" />
|
import "typings-global"
|
||||||
import plugins = require("./smartstring.plugins");
|
import plugins = require("./smartstring.plugins");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
40
ts/smartstring.domain.ts
Normal file
40
ts/smartstring.domain.ts
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
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;
|
||||||
|
//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];
|
||||||
|
// 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;
|
||||||
|
};
|
@ -1,10 +1,10 @@
|
|||||||
/// <reference path="./typings/main.d.ts" />
|
import "typings-global"
|
||||||
import plugins = require("./smartstring.plugins");
|
import plugins = require("./smartstring.plugins");
|
||||||
|
|
||||||
/* ---------------------------------------------- *
|
/* ---------------------------------------------- *
|
||||||
* ------------------ classes ------------------- *
|
* ------------------ classes ------------------- *
|
||||||
* ---------------------------------------------- */
|
* ---------------------------------------------- */
|
||||||
export class gitRepo {
|
export class GitRepo {
|
||||||
host:string;
|
host:string;
|
||||||
user:string;
|
user:string;
|
||||||
repo:string;
|
repo:string;
|
||||||
@ -50,12 +50,4 @@ let gitLink = function(hostArg:string, userArg:string, repoArg:string, tokenArg:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return returnString;
|
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" />
|
import "typings-global"
|
||||||
let plugins = {
|
|
||||||
beautylog: require("beautylog")
|
|
||||||
};
|
|
||||||
|
|
||||||
export = plugins;
|
export import beautylog = require("beautylog");
|
@ -1,3 +1,4 @@
|
|||||||
|
import "typings-global"
|
||||||
import plugins = require("./smartstring.plugins");
|
import plugins = require("./smartstring.plugins");
|
||||||
|
|
||||||
export let regexReferencePath = /\/\/\/\s*<reference\s+path\s*=\s*["|'].*["|']\s*\/>\s*[\\n]?/
|
export let regexReferencePath = /\/\/\/\s*<reference\s+path\s*=\s*["|'].*["|']\s*\/>\s*[\\n]?/
|
Reference in New Issue
Block a user