@superhero/core 1.8.5 → 4.0.0-beta.3
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/README.md +108 -739
- package/index.js +654 -54
- package/index.test.js +94 -0
- package/package.json +17 -31
- package/worker.js +12 -0
- package/LICENCE +0 -20
- package/bootstrap/config.js +0 -7
- package/bootstrap/index.js +0 -19
- package/bootstrap/locator.js +0 -16
- package/cli/config.js +0 -7
- package/cli/index.js +0 -49
- package/cli/locator.js +0 -17
- package/composer/bootstrap/error/schema-not-resolvable.js +0 -10
- package/composer/bootstrap/index.js +0 -62
- package/composer/bootstrap/locator.js +0 -20
- package/composer/config.js +0 -49
- package/composer/error/filter-is-not-honering-contract.js +0 -13
- package/composer/error/invalid-attribute.js +0 -13
- package/composer/error/invalid-collection.js +0 -13
- package/composer/error/invalid-schema.js +0 -13
- package/composer/error/schema-not-found.js +0 -13
- package/composer/error/validator-is-not-honering-contract.js +0 -13
- package/composer/error/validator-not-found.js +0 -13
- package/composer/filter/boolean/index.js +0 -44
- package/composer/filter/boolean/locator.js +0 -11
- package/composer/filter/decimal/index.js +0 -38
- package/composer/filter/decimal/locator.js +0 -11
- package/composer/filter/index.js +0 -10
- package/composer/filter/integer/index.js +0 -38
- package/composer/filter/integer/locator.js +0 -11
- package/composer/filter/json/index.js +0 -23
- package/composer/filter/json/locator.js +0 -11
- package/composer/filter/schema/error/missing-schema-definition.js +0 -13
- package/composer/filter/schema/index.js +0 -49
- package/composer/filter/schema/locator.js +0 -17
- package/composer/filter/string/index.js +0 -50
- package/composer/filter/string/locator.js +0 -11
- package/composer/filter/timestamp/index.js +0 -45
- package/composer/filter/timestamp/locator.js +0 -11
- package/composer/index.js +0 -180
- package/composer/locator.js +0 -17
- package/composer/validator/boolean/error/invalid.js +0 -13
- package/composer/validator/boolean/index.js +0 -17
- package/composer/validator/boolean/locator.js +0 -11
- package/composer/validator/decimal/error/invalid.js +0 -13
- package/composer/validator/decimal/index.js +0 -59
- package/composer/validator/decimal/locator.js +0 -11
- package/composer/validator/index.js +0 -10
- package/composer/validator/integer/error/invalid.js +0 -13
- package/composer/validator/integer/index.js +0 -65
- package/composer/validator/integer/locator.js +0 -11
- package/composer/validator/json/error/invalid.js +0 -13
- package/composer/validator/json/index.js +0 -23
- package/composer/validator/json/locator.js +0 -11
- package/composer/validator/schema/error/invalid.js +0 -13
- package/composer/validator/schema/index.js +0 -13
- package/composer/validator/schema/locator.js +0 -11
- package/composer/validator/string/error/invalid.js +0 -13
- package/composer/validator/string/index.js +0 -59
- package/composer/validator/string/locator.js +0 -11
- package/composer/validator/timestamp/error/invalid.js +0 -13
- package/composer/validator/timestamp/index.js +0 -54
- package/composer/validator/timestamp/locator.js +0 -11
- package/configuration/config.js +0 -7
- package/configuration/index.js +0 -23
- package/configuration/locator.js +0 -22
- package/console/config.js +0 -15
- package/console/index.js +0 -23
- package/console/locator.js +0 -21
- package/console/observer/error/config.js +0 -7
- package/console/observer/error/index.js +0 -14
- package/console/observer/error/locator.js +0 -17
- package/console/observer/info/config.js +0 -7
- package/console/observer/info/index.js +0 -14
- package/console/observer/info/locator.js +0 -17
- package/console/observer/warning/config.js +0 -7
- package/console/observer/warning/index.js +0 -14
- package/console/observer/warning/locator.js +0 -17
- package/core/config.js +0 -21
- package/core/error.js +0 -10
- package/deepcopy/config.js +0 -7
- package/deepcopy/error/failed-to-fast-copy.js +0 -10
- package/deepcopy/index.js +0 -18
- package/deepcopy/locator.js +0 -11
- package/deepfind/config.js +0 -7
- package/deepfind/index.js +0 -11
- package/deepfind/locator.js +0 -11
- package/deepfreeze/config.js +0 -7
- package/deepfreeze/index.js +0 -20
- package/deepfreeze/locator.js +0 -11
- package/deepmerge/config.js +0 -7
- package/deepmerge/index.js +0 -42
- package/deepmerge/locator.js +0 -11
- package/eventbus/bootstrap/error/observer-contract-not-honered.js +0 -10
- package/eventbus/bootstrap/index.js +0 -33
- package/eventbus/bootstrap/locator.js +0 -20
- package/eventbus/config.js +0 -17
- package/eventbus/index.js +0 -21
- package/eventbus/locator.js +0 -25
- package/eventbus/observer.js +0 -9
- package/factory.js +0 -55
- package/http/request/config.js +0 -7
- package/http/request/locator.js +0 -21
- package/http/server/config.js +0 -23
- package/http/server/dispatcher/chain/error/dispatcher-chain-ended.js +0 -10
- package/http/server/dispatcher/chain/index.js +0 -41
- package/http/server/dispatcher/chain/locator.js +0 -20
- package/http/server/dispatcher/collection/builder/error/dispatcher-can-not-be-resolved.js +0 -10
- package/http/server/dispatcher/collection/builder/error/not-honering-dispatcher-contract.js +0 -10
- package/http/server/dispatcher/collection/builder/index.js +0 -56
- package/http/server/dispatcher/collection/builder/locator.js +0 -20
- package/http/server/dispatcher/error/bad-gateway.js +0 -12
- package/http/server/dispatcher/error/bad-request.js +0 -12
- package/http/server/dispatcher/error/conflict.js +0 -12
- package/http/server/dispatcher/error/forbidden.js +0 -12
- package/http/server/dispatcher/error/gateway-timeout.js +0 -12
- package/http/server/dispatcher/error/index.js +0 -10
- package/http/server/dispatcher/error/method-not-allowed.js +0 -12
- package/http/server/dispatcher/error/not-implemented.js +0 -12
- package/http/server/dispatcher/error/page-not-found.js +0 -12
- package/http/server/dispatcher/error/request-timeout.js +0 -12
- package/http/server/dispatcher/error/server-error.js +0 -12
- package/http/server/dispatcher/error/service-unavailable.js +0 -12
- package/http/server/dispatcher/error/unauthorized.js +0 -12
- package/http/server/dispatcher/index.js +0 -26
- package/http/server/dispatcher/rest.js +0 -75
- package/http/server/error/no-endpoint-defined-in-route.js +0 -10
- package/http/server/error/view-contract-not-honered.js +0 -10
- package/http/server/index.js +0 -195
- package/http/server/locator.js +0 -34
- package/http/server/request/builder/index.js +0 -53
- package/http/server/request/builder/locator.js +0 -20
- package/http/server/route/builder/error/dto-invalid-reference.js +0 -10
- package/http/server/route/builder/error/routes-invalid-type.js +0 -10
- package/http/server/route/builder/index.js +0 -88
- package/http/server/route/builder/locator.js +0 -20
- package/http/server/session/builder/index.js +0 -34
- package/http/server/session/builder/locator.js +0 -11
- package/http/server/view/index.js +0 -12
- package/http/server/view/json/index.js +0 -17
- package/http/server/view/json/locator.js +0 -11
- package/http/server/view/locator.js +0 -11
- package/http/server/view/stream/index.js +0 -10
- package/http/server/view/stream/locator.js +0 -11
- package/http/server/view/text/index.js +0 -15
- package/http/server/view/text/locator.js +0 -11
- package/locator/constituent.js +0 -26
- package/locator/error/locator-not-implemented.js +0 -10
- package/locator/error/service-undefined.js +0 -10
- package/locator/index.js +0 -29
- package/path/config.js +0 -7
- package/path/index.js +0 -63
- package/path/locator.js +0 -11
- package/process/bootstrap/index.js +0 -31
- package/process/bootstrap/locator.js +0 -17
- package/process/config.js +0 -12
- package/process/index.js +0 -9
- package/process/locator.js +0 -11
- package/test/api/config.js +0 -43
- package/test/api/endpoint/append-calculation.js +0 -41
- package/test/api/endpoint/create-calculation.js +0 -18
- package/test/api/middleware/authentication.js +0 -27
- package/test/calculator/calculation.js +0 -29
- package/test/calculator/config.js +0 -14
- package/test/calculator/error/calculation-could-not-be-found.js +0 -13
- package/test/calculator/error/invalid-calculation-type.js +0 -13
- package/test/calculator/index.js +0 -67
- package/test/calculator/locator.js +0 -20
- package/test/init.js +0 -2
- package/test/logger/config.js +0 -15
- package/test/logger/index.js +0 -17
- package/test/logger/locator.js +0 -20
- package/test/mocha.opts +0 -4
- package/test/test.calculation.js +0 -58
- package/test/test.logger.js +0 -35
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
const InvalidIntegerError = require('./error/invalid')
|
|
2
|
-
/**
|
|
3
|
-
* @implements {ComposerValidator}
|
|
4
|
-
*/
|
|
5
|
-
class ComposerValidatorInteger
|
|
6
|
-
{
|
|
7
|
-
valid(options, data)
|
|
8
|
-
{
|
|
9
|
-
if(typeof data !== 'number')
|
|
10
|
-
{
|
|
11
|
-
const msg = `Invalid type: "${typeof data}", number expected`
|
|
12
|
-
throw new InvalidIntegerError(msg)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if(data !== parseInt(data))
|
|
16
|
-
{
|
|
17
|
-
const msg = `Integer expected, found decimals`
|
|
18
|
-
throw new InvalidIntegerError(msg)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if(options.unsigned
|
|
22
|
-
&& data < 0)
|
|
23
|
-
{
|
|
24
|
-
const msg = `Expected an unsigned integer `
|
|
25
|
-
throw new InvalidIntegerError(msg)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if('min' in options
|
|
29
|
-
&& data < options.min)
|
|
30
|
-
{
|
|
31
|
-
const msg = `Integer must be minimum: "${options.min}"`
|
|
32
|
-
throw new InvalidIntegerError(msg)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
if('max' in options
|
|
36
|
-
&& data > options.max)
|
|
37
|
-
{
|
|
38
|
-
const msg = `Integer can't be more then: "${options.max}"`
|
|
39
|
-
throw new InvalidIntegerError(msg)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if('gt' in options
|
|
43
|
-
&& data < options.gt)
|
|
44
|
-
{
|
|
45
|
-
const msg = `Integer must be more then: "${options.gt}"`
|
|
46
|
-
throw new InvalidIntegerError(msg)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if('lt' in options
|
|
50
|
-
&& data > options.lt)
|
|
51
|
-
{
|
|
52
|
-
const msg = `Integer must be less then: "${options.lt}"`
|
|
53
|
-
throw new InvalidIntegerError(msg)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if(options.enum
|
|
57
|
-
&&!options.enum.includes(data))
|
|
58
|
-
{
|
|
59
|
-
const msg = `Expected one of the enumeral values: "${options.enum}"`
|
|
60
|
-
throw new InvalidIntegerError(msg)
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
module.exports = ComposerValidatorInteger
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const InvalidJsonError = require('./error/invalid')
|
|
2
|
-
/**
|
|
3
|
-
* @implements {ComposerValidator}
|
|
4
|
-
*/
|
|
5
|
-
class ComposerValidatorJson
|
|
6
|
-
{
|
|
7
|
-
valid(options, data)
|
|
8
|
-
{
|
|
9
|
-
try
|
|
10
|
-
{
|
|
11
|
-
options.stringified
|
|
12
|
-
? JSON.parse(data)
|
|
13
|
-
: JSON.stringify(data)
|
|
14
|
-
}
|
|
15
|
-
catch(error)
|
|
16
|
-
{
|
|
17
|
-
const msg = `Unparsable JSON provided`
|
|
18
|
-
throw new InvalidJsonError(msg)
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
module.exports = ComposerValidatorJson
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
const InvalidStringError = require('./error/invalid')
|
|
2
|
-
/**
|
|
3
|
-
* @implements {ComposerValidator}
|
|
4
|
-
*/
|
|
5
|
-
class ComposerValidatorString
|
|
6
|
-
{
|
|
7
|
-
valid(options, data)
|
|
8
|
-
{
|
|
9
|
-
if(typeof data !== 'string')
|
|
10
|
-
{
|
|
11
|
-
const msg = `Invalid type: "${typeof data}", string expected`
|
|
12
|
-
throw new InvalidStringError(msg)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if(options['not-empty']
|
|
16
|
-
&& !data.length)
|
|
17
|
-
{
|
|
18
|
-
const msg = `Must not be empty`
|
|
19
|
-
throw new InvalidStringError(msg)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if('min' in options
|
|
23
|
-
&& data.length < options.min)
|
|
24
|
-
{
|
|
25
|
-
const msg = `String length must be minimum: "${options.min}" long`
|
|
26
|
-
throw new InvalidStringError(msg)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if('max' in options
|
|
30
|
-
&& data.length > options.max)
|
|
31
|
-
{
|
|
32
|
-
const msg = `String length can't be more then: "${options.max}" long`
|
|
33
|
-
throw new InvalidStringError(msg)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if(options.enum
|
|
37
|
-
&&!options.enum.includes(data))
|
|
38
|
-
{
|
|
39
|
-
const msg = `Expected one of the enumeral values: "${options.enum}"`
|
|
40
|
-
throw new InvalidStringError(msg)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if(options.uppercase
|
|
44
|
-
&& data !== data.toUpperCase())
|
|
45
|
-
{
|
|
46
|
-
const msg = `Upper case string expected`
|
|
47
|
-
throw new InvalidStringError(msg)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if(options.lowercase
|
|
51
|
-
&& data !== data.toLowerCase())
|
|
52
|
-
{
|
|
53
|
-
const msg = `Lower case string expected`
|
|
54
|
-
throw new InvalidStringError(msg)
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
module.exports = ComposerValidatorString
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
const InvalidTimestampError = require('./error/invalid')
|
|
2
|
-
/**
|
|
3
|
-
* @implements {ComposerValidator}
|
|
4
|
-
*/
|
|
5
|
-
class ComposerValidatorTimestamp
|
|
6
|
-
{
|
|
7
|
-
valid(options, data)
|
|
8
|
-
{
|
|
9
|
-
if(typeof data !== 'string')
|
|
10
|
-
{
|
|
11
|
-
const msg = `Invalid type: "${typeof data}", string expected`
|
|
12
|
-
throw new InvalidTimestampError(msg)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const date = new Date(data)
|
|
16
|
-
|
|
17
|
-
if('min' in options
|
|
18
|
-
&& date.getTime() < new Date(options.min).getTime())
|
|
19
|
-
{
|
|
20
|
-
const msg = `Timestamp must be at least: "${options.min}"`
|
|
21
|
-
throw new InvalidTimestampError(msg)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if('max' in options
|
|
25
|
-
&& date.getTime() > new Date(options.max).getTime())
|
|
26
|
-
{
|
|
27
|
-
const msg = `Timestamp can't be more then: "${options.max}"`
|
|
28
|
-
throw new InvalidTimestampError(msg)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if('gt' in options
|
|
32
|
-
&& date.getTime() > new Date(options.gt).getTime())
|
|
33
|
-
{
|
|
34
|
-
const msg = `Timestamp must be more then: "${options.gt}" long`
|
|
35
|
-
throw new InvalidTimestampError(msg)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if('lt' in options
|
|
39
|
-
&& date.getTime() < new Date(options.lt).getTime())
|
|
40
|
-
{
|
|
41
|
-
const msg = `Timestamp must be less then: "${options.lt}" long`
|
|
42
|
-
throw new InvalidTimestampError(msg)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if(options.enum
|
|
46
|
-
&&!options.enum.includes(data))
|
|
47
|
-
{
|
|
48
|
-
const msg = `Expected one of the enumeral values: "${options.enum}"`
|
|
49
|
-
throw new InvalidTimestampError(msg)
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
module.exports = ComposerValidatorTimestamp
|
package/configuration/config.js
DELETED
package/configuration/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
class Configuration
|
|
2
|
-
{
|
|
3
|
-
constructor(deepcopy, deepmerge, deepfind)
|
|
4
|
-
{
|
|
5
|
-
this.deepcopy = deepcopy
|
|
6
|
-
this.deepmerge = deepmerge
|
|
7
|
-
this.deepfind = deepfind
|
|
8
|
-
this.config = {}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
extend(config)
|
|
12
|
-
{
|
|
13
|
-
const copy = this.deepcopy.fast(config)
|
|
14
|
-
this.config = this.deepmerge.merge(this.config, copy)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
find(path)
|
|
18
|
-
{
|
|
19
|
-
return this.deepfind.find(path, this.config)
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
module.exports = Configuration
|
package/configuration/locator.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const Configuration = require('.')
|
|
2
|
-
|
|
3
|
-
class ConfigurationLocator
|
|
4
|
-
{
|
|
5
|
-
constructor(locator)
|
|
6
|
-
{
|
|
7
|
-
this.locator = locator
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
locate()
|
|
11
|
-
{
|
|
12
|
-
const
|
|
13
|
-
deepcopy = this.locator.locate('deepcopy'),
|
|
14
|
-
deepmerge = this.locator.locate('deepmerge'),
|
|
15
|
-
deepfind = this.locator.locate('deepfind'),
|
|
16
|
-
configuration = new Configuration(deepcopy, deepmerge, deepfind)
|
|
17
|
-
|
|
18
|
-
return configuration
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
module.exports = ConfigurationLocator
|
package/console/config.js
DELETED
package/console/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
const Debug = require('@superhero/debug')
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @extends {@superhero/debug}
|
|
5
|
-
*/
|
|
6
|
-
class Console extends Debug
|
|
7
|
-
{
|
|
8
|
-
constructor(options)
|
|
9
|
-
{
|
|
10
|
-
super(options)
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
error_options = { ...options, color:'red', prefix:'error:' },
|
|
14
|
-
warning_options = { ...options, color:'yellow', prefix:'warning:' },
|
|
15
|
-
error = new Debug(error_options),
|
|
16
|
-
warning = new Debug(warning_options)
|
|
17
|
-
|
|
18
|
-
this.error = error.error.bind(error)
|
|
19
|
-
this.warning = warning.log.bind(warning)
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
module.exports = Console
|
package/console/locator.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const Console = require('.')
|
|
2
|
-
|
|
3
|
-
class ConsoleLocator
|
|
4
|
-
{
|
|
5
|
-
constructor(locator)
|
|
6
|
-
{
|
|
7
|
-
this.locator = locator
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
locate()
|
|
11
|
-
{
|
|
12
|
-
const
|
|
13
|
-
configuration = this.locator.locate('configuration'),
|
|
14
|
-
options = configuration.find('console'),
|
|
15
|
-
console = new Console(options)
|
|
16
|
-
|
|
17
|
-
return console
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
module.exports = ConsoleLocator
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const ConsoleObserverError = require('.')
|
|
2
|
-
|
|
3
|
-
class ConsoleObserverErrorLocator
|
|
4
|
-
{
|
|
5
|
-
constructor(locator)
|
|
6
|
-
{
|
|
7
|
-
this.locator = locator
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
locate()
|
|
11
|
-
{
|
|
12
|
-
const console = this.locator.locate('console')
|
|
13
|
-
return new ConsoleObserverError(console)
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
module.exports = ConsoleObserverErrorLocator
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const ConsoleObserverInfo = require('.')
|
|
2
|
-
|
|
3
|
-
class ConsoleObserverInfoLocator
|
|
4
|
-
{
|
|
5
|
-
constructor(locator)
|
|
6
|
-
{
|
|
7
|
-
this.locator = locator
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
locate()
|
|
11
|
-
{
|
|
12
|
-
const console = this.locator.locate('console')
|
|
13
|
-
return new ConsoleObserverInfo(console)
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
module.exports = ConsoleObserverInfoLocator
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const ConsoleObserverWarning = require('.')
|
|
2
|
-
|
|
3
|
-
class ConsoleObserverWarningLocator
|
|
4
|
-
{
|
|
5
|
-
constructor(locator)
|
|
6
|
-
{
|
|
7
|
-
this.locator = locator
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
locate()
|
|
11
|
-
{
|
|
12
|
-
const console = this.locator.locate('console')
|
|
13
|
-
return new ConsoleObserverWarning(console)
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
module.exports = ConsoleObserverWarningLocator
|
package/core/config.js
DELETED
package/core/error.js
DELETED
package/deepcopy/config.js
DELETED
package/deepcopy/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const FailedToFastCopyError = require('./error/failed-to-fast-copy')
|
|
2
|
-
|
|
3
|
-
class DeepCopy
|
|
4
|
-
{
|
|
5
|
-
fast(obj)
|
|
6
|
-
{
|
|
7
|
-
try
|
|
8
|
-
{
|
|
9
|
-
return JSON.parse(JSON.stringify(obj))
|
|
10
|
-
}
|
|
11
|
-
catch(error)
|
|
12
|
-
{
|
|
13
|
-
throw new FailedToFastCopyError(error.message)
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
module.exports = DeepCopy
|
package/deepcopy/locator.js
DELETED