cdk-from-cfn 0.268.0 → 0.269.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.
package/index.d.ts CHANGED
@@ -1,12 +1,15 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function wasm_init(): void;
3
+
4
+ /**
5
+ * Returns an array containing all supported language names.
6
+ */
7
+ export function supported_languages(): any[];
8
+
4
9
  /**
5
10
  * Transforms the provided template into a CDK application in the specified
6
11
  * language.
7
12
  */
8
13
  export function transmute(template: string, language: string, stack_name: string): string;
9
- /**
10
- * Returns an array containing all supported language names.
11
- */
12
- export function supported_languages(): any[];
14
+
15
+ export function wasm_init(): void;
package/index.js CHANGED
@@ -1,24 +1,24 @@
1
1
 
2
2
  let imports = {};
3
3
  imports['__wbindgen_placeholder__'] = module.exports;
4
- let wasm;
5
- const { TextDecoder, TextEncoder } = require(`util`);
6
4
 
7
- let cachedUint8ArrayMemory0 = null;
8
-
9
- function getUint8ArrayMemory0() {
10
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
11
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
5
+ function getArrayJsValueFromWasm0(ptr, len) {
6
+ ptr = ptr >>> 0;
7
+ const mem = getDataViewMemory0();
8
+ const result = [];
9
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
10
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
12
11
  }
13
- return cachedUint8ArrayMemory0;
12
+ wasm.__externref_drop_slice(ptr, len);
13
+ return result;
14
14
  }
15
15
 
16
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
17
-
18
- cachedTextDecoder.decode();
19
-
20
- function decodeText(ptr, len) {
21
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
16
+ let cachedDataViewMemory0 = null;
17
+ function getDataViewMemory0() {
18
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
19
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
20
+ }
21
+ return cachedDataViewMemory0;
22
22
  }
23
23
 
24
24
  function getStringFromWasm0(ptr, len) {
@@ -26,25 +26,15 @@ function getStringFromWasm0(ptr, len) {
26
26
  return decodeText(ptr, len);
27
27
  }
28
28
 
29
- let WASM_VECTOR_LEN = 0;
30
-
31
- const cachedTextEncoder = new TextEncoder('utf-8');
32
-
33
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
34
- ? function (arg, view) {
35
- return cachedTextEncoder.encodeInto(arg, view);
29
+ let cachedUint8ArrayMemory0 = null;
30
+ function getUint8ArrayMemory0() {
31
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
32
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
33
+ }
34
+ return cachedUint8ArrayMemory0;
36
35
  }
37
- : function (arg, view) {
38
- const buf = cachedTextEncoder.encode(arg);
39
- view.set(buf);
40
- return {
41
- read: arg.length,
42
- written: buf.length
43
- };
44
- });
45
36
 
