Compare commits

..

8 Commits

Author SHA1 Message Date
4df1d41cc7 5.0.5 2022-11-08 11:19:20 +01:00
fb83e41eb3 fix(core): update 2022-11-08 11:19:20 +01:00
27b67b63cc 5.0.4 2022-10-26 10:56:02 +02:00
697afbaf98 fix(core): update 2022-10-26 10:56:01 +02:00
ab3ae7ec90 5.0.3 2022-10-26 10:52:15 +02:00
b2bb918ee4 fix(core): update 2022-10-26 10:52:14 +02:00
606ff73f58 5.0.2 2022-09-13 21:37:42 +02:00
7ea17c792d fix(core): update 2022-09-13 21:37:42 +02:00
8 changed files with 4407 additions and 10831 deletions

View File

@ -13,31 +13,24 @@ stages:
- metadata
before_script:
- npm install -g @shipzone/npmci
- pnpm install -g pnpm
- pnpm install -g @shipzone/npmci
- npmci npm prepare
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
# ====================
# security stage
# ====================
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
- npmci command npm config set registry https://registry.npmjs.org
- npmci command pnpm audit --audit-level=high --prod
tags:
- lossless
- docker
allow_failure: true
@ -45,11 +38,10 @@ auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=dev
- npmci command pnpm audit --audit-level=high --dev
tags:
- lossless
- docker
allow_failure: true
@ -60,7 +52,6 @@ auditDevDependencies:
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
@ -71,7 +62,6 @@ testStable:
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
@ -122,8 +112,7 @@ trigger:
pages:
stage: metadata
script:
- npmci node install stable
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run buildDocs
tags:

10801
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartjson",
"version": "5.0.1",
"version": "5.0.5",
"private": false,
"description": "typed json handlers",
"main": "dist_ts/index.js",
@ -21,15 +21,15 @@
},
"homepage": "https://gitlab.com/pushrocks/smartjson#README",
"devDependencies": {
"@gitzone/tsbuild": "^2.1.63",
"@gitzone/tsbuild": "^2.1.65",
"@gitzone/tsrun": "^1.2.37",
"@gitzone/tstest": "^1.0.71",
"@pushrocks/tapbundle": "^5.0.3",
"@types/node": "^18.0.0"
"@gitzone/tstest": "^1.0.74",
"@pushrocks/tapbundle": "^5.0.4",
"@types/node": "^18.11.9"
},
"dependencies": {
"@pushrocks/smartstring": "^4.0.5",
"@types/buffer-json": "^2.0.1",
"@types/fast-json-stable-stringify": "^2.1.0",
"@types/lodash.clonedeep": "^4.5.7",
"buffer-json": "^2.0.0",
"fast-json-stable-stringify": "^2.1.0",

4352
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -40,4 +40,23 @@ tap.test('should products stable jsons', async () => {
console.log(jsonString);
});
tap.test('should work with base64', async () => {
const someObject = {
hi: 'there',
thisIs: 'awesome',
};
const base64Json = smartjson.stringifyBase64(someObject);
console.log(base64Json);
const decodedObject = smartjson.parseBase64(base64Json);
expect(decodedObject).toEqual(someObject);
});
tap.test('stringify should handle plain string', async () => {
const stringifiedString = smartjson.stringify('hello');
console.log(stringifiedString);
expect(stringifiedString).toEqual('"hello"');
expect(smartjson.parse(stringifiedString)).toEqual('hello');
});
tap.start();

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartjson',
version: '5.0.1',
version: '5.0.5',
description: 'typed json handlers'
}

View File

@ -21,6 +21,18 @@ export const stringify = (
return returnJson;
};
export const stringifyBase64 = (...args: Parameters<typeof stringify>): string => {
const stringifiedResult = stringify(...args);
return plugins.smartstring.base64.encodeUri(stringifiedResult);
};
export const parseBase64 = (base64JsonStringArg: string) => {
const simpleStringified = plugins.smartstring.base64.decode(base64JsonStringArg);
return parse(simpleStringified);
};
parse;
export class Smartjson {
/**
* enfolds data from an object

View File

@ -1,3 +1,8 @@
// @pushrocks scope
import * as smartstring from '@pushrocks/smartstring';
export { smartstring };
// third party scope
import lodashCloneDeep from 'lodash.clonedeep';
import stableJson2 from 'fast-json-stable-stringify';