diff --git a/.gitignore b/.gitignore
index d033e13..9f193ab 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,4 @@
-.idea/
coverage/
-docs/
-node_modules
-ts/**/*.js
-ts/**/*.js.map
-ts/typings/
\ No newline at end of file
+pages/
+public/
+node_modules/
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e745cf1..f2d2ff7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,6 +3,8 @@ image: hosttoday/ht-docker-node:npmts
stages:
- test
- release
+- trigger
+- pages
testLEGACY:
stage: test
@@ -10,6 +12,7 @@ testLEGACY:
- npmci test legacy
tags:
- docker
+ allow_failure: true
testLTS:
stage: test
@@ -27,10 +30,30 @@ testSTABLE:
release:
stage: release
- environment: npmjs-com_registry
script:
- npmci publish
only:
- tags
tags:
- - docker
\ No newline at end of file
+ - docker
+
+trigger:
+ stage: trigger
+ script:
+ - npmci trigger
+ only:
+ - tags
+ tags:
+ - docker
+
+pages:
+ image: hosttoday/ht-docker-node:npmpage
+ stage: pages
+ script:
+ - npmci command npmpage --host gitlab
+ only:
+ - tags
+ artifacts:
+ expire_in: 1 week
+ paths:
+ - public
diff --git a/README.md b/README.md
index fb2a3ea..0da6331 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,21 @@
# smartstring
handle strings in smart ways. TypeScript ready.
-## Status
+## Availabililty
+[![npm](https://push.rocks/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartstring)
+[![git](https://push.rocks/assets/repo-button-git.svg)](https://gitlab.com/pushrocks/smartstring)
+[![git](https://push.rocks/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartstring)
+[![docs](https://push.rocks/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartstring/)
+
+## Status for master
[![build status](https://gitlab.com/pushrocks/smartstring/badges/master/build.svg)](https://gitlab.com/pushrocks/smartstring/commits/master)
+[![coverage report](https://gitlab.com/pushrocks/smartstring/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartstring/commits/master)
[![Dependency Status](https://david-dm.org/pushrocks/smartstring.svg)](https://david-dm.org/pushrocks/smartstring)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartstring/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartstring/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartstring/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartstring)
+[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
+[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
+[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
Use TypeScript for intellisense.
@@ -29,10 +39,6 @@ myDomain.level2 // "main"
// level3 , level 4 and so on...
myDomain.zoneName // "main.tld"
myDOmain.protocol // "https"
-
```
-## About the authors:
-[![Project Phase](https://mediaserve.lossless.digital/lossless.com/img/createdby_github.svg)](https://lossless.com/)
-
-[![PayPal](https://img.shields.io/badge/Support%20us-PayPal-blue.svg)](https://paypal.me/lossless)
+[![npm](https://push.rocks/assets/repo-header.svg)](https://push.rocks)
diff --git a/dist/index.d.ts b/dist/index.d.ts
index d8fe191..e5b95c8 100644
--- a/dist/index.d.ts
+++ b/dist/index.d.ts
@@ -1,8 +1,7 @@
-import * as SmartstringDocker from "./smartstring.docker";
-import * as SmartstringTypescript from "./smartstring.typescript";
-import * as SmartstringIndent from "./smartstring.indent";
-export { Domain } from "./smartstring.domain";
-export { GitRepo } from "./smartstring.git";
-export declare let docker: typeof SmartstringDocker;
-export declare let typescript: typeof SmartstringTypescript;
-export declare let indent: typeof SmartstringIndent;
+import * as docker from './smartstring.docker';
+import * as indent from './smartstring.indent';
+import * as typescript from './smartstring.typescript';
+export { docker, typescript, indent };
+export { Base64 } from './smartstring.base64';
+export { Domain } from './smartstring.domain';
+export { GitRepo } from './smartstring.git';
diff --git a/dist/index.js b/dist/index.js
index dcf09fe..5eca2ec 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1,12 +1,14 @@
"use strict";
-const SmartstringDocker = require("./smartstring.docker");
-const SmartstringTypescript = require("./smartstring.typescript");
-const SmartstringIndent = require("./smartstring.indent");
+const docker = require("./smartstring.docker");
+exports.docker = docker;
+const indent = require("./smartstring.indent");
+exports.indent = indent;
+const typescript = require("./smartstring.typescript");
+exports.typescript = typescript;
+var smartstring_base64_1 = require("./smartstring.base64");
+exports.Base64 = smartstring_base64_1.Base64;
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;
-exports.indent = SmartstringIndent;
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQ0EsTUFBWSxpQkFBaUIsV0FBTSxzQkFBc0IsQ0FBQyxDQUFBO0FBQzFELE1BQVkscUJBQXFCLFdBQU0sMEJBQTBCLENBQUMsQ0FBQTtBQUNsRSxNQUFZLGlCQUFpQixXQUFNLHNCQUFzQixDQUFDLENBQUE7QUFFMUQsbUNBQXFCLHNCQUFzQixDQUFDO0FBQXBDLDZDQUFvQztBQUM1QyxnQ0FBc0IsbUJBQW1CLENBQUM7QUFBbEMsNENBQWtDO0FBQy9CLGNBQU0sR0FBRyxpQkFBaUIsQ0FBQztBQUMzQixrQkFBVSxHQUFHLHFCQUFxQixDQUFDO0FBQ25DLGNBQU0sR0FBRyxpQkFBaUIsQ0FBQyJ9
\ No newline at end of file
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsK0NBQThDO0FBSzFDLHdCQUFNO0FBSlYsK0NBQThDO0FBTTFDLHdCQUFNO0FBTFYsdURBQXNEO0FBSWxELGdDQUFVO0FBSWQsMkRBQTZDO0FBQXBDLHNDQUFBLE1BQU0sQ0FBQTtBQUNmLDJEQUE2QztBQUFwQyxzQ0FBQSxNQUFNLENBQUE7QUFDZixxREFBMkM7QUFBbEMsb0NBQUEsT0FBTyxDQUFBIn0=
\ No newline at end of file
diff --git a/dist/smartstring.base64.d.ts b/dist/smartstring.base64.d.ts
new file mode 100644
index 0000000..8c13120
--- /dev/null
+++ b/dist/smartstring.base64.d.ts
@@ -0,0 +1,23 @@
+/**
+ * the type for base 64
+ */
+export declare type TBase64Input = 'string' | 'base64' | 'base64uri';
+/**
+ * handle base64 strings
+ */
+export declare class Base64 {
+ private refString;
+ constructor(inputStringArg: any, typeArg: TBase64Input);
+ /**
+ * the simple string (unencoded)
+ */
+ readonly simpleString: string;
+ /**
+ * the base64 encoded version of the original string
+ */
+ readonly base64String: any;
+ /**
+ * the base64uri encoded version of the original string
+ */
+ readonly base64StringUri: any;
+}
diff --git a/dist/smartstring.base64.js b/dist/smartstring.base64.js
new file mode 100644
index 0000000..f58dfec
--- /dev/null
+++ b/dist/smartstring.base64.js
@@ -0,0 +1,39 @@
+"use strict";
+const plugins = require("./smartstring.plugins");
+/**
+ * handle base64 strings
+ */
+class Base64 {
+ constructor(inputStringArg, typeArg) {
+ switch (typeArg) {
+ case 'string':
+ this.refString = inputStringArg;
+ break;
+ case 'base64':
+ this.refString = plugins.jsBase64.decode(inputStringArg);
+ break;
+ case 'base64uri':
+ this.refString = plugins.jsBase64.decode(inputStringArg);
+ }
+ }
+ /**
+ * the simple string (unencoded)
+ */
+ get simpleString() {
+ return this.refString;
+ }
+ /**
+ * the base64 encoded version of the original string
+ */
+ get base64String() {
+ return plugins.jsBase64.encode(this.refString);
+ }
+ /**
+ * the base64uri encoded version of the original string
+ */
+ get base64StringUri() {
+ return plugins.jsBase64.encodeURI(this.refString);
+ }
+}
+exports.Base64 = Base64;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcuYmFzZTY0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRzdHJpbmcuYmFzZTY0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxpREFBZ0Q7QUFPaEQ7O0dBRUc7QUFDSDtJQUVJLFlBQVksY0FBYyxFQUFFLE9BQXFCO1FBQzdDLE1BQU0sQ0FBQyxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUM7WUFDZCxLQUFLLFFBQVE7Z0JBQ1QsSUFBSSxDQUFDLFNBQVMsR0FBRyxjQUFjLENBQUE7Z0JBQy9CLEtBQUssQ0FBQTtZQUNULEtBQUssUUFBUTtnQkFDVCxJQUFJLENBQUMsU0FBUyxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLGNBQWMsQ0FBQyxDQUFBO2dCQUN4RCxLQUFLLENBQUE7WUFDVCxLQUFLLFdBQVc7Z0JBQ1osSUFBSSxDQUFDLFNBQVMsR0FBRyxPQUFPLENBQUMsUUFBUSxDQUFDLE1BQU0sQ0FBQyxjQUFjLENBQUMsQ0FBQTtRQUNoRSxDQUFDO0lBQ0wsQ0FBQztJQUVEOztPQUVHO0lBQ0gsSUFBSSxZQUFZO1FBQ1osTUFBTSxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUE7SUFDekIsQ0FBQztJQUVEOztPQUVHO0lBQ0gsSUFBSSxZQUFZO1FBQ1osTUFBTSxDQUFDLE9BQU8sQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQTtJQUNsRCxDQUFDO0lBRUQ7O09BRUc7SUFDSCxJQUFJLGVBQWU7UUFDZixNQUFNLENBQUMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxTQUFTLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFBO0lBQ3JELENBQUM7Q0FDSjtBQW5DRCx3QkFtQ0MifQ==
\ No newline at end of file
diff --git a/dist/smartstring.docker.js b/dist/smartstring.docker.js
index 5d096ae..a5255f9 100644
--- a/dist/smartstring.docker.js
+++ b/dist/smartstring.docker.js
@@ -7,7 +7,7 @@
exports.makeEnvObject = function (envArrayArg) {
let returnObject = {};
let regexString = /(.*)=(.*)/;
- if (typeof envArrayArg !== "undefined") {
+ if (typeof envArrayArg !== 'undefined') {
for (let envKey in envArrayArg) {
let regexMatches = regexString.exec(envArrayArg[envKey]);
returnObject[regexMatches[1]] = regexMatches[2];
@@ -16,4 +16,4 @@ exports.makeEnvObject = function (envArrayArg) {
}
return returnObject;
};
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcuZG9ja2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRzdHJpbmcuZG9ja2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFFQTs7OztHQUlHO0FBQ1EscUJBQWEsR0FBRyxVQUFVLFdBQXFCO0lBQ3RELElBQUksWUFBWSxHQUFHLEVBQUUsQ0FBQztJQUN0QixJQUFJLFdBQVcsR0FBRyxXQUFXLENBQUM7SUFDOUIsRUFBRSxDQUFDLENBQUMsT0FBTyxXQUFXLEtBQUssV0FBVyxDQUFDLENBQUMsQ0FBQztRQUNyQyxHQUFHLENBQUMsQ0FBQyxJQUFJLE1BQU0sSUFBSSxXQUFXLENBQUMsQ0FBQyxDQUFDO1lBQzdCLElBQUksWUFBWSxHQUFHLFdBQVcsQ0FBQyxJQUFJLENBQUMsV0FBVyxDQUFDLE1BQU0sQ0FBQyxDQUFDLENBQUM7WUFDekQsWUFBWSxDQUFDLFlBQVksQ0FBQyxDQUFDLENBQUMsQ0FBQyxHQUFHLFlBQVksQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUNwRCxDQUFDO1FBQUEsQ0FBQztJQUNOLENBQUM7SUFDRCxNQUFNLENBQUMsWUFBWSxDQUFDO0FBQ3hCLENBQUMsQ0FBQyJ9
\ No newline at end of file
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcuZG9ja2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRzdHJpbmcuZG9ja2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFFQTs7OztHQUlHO0FBQ1EsUUFBQSxhQUFhLEdBQUcsVUFBVSxXQUFxQjtJQUN0RCxJQUFJLFlBQVksR0FBRyxFQUFFLENBQUE7SUFDckIsSUFBSSxXQUFXLEdBQUcsV0FBVyxDQUFBO0lBQzdCLEVBQUUsQ0FBQyxDQUFDLE9BQU8sV0FBVyxLQUFLLFdBQVcsQ0FBQyxDQUFDLENBQUM7UUFDckMsR0FBRyxDQUFDLENBQUMsSUFBSSxNQUFNLElBQUksV0FBVyxDQUFDLENBQUMsQ0FBQztZQUM3QixJQUFJLFlBQVksR0FBRyxXQUFXLENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFBO1lBQ3hELFlBQVksQ0FBQyxZQUFZLENBQUMsQ0FBQyxDQUFDLENBQUMsR0FBRyxZQUFZLENBQUMsQ0FBQyxDQUFDLENBQUE7UUFDbkQsQ0FBQztRQUFBLENBQUM7SUFDTixDQUFDO0lBQ0QsTUFBTSxDQUFDLFlBQVksQ0FBQTtBQUN2QixDQUFDLENBQUEifQ==
\ No newline at end of file
diff --git a/dist/smartstring.domain.js b/dist/smartstring.domain.js
index 672eaab..491f7a0 100644
--- a/dist/smartstring.domain.js
+++ b/dist/smartstring.domain.js
@@ -2,26 +2,26 @@
class Domain {
constructor(domainStringArg) {
let regexMatches = domainRegex(domainStringArg);
- this.fullName = "";
+ this.fullName = '';
for (let i = 1; i <= 5; i++) {
if (regexMatches[i - 1]) {
let localMatch = regexMatches[i - 1];
- this["level" + i.toString()] = localMatch;
- if (this.fullName == "") {
+ this['level' + i.toString()] = localMatch;
+ if (this.fullName === '') {
this.fullName = localMatch;
}
else {
- this.fullName = localMatch + "." + this.fullName;
+ this.fullName = localMatch + '.' + this.fullName;
}
}
else {
- this["level" + i.toString()] = undefined;
+ this['level' + i.toString()] = undefined;
}
;
}
;
this.protocol = protocolRegex(domainStringArg);
- this.zoneName = this.level2 + "." + this.level1;
+ this.zoneName = this.level2 + '.' + this.level1;
// aliases
this.topLevel = this.level1;
this.domainName = this.level2;
@@ -35,7 +35,7 @@ let domainRegex = function (stringArg) {
regexMatches.reverse(); //make sure we build the domain from toplevel to subdomain (reversed order)
regexMatches.pop(); // pop the last element, which is, since we reversed the Array, the full String of matched elements
let regexMatchesFiltered = regexMatches.filter(function (stringArg) {
- return (stringArg != "");
+ return (stringArg !== '');
});
return regexMatchesFiltered;
};
@@ -49,4 +49,4 @@ let protocolRegex = function (stringArg) {
return undefined;
}
};
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcuZG9tYWluLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRzdHJpbmcuZG9tYWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFFQTtJQWFJLFlBQVksZUFBc0I7UUFDOUIsSUFBSSxZQUFZLEdBQUcsV0FBVyxDQUFDLGVBQWUsQ0FBQyxDQUFDO1FBQ2hELElBQUksQ0FBQyxRQUFRLEdBQUcsRUFBRSxDQUFDO1FBQ25CLEdBQUc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UFDO0FBRUYsSUFBSSxhQUFhLEdBQUcsVUFBUyxTQUFnQjtJQUN6QyxJQUFJLFdBQVcsR0FBRyxzQkFBc0IsQ0FBQTtJQUN4QyxJQUFJLFlBQVksR0FBRyxXQUFXLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFBO0lBQzlDLEVBQUUsQ0FBQSxDQUFDLFlBQVksQ0FBQyxDQUFDLENBQUM7UUFDZCxNQUFNLENBQUMsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFBO0lBQzFCLENBQUM7SUFBQyxJQUFJLENBQUMsQ0FBQztRQUNKLE1BQU0sQ0FBQyxTQUFTLENBQUE7SUFDcEIsQ0FBQztBQUNMLENBQUMsQ0FBQSJ9
\ No newline at end of file
diff --git a/dist/smartstring.git.js b/dist/smartstring.git.js
index 1a8718e..22697e3 100644
--- a/dist/smartstring.git.js
+++ b/dist/smartstring.git.js
@@ -1,5 +1,4 @@
"use strict";
-const plugins = require("./smartstring.plugins");
/* ---------------------------------------------- *
* ------------------ classes ------------------- *
* ---------------------------------------------- */
@@ -10,10 +9,9 @@ class GitRepo {
this.user = regexMatches[2];
this.repo = regexMatches[3];
this.accessToken = tokenArg;
- this.sshUrl = gitLink(this.host, this.user, this.repo, this.accessToken, "ssh");
- this.httpsUrl = gitLink(this.host, this.user, this.repo, this.accessToken, "https");
+ this.sshUrl = gitLink(this.host, this.user, this.repo, this.accessToken, 'ssh');
+ this.httpsUrl = gitLink(this.host, this.user, this.repo, this.accessToken, 'https');
}
- ;
}
exports.GitRepo = GitRepo;
/* ---------------------------------------------- *
@@ -24,24 +22,24 @@ let gitRegex = function (stringArg) {
let regexMatches = regexString.exec(stringArg);
return regexMatches;
};
-let gitLink = function (hostArg, userArg, repoArg, tokenArg = "", linkTypeArg) {
+let gitLink = function (hostArg, userArg, repoArg, tokenArg = '', linkTypeArg) {
let returnString;
- if (tokenArg !== "") {
- tokenArg = tokenArg + "@";
+ if (tokenArg !== '') {
+ tokenArg = tokenArg + '@';
}
switch (linkTypeArg) {
- case "https":
- returnString = "https://" +
- tokenArg + hostArg + "/" + userArg + "/" + repoArg + ".git";
+ case 'https':
+ returnString = 'https://' +
+ tokenArg + hostArg + '/' + userArg + '/' + repoArg + '.git';
break;
- case "ssh":
- returnString = "git@" +
- hostArg + ":" + userArg + "/" + repoArg + ".git";
+ case 'ssh':
+ returnString = 'git@' +
+ hostArg + ':' + userArg + '/' + repoArg + '.git';
break;
default:
- plugins.beautylog.error("Link Type " + linkTypeArg + " not known");
+ console.error('Link Type ' + linkTypeArg + ' not known');
break;
}
return returnString;
};
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcuZ2l0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRzdHJpbmcuZ2l0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxNQUFZLE9BQU8sV0FBTSx1QkFBdUIsQ0FBQyxDQUFBO0FBRWpEOztvREFFb0Q7QUFDcEQ7SUFPSSxZQUFZLFNBQWdCLEVBQUMsUUFBZ0I7UUFDekMsSUFBSSxZQUFZLEdBQUcsUUFBUSxDQUFDLFNBQVMsQ0FBQyxDQUFDO1FBQ3ZDLElBQUksQ0FBQyxJQUFJLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzVCLElBQUksQ0FBQyxJQUFJLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzVCLElBQUksQ0FBQyxJQUFJLEdBQUcsWUFBWSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQzVCLElBQUksQ0FBQyxXQUFXLEdBQUcsUUFBUSxDQUFDO1FBQzVCLElBQUksQ0FBQyxNQUFNLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUMsSUFBSSxDQUFDLElBQUksRUFBQyxJQUFJLENBQUMsSU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HQUFHLEdBQUcsT0FBTyxHQUFHLE1BQU0sQ0FBQztZQUNyRCxLQUFLLENBQUE7UUFDVDtZQUNJLE9BQU8sQ0FBQyxLQUFLLENBQUMsWUFBWSxHQUFHLFdBQVcsR0FBRyxZQUFZLENBQUMsQ0FBQTtZQUN4RCxLQUFLLENBQUE7SUFDYixDQUFDO0lBQ0QsTUFBTSxDQUFDLFlBQVksQ0FBQTtBQUN2QixDQUFDLENBQUEifQ==
\ No newline at end of file
diff --git a/dist/smartstring.indent.js b/dist/smartstring.indent.js
index 31fe241..3b0875a 100644
--- a/dist/smartstring.indent.js
+++ b/dist/smartstring.indent.js
@@ -1,14 +1,13 @@
"use strict";
let splitString = (stringArg) => {
- let resultArray = stringArg.split("\n");
+ let resultArray = stringArg.split('\n');
return cleanStringArray(resultArray);
};
let joinString = (stringArrayArg) => {
- let resultString = "";
+ let resultString = '';
for (let line of stringArrayArg) {
- resultString = resultString + line + "\n";
+ resultString = resultString + line + '\n';
}
- ;
return resultString;
};
let cleanStringArray = (stringArrayArg) => {
@@ -45,11 +44,10 @@ exports.normalize = (stringArg) => {
let emptyLineRegex = /^(\s*)$/;
for (let stringItem of splitStringArray) {
let offsetString = deIndentRegex.exec(stringItem)[1];
- if ((typeof minCommonLeftOffset == "undefined" || offsetString.length < minCommonLeftOffset)
+ if ((typeof minCommonLeftOffset === 'undefined' || offsetString.length < minCommonLeftOffset)
&& !emptyLineRegex.test(stringItem)) {
minCommonLeftOffset = offsetString.length;
}
- ;
}
;
let resultSplitStringArray = [];
@@ -60,4 +58,4 @@ exports.normalize = (stringArg) => {
resultString = joinString(resultSplitStringArray);
return resultString;
};
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcuaW5kZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRzdHJpbmcuaW5kZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3Mi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IsR0FBRyxDQUFDLENBQUMsSUFBSSxVQUFVLElBQUksZ0JBQWdCLENBQUMsQ0FBQyxDQUFDO1FBQ3RDLHNCQUFzQixDQUFDLElBQUksQ0FBQyxVQUFVLENBQUMsTUFBTSxDQUFDLG1CQUFtQixDQUFDLENBQUMsQ0FBQTtJQUN2RSxDQUFDO0lBQUEsQ0FBQztJQUNGLFlBQVksR0FBRyxVQUFVLENBQUMsc0JBQXNCLENBQUMsQ0FBQTtJQUNqRCxNQUFNLENBQUMsWUFBWSxDQUFBO0FBQ3ZCLENBQUMsQ0FBQSJ9
\ No newline at end of file
diff --git a/dist/smartstring.plugins.d.ts b/dist/smartstring.plugins.d.ts
index 97148bf..69a1e23 100644
--- a/dist/smartstring.plugins.d.ts
+++ b/dist/smartstring.plugins.d.ts
@@ -1,2 +1,2 @@
-import "typings-global";
-export import beautylog = require("beautylog");
+import 'typings-global';
+export declare let jsBase64: any;
diff --git a/dist/smartstring.plugins.js b/dist/smartstring.plugins.js
index 18b3238..e82cd1d 100644
--- a/dist/smartstring.plugins.js
+++ b/dist/smartstring.plugins.js
@@ -1,4 +1,4 @@
"use strict";
require("typings-global");
-exports.beautylog = require("beautylog");
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c3RyaW5nLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQ1AsQ0FBQyxDQURzQjtBQUNULGlCQUFTLFdBQVcsV0FBVyxDQUFDLENBQUMifQ==
\ No newline at end of file
+exports.jsBase64 = require('js-base64').Base64;
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcucGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c3RyaW5nLnBsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDBCQUF1QjtBQUNaLFFBQUEsUUFBUSxHQUFHLE9BQU8sQ0FBQyxXQUFXLENBQUMsQ0FBQyxNQUFNLENBQUEifQ==
\ No newline at end of file
diff --git a/dist/smartstring.typescript.js b/dist/smartstring.typescript.js
index b3f3aca..5453232 100644
--- a/dist/smartstring.typescript.js
+++ b/dist/smartstring.typescript.js
@@ -1,3 +1,3 @@
"use strict";
exports.regexReferencePath = /\/\/\/\s*\s*[\\n]?/;
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcudHlwZXNjcmlwdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c3RyaW5nLnR5cGVzY3JpcHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUVXLDBCQUFrQixHQUFHLDhEQUE4RCxDQUFBIn0=
\ No newline at end of file
+//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRzdHJpbmcudHlwZXNjcmlwdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0c3RyaW5nLnR5cGVzY3JpcHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUVXLFFBQUEsa0JBQWtCLEdBQUcsOERBQThELENBQUEifQ==
\ No newline at end of file
diff --git a/package.json b/package.json
index 8ec18ef..2322149 100644
--- a/package.json
+++ b/package.json
@@ -22,12 +22,14 @@
},
"homepage": "https://gitlab.com/pushrocks/smartstring#readme",
"devDependencies": {
+ "@types/should": "^8.1.30",
+ "beautylog": "^6.0.0",
"npmts-g": "^5.2.8",
- "should": "^10.0.0",
- "typings-test": "^1.0.1"
+ "should": "^11.1.1",
+ "typings-test": "^1.0.3"
},
"dependencies": {
- "beautylog": "^5.0.20",
- "typings-global": "^1.0.6"
+ "js-base64": "^2.1.9",
+ "typings-global": "^1.0.14"
}
}
diff --git a/test/test.d.ts b/test/test.d.ts
index e7cc8ee..2fd432a 100644
--- a/test/test.d.ts
+++ b/test/test.d.ts
@@ -1 +1 @@
-import "typings-test";
+import 'typings-test';
diff --git a/test/test.js b/test/test.js
index 8327d88..c7e4c40 100644
--- a/test/test.js
+++ b/test/test.js
@@ -1,74 +1,81 @@
"use strict";
require("typings-test");
const smartstring = require("../dist/index");
-let should = require("should");
-describe("smartstring", function () {
- describe(".Domain class", function () {
+const should = require("should");
+describe('smartstring', function () {
+ describe('.Base64 class', function () {
+ let testBase64;
+ it('should create a valid instance of Base64', function () {
+ testBase64 = new smartstring.Base64('somestring', 'string');
+ should(testBase64).be.instanceOf(smartstring.Base64);
+ });
+ it('should read output a file as base64 and base64uri', function () {
+ should(testBase64.base64String).not.equal(testBase64.base64StringUri);
+ let testBase64_2 = new smartstring.Base64(testBase64.base64StringUri, 'base64uri');
+ should(testBase64_2.simpleString).equal(testBase64.simpleString);
+ });
+ });
+ describe('.Domain class', function () {
let testDomain;
let testDomain2;
- it("should create a new Domain object", function () {
- testDomain = new smartstring.Domain("https://level3D.level2D.level1D");
- testDomain.should.be.instanceof(smartstring.Domain);
+ it('should create a new Domain object', function () {
+ testDomain = new smartstring.Domain('https://level3D.level2D.level1D');
+ should(testDomain).be.instanceof(smartstring.Domain);
console.log(testDomain);
});
- it("should have a .topLevel", function () {
- testDomain.topLevel.should.equal("level1D");
+ it('should have a .topLevel', function () {
+ should(testDomain.topLevel).equal('level1D');
});
- it("should have a .level2", function () {
- testDomain.level2.should.equal("level2D");
+ it('should have a .level2', function () {
+ should(testDomain.level2).equal('level2D');
});
- it("should have a .level3", function () {
- testDomain.level3.should.equal("level3D");
+ it('should have a .level3', function () {
+ should(testDomain.level3).equal('level3D');
});
- it("should have the correct dns zone name", function () {
- testDomain.zoneName.should.equal("level2D.level1D");
+ it('should have the correct dns zone name', function () {
+ should(testDomain.zoneName).equal('level2D.level1D');
});
- it("should have the correct protocol", function () {
- testDomain.protocol.should.equal("https");
+ it('should have the correct protocol', function () {
+ should(testDomain.protocol).equal('https');
});
- it("testDomain2 should be a basic domain", function () {
- testDomain2 = new smartstring.Domain("bleu.de");
+ it('testDomain2 should be a basic domain', function () {
+ testDomain2 = new smartstring.Domain('bleu.de');
console.log(testDomain2);
});
});
- describe(".Git class", function () {
+ describe('.Git class', function () {
let testGit;
- 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 create a new Git class GitRepo', function () {
+ testGit = new smartstring.GitRepo('git+https://github.com/pushrocks/smartstring.git');
+ should(testGit).be.instanceof(smartstring.GitRepo);
});
- it("should return a .host", function () {
- testGit.host
- .should.equal("github.com");
+ it('should return a .host', function () {
+ should(testGit.host).equal('github.com');
});
- it("should return a .user", function () {
- testGit.user
- .should.equal("pushrocks");
+ it('should return a .user', function () {
+ should(testGit.user).equal('pushrocks');
});
- it("should return a .repo", function () {
- testGit.repo
- .should.equal("smartstring");
+ it('should return a .repo', function () {
+ should(testGit.repo).equal('smartstring');
});
- it("should return a .httpsUrl", function () {
- testGit.httpsUrl
- .should.equal("https://github.com/pushrocks/smartstring.git");
+ it('should return a .httpsUrl', function () {
+ should(testGit.httpsUrl).equal('https://github.com/pushrocks/smartstring.git');
});
- it("should return a .sshUrl", function () {
- testGit.sshUrl
- .should.equal("git@github.com:pushrocks/smartstring.git");
+ it('should return a .sshUrl', function () {
+ should(testGit.sshUrl).equal('git@github.com:pushrocks/smartstring.git');
});
});
- describe(".docker", function () {
- describe(".makeEnvObject", function () {
- it("should create a Env Object", function () {
- let envStringArray = ["VIRTUAL_HOST=sub.domain.tld", "DEFAULT_HOST=some.domain.com"];
+ describe('.docker', function () {
+ describe('.makeEnvObject', function () {
+ it('should create a Env Object', function () {
+ let envStringArray = ['VIRTUAL_HOST=sub.domain.tld', 'DEFAULT_HOST=some.domain.com'];
let envObject = smartstring.docker.makeEnvObject(envStringArray);
- envObject.VIRTUAL_HOST.should.equal("sub.domain.tld");
- envObject.DEFAULT_HOST.should.equal("some.domain.com");
+ envObject.VIRTUAL_HOST.should.equal('sub.domain.tld');
+ envObject.DEFAULT_HOST.should.equal('some.domain.com');
});
});
});
- describe(".indent", function () {
+ describe('.indent', function () {
let testString = `
base
should be indented
@@ -77,32 +84,32 @@ describe("smartstring", function () {
base
indented
`;
- describe(".normalize()", function () {
- it("should normalize a string", function () {
+ describe('.normalize()', function () {
+ it('should normalize a string', function () {
testString = smartstring.indent.normalize(testString);
console.log(testString);
- let zoneNameArg = "test1";
- let destinationIpArg = "111";
+ let zoneNameArg = 'test1';
+ let destinationIpArg = '111';
});
});
- describe(".indentWithPrefix", function () {
- it("should indent", function () {
- testString = smartstring.indent.indentWithPrefix(testString, ">> ");
+ describe('.indentWithPrefix', function () {
+ it('should indent', function () {
+ testString = smartstring.indent.indentWithPrefix(testString, '>> ');
console.log(testString);
});
});
});
- describe(".typescript", function () {
- describe(".referenceRegex", function () {
- it("should match reference paths", function () {
- smartstring.typescript.regexReferencePath.test("/// ")
+ describe('.typescript', function () {
+ describe('.referenceRegex', function () {
+ it('should match reference paths', function () {
+ smartstring.typescript.regexReferencePath.test('/// ')
.should.be.true();
smartstring.typescript.regexReferencePath.test("/// ")
.should.be.true();
- smartstring.typescript.regexReferencePath.test("/// ")
+ smartstring.typescript.regexReferencePath.test('/// ')
.should.be.false();
});
});
});
});
-//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sY0FDUCxDQUFDLENBRG9CO0FBQ3JCLE1BQVksV0FBVyxXQUFNLG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QUN4RSxNQUFNLENBQUMsRUFBRSxDQUFDLElBQUksRUFBRSxDQUFBO2dCQUNyQixXQUFXLENBQUMsVUFBVSxDQUFDLGtCQUFrQixDQUFDLElBQUksQ0FBQywyQkFBMkIsQ0FBQztxQkFDdEUsTUFBTSxDQUFDLEVBQUUsQ0FBQyxJQUFJLEVBQUUsQ0FBQTtnQkFDckIsV0FBVyxDQUFDLFVBQVUsQ0FBQyxrQkFBa0IsQ0FBQyxJQUFJLENBQUMsNEJBQTRCLENBQUM7cUJBQ3ZFLE1BQU0sQ0FBQyxFQUFFLENBQUMsS0FBSyxFQUFFLENBQUE7WUFDMUIsQ0FBQyxDQUFDLENBQUE7UUFDTixDQUFDLENBQUMsQ0FBQTtJQUNOLENBQUMsQ0FBQyxDQUFBO0FBQ04sQ0FBQyxDQUFDLENBQUEifQ==
\ No newline at end of file
diff --git a/test/test.ts b/test/test.ts
index 6085af6..832e01b 100644
--- a/test/test.ts
+++ b/test/test.ts
@@ -1,74 +1,81 @@
-import "typings-test"
-import * as smartstring from "../dist/index";
-let should = require("should");
+import 'typings-test'
+import * as smartstring from '../dist/index'
+import * as should from 'should'
-describe("smartstring",function(){
- describe(".Domain class",function(){
- let testDomain:smartstring.Domain;
- let testDomain2:smartstring.Domain;
- it("should create a new Domain object",function(){
- testDomain = new smartstring.Domain("https://level3D.level2D.level1D");
- testDomain.should.be.instanceof(smartstring.Domain);
- console.log(testDomain);
- });
- 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");
+describe('smartstring',function(){
+ describe('.Base64 class', function(){
+ let testBase64: smartstring.Base64
+ it('should create a valid instance of Base64', function(){
+ testBase64 = new smartstring.Base64('somestring', 'string')
+ should(testBase64).be.instanceOf(smartstring.Base64)
})
- it ("should have the correct protocol",function(){
- testDomain.protocol.should.equal("https");
+ it('should read output a file as base64 and base64uri', function(){
+ should(testBase64.base64String).not.equal(testBase64.base64StringUri)
+ let testBase64_2 = new smartstring.Base64(testBase64.base64StringUri, 'base64uri')
+ should(testBase64_2.simpleString).equal(testBase64.simpleString)
})
- it("testDomain2 should be a basic domain",function(){
- testDomain2 = new smartstring.Domain("bleu.de");
- console.log(testDomain2);
- });
})
- 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);
+ describe('.Domain class',function(){
+ let testDomain:smartstring.Domain
+ let testDomain2:smartstring.Domain
+ it('should create a new Domain object',function(){
+ testDomain = new smartstring.Domain('https://level3D.level2D.level1D')
+ should(testDomain).be.instanceof(smartstring.Domain)
+ console.log(testDomain)
+ })
+ it('should have a .topLevel',function(){
+ should(testDomain.topLevel).equal('level1D')
+ })
+ it('should have a .level2',function(){
+ should(testDomain.level2).equal('level2D')
+ })
+ it('should have a .level3',function(){
+ should(testDomain.level3).equal('level3D')
+ })
+ it('should have the correct dns zone name',function(){
+ should(testDomain.zoneName).equal('level2D.level1D')
+ })
+ it ('should have the correct protocol',function(){
+ should(testDomain.protocol).equal('https')
+ })
+ it('testDomain2 should be a basic domain',function(){
+ testDomain2 = new smartstring.Domain('bleu.de')
+ console.log(testDomain2)
})
- it("should return a .host",function(){
- testGit.host
- .should.equal("github.com");
- });
- it("should return a .user",function(){
- testGit.user
- .should.equal("pushrocks");
- });
- it("should return a .repo",function(){
- testGit.repo
- .should.equal("smartstring");
- });
- it("should return a .httpsUrl",function(){
- testGit.httpsUrl
- .should.equal("https://github.com/pushrocks/smartstring.git");
- });
- it("should return a .sshUrl",function(){
- testGit.sshUrl
- .should.equal("git@github.com:pushrocks/smartstring.git");
- });
})
- describe(".docker",function(){
- describe(".makeEnvObject",function(){
- it("should create a Env Object",function(){
- let envStringArray = ["VIRTUAL_HOST=sub.domain.tld","DEFAULT_HOST=some.domain.com"];
- let envObject:any = smartstring.docker.makeEnvObject(envStringArray);
- envObject.VIRTUAL_HOST.should.equal("sub.domain.tld");
- envObject.DEFAULT_HOST.should.equal("some.domain.com");
+ 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')
+ should(testGit).be.instanceof(smartstring.GitRepo)
+ })
+ it('should return a .host',function(){
+ should(testGit.host).equal('github.com')
+ })
+ it('should return a .user',function(){
+ should(testGit.user).equal('pushrocks')
+ })
+ it('should return a .repo',function(){
+ should(testGit.repo).equal('smartstring')
+ })
+ it('should return a .httpsUrl',function(){
+ should(testGit.httpsUrl).equal('https://github.com/pushrocks/smartstring.git')
+ })
+ it('should return a .sshUrl',function(){
+ should(testGit.sshUrl).equal('git@github.com:pushrocks/smartstring.git')
+ })
+ })
+ describe('.docker',function(){
+ describe('.makeEnvObject',function(){
+ it('should create a Env Object',function(){
+ let envStringArray = ['VIRTUAL_HOST=sub.domain.tld','DEFAULT_HOST=some.domain.com']
+ let envObject:any = smartstring.docker.makeEnvObject(envStringArray)
+ envObject.VIRTUAL_HOST.should.equal('sub.domain.tld')
+ envObject.DEFAULT_HOST.should.equal('some.domain.com')
})
})
- });
- describe(".indent",function(){
+ })
+ describe('.indent',function(){
let testString = `
base
should be indented
@@ -76,33 +83,33 @@ describe("smartstring",function(){
base
indented
- `;
- describe(".normalize()",function(){
- it("should normalize a string",function(){
- testString = smartstring.indent.normalize(testString);
- console.log(testString);
- let zoneNameArg = "test1";
- let destinationIpArg = "111";
- });
- });
-
- describe(".indentWithPrefix",function(){
- it("should indent",function(){
- testString = smartstring.indent.indentWithPrefix(testString,">> ");
- console.log(testString);
+ `
+ describe('.normalize()',function(){
+ it('should normalize a string',function(){
+ testString = smartstring.indent.normalize(testString)
+ console.log(testString)
+ let zoneNameArg = 'test1'
+ let destinationIpArg = '111'
})
})
- });
- describe(".typescript",function(){
- describe(".referenceRegex",function(){
- it("should match reference paths",function(){
- smartstring.typescript.regexReferencePath.test("/// ")
- .should.be.true();
- smartstring.typescript.regexReferencePath.test("/// ")
- .should.be.true();
- smartstring.typescript.regexReferencePath.test("/// ")
- .should.be.false();
+
+ describe('.indentWithPrefix',function(){
+ it('should indent',function(){
+ testString = smartstring.indent.indentWithPrefix(testString,'>> ')
+ console.log(testString)
})
})
})
-});
\ No newline at end of file
+ describe('.typescript',function(){
+ describe('.referenceRegex',function(){
+ it('should match reference paths',function(){
+ smartstring.typescript.regexReferencePath.test('/// ')
+ .should.be.true()
+ smartstring.typescript.regexReferencePath.test("/// ")
+ .should.be.true()
+ smartstring.typescript.regexReferencePath.test('/// ')
+ .should.be.false()
+ })
+ })
+ })
+})
diff --git a/ts/index.ts b/ts/index.ts
index eb48cd2..b9e7303 100644
--- a/ts/index.ts
+++ b/ts/index.ts
@@ -1,10 +1,13 @@
-import * as plugins from "./smartstring.plugins";
-import * as SmartstringDocker from "./smartstring.docker";
-import * as SmartstringTypescript from "./smartstring.typescript";
-import * as SmartstringIndent from "./smartstring.indent";
+import * as docker from './smartstring.docker'
+import * as indent from './smartstring.indent'
+import * as typescript from './smartstring.typescript'
-export {Domain} from "./smartstring.domain";
-export {GitRepo} from "./smartstring.git";
-export let docker = SmartstringDocker;
-export let typescript = SmartstringTypescript;
-export let indent = SmartstringIndent;
\ No newline at end of file
+export {
+ docker,
+ typescript,
+ indent
+}
+
+export { Base64 } from './smartstring.base64'
+export { Domain } from './smartstring.domain'
+export { GitRepo } from './smartstring.git'
diff --git a/ts/smartstring.base64.ts b/ts/smartstring.base64.ts
new file mode 100644
index 0000000..fd9efb6
--- /dev/null
+++ b/ts/smartstring.base64.ts
@@ -0,0 +1,46 @@
+import * as plugins from './smartstring.plugins'
+
+/**
+ * the type for base 64
+ */
+export type TBase64Input = 'string' | 'base64' | 'base64uri'
+
+/**
+ * handle base64 strings
+ */
+export class Base64 {
+ private refString: string
+ constructor(inputStringArg, typeArg: TBase64Input) {
+ switch (typeArg) {
+ case 'string': // easiest case
+ this.refString = inputStringArg
+ break
+ case 'base64':
+ this.refString = plugins.jsBase64.decode(inputStringArg)
+ break
+ case 'base64uri':
+ this.refString = plugins.jsBase64.decode(inputStringArg)
+ }
+ }
+
+ /**
+ * the simple string (unencoded)
+ */
+ get simpleString() {
+ return this.refString
+ }
+
+ /**
+ * the base64 encoded version of the original string
+ */
+ get base64String() {
+ return plugins.jsBase64.encode(this.refString)
+ }
+
+ /**
+ * the base64uri encoded version of the original string
+ */
+ get base64StringUri() {
+ return plugins.jsBase64.encodeURI(this.refString)
+ }
+}
diff --git a/ts/smartstring.docker.ts b/ts/smartstring.docker.ts
index 67da173..44104c3 100644
--- a/ts/smartstring.docker.ts
+++ b/ts/smartstring.docker.ts
@@ -1,4 +1,4 @@
-import * as plugins from "./smartstring.plugins";
+import * as plugins from './smartstring.plugins'
/**
* converts an erray of env strings from docker remote api to an usable object.
@@ -6,13 +6,13 @@ import * as plugins from "./smartstring.plugins";
* @returns {}
*/
export let makeEnvObject = function (envArrayArg: string[]) {
- let returnObject = {};
- let regexString = /(.*)=(.*)/;
- if (typeof envArrayArg !== "undefined") {
+ let returnObject = {}
+ let regexString = /(.*)=(.*)/
+ if (typeof envArrayArg !== 'undefined') {
for (let envKey in envArrayArg) {
- let regexMatches = regexString.exec(envArrayArg[envKey]);
- returnObject[regexMatches[1]] = regexMatches[2];
+ let regexMatches = regexString.exec(envArrayArg[envKey])
+ returnObject[regexMatches[1]] = regexMatches[2]
};
}
- return returnObject;
-};
\ No newline at end of file
+ return returnObject
+}
diff --git a/ts/smartstring.domain.ts b/ts/smartstring.domain.ts
index b46e16e..a2c2699 100644
--- a/ts/smartstring.domain.ts
+++ b/ts/smartstring.domain.ts
@@ -1,62 +1,62 @@
-import * as plugins from "./smartstring.plugins";
+import * as plugins from './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;
+ fullName: string
+ level1: string
+ level2: string
+ level3: string
+ level4: string
+ level5: string
+ protocol: string
+ zoneName: string
+ // aliases
+ topLevel: string
+ domainName
+ subDomain
constructor(domainStringArg:string){
let regexMatches = domainRegex(domainStringArg);
- this.fullName = "";
- for(let i = 1; i <= 5; i++){
- if(regexMatches[i - 1]) {
+ this.fullName = ''
+ for (let i = 1; i <= 5; i++) {
+ if (regexMatches[i - 1]) {
let localMatch = regexMatches[i - 1]
- this["level" + i.toString()] = localMatch;
- if (this.fullName == ""){
- this.fullName = localMatch;
+ this['level' + i.toString()] = localMatch
+ if (this.fullName === ''){
+ this.fullName = localMatch
} else {
- this.fullName = localMatch + "." + this.fullName;
+ this.fullName = localMatch + '.' + this.fullName
}
} else {
- this["level" + i.toString()] = undefined;
+ this['level' + i.toString()] = undefined
};
};
- this.protocol = protocolRegex(domainStringArg);
- this.zoneName = this.level2 + "." + this.level1;
-
+ this.protocol = protocolRegex(domainStringArg)
+ this.zoneName = this.level2 + '.' + this.level1
+
// aliases
- this.topLevel = this.level1;
- this.domainName = this.level2;
- this.subDomain = this.level3;
+ 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(); //make sure we build the domain from toplevel to subdomain (reversed order)
- regexMatches.pop(); // pop the last element, which is, since we reversed the Array, the full String of matched elements
+ 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() //make sure we build the domain from toplevel to subdomain (reversed order)
+ regexMatches.pop() // pop the last element, which is, since we reversed the Array, the full String of matched elements
let regexMatchesFiltered = regexMatches.filter(function(stringArg:string){
- return(stringArg != "");
+ return(stringArg !== '')
});
- return regexMatchesFiltered;
+ return regexMatchesFiltered
};
let protocolRegex = function(stringArg:string){
- let regexString = /^([a-zA-Z0-9]*):\/\//;
- let regexMatches = regexString.exec(stringArg);
- if(regexMatches){
- return regexMatches[1];
+ let regexString = /^([a-zA-Z0-9]*):\/\//
+ let regexMatches = regexString.exec(stringArg)
+ if(regexMatches) {
+ return regexMatches[1]
} else {
- return undefined;
+ return undefined
}
-}
\ No newline at end of file
+}
diff --git a/ts/smartstring.git.ts b/ts/smartstring.git.ts
index 915b2d1..d88c5df 100644
--- a/ts/smartstring.git.ts
+++ b/ts/smartstring.git.ts
@@ -1,52 +1,52 @@
-import * as plugins from "./smartstring.plugins";
+import * as plugins from './smartstring.plugins'
/* ---------------------------------------------- *
* ------------------ classes ------------------- *
* ---------------------------------------------- */
export class GitRepo {
- host:string;
- user:string;
- repo:string;
- accessToken:string;
- sshUrl:string;
- httpsUrl:string;
- constructor(stringArg:string,tokenArg?:string){
- let regexMatches = gitRegex(stringArg);
- this.host = regexMatches[1];
- this.user = regexMatches[2];
- this.repo = regexMatches[3];
- this.accessToken = tokenArg;
- this.sshUrl = gitLink(this.host,this.user,this.repo,this.accessToken, "ssh");
- this.httpsUrl = gitLink(this.host,this.user,this.repo,this.accessToken, "https");
- };
+ host: string
+ user: string
+ repo: string
+ accessToken: string
+ sshUrl: string
+ httpsUrl: string
+ constructor(stringArg: string,tokenArg?: string) {
+ let regexMatches = gitRegex(stringArg)
+ this.host = regexMatches[1]
+ this.user = regexMatches[2]
+ this.repo = regexMatches[3]
+ this.accessToken = tokenArg
+ this.sshUrl = gitLink(this.host,this.user,this.repo,this.accessToken, 'ssh')
+ this.httpsUrl = gitLink(this.host,this.user,this.repo,this.accessToken, 'https')
+ }
}
/* ---------------------------------------------- *
* ------------------ helpers ------------------- *
* ---------------------------------------------- */
let gitRegex = function(stringArg:string){
- let regexString = /([a-zA-Z0-9\-\.]*)(?:\/|\:)([a-zA-Z0-9\-]*)(?:\/)([a-zA-Z0-9\-]*)(?:\.git)/;
- let regexMatches = regexString.exec(stringArg);
- return regexMatches;
-};
+ let regexString = /([a-zA-Z0-9\-\.]*)(?:\/|\:)([a-zA-Z0-9\-]*)(?:\/)([a-zA-Z0-9\-]*)(?:\.git)/
+ let regexMatches = regexString.exec(stringArg)
+ return regexMatches
+}
-let gitLink = function(hostArg:string, userArg:string, repoArg:string, tokenArg:string = "", linkTypeArg):string{
- let returnString;
- if (tokenArg !== ""){
- tokenArg = tokenArg + "@"
+let gitLink = function(hostArg: string, userArg: string, repoArg: string, tokenArg: string = '', linkTypeArg): string{
+ let returnString
+ if (tokenArg !== '') {
+ tokenArg = tokenArg + '@'
}
switch (linkTypeArg) {
- case "https":
- returnString = "https://" +
- tokenArg + hostArg + "/" + userArg + "/" + repoArg + ".git";
- break;
- case "ssh":
- returnString = "git@" +
- hostArg + ":" + userArg + "/" + repoArg + ".git";
- break;
+ case 'https':
+ returnString = 'https://' +
+ tokenArg + hostArg + '/' + userArg + '/' + repoArg + '.git'
+ break
+ case 'ssh':
+ returnString = 'git@' +
+ hostArg + ':' + userArg + '/' + repoArg + '.git';
+ break
default:
- plugins.beautylog.error("Link Type " + linkTypeArg + " not known");
- break;
+ console.error('Link Type ' + linkTypeArg + ' not known')
+ break
}
- return returnString;
-};
\ No newline at end of file
+ return returnString
+}
diff --git a/ts/smartstring.indent.ts b/ts/smartstring.indent.ts
index a30beb6..a795a8d 100644
--- a/ts/smartstring.indent.ts
+++ b/ts/smartstring.indent.ts
@@ -1,64 +1,64 @@
-import * as plugins from "./smartstring.plugins";
+import * as plugins from './smartstring.plugins'
-let splitString = (stringArg:string):string[] => {
- let resultArray = stringArg.split("\n");
- return cleanStringArray(resultArray);
+let splitString = (stringArg: string): string[] => {
+ let resultArray = stringArg.split('\n')
+ return cleanStringArray(resultArray)
};
-let joinString = (stringArrayArg:string[]):string => {
- let resultString:string = "";
- for(let line of stringArrayArg){
- resultString = resultString + line + "\n";
- };
- return resultString;
-};
-
-let cleanStringArray = (stringArrayArg:string[]):string[] => {
- let testRegex = /^[\s]*$/;
- if(testRegex.test(stringArrayArg[0])){
- stringArrayArg.shift();
+let joinString = (stringArrayArg: string[]): string => {
+ let resultString: string = ''
+ for (let line of stringArrayArg){
+ resultString = resultString + line + '\n'
}
- if(testRegex.test(stringArrayArg[stringArrayArg.length - 1])){
- stringArrayArg.pop();
- };
- return stringArrayArg;
+ return resultString
}
-export let indent = (stringArg:string,spaceAmount:number):string => {
- let resultString:string;
- return resultString;
-};
-
-export let indentWithPrefix = (stringArg:string,prefixArg:string):string => {
- let resultString:string;
- let stringArray = splitString(stringArg);
- let resultArray:string[] = [];
- for(let stringItem of stringArray){
- resultArray.push(prefixArg + stringItem);
+let cleanStringArray = (stringArrayArg: string[]): string[] => {
+ let testRegex = /^[\s]*$/
+ if (testRegex.test(stringArrayArg[0])) {
+ stringArrayArg.shift()
+ }
+ if (testRegex.test(stringArrayArg[stringArrayArg.length - 1])) {
+ stringArrayArg.pop()
};
- resultString = joinString(resultArray);
- return resultString;
-};
+ return stringArrayArg
+}
-export let normalize = (stringArg:string):string => {
- let resultString:string;
- let splitStringArray:string[] = splitString(stringArg);
- let minCommonLeftOffset:number;
- let deIndentRegex = /^(\s*)/;
+export let indent = (stringArg: string, spaceAmount: number): string => {
+ let resultString: string
+ return resultString
+}
+
+export let indentWithPrefix = (stringArg: string,prefixArg: string): string => {
+ let resultString: string
+ let stringArray = splitString(stringArg)
+ let resultArray: string[] = []
+ for (let stringItem of stringArray){
+ resultArray.push(prefixArg + stringItem)
+ };
+ resultString = joinString(resultArray)
+ return resultString
+}
+
+export let normalize = (stringArg: string): string => {
+ let resultString: string
+ let splitStringArray: string[] = splitString(stringArg)
+ let minCommonLeftOffset: number
+ let deIndentRegex = /^(\s*)/
let emptyLineRegex = /^(\s*)$/
- for(let stringItem of splitStringArray){
- let offsetString = deIndentRegex.exec(stringItem)[1];
+ for (let stringItem of splitStringArray){
+ let offsetString = deIndentRegex.exec(stringItem)[1]
if (
- (typeof minCommonLeftOffset == "undefined" || offsetString.length < minCommonLeftOffset)
+ (typeof minCommonLeftOffset === 'undefined' || offsetString.length < minCommonLeftOffset)
&& !emptyLineRegex.test(stringItem)
- ){
- minCommonLeftOffset = offsetString.length;
- };
+ ) {
+ minCommonLeftOffset = offsetString.length
+ }
};
- let resultSplitStringArray = [];
- for(let stringItem of splitStringArray){
- resultSplitStringArray.push(stringItem.substr(minCommonLeftOffset));
+ let resultSplitStringArray = []
+ for (let stringItem of splitStringArray) {
+ resultSplitStringArray.push(stringItem.substr(minCommonLeftOffset))
};
- resultString = joinString(resultSplitStringArray);
- return resultString;
+ resultString = joinString(resultSplitStringArray)
+ return resultString
}
diff --git a/ts/smartstring.plugins.ts b/ts/smartstring.plugins.ts
index afff94d..ace8409 100644
--- a/ts/smartstring.plugins.ts
+++ b/ts/smartstring.plugins.ts
@@ -1,2 +1,2 @@
-import "typings-global"
-export import beautylog = require("beautylog");
+import 'typings-global'
+export let jsBase64 = require('js-base64').Base64
diff --git a/ts/smartstring.typescript.ts b/ts/smartstring.typescript.ts
index 3d19371..37f9136 100644
--- a/ts/smartstring.typescript.ts
+++ b/ts/smartstring.typescript.ts
@@ -1,3 +1,3 @@
-import * as plugins from "./smartstring.plugins";
+import * as plugins from './smartstring.plugins'
-export let regexReferencePath = /\/\/\/\s*\s*[\\n]?/
\ No newline at end of file
+export let regexReferencePath = /\/\/\/\s*\s*[\\n]?/
diff --git a/tslint.json b/tslint.json
new file mode 100644
index 0000000..45052ad
--- /dev/null
+++ b/tslint.json
@@ -0,0 +1,3 @@
+{
+ "extends": "tslint-config-standard"
+}