46
37
  function passStringToWasm0(arg, malloc, realloc) {
47
-
48
38
  if (realloc === undefined) {
49
39
  const buf = cachedTextEncoder.encode(arg);
50
40
  const ptr = malloc(buf.length, 1) >>> 0;
@@ -65,14 +55,13 @@ function passStringToWasm0(arg, malloc, realloc) {
65
55
  if (code > 0x7F) break;
66
56
  mem[ptr + offset] = code;
67
57
  }
68
-
69
58
  if (offset !== len) {
70
59
  if (offset !== 0) {
71
60
  arg = arg.slice(offset);
72
61
  }
73
62
  ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
74
63
  const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
75
- const ret = encodeString(arg, view);
64
+ const ret = cachedTextEncoder.encodeInto(arg, view);
76
65
 
77
66
  offset += ret.written;
78
67
  ptr = realloc(ptr, len, offset, 1) >>> 0;
@@ -82,24 +71,45 @@ function passStringToWasm0(arg, malloc, realloc) {
82
71
  return ptr;
83
72
  }
84
73
 
85
- let cachedDataViewMemory0 = null;
74
+ function takeFromExternrefTable0(idx) {
75
+ const value = wasm.__wbindgen_externrefs.get(idx);
76
+ wasm.__externref_table_dealloc(idx);
77
+ return value;
78
+ }
86
79
 
87
- function getDataViewMemory0() {
88
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
89
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
80
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
81
+ cachedTextDecoder.decode();
82
+ function decodeText(ptr, len) {
83
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
84
+ }
85
+
86
+ const cachedTextEncoder = new TextEncoder();
87
+
88
+ if (!('encodeInto' in cachedTextEncoder)) {
89
+ cachedTextEncoder.encodeInto = function (arg, view) {
90
+ const buf = cachedTextEncoder.encode(arg);
91
+ view.set(buf);
92
+ return {
93
+ read: arg.length,
94
+ written: buf.length
95
+ };
90
96
  }
91
- return cachedDataViewMemory0;
92
97
  }
93
98
 
94
- module.exports.wasm_init = function() {
95
- wasm.wasm_init();
96
- };
99
+ let WASM_VECTOR_LEN = 0;
97
100
 
98
- function takeFromExternrefTable0(idx) {
99
- const value = wasm.__wbindgen_export_3.get(idx);
100
- wasm.__externref_table_dealloc(idx);
101
- return value;
101
+ /**
102
+ * Returns an array containing all supported language names.
103
+ * @returns {any[]}
104
+ */
105
+ function supported_languages() {
106
+ const ret = wasm.supported_languages();
107
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
108
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
109
+ return v1;
102
110
  }
111
+ exports.supported_languages = supported_languages;
112
+
103
113
  /**
104
114
  * Transforms the provided template into a CDK application in the specified
105
115
  * language.
@@ -108,7 +118,7 @@ function takeFromExternrefTable0(idx) {
108
118
  * @param {string} stack_name
109
119
  * @returns {string}
110
120
  */
111
- module.exports.transmute = function(template, language, stack_name) {
121
+ function transmute(template, language, stack_name) {
112
122
  let deferred5_0;
113
123
  let deferred5_1;
114
124
  try {
@@ -131,35 +141,20 @@ module.exports.transmute = function(template, language, stack_name) {
131
141
  } finally {
132
142
  wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
133
143
  }
134
- };
144
+ }
145
+ exports.transmute = transmute;
135
146
 
136
- function getArrayJsValueFromWasm0(ptr, len) {
137
- ptr = ptr >>> 0;
138
- const mem = getDataViewMemory0();
139
- const result = [];
140
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
141
- result.push(wasm.__wbindgen_export_3.get(mem.getUint32(i, true)));
142
- }
143
- wasm.__externref_drop_slice(ptr, len);
144
- return result;
147
+ function wasm_init() {
148
+ wasm.wasm_init();
145
149
  }
146
- /**
147
- * Returns an array containing all supported language names.
148
- * @returns {any[]}
149
- */
150
- module.exports.supported_languages = function() {
151
- const ret = wasm.supported_languages();
152
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
153
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
154
- return v1;
155
- };
150
+ exports.wasm_init = wasm_init;
156
151
 
157
- module.exports.__wbg_Error_1f3748b298f99708 = function(arg0, arg1) {
152
+ exports.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
158
153
  const ret = Error(getStringFromWasm0(arg0, arg1));
159
154
  return ret;
160
155
  };
161
156
 
162
- module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
157
+ exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
163
158
  let deferred0_0;
164
159
  let deferred0_1;
165
160
  try {
@@ -171,12 +166,12 @@ module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
171
166
  }
172
167
  };
173
168
 
174
- module.exports.__wbg_new_8a6f238a6ece86ea = function() {
169
+ exports.__wbg_new_8a6f238a6ece86ea = function() {
175
170
  const ret = new Error();
176
171
  return ret;
177
172
  };
178
173
 
179
- module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
174
+ exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
180
175
  const ret = arg1.stack;
181
176
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
182
177
  const len1 = WASM_VECTOR_LEN;
@@ -184,30 +179,25 @@ module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
184
179
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
185
180
  };
186
181
 
187
- module.exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
182
+ exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
188
183
  // Cast intrinsic for `Ref(String) -> Externref`.
189
184
  const ret = getStringFromWasm0(arg0, arg1);
190
185
  return ret;
191
186
  };
192
187
 
193
- module.exports.__wbindgen_init_externref_table = function() {
194
- const table = wasm.__wbindgen_export_3;
188
+ exports.__wbindgen_init_externref_table = function() {
189
+ const table = wasm.__wbindgen_externrefs;
195
190
  const offset = table.grow(4);
196
191
  table.set(0, undefined);
197
192
  table.set(offset + 0, undefined);
198
193
  table.set(offset + 1, null);
199
194
  table.set(offset + 2, true);
200
195
  table.set(offset + 3, false);
201
- ;
202
196
  };
203
197
 
204
- const path = require('path').join(__dirname, 'index_bg.wasm');
205
- const bytes = require('fs').readFileSync(path);
206
-
207
- const wasmModule = new WebAssembly.Module(bytes);
208
- const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
209
- wasm = wasmInstance.exports;
210
- module.exports.__wasm = wasm;
198
+ const wasmPath = `${__dirname}/index_bg.wasm`;
199
+ const wasmBytes = require('fs').readFileSync(wasmPath);
200
+ const wasmModule = new WebAssembly.Module(wasmBytes);
201
+ const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
211
202
 
212
203
  wasm.__wbindgen_start();
213
-
package/index_bg.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cdk-from-cfn",
3
3
  "description": "Turn AWS CloudFormation templates into AWS CDK applications",
4
- "version": "0.268.0",
4
+ "version": "0.269.0",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",