diff --git a/packages/test-serializer/spec/test-serializer.spec.ts b/packages/test-serializer/spec/test-serializer.spec.ts index 3319dc6e..3cc0d248 100644 --- a/packages/test-serializer/spec/test-serializer.spec.ts +++ b/packages/test-serializer/spec/test-serializer.spec.ts @@ -30,4 +30,11 @@ describe('Test Serializer', () => { expect(buffersContentsAreEqual).toBe(true); }); + + it('check json serializer', () => { + const config1Ts: UserConfiguration = new UserConfiguration().fromJsonObject(userConfig); + const jsonObject = config1Ts.toJsonObject(); + + expect(jsonObject).toEqual(userConfig); + }); }); diff --git a/packages/uhk-common/.gitignore b/packages/uhk-common/.gitignore new file mode 100644 index 00000000..c1cb757a --- /dev/null +++ b/packages/uhk-common/.gitignore @@ -0,0 +1,2 @@ +.nyc_output/ +coverage/ diff --git a/packages/uhk-common/index.ts b/packages/uhk-common/index.ts index b5850584..8420b109 100644 --- a/packages/uhk-common/index.ts +++ b/packages/uhk-common/index.ts @@ -1,4 +1 @@ -export * from './src/util'; -export * from './src/models'; -export * from './src/services'; -export * from './src/config-serializer'; +export * from './src'; diff --git a/packages/uhk-common/jasmine.json b/packages/uhk-common/jasmine.json new file mode 100644 index 00000000..5b0fa16c --- /dev/null +++ b/packages/uhk-common/jasmine.json @@ -0,0 +1,8 @@ +{ + "spec_dir": "src", + "spec_files": [ + "**/*.ts" + ], + "stopSpecOnExpectationFailure": true, + "random": false +} diff --git a/packages/uhk-common/package-lock.json b/packages/uhk-common/package-lock.json index 3ada805b..b88323d6 100644 --- a/packages/uhk-common/package-lock.json +++ b/packages/uhk-common/package-lock.json @@ -20,15 +20,2323 @@ "resolved": "https://registry.npmjs.org/@ngrx/store/-/store-2.2.3.tgz", "integrity": "sha1-570RSfHEQgjxzEdENT8PmKDx9Xs=" }, + "@types/jasmine": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-2.6.0.tgz", + "integrity": "sha512-1ZZdFvYA5zARDXPj5+VF0bwDZWH/o0QQWJVDc5srdC/DngcCZXskR33eR/4PielGvBjLQpQOd6KiQbmtqVkeZA==" + }, "@types/node": { - "version": "8.0.28", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.28.tgz", - "integrity": "sha512-HupkFXEv3O3KSzcr3Ylfajg0kaerBg1DyaZzRBBQfrU3NN1mTBRE7sCveqHwXLS5Yrjvww8qFzkzYQQakG9FuQ==" + "version": "8.0.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.30.tgz", + "integrity": "sha512-IaQtG3DWe9gRsmk1DqNnYyRVjGDVcBdZywkRVF2f62Boe8XKmlR7lNcwC6pk4V4W8nk+Zu+vdGMsOdRTDj1JPA==" + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "requires": { + "color-convert": "1.9.0" + } + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" + }, + "chalk": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", + "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.4.0" + } + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + }, + "dependencies": { + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "coffee-script": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.7.1.tgz", + "integrity": "sha1-YplqhheAx15tUGnROCJyO3NAS/w=", + "requires": { + "mkdirp": "0.3.5" + } + }, + "color-convert": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz", + "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "requires": { + "lru-cache": "4.1.1", + "shebang-command": "1.2.0", + "which": "1.3.0" + }, + "dependencies": { + "lru-cache": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + } + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "diff": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", + "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==" + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "requires": { + "is-arrayish": "0.2.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "requires": { + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=" + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "requires": { + "locate-path": "2.0.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "gaze": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.2.tgz", + "integrity": "sha1-QLcJU30k0dRXZ9takIaJ3+aaxE8=", + "requires": { + "globule": "0.1.0" + } + }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=" + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "globule": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz", + "integrity": "sha1-2cjt3h2nnRJaFRt5UzuXhnY0auU=", + "requires": { + "glob": "3.1.21", + "lodash": "1.0.2", + "minimatch": "0.2.14" + }, + "dependencies": { + "glob": { + "version": "3.1.21", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", + "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", + "requires": { + "graceful-fs": "1.2.3", + "inherits": "1.0.2", + "minimatch": "0.2.14" + } + }, + "inherits": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", + "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=" + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + } + } + }, + "graceful-fs": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", + "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=" + }, + "growl": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.7.0.tgz", + "integrity": "sha1-3i1mE20ALhErpw8/EMMc98NQsto=" + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" + }, + "homedir-polyfill": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", + "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "requires": { + "parse-passwd": "1.0.0" + } + }, + "hosted-git-info": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", + "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "jasmine": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.8.0.tgz", + "integrity": "sha1-awicChFXax8W3xG4AUbZHU6Lij4=", + "requires": { + "exit": "0.1.2", + "glob": "7.1.2", + "jasmine-core": "2.8.0" + } + }, + "jasmine-core": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.8.0.tgz", + "integrity": "sha1-vMl5rh+f0FcB5F5S5l06XWPxok4=" + }, + "jasmine-growl-reporter": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/jasmine-growl-reporter/-/jasmine-growl-reporter-0.2.1.tgz", + "integrity": "sha1-1fCje5L2qD/VxkgrgJSVyQqLVf4=", + "requires": { + "growl": "1.7.0" + } + }, + "jasmine-node": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jasmine-node/-/jasmine-node-2.0.0.tgz", + "integrity": "sha1-gXUacjJfVJdJCxQYGlUIfxsDcf8=", + "requires": { + "coffee-script": "1.7.1", + "gaze": "0.5.2", + "jasmine-growl-reporter": "0.2.1", + "minimist": "0.0.8", + "mkdirp": "0.3.5", + "underscore": "1.6.0", + "walkdir": "0.0.12" + } + }, + "jasmine-ts": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/jasmine-ts/-/jasmine-ts-0.2.1.tgz", + "integrity": "sha512-Ljieg2aAfd8JHSmSQgQpGNTCWzD05LdbX21dkmRKuk9xqEz9ip17+033UiWKOUeIy2t+adiOfo0vZzEV61z96A==", + "requires": { + "jasmine": "2.8.0", + "ts-node": "3.3.0", + "typescript": "2.5.3", + "yargs": "8.0.2" + } + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "1.0.0" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + } + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + } + }, + "lodash": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.2.tgz", + "integrity": "sha1-j1dWDIO1n8JwvT1WG2kAQ0MOJVE=" + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=" + }, + "make-error": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.0.tgz", + "integrity": "sha1-Uq06M5zPEM5itAQLcI/nByRLi5Y=" + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "requires": { + "mimic-fn": "1.1.0" + } + }, + "mimic-fn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", + "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "1.1.8" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mkdirp": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz", + "integrity": "sha1-3j5fiWHIjHh+4TaN+EmsRBPsqNc=" + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "requires": { + "hosted-git-info": "2.5.0", + "is-builtin-module": "1.0.0", + "semver": "5.4.1", + "validate-npm-package-license": "3.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "requires": { + "path-key": "2.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "nyc": { + "version": "11.2.1", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-11.2.1.tgz", + "integrity": "sha1-rYUK/p261/SXByi0suR/7Rw4chw=", + "requires": { + "archy": "1.0.0", + "arrify": "1.0.1", + "caching-transform": "1.0.1", + "convert-source-map": "1.5.0", + "debug-log": "1.0.1", + "default-require-extensions": "1.0.0", + "find-cache-dir": "0.1.1", + "find-up": "2.1.0", + "foreground-child": "1.5.6", + "glob": "7.1.2", + "istanbul-lib-coverage": "1.1.1", + "istanbul-lib-hook": "1.0.7", + "istanbul-lib-instrument": "1.8.0", + "istanbul-lib-report": "1.1.1", + "istanbul-lib-source-maps": "1.2.1", + "istanbul-reports": "1.1.2", + "md5-hex": "1.3.0", + "merge-source-map": "1.0.4", + "micromatch": "2.3.11", + "mkdirp": "0.5.1", + "resolve-from": "2.0.0", + "rimraf": "2.6.1", + "signal-exit": "3.0.2", + "spawn-wrap": "1.3.8", + "test-exclude": "4.1.1", + "yargs": "8.0.2", + "yargs-parser": "5.0.0" + }, + "dependencies": { + "align-text": { + "version": "0.1.4", + "bundled": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, + "amdefine": { + "version": "1.0.1", + "bundled": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "ansi-styles": { + "version": "2.2.1", + "bundled": true + }, + "append-transform": { + "version": "0.4.0", + "bundled": true, + "requires": { + "default-require-extensions": "1.0.0" + } + }, + "archy": { + "version": "1.0.0", + "bundled": true + }, + "arr-diff": { + "version": "2.0.0", + "bundled": true, + "requires": { + "arr-flatten": "1.1.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "bundled": true + }, + "array-unique": { + "version": "0.2.1", + "bundled": true + }, + "arrify": { + "version": "1.0.1", + "bundled": true + }, + "async": { + "version": "1.5.2", + "bundled": true + }, + "babel-code-frame": { + "version": "6.26.0", + "bundled": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, + "babel-generator": { + "version": "6.26.0", + "bundled": true, + "requires": { + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "detect-indent": "4.0.0", + "jsesc": "1.3.0", + "lodash": "4.17.4", + "source-map": "0.5.7", + "trim-right": "1.0.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "bundled": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-runtime": { + "version": "6.26.0", + "bundled": true, + "requires": { + "core-js": "2.5.1", + "regenerator-runtime": "0.11.0" + } + }, + "babel-template": { + "version": "6.26.0", + "bundled": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "lodash": "4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "bundled": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "debug": "2.6.8", + "globals": "9.18.0", + "invariant": "2.2.2", + "lodash": "4.17.4" + } + }, + "babel-types": { + "version": "6.26.0", + "bundled": true, + "requires": { + "babel-runtime": "6.26.0", + "esutils": "2.0.2", + "lodash": "4.17.4", + "to-fast-properties": "1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "bundled": true + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "brace-expansion": { + "version": "1.1.8", + "bundled": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "bundled": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "builtin-modules": { + "version": "1.1.1", + "bundled": true + }, + "caching-transform": { + "version": "1.0.1", + "bundled": true, + "requires": { + "md5-hex": "1.3.0", + "mkdirp": "0.5.1", + "write-file-atomic": "1.3.4" + } + }, + "camelcase": { + "version": "1.2.1", + "bundled": true, + "optional": true + }, + "center-align": { + "version": "0.1.3", + "bundled": true, + "optional": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chalk": { + "version": "1.1.3", + "bundled": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "cliui": { + "version": "2.1.0", + "bundled": true, + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "bundled": true, + "optional": true + } + } + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "commondir": { + "version": "1.0.1", + "bundled": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "convert-source-map": { + "version": "1.5.0", + "bundled": true + }, + "core-js": { + "version": "2.5.1", + "bundled": true + }, + "cross-spawn": { + "version": "4.0.2", + "bundled": true, + "requires": { + "lru-cache": "4.1.1", + "which": "1.3.0" + } + }, + "debug": { + "version": "2.6.8", + "bundled": true, + "requires": { + "ms": "2.0.0" + } + }, + "debug-log": { + "version": "1.0.1", + "bundled": true + }, + "decamelize": { + "version": "1.2.0", + "bundled": true + }, + "default-require-extensions": { + "version": "1.0.0", + "bundled": true, + "requires": { + "strip-bom": "2.0.0" + } + }, + "detect-indent": { + "version": "4.0.0", + "bundled": true, + "requires": { + "repeating": "2.0.1" + } + }, + "error-ex": { + "version": "1.3.1", + "bundled": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "bundled": true + }, + "esutils": { + "version": "2.0.2", + "bundled": true + }, + "execa": { + "version": "0.7.0", + "bundled": true, + "requires": { + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "bundled": true, + "requires": { + "lru-cache": "4.1.1", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + } + } + }, + "expand-brackets": { + "version": "0.1.5", + "bundled": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "expand-range": { + "version": "1.8.2", + "bundled": true, + "requires": { + "fill-range": "2.2.3" + } + }, + "extglob": { + "version": "0.3.2", + "bundled": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "filename-regex": { + "version": "2.0.1", + "bundled": true + }, + "fill-range": { + "version": "2.2.3", + "bundled": true, + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.7", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } + }, + "find-cache-dir": { + "version": "0.1.1", + "bundled": true, + "requires": { + "commondir": "1.0.1", + "mkdirp": "0.5.1", + "pkg-dir": "1.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "bundled": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "for-in": { + "version": "1.0.2", + "bundled": true + }, + "for-own": { + "version": "0.1.5", + "bundled": true, + "requires": { + "for-in": "1.0.2" + } + }, + "foreground-child": { + "version": "1.5.6", + "bundled": true, + "requires": { + "cross-spawn": "4.0.2", + "signal-exit": "3.0.2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true + }, + "get-caller-file": { + "version": "1.0.2", + "bundled": true + }, + "get-stream": { + "version": "3.0.0", + "bundled": true + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-base": { + "version": "0.3.0", + "bundled": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } + }, + "glob-parent": { + "version": "2.0.0", + "bundled": true, + "requires": { + "is-glob": "2.0.1" + } + }, + "globals": { + "version": "9.18.0", + "bundled": true + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true + }, + "handlebars": { + "version": "4.0.10", + "bundled": true, + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + }, + "dependencies": { + "source-map": { + "version": "0.4.4", + "bundled": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "has-ansi": { + "version": "2.0.0", + "bundled": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "1.0.0", + "bundled": true + }, + "hosted-git-info": { + "version": "2.5.0", + "bundled": true + }, + "imurmurhash": { + "version": "0.1.4", + "bundled": true + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "invariant": { + "version": "2.2.2", + "bundled": true, + "requires": { + "loose-envify": "1.3.1" + } + }, + "invert-kv": { + "version": "1.0.0", + "bundled": true + }, + "is-arrayish": { + "version": "0.2.1", + "bundled": true + }, + "is-buffer": { + "version": "1.1.5", + "bundled": true + }, + "is-builtin-module": { + "version": "1.0.0", + "bundled": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-dotfile": { + "version": "1.0.3", + "bundled": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "bundled": true, + "requires": { + "is-primitive": "2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "bundled": true + }, + "is-extglob": { + "version": "1.0.0", + "bundled": true + }, + "is-finite": { + "version": "1.0.2", + "bundled": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-glob": { + "version": "2.0.1", + "bundled": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "is-number": { + "version": "2.1.0", + "bundled": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "bundled": true + }, + "is-primitive": { + "version": "2.0.0", + "bundled": true + }, + "is-stream": { + "version": "1.1.0", + "bundled": true + }, + "is-utf8": { + "version": "0.2.1", + "bundled": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true + }, + "isexe": { + "version": "2.0.0", + "bundled": true + }, + "isobject": { + "version": "2.1.0", + "bundled": true, + "requires": { + "isarray": "1.0.0" + } + }, + "istanbul-lib-coverage": { + "version": "1.1.1", + "bundled": true + }, + "istanbul-lib-hook": { + "version": "1.0.7", + "bundled": true, + "requires": { + "append-transform": "0.4.0" + } + }, + "istanbul-lib-instrument": { + "version": "1.8.0", + "bundled": true, + "requires": { + "babel-generator": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "istanbul-lib-coverage": "1.1.1", + "semver": "5.4.1" + } + }, + "istanbul-lib-report": { + "version": "1.1.1", + "bundled": true, + "requires": { + "istanbul-lib-coverage": "1.1.1", + "mkdirp": "0.5.1", + "path-parse": "1.0.5", + "supports-color": "3.2.3" + }, + "dependencies": { + "supports-color": { + "version": "3.2.3", + "bundled": true, + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "1.2.1", + "bundled": true, + "requires": { + "debug": "2.6.8", + "istanbul-lib-coverage": "1.1.1", + "mkdirp": "0.5.1", + "rimraf": "2.6.1", + "source-map": "0.5.7" + } + }, + "istanbul-reports": { + "version": "1.1.2", + "bundled": true, + "requires": { + "handlebars": "4.0.10" + } + }, + "js-tokens": { + "version": "3.0.2", + "bundled": true + }, + "jsesc": { + "version": "1.3.0", + "bundled": true + }, + "kind-of": { + "version": "3.2.2", + "bundled": true, + "requires": { + "is-buffer": "1.1.5" + } + }, + "lazy-cache": { + "version": "1.0.4", + "bundled": true, + "optional": true + }, + "lcid": { + "version": "1.0.0", + "bundled": true, + "requires": { + "invert-kv": "1.0.0" + } + }, + "load-json-file": { + "version": "1.1.0", + "bundled": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "bundled": true, + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "bundled": true + } + } + }, + "lodash": { + "version": "4.17.4", + "bundled": true + }, + "longest": { + "version": "1.0.1", + "bundled": true + }, + "loose-envify": { + "version": "1.3.1", + "bundled": true, + "requires": { + "js-tokens": "3.0.2" + } + }, + "lru-cache": { + "version": "4.1.1", + "bundled": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "md5-hex": { + "version": "1.3.0", + "bundled": true, + "requires": { + "md5-o-matic": "0.1.1" + } + }, + "md5-o-matic": { + "version": "0.1.1", + "bundled": true + }, + "mem": { + "version": "1.1.0", + "bundled": true, + "requires": { + "mimic-fn": "1.1.0" + } + }, + "merge-source-map": { + "version": "1.0.4", + "bundled": true, + "requires": { + "source-map": "0.5.7" + } + }, + "micromatch": { + "version": "2.3.11", + "bundled": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + } + }, + "mimic-fn": { + "version": "1.1.0", + "bundled": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true + }, + "normalize-package-data": { + "version": "2.4.0", + "bundled": true, + "requires": { + "hosted-git-info": "2.5.0", + "is-builtin-module": "1.0.0", + "semver": "5.4.1", + "validate-npm-package-license": "3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "bundled": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } + }, + "npm-run-path": { + "version": "2.0.2", + "bundled": true, + "requires": { + "path-key": "2.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true + }, + "object.omit": { + "version": "2.0.1", + "bundled": true, + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + } + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "optimist": { + "version": "0.6.1", + "bundled": true, + "requires": { + "minimist": "0.0.8", + "wordwrap": "0.0.3" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true + }, + "os-locale": { + "version": "2.1.0", + "bundled": true, + "requires": { + "execa": "0.7.0", + "lcid": "1.0.0", + "mem": "1.1.0" + } + }, + "p-finally": { + "version": "1.0.0", + "bundled": true + }, + "p-limit": { + "version": "1.1.0", + "bundled": true + }, + "p-locate": { + "version": "2.0.0", + "bundled": true, + "requires": { + "p-limit": "1.1.0" + } + }, + "parse-glob": { + "version": "3.0.4", + "bundled": true, + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + } + }, + "parse-json": { + "version": "2.2.0", + "bundled": true, + "requires": { + "error-ex": "1.3.1" + } + }, + "path-exists": { + "version": "2.1.0", + "bundled": true, + "requires": { + "pinkie-promise": "2.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true + }, + "path-key": { + "version": "2.0.1", + "bundled": true + }, + "path-parse": { + "version": "1.0.5", + "bundled": true + }, + "path-type": { + "version": "1.1.0", + "bundled": true, + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pify": { + "version": "2.3.0", + "bundled": true + }, + "pinkie": { + "version": "2.0.4", + "bundled": true + }, + "pinkie-promise": { + "version": "2.0.1", + "bundled": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "pkg-dir": { + "version": "1.0.0", + "bundled": true, + "requires": { + "find-up": "1.1.2" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "bundled": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + } + } + }, + "preserve": { + "version": "0.2.0", + "bundled": true + }, + "pseudomap": { + "version": "1.0.2", + "bundled": true + }, + "randomatic": { + "version": "1.1.7", + "bundled": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "bundled": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "bundled": true, + "requires": { + "is-buffer": "1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "bundled": true, + "requires": { + "is-buffer": "1.1.5" + } + } + } + }, + "read-pkg": { + "version": "1.1.0", + "bundled": true, + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "bundled": true, + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + }, + "dependencies": { + "find-up": { + "version": "1.1.2", + "bundled": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + } + } + }, + "regenerator-runtime": { + "version": "0.11.0", + "bundled": true + }, + "regex-cache": { + "version": "0.4.4", + "bundled": true, + "requires": { + "is-equal-shallow": "0.1.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "bundled": true + }, + "repeat-element": { + "version": "1.1.2", + "bundled": true + }, + "repeat-string": { + "version": "1.6.1", + "bundled": true + }, + "repeating": { + "version": "2.0.1", + "bundled": true, + "requires": { + "is-finite": "1.0.2" + } + }, + "require-directory": { + "version": "2.1.1", + "bundled": true + }, + "require-main-filename": { + "version": "1.0.1", + "bundled": true + }, + "resolve-from": { + "version": "2.0.0", + "bundled": true + }, + "right-align": { + "version": "0.1.3", + "bundled": true, + "optional": true, + "requires": { + "align-text": "0.1.4" + } + }, + "rimraf": { + "version": "2.6.1", + "bundled": true, + "requires": { + "glob": "7.1.2" + } + }, + "semver": { + "version": "5.4.1", + "bundled": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true + }, + "shebang-command": { + "version": "1.2.0", + "bundled": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "bundled": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true + }, + "slide": { + "version": "1.1.6", + "bundled": true + }, + "source-map": { + "version": "0.5.7", + "bundled": true + }, + "spawn-wrap": { + "version": "1.3.8", + "bundled": true, + "requires": { + "foreground-child": "1.5.6", + "mkdirp": "0.5.1", + "os-homedir": "1.0.2", + "rimraf": "2.6.1", + "signal-exit": "3.0.2", + "which": "1.3.0" + } + }, + "spdx-correct": { + "version": "1.0.2", + "bundled": true, + "requires": { + "spdx-license-ids": "1.2.2" + } + }, + "spdx-expression-parse": { + "version": "1.0.4", + "bundled": true + }, + "spdx-license-ids": { + "version": "1.2.2", + "bundled": true + }, + "string-width": { + "version": "2.1.1", + "bundled": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "bundled": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "bundled": true + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "2.0.0", + "bundled": true, + "requires": { + "is-utf8": "0.2.1" + } + }, + "strip-eof": { + "version": "1.0.0", + "bundled": true + }, + "supports-color": { + "version": "2.0.0", + "bundled": true + }, + "test-exclude": { + "version": "4.1.1", + "bundled": true, + "requires": { + "arrify": "1.0.1", + "micromatch": "2.3.11", + "object-assign": "4.1.1", + "read-pkg-up": "1.0.1", + "require-main-filename": "1.0.1" + } + }, + "to-fast-properties": { + "version": "1.0.3", + "bundled": true + }, + "trim-right": { + "version": "1.0.1", + "bundled": true + }, + "uglify-js": { + "version": "2.8.29", + "bundled": true, + "optional": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "yargs": { + "version": "3.10.0", + "bundled": true, + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "validate-npm-package-license": { + "version": "3.0.1", + "bundled": true, + "requires": { + "spdx-correct": "1.0.2", + "spdx-expression-parse": "1.0.4" + } + }, + "which": { + "version": "1.3.0", + "bundled": true, + "requires": { + "isexe": "2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "bundled": true + }, + "window-size": { + "version": "0.1.0", + "bundled": true, + "optional": true + }, + "wordwrap": { + "version": "0.0.3", + "bundled": true + }, + "wrap-ansi": { + "version": "2.1.0", + "bundled": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "write-file-atomic": { + "version": "1.3.4", + "bundled": true, + "requires": { + "graceful-fs": "4.1.11", + "imurmurhash": "0.1.4", + "slide": "1.1.6" + } + }, + "y18n": { + "version": "3.2.1", + "bundled": true + }, + "yallist": { + "version": "2.1.2", + "bundled": true + }, + "yargs": { + "version": "8.0.2", + "bundled": true, + "requires": { + "camelcase": "4.1.0", + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.2", + "os-locale": "2.1.0", + "read-pkg-up": "2.0.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "3.2.1", + "yargs-parser": "7.0.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "bundled": true + }, + "cliui": { + "version": "3.2.0", + "bundled": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + }, + "dependencies": { + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, + "load-json-file": { + "version": "2.0.0", + "bundled": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" + } + }, + "path-type": { + "version": "2.0.0", + "bundled": true, + "requires": { + "pify": "2.3.0" + } + }, + "read-pkg": { + "version": "2.0.0", + "bundled": true, + "requires": { + "load-json-file": "2.0.0", + "normalize-package-data": "2.4.0", + "path-type": "2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "bundled": true, + "requires": { + "find-up": "2.1.0", + "read-pkg": "2.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "bundled": true + }, + "yargs-parser": { + "version": "7.0.0", + "bundled": true, + "requires": { + "camelcase": "4.1.0" + } + } + } + }, + "yargs-parser": { + "version": "5.0.0", + "bundled": true, + "requires": { + "camelcase": "3.0.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "bundled": true + } + } + } + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1.0.2" + } + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "requires": { + "execa": "0.7.0", + "lcid": "1.0.0", + "mem": "1.1.0" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "p-limit": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz", + "integrity": "sha1-sH/y2aXYi+yAYDWJWiurZqJ5iLw=" + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "requires": { + "p-limit": "1.1.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "requires": { + "error-ex": "1.3.1" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "requires": { + "pify": "2.3.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "requires": { + "load-json-file": "2.0.0", + "normalize-package-data": "2.4.0", + "path-type": "2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "requires": { + "find-up": "2.1.0", + "read-pkg": "2.0.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=" + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "requires": { + "source-map": "0.5.7" + } + }, + "spdx-correct": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "requires": { + "spdx-license-ids": "1.2.2" + } + }, + "spdx-expression-parse": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", + "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=" + }, + "spdx-license-ids": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", + "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=" + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + }, + "supports-color": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "requires": { + "has-flag": "2.0.0" + } + }, + "ts-node": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-3.3.0.tgz", + "integrity": "sha1-wTxqMCTjC+EYDdUwOPwgkonUv2k=", + "requires": { + "arrify": "1.0.1", + "chalk": "2.1.0", + "diff": "3.3.1", + "make-error": "1.3.0", + "minimist": "1.2.0", + "mkdirp": "0.5.1", + "source-map-support": "0.4.18", + "tsconfig": "6.0.0", + "v8flags": "3.0.1", + "yn": "2.0.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + } + } + } + } + }, + "tsconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-6.0.0.tgz", + "integrity": "sha1-aw6DdgA9evGGT434+J3QBZ/80DI=", + "requires": { + "strip-bom": "3.0.0", + "strip-json-comments": "2.0.1" + } }, "tslib": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.7.1.tgz", "integrity": "sha1-vIAEFkaRkjp5/oN4u+s9ogF1OOw=" + }, + "typescript": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.5.3.tgz", + "integrity": "sha512-ptLSQs2S4QuS6/OD1eAKG+S5G8QQtrU5RT32JULdZQtM1L3WTi34Wsu48Yndzi8xsObRAB9RPt/KhA9wlpEF6w==" + }, + "underscore": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=" + }, + "v8flags": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.0.1.tgz", + "integrity": "sha1-3Oj8N5wX2fLJ6e142JzgAFKxt2s=", + "requires": { + "homedir-polyfill": "1.0.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "requires": { + "spdx-correct": "1.0.2", + "spdx-expression-parse": "1.0.4" + } + }, + "walkdir": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/walkdir/-/walkdir-0.0.12.tgz", + "integrity": "sha512-HFhaD4mMWPzFSqhpyDG48KDdrjfn409YQuVW7ckZYhW4sE87mYtWifdB/+73RA7+p4s4K18n5Jfx1kHthE1gBw==" + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "requires": { + "isexe": "2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "yargs": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz", + "integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=", + "requires": { + "camelcase": "4.1.0", + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.2", + "os-locale": "2.1.0", + "read-pkg-up": "2.0.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "3.2.1", + "yargs-parser": "7.0.0" + } + }, + "yargs-parser": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz", + "integrity": "sha1-jQrELxbqVd69MyyvTEA4s+P139k=", + "requires": { + "camelcase": "4.1.0" + } + }, + "yn": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", + "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=" } } } diff --git a/packages/uhk-common/package.json b/packages/uhk-common/package.json index 64422be5..13f93f01 100644 --- a/packages/uhk-common/package.json +++ b/packages/uhk-common/package.json @@ -4,16 +4,42 @@ "version": "1.0.0", "description": "Common Library contains the common code for uhk-agent (electron-main) and web (electron-renderer) modules", "main": "dist/index.js", + "author": "Ultimate Gadget Laboratories", + "repository": { + "type": "git", + "url": "git@github.com:UltimateHackingKeyboard/agent.git" + }, "scripts": { "build": "tsc", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "jasmine-ts --config=jasmine.json", + "coverage": "nyc jasmine-ts --config=jasmine.json" }, - "author": "", - "license": "ISC", + "license": "GPL-3.0", "devDependencies": { "@angular/core": "4.3.3", "@ngrx/core": "1.2.0", + "@types/jasmine": "2.6.0", "@ngrx/store": "2.2.3", - "@types/node": "8.0.28" + "@types/node": "8.0.30", + "jasmine": "2.8.0", + "jasmine-core": "2.8.0", + "jasmine-node": "2.0.0", + "jasmine-ts": "0.2.1", + "nyc": "11.2.1", + "ts-node": "3.3.0" + }, + "nyc": { + "extension": [ + ".ts" + ], + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "src/**/*.spec.ts" + ], + "reporter": [ + "lcov" + ] } } diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/helper.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/helper.ts index c82430e0..710980a3 100644 --- a/packages/uhk-common/src/config-serializer/config-items/key-action/helper.ts +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/helper.ts @@ -63,7 +63,7 @@ export class Helper { private static fromJSONObject(keyAction: any, macros: Macro[]): KeyAction { if (!keyAction) { - return; + return null; } switch (keyAction.keyActionType) { diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/keystroke-action.spec.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/keystroke-action.spec.ts new file mode 100644 index 00000000..ee01b754 --- /dev/null +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/keystroke-action.spec.ts @@ -0,0 +1,303 @@ +import { KeystrokeAction } from './keystroke-action'; +import { KeystrokeType } from './keystroke-type'; +import { LongPressAction } from '../long-press-action'; + +describe('keystroke-action', () => { + it('should be instantiate', () => { + const action = new KeystrokeAction(); + expect(action).toBeTruthy(); + }); + + it('Should be inherit from other KeyStroke', () => { + const other = new KeystrokeAction(); + other.type = KeystrokeType.basic; + other.scancode = 125; + other.modifierMask = 1; + other.longPressAction = LongPressAction.leftAlt; + const action = new KeystrokeAction(other); + expect(action).toEqual(other); + }); + + describe('set scancode', () => { + it('should store the value without modification', () => { + const value = 125; + const action = new KeystrokeAction(); + action.scancode = value; + expect(action.scancode).toEqual(value); + }); + + it('should not change the "type" when is "basic"', () => { + const type = KeystrokeType.basic; + const action = new KeystrokeAction(); + action.type = type; + action.scancode = 125; + expect(action.type).toEqual(type); + }); + + it('should not change the "type" when is "system"', () => { + const type = KeystrokeType.system; + const action = new KeystrokeAction(); + action.type = type; + action.scancode = 125; + expect(action.type).toEqual(type); + }); + + it('should not change the "type" when is "shortMedia" if scancode < 256', () => { + const type = KeystrokeType.shortMedia; + const action = new KeystrokeAction(); + action.type = type; + action.scancode = 125; + expect(action.type).toEqual(type); + }); + + it('should not change the "type" to "shortMedia" when is "longMedia" if scancode < 256', () => { + const action = new KeystrokeAction(); + action.type = KeystrokeType.longMedia; + action.scancode = 125; + expect(action.type).toEqual(KeystrokeType.shortMedia); + }); + + it('should not change the "type" when is "longMedia" if scancode >= 256', () => { + const type = KeystrokeType.longMedia; + const action = new KeystrokeAction(); + action.type = type; + action.scancode = 256; + expect(action.type).toEqual(type); + }); + + it('should not change the "type" to "longMedia" when is "shortMedia" if scancode >= 256', () => { + const action = new KeystrokeAction(); + action.type = KeystrokeType.shortMedia; + action.scancode = 256; + expect(action.type).toEqual(KeystrokeType.longMedia); + }); + }); + + describe('modifierMask', () => { + it('should store the value without modification', () => { + const value = 100; + const action = new KeystrokeAction(); + action.modifierMask = value; + expect(action.modifierMask).toEqual(value); + }); + + it('should throw an error when value < 0', () => { + const value = -1; + + function test() { + const action = new KeystrokeAction(); + action.modifierMask = value; + } + + expect(test).toThrow(`KeystrokeAction.modifierMask: Integer ${value} is outside the valid [0, 255] interval`); + }); + + it('should throw an error when value > 255', () => { + const value = 256; + + function test() { + const action = new KeystrokeAction(); + action.modifierMask = value; + } + + expect(test).toThrow(`KeystrokeAction.modifierMask: Integer ${value} is outside the valid [0, 255] interval`); + }); + }); + + describe('longPressAction', () => { + it('should store the value without modification', () => { + const value = LongPressAction.leftAlt; + const action = new KeystrokeAction(); + action.longPressAction = value; + expect(action.longPressAction).toEqual(value); + }); + }); + + describe('type', () => { + it('should not change the value if value "basic"', () => { + const value = KeystrokeType.basic; + const scancode = 200; + const action = new KeystrokeAction(); + action.scancode = scancode; + action.type = value; + expect(action.type).toEqual(value); + expect(action.scancode).toEqual(scancode); + }); + + it('should not change the value if value "system"', () => { + const value = KeystrokeType.system; + const scancode = 200; + const action = new KeystrokeAction(); + action.scancode = scancode; + action.type = value; + expect(action.type).toEqual(value); + expect(action.scancode).toEqual(scancode); + }); + + it('should not change the value if scancode >= 256 and value "longMedia"', () => { + const value = KeystrokeType.longMedia; + const scancode = 256; + const action = new KeystrokeAction(); + action.scancode = scancode; + action.type = value; + expect(action.type).toEqual(value); + expect(action.scancode).toEqual(scancode); + }); + + it('should change the value to "longMedia" if scancode >= 256 and value "shortMedia"', () => { + const value = KeystrokeType.shortMedia; + const scancode = 256; + const action = new KeystrokeAction(); + action.scancode = scancode; + action.type = value; + expect(action.type).toEqual(KeystrokeType.longMedia); + expect(action.scancode).toEqual(scancode); + }); + + it('should not change the value if scancode < 256 and value "shortMedia"', () => { + const value = KeystrokeType.shortMedia; + const scancode = 100; + const action = new KeystrokeAction(); + action.scancode = scancode; + action.type = value; + expect(action.type).toEqual(value); + expect(action.scancode).toEqual(scancode); + }); + + it('should change the value to "shortMedia" if scancode < 256 and value "longMedia"', () => { + const value = KeystrokeType.longMedia; + const scancode = 100; + const action = new KeystrokeAction(); + action.scancode = scancode; + action.type = value; + expect(action.type).toEqual(KeystrokeType.shortMedia); + expect(action.scancode).toEqual(scancode); + }); + }); + + describe('fromJsonObject', () => { + it('should map "basic" type', () => { + const jsObject = { + keyActionType: 'keystroke', + type: 'basic', + scancode: 100, + modifierMask: 10, + longPressAction: 'leftAlt' + }; + const action = new KeystrokeAction(); + action.fromJsonObject(jsObject); + + const expected = new KeystrokeAction(); + expected.type = KeystrokeType.basic; + expected.scancode = 100; + expected.modifierMask = 10; + expected.longPressAction = LongPressAction.leftAlt; + + expect(action).toEqual(expected); + }); + + it('should map "system" type', () => { + const jsObject = { + keyActionType: 'keystroke', + type: 'system', + scancode: 100, + modifierMask: 10, + longPressAction: 'leftAlt' + }; + const action = new KeystrokeAction(); + action.fromJsonObject(jsObject); + + const expected = new KeystrokeAction(); + expected.type = KeystrokeType.system; + expected.scancode = 100; + expected.modifierMask = 10; + expected.longPressAction = LongPressAction.leftAlt; + + expect(action).toEqual(expected); + }); + + it('should map "media" type to "shortMedia" if scancode < 256', () => { + const jsObject = { + keyActionType: 'keystroke', + type: 'media', + scancode: 100, + modifierMask: 10, + longPressAction: 'leftAlt' + }; + const action = new KeystrokeAction(); + action.fromJsonObject(jsObject); + + const expected = new KeystrokeAction(); + expected.type = KeystrokeType.shortMedia; + expected.scancode = 100; + expected.modifierMask = 10; + expected.longPressAction = LongPressAction.leftAlt; + + expect(action).toEqual(expected); + }); + + it('should map "media" type to "longMedia" if scancode <= 256', () => { + const jsObject = { + keyActionType: 'keystroke', + type: 'media', + scancode: 256, + modifierMask: 10, + longPressAction: 'leftAlt' + }; + const action = new KeystrokeAction(); + action.fromJsonObject(jsObject); + + const expected = new KeystrokeAction(); + expected.type = KeystrokeType.longMedia; + expected.scancode = 256; + expected.modifierMask = 10; + expected.longPressAction = LongPressAction.leftAlt; + + expect(action).toEqual(expected); + }); + }); + + describe('fromBinary', () => { + + }); + + describe('toJsonObject', () => { + + }); + + describe('toBinary', () => { + + }); + + describe('toString', () => { + + }); + + describe('isActive', () => { + + }); + + describe('hasActiveModifier', () => { + + }); + + describe('hasLongPressAction', () => { + + }); + + describe('hasScancode', () => { + + }); + + describe('hasOnlyOneActiveModifier', () => { + + }); + + describe('getModifierList', () => { + + }); + + describe('getName', () => { + + }); +}); diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/keystroke-action.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/keystroke-action.ts index e087f462..a35d37c6 100644 --- a/packages/uhk-common/src/config-serializer/config-items/key-action/keystroke-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/keystroke-action.ts @@ -65,7 +65,7 @@ export class KeystrokeAction extends KeyAction { return; } this.type = other.type; - this._scancode = other._scancode; + this.scancode = other.scancode; this.modifierMask = other.modifierMask; this.longPressAction = other.longPressAction; } @@ -77,7 +77,8 @@ export class KeystrokeAction extends KeyAction { } else { this.type = KeystrokeType[jsonObject.type]; } - this._scancode = jsonObject.scancode; + + this.scancode = jsonObject.scancode; this.modifierMask = jsonObject.modifierMask; this.longPressAction = LongPressAction[jsonObject.longPressAction]; return this; @@ -134,17 +135,17 @@ export class KeystrokeAction extends KeyAction { if (this.hasScancode()) { flags |= KeystrokeActionFlag.scancode; - toWrite.push({ data: this._scancode, long: this.type === KeystrokeType.longMedia }); + toWrite.push({data: this._scancode, long: this.type === KeystrokeType.longMedia}); } if (this.hasActiveModifier()) { flags |= KeystrokeActionFlag.modifierMask; - toWrite.push({ data: this.modifierMask, long: false }); + toWrite.push({data: this.modifierMask, long: false}); } if (this.hasLongPressAction()) { flags |= KeystrokeActionFlag.longPressAction; - toWrite.push({ data: this.longPressAction, long: false }); + toWrite.push({data: this.longPressAction, long: false}); } const TYPE_OFFSET = flags + (this.type << KEYSTROKE_ACTION_FLAG_LENGTH); diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/mouse-action.spec.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/mouse-action.spec.ts new file mode 100644 index 00000000..37f65c2f --- /dev/null +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/mouse-action.spec.ts @@ -0,0 +1,39 @@ +import { binaryDefaultHelper, jsonDefaultHelper } from '../../../../test/serializer-test-helper'; +import { MouseAction, MouseActionParam } from './mouse-action'; + +// TODO: Add null, undefined, empty object, empty buffer test cases +describe('mouse-action', () => { + it('should be instantiate', () => { + const action = new MouseAction(); + expect(action).toBeTruthy(); + }); + + describe('toString', () => { + it(`should return with `, () => { + const action = new MouseAction(); + action.mouseAction = MouseActionParam.leftClick; + expect(action.toString()).toEqual(``); + }); + }); + + describe('getName', () => { + it('should return with "MouseAction"', () => { + const action = new MouseAction(); + expect(action.getName()).toEqual('MouseAction'); + }); + }); + + describe('full serialization', () => { + it('should json match', () => { + const action = new MouseAction(); + action.mouseAction = MouseActionParam.leftClick; + jsonDefaultHelper(action); + }); + + it('should binary match', () => { + const action = new MouseAction(); + action.mouseAction = MouseActionParam.leftClick; + binaryDefaultHelper(action); + }); + }); +}); diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/none-action.spec.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/none-action.spec.ts new file mode 100644 index 00000000..2ce70e2b --- /dev/null +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/none-action.spec.ts @@ -0,0 +1,73 @@ +import { NoneAction } from './none-action'; +import { keyActionType } from './key-action'; +import { UhkBuffer } from '../../uhk-buffer'; +import { binaryDefaultHelper, jsonDefaultHelper } from '../../../../test/serializer-test-helper'; + +// TODO: Add null, undefined, empty object, empty buffer test cases +describe('node-action', () => { + it('should be instantiate', () => { + const action = new NoneAction(); + expect(action).toBeTruthy(); + }); + + describe('fromJsonObject', () => { + it('should map null', () => { + const action = new NoneAction(); + expect(action.fromJsonObject({keyActionType: keyActionType.NoneAction})).toEqual(new NoneAction()); + }); + }); + + describe('toJsonObject', () => { + it('should work', () => { + const action = new NoneAction(); + expect(action.toJsonObject()).toEqual({ + keyActionType: keyActionType.NoneAction + }); + }); + }); + + describe('fromBinary', () => { + it('should work', () => { + const buffer = new UhkBuffer(); + const action = new NoneAction(); + action.toBinary(buffer); + expect(action).toEqual(new NoneAction()); + }); + }); + + describe('toBinary', () => { + it('should work', () => { + const buffer = new UhkBuffer(); + const action = new NoneAction(); + action.toBinary(buffer); + + const expected = new UhkBuffer(); + expected.offset = 1; + expect(buffer).toEqual(expected); + }); + }); + + describe('toString', () => { + it('should return with ""', () => { + const action = new NoneAction(); + expect(action.toString()).toEqual(''); + }); + }); + + describe('getName', () => { + it('should return with "NoneAction"', () => { + const action = new NoneAction(); + expect(action.getName()).toEqual('NoneAction'); + }); + }); + + describe('full serialization', () => { + it('should json match with default constructor', () => { + jsonDefaultHelper(new NoneAction()); + }); + + it('should binary match with default constructor', () => { + binaryDefaultHelper(new NoneAction()); + }); + }); +}); diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/play-macro-action.spec.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/play-macro-action.spec.ts new file mode 100644 index 00000000..0c578c98 --- /dev/null +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/play-macro-action.spec.ts @@ -0,0 +1,42 @@ +import { binaryDefaultHelper, jsonDefaultHelper } from '../../../../test/serializer-test-helper'; +import { PlayMacroAction } from './play-macro-action'; + +// TODO: Add null, undefined, empty object, empty buffer test cases +describe('play-action', () => { + const macros = [{id: 1}, {id: 2}]; + const userConfiguration = {macros}; + + it('should be instantiate', () => { + const action = new PlayMacroAction(); + expect(action).toBeTruthy(); + }); + + describe('toString', () => { + it('should return ', () => { + const action = new PlayMacroAction(); + action.macroId = 1; + expect(action.toString()).toEqual(''); + }); + }); + + describe('getName', () => { + it('should return with "PlayMacroAction"', () => { + const action = new PlayMacroAction(); + expect(action.getName()).toEqual('PlayMacroAction'); + }); + }); + + describe('full serialization', () => { + it('should json match', () => { + const action = new PlayMacroAction(); + action.macroId = 1; + jsonDefaultHelper(action, macros, macros); + }); + + it('should binary match', () => { + const action = new PlayMacroAction(); + action.macroId = 1; + binaryDefaultHelper(action, userConfiguration, macros); + }); + }); +}); diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/switch-keymap-action.spec.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/switch-keymap-action.spec.ts new file mode 100644 index 00000000..59da9d5a --- /dev/null +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/switch-keymap-action.spec.ts @@ -0,0 +1,43 @@ +import { binaryDefaultHelper, jsonDefaultHelper } from '../../../../test/serializer-test-helper'; +import { SwitchKeymapAction } from './switch-keymap-action'; + +// TODO: Add null, undefined, empty object, empty buffer test cases +describe('switch-keymap-action', () => { + const userConfiguration = { + keymaps: [ + {abbreviation: 'AB1'}, + {abbreviation: 'AB2'} + ] + }; + + it('should be instantiate', () => { + const action = new SwitchKeymapAction(); + expect(action).toBeTruthy(); + }); + + describe('toString', () => { + it('should return ', () => { + const action = new SwitchKeymapAction('ABB'); + expect(action.toString()).toEqual(''); + }); + }); + + describe('getName', () => { + it('should return with "SwitchKeymapAction"', () => { + const action = new SwitchKeymapAction(); + expect(action.getName()).toEqual('SwitchKeymapAction'); + }); + }); + + describe('full serialization', () => { + it('should json match', () => { + const action = new SwitchKeymapAction('AB1'); + jsonDefaultHelper(action, null, userConfiguration); + }); + + it('should binary match', () => { + const action = new SwitchKeymapAction('AB1'); + binaryDefaultHelper(action, userConfiguration, userConfiguration); + }); + }); +}); diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/switch-keymap-action.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/switch-keymap-action.ts index c5fee256..7e1a2318 100644 --- a/packages/uhk-common/src/config-serializer/config-items/key-action/switch-keymap-action.ts +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/switch-keymap-action.ts @@ -35,6 +35,14 @@ export class SwitchKeymapAction extends KeyAction { }; } + // TODO: New method pls check UnresolvedSwitchKeymapAction TODO + fromBinary(buffer: UhkBuffer, userConfiguration: UserConfiguration): SwitchKeymapAction { + buffer.readUInt8(); // Skip key action id + const keymapIndex = buffer.readUInt8(); + this.keymapAbbreviation = userConfiguration.keymaps[keymapIndex].abbreviation; + return this; + } + toBinary(buffer: UhkBuffer, userConfiguration: UserConfiguration): void { const keymapIndex = userConfiguration.keymaps.findIndex(keymap => keymap.abbreviation === this.keymapAbbreviation); buffer.writeUInt8(KeyActionId.SwitchKeymapAction); @@ -45,6 +53,10 @@ export class SwitchKeymapAction extends KeyAction { return ``; } + // TODO: It is a bad pattern the method should have same behavior + // Not good if sometimes return with the same keymap and sometime a new instance + // for the consistent behavior it should be throw and error if + // oldAbbr not equal with current keymapAbbreviation renameKeymap(oldAbbr: string, newAbbr: string): KeyAction { if (this.keymapAbbreviation !== oldAbbr) { return this; @@ -57,6 +69,10 @@ export class SwitchKeymapAction extends KeyAction { } } +// TODO: This is unnecessary object. +// move the fromBinary() method to the SwitchKeymapAction +// and append the resolve() method logic to the new fromBinary() +// I checked and hard to delete this class. export class UnresolvedSwitchKeymapAction extends KeyAction { @assertUInt8 diff --git a/packages/uhk-common/src/config-serializer/config-items/key-action/switch-layer-action.spec.ts b/packages/uhk-common/src/config-serializer/config-items/key-action/switch-layer-action.spec.ts new file mode 100644 index 00000000..8483cafd --- /dev/null +++ b/packages/uhk-common/src/config-serializer/config-items/key-action/switch-layer-action.spec.ts @@ -0,0 +1,33 @@ +import { binaryDefaultHelper, jsonDefaultHelper } from '../../../../test/serializer-test-helper'; +import { SwitchLayerAction } from './switch-layer-action'; + +// TODO: Add null, undefined, empty object, empty buffer test cases +describe('switch-layer-action', () => { + const action = new SwitchLayerAction({layer: 0, isLayerToggleable: false}); + + it('should be instantiate', () => { + expect(new SwitchLayerAction()).toBeTruthy(); + }); + + describe('toString', () => { + it('should return ', () => { + expect(action.toString()).toEqual(''); + }); + }); + + describe('getName', () => { + it('should return with "SwitchLayerAction"', () => { + expect(action.getName()).toEqual('SwitchLayerAction'); + }); + }); + + describe('full serialization', () => { + it('should json match', () => { + jsonDefaultHelper(action); + }); + + it('should binary match', () => { + binaryDefaultHelper(action); + }); + }); +}); diff --git a/packages/uhk-common/src/config-serializer/config-items/module.ts b/packages/uhk-common/src/config-serializer/config-items/module.ts index 8dbf7a4b..a7edf199 100644 --- a/packages/uhk-common/src/config-serializer/config-items/module.ts +++ b/packages/uhk-common/src/config-serializer/config-items/module.ts @@ -57,6 +57,7 @@ export class Module { if (keyAction && (macros || !(keyAction instanceof PlayMacroAction || keyAction instanceof SwitchKeymapAction))) { return keyAction.toJsonObject(macros); } + return null; }) }; } diff --git a/packages/uhk-common/src/config-serializer/config-items/user-configuration.spec.ts b/packages/uhk-common/src/config-serializer/config-items/user-configuration.spec.ts new file mode 100644 index 00000000..beec45e1 --- /dev/null +++ b/packages/uhk-common/src/config-serializer/config-items/user-configuration.spec.ts @@ -0,0 +1,1209 @@ +import { UserConfiguration } from './user-configuration'; + +describe('user-configuration', () => { + it('should be instantiate', () => { + const config = new UserConfiguration(); + expect(config).toBeTruthy(); + }); + + it('should transform an empty config', () => { + jsonTester({ + dataModelVersion: 1, + moduleConfigurations: [], + macros: [], + keymaps: [] + }); + }); + + it('should transform a null keyActionType ', () => { + jsonTester({ + dataModelVersion: 1, + moduleConfigurations: [], + macros: [], + keymaps: [ + { + isDefault: true, + abbreviation: 'QWR', + name: 'QWERTY', + description: '', + layers: [{ + modules: [{ + id: 0, + pointerRole: 'move', + keyActions: [ + null + ] + }] + }] + } + ] + }); + }); + + xit('', () => { + jsonTester({ + dataModelVersion: 1, + moduleConfigurations: [], + macros: [], + keymaps: [ + { + isDefault: false, + abbreviation: '1HA', + name: 'ONE-HANDED', + description: '', + layers: [ + { + modules: [ + { + id: 0, + pointerRole: 'move', + keyActions: [ + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 36 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 37 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 38 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 39 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 45 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 46 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 42 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 24 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 12 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 18 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 19 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 47 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 48 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 49 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 28 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 13 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 14 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 15 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 51 + }, + { + keyActionType: 'switchLayer', + layer: 'mouse', + toggle: false + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 40 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 11 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 17 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 16 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 54 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 55 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 56 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 32 + }, + null, + { + keyActionType: 'switchLayer', + layer: 'mod', + toggle: false + }, + { + keyActionType: 'switchLayer', + layer: 'fn', + toggle: false + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 44 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 64 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 128 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 16 + } + ] + }, + { + id: 1, + pointerRole: 'move', + keyActions: [ + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 53 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 30 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 31 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 32 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 33 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 34 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 35 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 43 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 20 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 26 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 8 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 21 + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 23 + }, + { + keyActionType: 'switchLayer', + layer: 'mouse', + toggle: false + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 4 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 22 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 7 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 9 + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 10 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 2 + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 29 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 27 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 6 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 25 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 5 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 1 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 8 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 4 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 44 + }, + { + keyActionType: 'switchLayer', + layer: 'fn', + toggle: false + }, + { + keyActionType: 'switchLayer', + layer: 'mod', + toggle: false + }, + null + ] + }, + { + id: 2, + pointerRole: 'scroll', + keyActions: [] + } + ] + }, + { + modules: [ + { + id: 0, + pointerRole: 'none', + keyActions: [ + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 35 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 34 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 33 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 32 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 31 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 30 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 53 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 21 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 8 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 26 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 20 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 43 + }, + null, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 23 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 9 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 7 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 22 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 4 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 19 + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 10 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 5 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 25 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 6 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 27 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 29 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 32 + }, + null, + { + keyActionType: 'switchLayer', + layer: 'mod', + toggle: false + }, + { + keyActionType: 'switchLayer', + layer: 'fn', + toggle: false + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 64 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 128 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 16 + } + ] + }, + { + id: 1, + pointerRole: 'none', + keyActions: [ + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 42 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 46 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 45 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 39 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 38 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 37 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 36 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 49 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 19 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 18 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 12 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 24 + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 28 + }, + { + keyActionType: 'switchLayer', + layer: 'mouse', + toggle: false + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 51 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 15 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 14 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 13 + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 11 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 2 + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 56 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 55 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 54 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 16 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 17 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 1 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 8 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 4 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 40 + }, + { + keyActionType: 'switchLayer', + layer: 'fn', + toggle: false + }, + { + keyActionType: 'switchLayer', + layer: 'mod', + toggle: false + }, + null + ] + } + ] + }, + { + modules: [ + { + id: 0, + pointerRole: 'move', + keyActions: [ + null, + null, + null, + null, + null, + null, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 74 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 82 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 77 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 76 + }, + { + keyActionType: 'switchKeymap', + keymapAbbreviation: 'WOR' + }, + { + keyActionType: 'switchKeymap', + keymapAbbreviation: 'KAP' + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 75 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 80 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 81 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 79 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 73 + }, + { + keyActionType: 'keystroke', + type: 'system', + scancode: 131 + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 78 + }, + null, + null, + null, + null, + { + keyActionType: 'keystroke', + type: 'system', + scancode: 130 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 32 + }, + null, + { + keyActionType: 'switchLayer', + layer: 'mod', + toggle: false + }, + { + keyActionType: 'switchLayer', + layer: 'fn', + toggle: false + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 64 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 128 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 16 + } + ] + }, + { + id: 1, + pointerRole: 'scroll', + keyActions: [ + { + keyActionType: 'switchKeymap', + keymapAbbreviation: 'QWR' + }, + { + keyActionType: 'switchKeymap', + keymapAbbreviation: 'DVO' + }, + { + keyActionType: 'switchKeymap', + keymapAbbreviation: 'COL' + }, + { + keyActionType: 'switchKeymap', + keymapAbbreviation: 'WOR' + }, + null, + { + keyActionType: 'switchKeymap', + keymapAbbreviation: 'KAP' + }, + { + keyActionType: 'switchKeymap', + keymapAbbreviation: 'EGG' + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 75 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 74 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 82 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 77 + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 76 + }, + { + keyActionType: 'switchLayer', + layer: 'mouse', + toggle: false + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 78 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 80 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 81 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 79 + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 73 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 2 + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 52 + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 47 + }, + { + keyActionType: 'keystroke', + type: 'basic', + scancode: 48 + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 1 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 8 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 4 + }, + null, + { + keyActionType: 'switchLayer', + layer: 'fn', + toggle: false + }, + { + keyActionType: 'switchLayer', + layer: 'mod', + toggle: false + }, + null + ] + } + ] + }, + { + modules: [ + { + id: 0, + pointerRole: 'move', + keyActions: [ + null, + null, + null, + null, + null, + null, + null, + { + keyActionType: 'mouse', + mouseAction: 'leftClick' + }, + { + keyActionType: 'mouse', + mouseAction: 'moveUp' + }, + { + keyActionType: 'mouse', + mouseAction: 'rightClick' + }, + null, + null, + null, + null, + { + keyActionType: 'mouse', + mouseAction: 'scrollUp' + }, + { + keyActionType: 'mouse', + mouseAction: 'moveLeft' + }, + { + keyActionType: 'mouse', + mouseAction: 'moveDown' + }, + { + keyActionType: 'mouse', + mouseAction: 'moveRight' + }, + null, + null, + null, + { + keyActionType: 'mouse', + mouseAction: 'scrollDown' + }, + null, + { + keyActionType: 'mouse', + mouseAction: 'scrollLeft' + }, + { + keyActionType: 'mouse', + mouseAction: 'middleClick' + }, + { + keyActionType: 'mouse', + mouseAction: 'scrollRight' + }, + null, + null, + null, + { + keyActionType: 'switchLayer', + layer: 'mod', + toggle: false + }, + { + keyActionType: 'switchLayer', + layer: 'fn', + toggle: false + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 64 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 128 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 16 + } + ] + }, + { + id: 1, + pointerRole: 'move', + keyActions: [ + null, + null, + null, + null, + null, + null, + null, + null, + { + keyActionType: 'mouse', + mouseAction: 'scrollUp' + }, + { + keyActionType: 'mouse', + mouseAction: 'leftClick' + }, + { + keyActionType: 'mouse', + mouseAction: 'moveUp' + }, + { + keyActionType: 'mouse', + mouseAction: 'rightClick' + }, + null, + null, + { + keyActionType: 'switchLayer', + layer: 'mouse', + toggle: false + }, + { + keyActionType: 'mouse', + mouseAction: 'scrollDown' + }, + { + keyActionType: 'mouse', + mouseAction: 'moveLeft' + }, + { + keyActionType: 'mouse', + mouseAction: 'moveDown' + }, + { + keyActionType: 'mouse', + mouseAction: 'moveRight' + }, + null, + null, + null, + null, + null, + { + keyActionType: 'mouse', + mouseAction: 'scrollLeft' + }, + { + keyActionType: 'mouse', + mouseAction: 'middleClick' + }, + { + keyActionType: 'mouse', + mouseAction: 'scrollRight' + }, + null, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 1 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 8 + }, + { + keyActionType: 'keystroke', + type: 'basic', + modifierMask: 4 + }, + null, + { + keyActionType: 'switchLayer', + layer: 'fn', + toggle: false + }, + { + keyActionType: 'switchLayer', + layer: 'mod', + toggle: false + }, + null + ] + } + ] + } + ] + } + ] + }); + }); +}); + +function jsonTester(json: any): void { + const orig = JSON.parse(JSON.stringify(json)); + const config = new UserConfiguration(); + config.fromJsonObject(json); + expect(json).toEqual(orig); // check the input json is not mutated + const newJson = config.toJsonObject(); + expect(json).toEqual(orig); // check the input json is not mutated + expect(newJson).toEqual(json); +} diff --git a/packages/uhk-common/src/index.ts b/packages/uhk-common/src/index.ts new file mode 100644 index 00000000..9edef734 --- /dev/null +++ b/packages/uhk-common/src/index.ts @@ -0,0 +1,4 @@ +export * from './util'; +export * from './models'; +export * from './services'; +export * from './config-serializer'; diff --git a/packages/uhk-common/test/serializer-test-helper.ts b/packages/uhk-common/test/serializer-test-helper.ts new file mode 100644 index 00000000..34abfaba --- /dev/null +++ b/packages/uhk-common/test/serializer-test-helper.ts @@ -0,0 +1,19 @@ +import { UhkBuffer } from '../src/config-serializer'; + +export function jsonDefaultHelper(baseObject: any, serializationParam?: any, deserializationParam?: any): void { + const json = baseObject.toJsonObject(serializationParam); + const newObject = new baseObject.constructor; + newObject.fromJsonObject(json, deserializationParam); + + expect(newObject).toEqual(baseObject); +} + +export function binaryDefaultHelper(baseObject: any, serializerParam?: any, deserializationParam?: any): void { + const buffer = new UhkBuffer(); + baseObject.toBinary(buffer, serializerParam); + buffer.offset = 0; + const newObject = new baseObject.constructor; + newObject.fromBinary(buffer, deserializationParam); + + expect(newObject).toEqual(baseObject); +}