@aws-solutions-constructs/core 2.78.0 → 2.79.0

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.
Files changed (61) hide show
  1. package/.jsii +303 -29
  2. package/lib/cloudfront-distribution-helper.d.ts +29 -0
  3. package/lib/cloudfront-distribution-helper.js +81 -1
  4. package/node_modules/deep-diff/.circleci/config.yml +76 -0
  5. package/node_modules/deep-diff/.eslintrc +72 -0
  6. package/node_modules/deep-diff/.vscode/launch.json +30 -0
  7. package/node_modules/deep-diff/.vscode/tasks.json +12 -0
  8. package/node_modules/deep-diff/ChangeLog.md +63 -0
  9. package/node_modules/deep-diff/LICENSE +7 -0
  10. package/node_modules/deep-diff/Readme.md +239 -0
  11. package/node_modules/deep-diff/dist/deep-diff.min.js +1 -0
  12. package/node_modules/deep-diff/dist/deep-diff.min.js.map +1 -0
  13. package/node_modules/deep-diff/examples/apply-diff-from-any.js +39 -0
  14. package/node_modules/deep-diff/examples/array-change.js +45 -0
  15. package/node_modules/deep-diff/examples/capture_change_apply_elsewhere.js +53 -0
  16. package/node_modules/deep-diff/examples/diff-ignoring-fun.js +88 -0
  17. package/node_modules/deep-diff/examples/diff-scenarios.js +49 -0
  18. package/node_modules/deep-diff/examples/example1.js +41 -0
  19. package/node_modules/deep-diff/examples/issue-111.js +6 -0
  20. package/node_modules/deep-diff/examples/issue-113-1.js +14 -0
  21. package/node_modules/deep-diff/examples/issue-113-2.js +11 -0
  22. package/node_modules/deep-diff/examples/issue-115.js +17 -0
  23. package/node_modules/deep-diff/examples/issue-124.js +8 -0
  24. package/node_modules/deep-diff/examples/issue-125.js +19 -0
  25. package/node_modules/deep-diff/examples/issue-126.js +33 -0
  26. package/node_modules/deep-diff/examples/issue-35.js +11 -0
  27. package/node_modules/deep-diff/examples/issue-47.js +17 -0
  28. package/node_modules/deep-diff/examples/issue-48.js +48 -0
  29. package/node_modules/deep-diff/examples/issue-62.js +14 -0
  30. package/node_modules/deep-diff/examples/issue-70.js +6 -0
  31. package/node_modules/deep-diff/examples/issue-71.js +15 -0
  32. package/node_modules/deep-diff/examples/issue-72.js +21 -0
  33. package/node_modules/deep-diff/examples/issue-74.js +9 -0
  34. package/node_modules/deep-diff/examples/issue-78.js +24 -0
  35. package/node_modules/deep-diff/examples/issue-83.js +11 -0
  36. package/node_modules/deep-diff/examples/issue-88.js +26 -0
  37. package/node_modules/deep-diff/examples/performance.js +64 -0
  38. package/node_modules/deep-diff/examples/practice-data.json +2501 -0
  39. package/node_modules/deep-diff/index.js +526 -0
  40. package/node_modules/deep-diff/package.json +74 -0
  41. package/node_modules/deep-diff/test/.eslintrc +10 -0
  42. package/node_modules/deep-diff/test/tests.html +34 -0
  43. package/node_modules/deep-diff/test/tests.js +759 -0
  44. package/node_modules/deepmerge/.editorconfig +7 -0
  45. package/node_modules/deepmerge/.eslintcache +1 -0
  46. package/node_modules/deepmerge/changelog.md +167 -0
  47. package/node_modules/deepmerge/dist/cjs.js +133 -0
  48. package/node_modules/deepmerge/dist/umd.js +139 -0
  49. package/node_modules/deepmerge/index.d.ts +20 -0
  50. package/node_modules/deepmerge/index.js +106 -0
  51. package/node_modules/deepmerge/license.txt +21 -0
  52. package/node_modules/deepmerge/package.json +42 -0
  53. package/node_modules/deepmerge/readme.md +264 -0
  54. package/node_modules/deepmerge/rollup.config.js +22 -0
  55. package/node_modules/npmlog/LICENSE.md +20 -0
  56. package/node_modules/npmlog/README.md +216 -0
  57. package/node_modules/npmlog/lib/log.js +400 -0
  58. package/node_modules/npmlog/package.json +52 -0
  59. package/nohoist.sh +11 -0
  60. package/package.json +3 -2
  61. package/test/cloudfront-distribution-s3-helper.test.js +455 -1
