@lakutata/core 1.0.55 → 1.0.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lakutata/core",
3
- "version": "1.0.55",
3
+ "version": "1.0.57",
4
4
  "description": "Lakutata Framework Core",
5
5
  "main": "./build/Core.js",
6
6
  "types": "./build/Core.d.ts",
@@ -1,7 +1,7 @@
1
1
  import {Plugin} from '../base/Plugin'
2
2
  import {JSONParserV2} from 'json-helpers'
3
3
  import {Exception} from '../base/abstracts/Exception'
4
- import JSON5 from 'json5'
4
+ import json5 from 'json5'
5
5
 
6
6
  declare module '../Core' {
7
7
  interface Application {
@@ -23,7 +23,7 @@ JSONParserV2.formatter<Exception | Error>({
23
23
  objectConstructor: (Error as unknown) as ObjectConstructor,
24
24
  serialize: (t: Exception | Error) => {
25
25
  if (t instanceof Exception) {
26
- return JSON5.stringify({
26
+ return json5.stringify({
27
27
  isException: true,
28
28
  appId: t.appId,
29
29
  appName: t.appName,
@@ -33,7 +33,7 @@ JSONParserV2.formatter<Exception | Error>({
33
33
  stack: t.stack
34
34
  })
35
35
  } else {
36
- return JSON5.stringify({
36
+ return json5.stringify({
37
37
  isException: false,
38
38
  name: t.name,
39
39
  message: t.message,
@@ -42,7 +42,7 @@ JSONParserV2.formatter<Exception | Error>({
42
42
  }
43
43
  },
44
44
  unserialize: (data: string) => {
45
- const parsedErrorObject = JSON5.parse(data)
45
+ const parsedErrorObject = json5.parse(data)
46
46
  if (parsedErrorObject.isException) {
47
47
  const unSerializeException = class extends ParseException {
48
48
  public get name(): string {
@@ -6,7 +6,7 @@ import {TestComponent1} from './components/TestComponent1'
6
6
  import {
7
7
  Application,
8
8
  BaseObject,
9
- createApp,
9
+ createApp, Exception,
10
10
  FatalException, Formatter,
11
11
  getApp,
12
12
  IApplicationConfig,
@@ -158,7 +158,9 @@ import {TestException} from './exceptions/TestException'
158
158
  await app.Processes.destroy(TestProcess)
159
159
  const excep = new TestException('hhhh')
160
160
  const ssss = app.JSON.stringify(excep)
161
- console.log(app.JSON.parse(ssss))
161
+ const ssssParsed = app.JSON.parse(ssss)
162
+ console.log(ssssParsed)
163
+ console.log('Is parsed object instance of Exception:', ssssParsed instanceof Exception)
162
164
  app.Shell.exec('echo "hello world!!!!!"')
163
165
  } catch (e) {
164
166
  console.error(e)