fix(core): update

This commit is contained in:
Philipp Kunz 2019-01-12 20:12:58 +01:00
parent ceb6962a1c
commit fb4a03ad37
5 changed files with 742 additions and 179 deletions

View File

@ -34,6 +34,31 @@ snyk:
- docker
- 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
# ====================

845
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -24,15 +24,15 @@
},
"homepage": "https://gitlab.com/pushrocks/smartstring#readme",
"devDependencies": {
"@gitzone/tsbuild": "^2.0.22",
"@gitzone/tsrun": "^1.1.13",
"@gitzone/tstest": "^1.0.15",
"@gitzone/tsbuild": "^2.1.4",
"@gitzone/tsrun": "^1.1.17",
"@gitzone/tstest": "^1.0.18",
"@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^10.12.10"
"@types/node": "^10.12.18"
},
"dependencies": {
"crypto-random-string": "^1.0.0",
"js-base64": "^2.4.9",
"js-base64": "^2.5.0",
"normalize-newline": "^3.0.0",
"randomatic": "^3.1.1",
"strip-indent": "^2.0.0"

19
test/test.normalize.ts Normal file
View File

@ -0,0 +1,19 @@
import { tap, expect } from '@pushrocks/tapbundle';
import * as smartstring from '../ts/index';
tap.test('should normalize a string', async () => {
const testString = `
myawesome string;
is indented with two spaces
`
const normalizedString = smartstring.normalize.standard(testString);
expect(normalizedString).to.equal(
`
myawesome string;
is indented with two spaces
`
)
})
tap.start()

View File

@ -1,13 +1,29 @@
import * as plugins from './smartstring.plugins';
/**
* creates a random string
*
* ```ts
* createRandomString('AAAA')
* //=> 'AGHR'
* ```
*
* @param patternArg the pattern argument to use, Aa0!* are viable pattern descritors
* @param lengthArg the length of the random string
* @param optionsArg options
*/
export const createRandomString = (
patternArg: string,
lengthArg: number,
optionsArg: any
lengthArg?: number,
optionsArg?: any
): string => {
return plugins.randomatic(patternArg, lengthArg, optionsArg);
};
export const createCryptoRandomString = (lengthArg): string => {
/**
* creates a crytic string in the speicifed length
* @param lengthArg the length of the crypto string
*/
export const createCryptoRandomString = (lengthArg: number): string => {
return plugins.cryptoRandomString(lengthArg);
};