fix(core): update
This commit is contained in:
parent
c92ece79ff
commit
95d5c6ceee
@ -34,31 +34,6 @@ snyk:
|
|||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
sast:
|
|
||||||
stage: security
|
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-dbase:npmci
|
|
||||||
variables:
|
|
||||||
DOCKER_DRIVER: overlay2
|
|
||||||
allow_failure: true
|
|
||||||
services:
|
|
||||||
- docker:stable-dind
|
|
||||||
script:
|
|
||||||
- npmci npm prepare
|
|
||||||
- npmci npm install
|
|
||||||
- npmci command npm run build
|
|
||||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
|
||||||
- docker run
|
|
||||||
--env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}"
|
|
||||||
--volume "$PWD:/code"
|
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
"registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
|
|
||||||
artifacts:
|
|
||||||
reports:
|
|
||||||
sast: gl-sast-report.json
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- priv
|
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
# ====================
|
# ====================
|
||||||
|
36
README.md
36
README.md
@ -1,25 +1,20 @@
|
|||||||
# smartstring
|
# @pushrocks/smartstring
|
||||||
|
|
||||||
handle strings in smart ways. TypeScript ready.
|
handle strings in smart ways. TypeScript ready.
|
||||||
|
|
||||||
## Availabililty
|
## Availabililty and Links
|
||||||
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartstring)
|
||||||
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartstring)
|
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartstring)
|
||||||
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartstring)
|
* [github.com (source mirror)](https://github.com/pushrocks/smartstring)
|
||||||
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartstring)
|
* [docs (typedoc)](https://pushrocks.gitlab.io/smartstring/)
|
||||||
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartstring/)
|
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
|
[![build status](https://gitlab.com/pushrocks/smartstring/badges/master/build.svg)](https://gitlab.com/pushrocks/smartstring/commits/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)
|
||||||
[![coverage report](https://GitLab.com/pushrocks/smartstring/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartstring/commits/master)
|
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartstring.svg)](https://www.npmjs.com/package/@pushrocks/smartstring)
|
||||||
[![npm downloads per month](https://img.shields.io/npm/dm/smartstring.svg)](https://www.npmjs.com/package/smartstring)
|
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartstring/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartstring)
|
||||||
[![Dependency Status](https://david-dm.org/pushrocks/smartstring.svg)](https://david-dm.org/pushrocks/smartstring)
|
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartstring/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartstring/master/dependencies/npm)
|
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartstring/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartstring)
|
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
|
||||||
[![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
|
## Usage
|
||||||
|
|
||||||
@ -63,8 +58,9 @@ smartstring.indent.indent('somestringanotherstring', '>>>> '); // indents a stri
|
|||||||
smartstring.indent.normalize(' somestring anotherstring', '>>>> '); // looks for the least amount of indention and removes superflouous space
|
smartstring.indent.normalize(' somestring anotherstring', '>>>> '); // looks for the least amount of indention and removes superflouous space
|
||||||
```
|
```
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
|
||||||
|
|
||||||
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)
|
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com)
|
||||||
|
@ -7,5 +7,15 @@
|
|||||||
"baseImage": "hosttoday/ht-docker-node:npmci",
|
"baseImage": "hosttoday/ht-docker-node:npmci",
|
||||||
"command": "npmci node install stable && npmci npm install && npmci npm test",
|
"command": "npmci node install stable && npmci npm install && npmci npm test",
|
||||||
"dockerSock": false
|
"dockerSock": false
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"module": {
|
||||||
|
"githost": "gitlab.com",
|
||||||
|
"gitscope": "pushrocks",
|
||||||
|
"gitrepo": "smartstring",
|
||||||
|
"shortDescription": "handle strings in smart ways. TypeScript ready.",
|
||||||
|
"npmPackagename": "@pushrocks/smartstring",
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -39,4 +39,4 @@
|
|||||||
"randomatic": "^3.1.1",
|
"randomatic": "^3.1.1",
|
||||||
"strip-indent": "^2.0.0"
|
"strip-indent": "^2.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,14 +6,14 @@ tap.test('should normalize a string', async () => {
|
|||||||
const testString = `
|
const testString = `
|
||||||
myawesome string;
|
myawesome string;
|
||||||
is indented with two spaces
|
is indented with two spaces
|
||||||
`
|
`;
|
||||||
const normalizedString = smartstring.normalize.standard(testString);
|
const normalizedString = smartstring.normalize.standard(testString);
|
||||||
expect(normalizedString).to.equal(
|
expect(normalizedString).to.equal(
|
||||||
`
|
`
|
||||||
myawesome string;
|
myawesome string;
|
||||||
is indented with two spaces
|
is indented with two spaces
|
||||||
`
|
`
|
||||||
)
|
);
|
||||||
})
|
});
|
||||||
|
|
||||||
tap.start()
|
tap.start();
|
||||||
|
@ -2,12 +2,12 @@ import * as plugins from './smartstring.plugins';
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* creates a random string
|
* creates a random string
|
||||||
*
|
*
|
||||||
* ```ts
|
* ```ts
|
||||||
* createRandomString('AAAA')
|
* createRandomString('AAAA')
|
||||||
* //=> 'AGHR'
|
* //=> 'AGHR'
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @param patternArg the pattern argument to use, Aa0!* are viable pattern descritors
|
* @param patternArg the pattern argument to use, Aa0!* are viable pattern descritors
|
||||||
* @param lengthArg the length of the random string
|
* @param lengthArg the length of the random string
|
||||||
* @param optionsArg options
|
* @param optionsArg options
|
||||||
|
@ -46,7 +46,7 @@ export class Domain {
|
|||||||
// helper functions
|
// helper functions
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
private _domainRegex (stringArg: string) {
|
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);
|
const regexMatches = regexString.exec(stringArg);
|
||||||
regexMatches.reverse(); //make sure we build the domain from toplevel to subdomain (reversed order)
|
regexMatches.reverse(); //make sure we build the domain from toplevel to subdomain (reversed order)
|
||||||
@ -57,7 +57,7 @@ export class Domain {
|
|||||||
return regexMatchesFiltered;
|
return regexMatchesFiltered;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _protocolRegex (stringArg: string) {
|
private _protocolRegex(stringArg: string) {
|
||||||
const regexString = /^([a-zA-Z0-9]*):\/\//;
|
const regexString = /^([a-zA-Z0-9]*):\/\//;
|
||||||
const regexMatches = regexString.exec(stringArg);
|
const regexMatches = regexString.exec(stringArg);
|
||||||
if (regexMatches) {
|
if (regexMatches) {
|
||||||
@ -67,7 +67,7 @@ export class Domain {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _portRegex (stringArg: string) {
|
private _portRegex(stringArg: string) {
|
||||||
const regexString = /^([a-zA-Z0-9]*):\/\//;
|
const regexString = /^([a-zA-Z0-9]*):\/\//;
|
||||||
const regexMatches = regexString.exec(stringArg);
|
const regexMatches = regexString.exec(stringArg);
|
||||||
if (regexMatches) {
|
if (regexMatches) {
|
||||||
@ -76,5 +76,4 @@ export class Domain {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,7 @@
|
|||||||
import * as crypto from 'crypto';
|
import * as crypto from 'crypto';
|
||||||
import * as url from 'url';
|
import * as url from 'url';
|
||||||
|
|
||||||
export {
|
export { crypto, url };
|
||||||
crypto,
|
|
||||||
url
|
|
||||||
};
|
|
||||||
|
|
||||||
// third party
|
// third party
|
||||||
export let jsBase64 = require('js-base64').Base64;
|
export let jsBase64 = require('js-base64').Base64;
|
||||||
@ -14,4 +11,3 @@ export let stripIndent = require('strip-indent');
|
|||||||
export let normalizeNewline = require('normalize-newline');
|
export let normalizeNewline = require('normalize-newline');
|
||||||
export let randomatic = require('randomatic');
|
export let randomatic = require('randomatic');
|
||||||
export let cryptoRandomString = require('crypto-random-string');
|
export let cryptoRandomString = require('crypto-random-string');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user