diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9a4467e..7b61eb3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,6 +12,9 @@ stages: - release - metadata +before_script: + - npm install -g @shipzone/npmci + # ==================== # security stage # ==================== @@ -36,6 +39,7 @@ auditProductionDependencies: - npmci command npm audit --audit-level=high --only=prod --production tags: - docker + allow_failure: true auditDevDependencies: image: registry.gitlab.com/hosttoday/ht-docker-node:npmci @@ -96,10 +100,9 @@ codequality: only: - tags script: - - npmci command npm install -g tslint typescript + - npmci command npm install -g typescript - npmci npm prepare - npmci npm install - - npmci command "tslint -c tslint.json ./ts/**/*.ts" tags: - lossless - docker diff --git a/.vscode/launch.json b/.vscode/launch.json index 112db52..26e9f92 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,28 +2,10 @@ "version": "0.2.0", "configurations": [ { - "name": "current file", - "type": "node", + "command": "npm test", + "name": "Run npm test", "request": "launch", - "args": [ - "${relativeFile}" - ], - "runtimeArgs": ["-r", "@gitzone/tsrun"], - "cwd": "${workspaceRoot}", - "protocol": "inspector", - "internalConsoleOptions": "openOnSessionStart" - }, - { - "name": "test.ts", - "type": "node", - "request": "launch", - "args": [ - "test/test.ts" - ], - "runtimeArgs": ["-r", "@gitzone/tsrun"], - "cwd": "${workspaceRoot}", - "protocol": "inspector", - "internalConsoleOptions": "openOnSessionStart" + "type": "node-terminal" } ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 2868e45..3648eaa 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -22,6 +22,5 @@ } } } - ], - "typescript.tsdk": "node_modules/typescript/lib" + ] } diff --git a/license b/license new file mode 100644 index 0000000..a58c00e --- /dev/null +++ b/license @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 Maurice Butler +Copyright (c) 2016 Lossless GmbH + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/npmextra.json b/npmextra.json index f125a42..ae66a98 100644 --- a/npmextra.json +++ b/npmextra.json @@ -14,7 +14,7 @@ "githost": "gitlab.com", "gitscope": "pushrocks", "gitrepo": "smartstring", - "shortDescription": "handle strings in smart ways. TypeScript ready.", + "description": "handle strings in smart ways. TypeScript ready.", "npmPackagename": "@pushrocks/smartstring", "license": "MIT" } diff --git a/package.json b/package.json index 808b693..6657a95 100644 --- a/package.json +++ b/package.json @@ -60,4 +60,4 @@ "browserslist": [ "last 1 chrome versions" ] -} +} \ No newline at end of file diff --git a/ts/smartstring.domain.ts b/ts/smartstring.domain.ts index c4b8104..d97f1dc 100644 --- a/ts/smartstring.domain.ts +++ b/ts/smartstring.domain.ts @@ -19,13 +19,15 @@ export class Domain { // lets do the node standard stuff first this.protocol = this._protocolRegex(domainStringArg); if (!this.protocol) { - domainStringArg = `https://${domainStringArg}` + domainStringArg = `https://${domainStringArg}`; } this.nodeParsedUrl = plugins.url.parse(domainStringArg); this.port = this.nodeParsedUrl.port; // lets do the rest after - const regexMatches = this._domainRegex(domainStringArg.replace(this.nodeParsedUrl.pathname, '')); + const regexMatches = this._domainRegex( + domainStringArg.replace(this.nodeParsedUrl.pathname, '') + ); this.fullName = ''; for (let i = 1; i <= 5; i++) { if (regexMatches[i - 1]) { @@ -52,7 +54,8 @@ export class Domain { /** */ private _domainRegex(stringArg: string) { - const 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}$/; + const 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}$/; const 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 diff --git a/ts/smartstring.git.ts b/ts/smartstring.git.ts index fb2d057..ea73ae3 100644 --- a/ts/smartstring.git.ts +++ b/ts/smartstring.git.ts @@ -25,7 +25,8 @@ export class GitRepo { * ------------------ helpers ------------------- * * ---------------------------------------------- */ const gitRegex = function (stringArg: string) { - const regexString = /([a-zA-Z0-9\-\.]*)(?:\/|\:)([a-zA-Z0-9\-\.]*)(?:\/)([a-zA-Z0-9\-\.]*)(?:\.git)/; + const regexString = + /([a-zA-Z0-9\-\.]*)(?:\/|\:)([a-zA-Z0-9\-\.]*)(?:\/)([a-zA-Z0-9\-\.]*)(?:\.git)/; let regexMatches = regexString.exec(stringArg); return regexMatches; }; diff --git a/ts/smartstring.plugins.ts b/ts/smartstring.plugins.ts index 8554214..6fc4b62 100644 --- a/ts/smartstring.plugins.ts +++ b/ts/smartstring.plugins.ts @@ -3,9 +3,7 @@ import * as smartenv from '@pushrocks/smartenv'; const smartenvInstance = new smartenv.Smartenv(); import * as isounique from '@pushrocks/isounique'; -export { - isounique -} +export { isounique }; import { Buffer } from 'buffer'; if (smartenvInstance.isBrowser) {