fix(core): update
This commit is contained in:
parent
36bcb9265a
commit
5e961f7a5b
@ -18,17 +18,6 @@ before_script:
|
|||||||
# ====================
|
# ====================
|
||||||
# security stage
|
# security stage
|
||||||
# ====================
|
# ====================
|
||||||
mirror:
|
|
||||||
stage: security
|
|
||||||
script:
|
|
||||||
- npmci git mirror
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
tags:
|
|
||||||
- lossless
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
|
|
||||||
auditProductionDependencies:
|
auditProductionDependencies:
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
@ -122,11 +111,10 @@ trigger:
|
|||||||
pages:
|
pages:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci node install lts
|
- npmci node install stable
|
||||||
- npmci command npm install -g @gitzone/tsdoc
|
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command tsdoc
|
- npmci command npm run buildDocs
|
||||||
tags:
|
tags:
|
||||||
- lossless
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
|
@ -8,7 +8,8 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "(tstest test/)",
|
||||||
"build": "(tsbuild --web --allowimplicitany)"
|
"build": "(tsbuild --web --allowimplicitany)",
|
||||||
|
"buildDocs": "tsdoc"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -3,14 +3,21 @@ import { tap, expect } from '@pushrocks/tapbundle';
|
|||||||
|
|
||||||
// Base64
|
// Base64
|
||||||
let testBase64: smartstring.Base64;
|
let testBase64: smartstring.Base64;
|
||||||
|
|
||||||
tap.test('expect create a valid instance of Base64', async () => {
|
tap.test('expect create a valid instance of Base64', async () => {
|
||||||
testBase64 = new smartstring.Base64('somestring', 'string');
|
testBase64 = new smartstring.Base64('somestring', 'string');
|
||||||
expect(testBase64).toBeInstanceOf(smartstring.Base64);
|
expect(testBase64).toBeInstanceOf(smartstring.Base64);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.test('expect read output a file as base64 and base64uri', async () => {
|
tap.test('expect read output a file as base64 and base64uri', async () => {
|
||||||
expect(testBase64.base64String).not.toEqual(testBase64.base64UriString);
|
expect(testBase64.base64String).not.toEqual(testBase64.base64UriString);
|
||||||
let testBase64_2 = new smartstring.Base64(testBase64.base64UriString, 'base64uri');
|
let testBase64_2 = new smartstring.Base64(testBase64.base64UriString, 'base64uri');
|
||||||
expect(testBase64_2.simpleString).toEqual(testBase64.simpleString);
|
expect(testBase64_2.simpleString).toEqual(testBase64.simpleString);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
tap.test('should test for a valid base64 token', async () => {
|
||||||
|
const result = smartstring.base64.isBase64('dGVzdA==');
|
||||||
|
expect(result).toBeTrue();
|
||||||
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@pushrocks/smartstring',
|
name: '@pushrocks/smartstring',
|
||||||
version: '4.0.4',
|
version: '4.0.5',
|
||||||
description: 'handle strings in smart ways. TypeScript ready.'
|
description: 'handle strings in smart ways. TypeScript ready.'
|
||||||
}
|
}
|
||||||
|
@ -66,4 +66,14 @@ export let base64 = {
|
|||||||
decode: (stringArg: string) => {
|
decode: (stringArg: string) => {
|
||||||
return plugins.jsBase64.decode(stringArg);
|
return plugins.jsBase64.decode(stringArg);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param stringArg
|
||||||
|
* checks wether the string is base64 encoded
|
||||||
|
*/
|
||||||
|
isBase64: (stringArg: string) => {
|
||||||
|
const regex = /^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$/;
|
||||||
|
return regex.test(stringArg);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user