@@ -0,0 +1,19 @@
1
+ var diff = require('../');
2
+
3
+ const left = {
4
+ nested: {
5
+ param1: null,
6
+ param2: null
7
+ }
8
+ };
9
+
10
+ const right = {
11
+ nested: {
12
+ param1: null,
13
+ param2: null
14
+ }
15
+ };
16
+
17
+ var differences = diff(left, right);
18
+ // eslint-disable-next-line no-console
19
+ console.log(differences);
@@ -0,0 +1,33 @@
1
+ // This example shows how prefiltering can be used.
2
+
3
+ const diff = require('../'); // deep-diff
4
+ const { log, inspect } = require('util');
5
+ const assert = require('assert');
6
+
7
+ const data = {
8
+ issue: 126,
9
+ submittedBy: 'abuzarhamza',
10
+ title: 'readme.md need some additional example prefilter',
11
+ posts: [
12
+ {
13
+ date: '2018-04-16',
14
+ text: `additional example for prefilter for deep-diff would be great.
15
+ https://stackoverflow.com/questions/38364639/pre-filter-condition-deep-diff-node-js`
16
+ }
17
+ ]
18
+ };
19
+
20
+ const clone = JSON.parse(JSON.stringify(data));
21
+ clone.title = 'README.MD needs additional example illustrating how to prefilter';
22
+ clone.disposition = 'completed';
23
+
24
+ const two = diff(data, clone);
25
+ const none = diff(data, clone,
26
+ (path, key) => path.length === 0 && ~['title', 'disposition'].indexOf(key)
27
+ );
28
+
29
+ assert.equal(two.length, 2, 'should reflect two differences');
30
+ assert.ok(typeof none === 'undefined', 'should reflect no differences');
31
+
32
+ log(inspect(two, false, 9));
33
+ log(inspect(none, false, 9));
@@ -0,0 +1,11 @@
1
+ var deep = require('../');
2
+
3
+ var lhs = ['a', 'a'];
4
+ var rhs = ['a'];
5
+ var differences = deep.diff(lhs, rhs);
6
+ differences.forEach(function (change) {
7
+ deep.applyChange(lhs, true, change);
8
+ });
9
+
10
+ console.log(lhs); // eslint-disable-line no-console
11
+ console.log(rhs); // eslint-disable-line no-console
@@ -0,0 +1,17 @@
1
+ var diff = require('../');
2
+ var expect = require('expect.js');
3
+
4
+ var thing1 = 'this';
5
+ var thing2 = 'that';
6
+ var thing3 = 'other';
7
+ var thing4 = 'another';
8
+
9
+ var oldArray = [thing1, thing2, thing3, thing4];
10
+ var newArray = [thing1, thing2];
11
+
12
+ diff.observableDiff(oldArray, newArray,
13
+ function (d) {
14
+ diff.applyChange(oldArray, newArray, d);
15
+ });
16
+
17
+ expect(oldArray).to.eql(newArray);
@@ -0,0 +1,48 @@
1
+
2
+ var dd = require('../'); // deep-diff
3
+ var inspect = require('util').inspect;
4
+ var expect = require('expect.js');
5
+
6
+ var before = {
7
+ name: 'my object',
8
+ description: 'it\'s an object!',
9
+ details: {
10
+ it: 'has',
11
+ an: 'array',
12
+ with: ['a', 'few', 'elements']
13
+ }
14
+ };
15
+
16
+ var after = {
17
+ name: 'updated object',
18
+ description: 'it\'s an object!',
19
+ details: {
20
+ it: 'has',
21
+ an: 'array',
22
+ with: ['a', 'few', 'more', 'elements', { than: 'before' }]
23
+ }
24
+ };
25
+
26
+ var revertDiff = function (src, d) {
27
+ d.forEach(function (change) {
28
+ dd.revertChange(src, true, change);
29
+ });
30
+ return src;
31
+ };
32
+
33
+ var clone = function (src) {
34
+ return JSON.parse(JSON.stringify(src));
35
+ };
36
+
37
+ var df = dd.diff(before, after);
38
+ var b1 = clone(before);
39
+ var a1 = clone(after);
40
+
41
+ console.log(inspect(a1, false, 9)); // eslint-disable-line no-console
42
+
43
+ var reverted = revertDiff(a1, df);
44
+ console.log(inspect(reverted, false, 9)); // eslint-disable-line no-console
45
+ console.log(inspect(b1, false, 9)); // eslint-disable-line no-console
46
+
47
+ expect(reverted).to.eql(b1);
48
+
@@ -0,0 +1,14 @@
1
+ var deep = require("../");
2
+
3
+ // https://github.com/flitbit/diff/issues/62#issuecomment-229549984
4
+ // 3: appears to be fixed, probably in fixing #74.
5
+
6
+ var a = {};
7
+ var b = {};
8
+ a.x = b;
9
+ b.x = b;
10
+ deep.diff(a, b); // True
11
+
12
+ a.x = a; // Change to a
13
+ // No change to b
14
+ console.log(deep.diff(a, b)); // Still true...
@@ -0,0 +1,6 @@
1
+ var deepDiff = require('../');
2
+
3
+ var left = {foo: undefined};
4
+ var right = {};
5
+
6
+ console.log(deepDiff.diff(left, right)); // eslint-disable-line no-console
@@ -0,0 +1,15 @@
1
+ var diff = require('../');
2
+
3
+ var left = {
4
+ left: 'yes',
5
+ right: 'no',
6
+ };
7
+
8
+ var right = {
9
+ left: {
10
+ toString: true,
11
+ },
12
+ right: 'no',
13
+ };
14
+
15
+ console.log(diff(left, right)); // eslint-disable-line no-console
@@ -0,0 +1,21 @@
1
+ var diff = require('../');
2
+
3
+ var before = {
4
+ data: [1, 2, 3]
5
+ };
6
+
7
+ var after = {
8
+ data: [4, 5, 1]
9
+ };
10
+
11
+ var differences = diff(before, after);
12
+ console.log(differences); // eslint-disable-line no-console
13
+ differences.reduce(
14
+ (acc, change) => {
15
+ diff.revertChange(acc, true, change);
16
+ return acc;
17
+ },
18
+ after
19
+ );
20
+
21
+ console.log(after); // eslint-disable-line no-console
@@ -0,0 +1,9 @@
1
+ var deepDiff = require("../");
2
+
3
+ var a = {prop: {}};
4
+ var b = {prop: {}};
5
+
6
+ a.prop.circ = a.prop;
7
+ b.prop.circ = b;
8
+
9
+ console.log(deepDiff.diff(a, b));
@@ -0,0 +1,24 @@
1
+
2
+ const diff = require('../');
3
+ const ptr = require('json-ptr');
4
+
5
+ const inspect = require('util').inspect;
6
+
7
+
8
+ const objA = { array: [{ a: 1 }] };
9
+ const objB = { array: [{ a: 2 }] };
10
+
11
+ let changes = diff(objA, objB);
12
+ if (changes) {
13
+ // decorate the changes using json-pointers
14
+ for (let i = 0; i < changes.length; ++i) {
15
+ let change = changes[i];
16
+ // get the parent path:
17
+ let pointer = ptr.create(change.path.slice(0, change.path.length - 1));
18
+ if (change.kind === 'E') {
19
+ change.elementLeft = pointer.get(objA);
20
+ change.elementRight = pointer.get(objB);
21
+ }
22
+ }
23
+ }
24
+ console.log(inspect(changes, false, 9)); // eslint-disable-line no-console
@@ -0,0 +1,11 @@
1
+ var deepDiff = require("../");
2
+
3
+ var left = {
4
+ date: null
5
+ };
6
+
7
+ var right = {
8
+ date: null
9
+ };
10
+
11
+ console.log(deepDiff(left, right));
@@ -0,0 +1,26 @@
1
+ var diff = require("../");
2
+
3
+ var before = {
4
+ length: 3,
5
+ data: [1, 2, 3]
6
+ };
7
+
8
+ var after = {
9
+ data: [4, 5, 1, 2, 3],
10
+ count: 5
11
+ };
12
+
13
+ var differences = diff(before, after);
14
+ console.log(differences);
15
+
16
+ function applyChanges(target, changes) {
17
+ return changes.reduce(
18
+ (acc, change) => {
19
+ diff.applyChange(acc, true, change);
20
+ return acc;
21
+ },
22
+ target
23
+ );
24
+ }
25
+
26
+ console.log(applyChanges(before, differences));
@@ -0,0 +1,64 @@
1
+ var util = require('util')
2
+ , diff = require('..')
3
+ , data = require('./practice-data')
4
+ ;
5
+
6
+ var cycle = -1
7
+ , i
8
+ , len = data.length
9
+ , prior = {}
10
+ , comparand
11
+ , records
12
+ , roll = []
13
+ , stat
14
+ , stats = []
15
+ , mark, elapsed, avg = { diff: { ttl: 0 }, apply: { ttl: 0 } }, ttl = 0
16
+ ;
17
+
18
+ mark = process.hrtime();
19
+ while (++cycle < 10) {
20
+ i = -1;
21
+ while (++i < len) {
22
+ stats.push(stat = { mark: process.hrtime() });
23
+
24
+ comparand = roll[i] || data[i];
25
+
26
+ stat.diff = { mark: process.hrtime() };
27
+ records = diff(prior, comparand);
28
+ stat.diff.intv = process.hrtime(stat.diff.mark);
29
+
30
+ if (records) {
31
+ stat.apply = { count: diff.length, mark: process.hrtime() };
32
+ records.forEach(function (ch) {
33
+ diff.applyChange(prior, comparand, ch);
34
+ });
35
+ stat.apply.intv = process.hrtime(stat.apply.mark);
36
+
37
+ prior = comparand;
38
+ }
39
+ stat.intv = process.hrtime(stat.mark);
40
+ }
41
+ }
42
+
43
+ function ms(intv) {
44
+ return (intv[0] * 1e9 + intv[1] / 1e6);
45
+ }
46
+ elapsed = ms(process.hrtime(mark));
47
+
48
+ stats.forEach(function (stat) {
49
+ stat.elapsed = ms(stat.intv);
50
+ stat.diff.elapsed = ms(stat.diff.intv);
51
+ avg.diff.ttl += stat.diff.elapsed;
52
+ if (stat.apply) {
53
+ stat.apply.elapsed = ms(stat.apply.intv);
54
+ ttl += stat.apply.count;
55
+ avg.apply.ttl += stat.apply.elapsed;
56
+ }
57
+ });
58
+
59
+ avg.diff.avg = avg.diff.ttl / ttl;
60
+ avg.apply.avg = avg.apply.ttl / ttl;
61
+
62
+ console.log('Captured '.concat(stats.length, ' samples with ', ttl, ' combined differences in ', elapsed, 'ms'));
63
+ console.log('\tavg diff: '.concat(avg.diff.avg, 'ms or ', (1 / avg.diff.avg), ' per ms'));
64
+ console.log('\tavg apply: '.concat(avg.apply.avg, 'ms or ', (1 / avg.apply.avg), ' per ms'));