fix(core): update
This commit is contained in:
parent
ceb6962a1c
commit
fb4a03ad37
@ -34,6 +34,31 @@ 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
|
||||||
# ====================
|
# ====================
|
||||||
|
845
package-lock.json
generated
845
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@ -24,15 +24,15 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/smartstring#readme",
|
"homepage": "https://gitlab.com/pushrocks/smartstring#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.0.22",
|
"@gitzone/tsbuild": "^2.1.4",
|
||||||
"@gitzone/tsrun": "^1.1.13",
|
"@gitzone/tsrun": "^1.1.17",
|
||||||
"@gitzone/tstest": "^1.0.15",
|
"@gitzone/tstest": "^1.0.18",
|
||||||
"@pushrocks/tapbundle": "^3.0.7",
|
"@pushrocks/tapbundle": "^3.0.7",
|
||||||
"@types/node": "^10.12.10"
|
"@types/node": "^10.12.18"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"crypto-random-string": "^1.0.0",
|
"crypto-random-string": "^1.0.0",
|
||||||
"js-base64": "^2.4.9",
|
"js-base64": "^2.5.0",
|
||||||
"normalize-newline": "^3.0.0",
|
"normalize-newline": "^3.0.0",
|
||||||
"randomatic": "^3.1.1",
|
"randomatic": "^3.1.1",
|
||||||
"strip-indent": "^2.0.0"
|
"strip-indent": "^2.0.0"
|
||||||
|
19
test/test.normalize.ts
Normal file
19
test/test.normalize.ts
Normal 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()
|
@ -1,13 +1,29 @@
|
|||||||
import * as plugins from './smartstring.plugins';
|
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 = (
|
export const createRandomString = (
|
||||||
patternArg: string,
|
patternArg: string,
|
||||||
lengthArg: number,
|
lengthArg?: number,
|
||||||
optionsArg: any
|
optionsArg?: any
|
||||||
): string => {
|
): string => {
|
||||||
return plugins.randomatic(patternArg, lengthArg, optionsArg);
|
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);
|
return plugins.cryptoRandomString(lengthArg);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user