Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
c0035bb4f3 | |||
976f81420f | |||
1be144d099 | |||
9d4b7a5292 | |||
563d6f0ac3 | |||
4da0aeb871 |
@ -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
|
||||
|
24
.vscode/launch.json
vendored
24
.vscode/launch.json
vendored
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -22,6 +22,5 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
]
|
||||
}
|
||||
|
22
license
Normal file
22
license
Normal file
@ -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.
|
@ -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"
|
||||
}
|
||||
|
100
package-lock.json
generated
100
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@pushrocks/smartstring",
|
||||
"version": "3.0.25",
|
||||
"version": "4.0.2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@pushrocks/smartstring",
|
||||
"version": "3.0.25",
|
||||
"version": "4.0.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pushrocks/isounique": "^1.0.5",
|
||||
@ -21,11 +21,11 @@
|
||||
"url": "^0.11.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.59",
|
||||
"@gitzone/tsrun": "^1.2.31",
|
||||
"@gitzone/tsbuild": "^2.1.61",
|
||||
"@gitzone/tsrun": "^1.2.32",
|
||||
"@gitzone/tstest": "^1.0.69",
|
||||
"@pushrocks/tapbundle": "^5.0.2",
|
||||
"@types/node": "^17.0.21",
|
||||
"@pushrocks/tapbundle": "^5.0.3",
|
||||
"@types/node": "^17.0.23",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
}
|
||||
@ -1882,9 +1882,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@gitzone/tsbuild": {
|
||||
"version": "2.1.59",
|
||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbuild/-/tsbuild-2.1.59.tgz",
|
||||
"integrity": "sha512-x0ava10YA7ue+P+5vJOy8zn6u9Kal/6uVGd83/j0fqJFxg5k5iPyotQaXAuHNKLZ+DDLK8ljl3yvUat0pjRobw==",
|
||||
"version": "2.1.61",
|
||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbuild/-/tsbuild-2.1.61.tgz",
|
||||
"integrity": "sha512-wKMl3OK6YcXcPutQqOtuZvt2GhxpO+DrvLJ/75zyfEF5JVzOtBdfdfd4Nv3prDKBpViXaqgQVVf1BARKQVA7wA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@ -1942,9 +1942,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@gitzone/tsrun": {
|
||||
"version": "1.2.31",
|
||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsrun/-/tsrun-1.2.31.tgz",
|
||||
"integrity": "sha512-28xyJ46KXYDXnZHp4QBKrsdOOvvqcK+5tp5rvRncpCmTcTi5k6ixC8kv4XfbH9jDtq+ubKDu+/Y2tF0tNjGTgA==",
|
||||
"version": "1.2.32",
|
||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsrun/-/tsrun-1.2.32.tgz",
|
||||
"integrity": "sha512-IngeVJRmE6Y5nFttyHNpbpvVZehD5MR/cOoG2VISbbIrsV3a+a8jtGjucFwutAzIPYnSHmYnQH/RxMbfuqOdvA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@ -4132,38 +4132,20 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@pushrocks/tapbundle": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-5.0.2.tgz",
|
||||
"integrity": "sha512-j3PPKGsQcUbIEtlaQcBJ3PkUIedttfwxPWUXlhRZMwRWp0L+6QyA9apJGPjw9I1zuz/50XxpLQZfk4BqDdQyVg==",
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-5.0.3.tgz",
|
||||
"integrity": "sha512-M6CnP9FPz9BLD7rkhKm4Ce4I8VHPQjGNLV3ZgeMH8Q2H/ytLjLp2PVh02i06fZRyD+SIV2Qykm622YNtJOiiWA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@open-wc/testing-helpers": "^2.1.2",
|
||||
"@pushrocks/smartdelay": "^2.0.13",
|
||||
"@pushrocks/smartenv": "^4.0.16",
|
||||
"@pushrocks/smartenv": "^5.0.0",
|
||||
"@pushrocks/smartexpect": "^1.0.13",
|
||||
"@pushrocks/smartpromise": "^3.1.7",
|
||||
"@pushrocks/smarttime": "^3.0.45"
|
||||
}
|
||||
},
|
||||
"node_modules/@pushrocks/tapbundle/node_modules/@pushrocks/smartenv": {
|
||||
"version": "4.0.16",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartenv/-/smartenv-4.0.16.tgz",
|
||||
"integrity": "sha512-NwYMONDc/NjY6BGvzZzLMteF83kPQTF9BCGfqWbktUUruEtdqL+nGw6ecoLFi2b5u7XPb8jK1TKIcSvpNJ7SyA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"@types/node": "^14.11.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@pushrocks/tapbundle/node_modules/@types/node": {
|
||||
"version": "14.18.12",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.18.12.tgz",
|
||||
"integrity": "sha512-q4jlIR71hUpWTnGhXWcakgkZeHa3CCjcQcnuzU8M891BAWA2jHiziiWEPEkdS5pFsz7H9HJiy8BrK7tBRNrY7A==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@pushrocks/webrequest": {
|
||||
"version": "2.0.15",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fwebrequest/-/webrequest-2.0.15.tgz",
|
||||
@ -4637,9 +4619,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "17.0.21",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-17.0.21.tgz",
|
||||
"integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==",
|
||||
"version": "17.0.23",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-17.0.23.tgz",
|
||||
"integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/parse-json": {
|
||||
@ -12445,9 +12427,9 @@
|
||||
}
|
||||
},
|
||||
"@gitzone/tsbuild": {
|
||||
"version": "2.1.59",
|
||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbuild/-/tsbuild-2.1.59.tgz",
|
||||
"integrity": "sha512-x0ava10YA7ue+P+5vJOy8zn6u9Kal/6uVGd83/j0fqJFxg5k5iPyotQaXAuHNKLZ+DDLK8ljl3yvUat0pjRobw==",
|
||||
"version": "2.1.61",
|
||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbuild/-/tsbuild-2.1.61.tgz",
|
||||
"integrity": "sha512-wKMl3OK6YcXcPutQqOtuZvt2GhxpO+DrvLJ/75zyfEF5JVzOtBdfdfd4Nv3prDKBpViXaqgQVVf1BARKQVA7wA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@pushrocks/early": "^3.0.6",
|
||||
@ -12497,9 +12479,9 @@
|
||||
}
|
||||
},
|
||||
"@gitzone/tsrun": {
|
||||
"version": "1.2.31",
|
||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsrun/-/tsrun-1.2.31.tgz",
|
||||
"integrity": "sha512-28xyJ46KXYDXnZHp4QBKrsdOOvvqcK+5tp5rvRncpCmTcTi5k6ixC8kv4XfbH9jDtq+ubKDu+/Y2tF0tNjGTgA==",
|
||||
"version": "1.2.32",
|
||||
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsrun/-/tsrun-1.2.32.tgz",
|
||||
"integrity": "sha512-IngeVJRmE6Y5nFttyHNpbpvVZehD5MR/cOoG2VISbbIrsV3a+a8jtGjucFwutAzIPYnSHmYnQH/RxMbfuqOdvA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@pushrocks/smartfile": "^9.0.6",
|
||||
@ -14119,35 +14101,17 @@
|
||||
}
|
||||
},
|
||||
"@pushrocks/tapbundle": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-5.0.2.tgz",
|
||||
"integrity": "sha512-j3PPKGsQcUbIEtlaQcBJ3PkUIedttfwxPWUXlhRZMwRWp0L+6QyA9apJGPjw9I1zuz/50XxpLQZfk4BqDdQyVg==",
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2ftapbundle/-/tapbundle-5.0.3.tgz",
|
||||
"integrity": "sha512-M6CnP9FPz9BLD7rkhKm4Ce4I8VHPQjGNLV3ZgeMH8Q2H/ytLjLp2PVh02i06fZRyD+SIV2Qykm622YNtJOiiWA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@open-wc/testing-helpers": "^2.1.2",
|
||||
"@pushrocks/smartdelay": "^2.0.13",
|
||||
"@pushrocks/smartenv": "^4.0.16",
|
||||
"@pushrocks/smartenv": "^5.0.0",
|
||||
"@pushrocks/smartexpect": "^1.0.13",
|
||||
"@pushrocks/smartpromise": "^3.1.7",
|
||||
"@pushrocks/smarttime": "^3.0.45"
|
||||
},
|
||||
"dependencies": {
|
||||
"@pushrocks/smartenv": {
|
||||
"version": "4.0.16",
|
||||
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartenv/-/smartenv-4.0.16.tgz",
|
||||
"integrity": "sha512-NwYMONDc/NjY6BGvzZzLMteF83kPQTF9BCGfqWbktUUruEtdqL+nGw6ecoLFi2b5u7XPb8jK1TKIcSvpNJ7SyA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@pushrocks/smartpromise": "^3.0.6",
|
||||
"@types/node": "^14.11.2"
|
||||
}
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "14.18.12",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-14.18.12.tgz",
|
||||
"integrity": "sha512-q4jlIR71hUpWTnGhXWcakgkZeHa3CCjcQcnuzU8M891BAWA2jHiziiWEPEkdS5pFsz7H9HJiy8BrK7tBRNrY7A==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"@pushrocks/webrequest": {
|
||||
@ -14532,9 +14496,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "17.0.21",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-17.0.21.tgz",
|
||||
"integrity": "sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ=="
|
||||
"version": "17.0.23",
|
||||
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-17.0.23.tgz",
|
||||
"integrity": "sha512-UxDxWn7dl97rKVeVS61vErvw086aCYhDLyvRQZ5Rk65rZKepaFdm53GeqXaKBuOhED4e9uWq34IC3TdSdJJ2Gw=="
|
||||
},
|
||||
"@types/parse-json": {
|
||||
"version": "4.0.0",
|
||||
|
10
package.json
10
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartstring",
|
||||
"version": "3.0.25",
|
||||
"version": "4.0.2",
|
||||
"private": false,
|
||||
"description": "handle strings in smart ways. TypeScript ready.",
|
||||
"main": "dist_ts/index.js",
|
||||
@ -25,11 +25,11 @@
|
||||
},
|
||||
"homepage": "https://gitlab.com/pushrocks/smartstring#readme",
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.59",
|
||||
"@gitzone/tsrun": "^1.2.31",
|
||||
"@gitzone/tsbuild": "^2.1.61",
|
||||
"@gitzone/tsrun": "^1.2.32",
|
||||
"@gitzone/tstest": "^1.0.69",
|
||||
"@pushrocks/tapbundle": "^5.0.2",
|
||||
"@types/node": "^17.0.21",
|
||||
"@pushrocks/tapbundle": "^5.0.3",
|
||||
"@types/node": "^17.0.23",
|
||||
"tslint": "^6.1.3",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
};
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user