Compare commits

..

8 Commits

Author SHA1 Message Date
d70310ce8b 3.0.5 2019-07-04 17:04:24 +02:00
e0e9ceed31 fix(core): update 2019-07-04 17:04:24 +02:00
e3add99efe 3.0.4 2019-07-04 17:03:15 +02:00
91d57c84f4 fix(core): update 2019-07-04 17:03:15 +02:00
37b32d5d5d 3.0.3 2019-05-05 19:10:07 +02:00
f6199740aa fix(core): update 2019-05-05 19:10:07 +02:00
215cf77205 3.0.2 2019-05-05 19:01:19 +02:00
6e2c86dbb4 fix(core): update 2019-05-05 19:01:19 +02:00
8 changed files with 570 additions and 226 deletions

20
.gitignore vendored
View File

@ -1,4 +1,22 @@
node_modules/ .nogit/
# artifacts
coverage/ coverage/
public/ public/
pages/ pages/
# installs
node_modules/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_web/
dist_serve/
dist_ts_web/
# custom

View File

@ -1,5 +1,5 @@
# gitzone standard # gitzone ci_default
image: hosttoday/ht-docker-node:npmci image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache: cache:
paths: paths:
@ -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
# ==================== # ====================
@ -75,22 +50,10 @@ testLTS:
- docker - docker
- notpriv - notpriv
testSTABLE:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
release: release:
stage: release stage: release
script: script:
- npmci node install stable - npmci node install lts
- npmci npm publish - npmci npm publish
only: only:
- tags - tags
@ -103,19 +66,11 @@ release:
# ==================== # ====================
codequality: codequality:
stage: metadata stage: metadata
image: docker:stable
allow_failure: true allow_failure: true
services:
- docker:stable-dind
script: script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/') - npmci command npm install -g tslint typescript
- docker run - npmci npm install
--env SOURCE_CODE="$PWD" - npmci command "tslint -c tslint.json ./ts/**/*.ts"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [codeclimate.json]
tags: tags:
- docker - docker
- priv - priv
@ -134,10 +89,10 @@ pages:
image: hosttoday/ht-docker-node:npmci image: hosttoday/ht-docker-node:npmci
stage: metadata stage: metadata
script: script:
- npmci command npm install -g typedoc typescript - npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare - npmci npm prepare
- npmci npm install - npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/ - npmci command tsdoc
tags: tags:
- docker - docker
- notpriv - notpriv

View File

@ -14,7 +14,7 @@ typed json handlers
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartjson/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartjson) [![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartjson/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartjson)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) [![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
## Usage ## Usage
@ -28,8 +28,7 @@ SmartJson makes it easy to fold and enfold classes into and from JSON
import { Smartjson, foldDec } from 'smartjson'; import { Smartjson, foldDec } from 'smartjson';
class AwesomeClass extends Smartjson { class AwesomeClass extends Smartjson {
static stringify static stringify;
computedValue: string; computedValue: string;

662
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartjson", "name": "@pushrocks/smartjson",
"version": "3.0.1", "version": "3.0.5",
"private": false, "private": false,
"description": "typed json handlers", "description": "typed json handlers",
"main": "dist/index.js", "main": "dist/index.js",
@ -20,15 +20,27 @@
}, },
"homepage": "https://gitlab.com/pushrocks/smartjson#README", "homepage": "https://gitlab.com/pushrocks/smartjson#README",
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.8", "@gitzone/tsbuild": "^2.1.11",
"@gitzone/tsrun": "^1.1.17", "@gitzone/tsrun": "^1.2.6",
"@gitzone/tstest": "^1.0.18", "@gitzone/tstest": "^1.0.24",
"@pushrocks/tapbundle": "^3.0.7", "@pushrocks/tapbundle": "^3.0.11",
"@types/node": "^11.9.4" "@types/node": "^12.0.12",
"tslint": "^5.18.0",
"tslint-config-prettier": "^1.18.0"
}, },
"dependencies": { "dependencies": {
"@types/fast-json-stable-stringify": "^2.0.0", "@types/fast-json-stable-stringify": "^2.0.0",
"fast-json-stable-stringify": "^2.0.0", "fast-json-stable-stringify": "^2.0.0",
"lodash": "^4.17.11" "lodash.clonedeep": "^4.5.0"
} },
"files": [
"ts/*",
"ts_web/*",
"dist/*",
"dist_web/*",
"assets/*",
"cli.js",
"npmextra.json",
"readme.md"
]
} }

View File

@ -6,7 +6,9 @@ export class Smartjson {
// ====== // ======
static parse = JSON.parse; static parse = JSON.parse;
static stringify = plugins.stableJson; static stringify = (objArg: any, optionsArg: plugins.stableJson.Options) => {
return plugins.stableJson(objArg, optionsArg);
};
// ======== // ========
// INSTANCE // INSTANCE
@ -18,9 +20,9 @@ export class Smartjson {
* folds a class into an object * folds a class into an object
*/ */
foldToObject() { foldToObject() {
let newFoldedObject: {[key: string]: any} = {}; let newFoldedObject: { [key: string]: any } = {};
for (let keyName of this.saveableProperties) { for (let keyName of this.saveableProperties) {
newFoldedObject[keyName] = plugins.lodash.cloneDeep(this[keyName]); newFoldedObject[keyName] = plugins.lodashCloneDeep(this[keyName]);
} }
return newFoldedObject; return newFoldedObject;
} }

View File

@ -1,7 +1,4 @@
import * as lodash from 'lodash'; import lodashCloneDeep from 'lodash.clonedeep';
import * as stableJson from 'fast-json-stable-stringify'; import stableJson from 'fast-json-stable-stringify';
export { export { lodashCloneDeep, stableJson };
lodash,
stableJson
}

View File

@ -1,7 +1,8 @@
{ {
"compilerOptions": { "compilerOptions": {
"experimentalDecorators": true, "experimentalDecorators": true,
"target": "es2016", "esModuleInterop": true,
"target": "es2017",
"module": "commonjs" "module": "commonjs"
} }
} }