cdk-common 2.0.383 → 2.0.384

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.
@@ -15,7 +15,7 @@ const delimiter = '-'; // '\x2D'
15
15
 
16
16
  /** Regular expressions */
17
17
  const regexPunycode = /^xn--/;
18
- const regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars
18
+ const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too.
19
19
  const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
20
20
 
21
21
  /** Error messages */
@@ -142,13 +142,13 @@ const ucs2encode = codePoints => String.fromCodePoint(...codePoints);
142
142
  * the code point does not represent a value.
143
143
  */
144
144
  const basicToDigit = function(codePoint) {
145
- if (codePoint - 0x30 < 0x0A) {
146
- return codePoint - 0x16;
145
+ if (codePoint >= 0x30 && codePoint < 0x3A) {
146
+ return 26 + (codePoint - 0x30);
147
147
  }
148
- if (codePoint - 0x41 < 0x1A) {
148
+ if (codePoint >= 0x41 && codePoint < 0x5B) {
149
149
  return codePoint - 0x41;
150
150
  }
151
- if (codePoint - 0x61 < 0x1A) {
151
+ if (codePoint >= 0x61 && codePoint < 0x7B) {
152
152
  return codePoint - 0x61;
153
153
  }
154
154
  return base;
@@ -228,7 +228,7 @@ const decode = function(input) {
228
228
  // which gets added to `i`. The overflow checking is easier
229
229
  // if we increase `i` as we go, then subtract off its starting
230
230
  // value at the end to obtain `delta`.
231
- let oldi = i;
231
+ const oldi = i;
232
232
  for (let w = 1, k = base; /* no condition */; k += base) {
233
233
 
234
234
  if (index >= inputLength) {
@@ -237,7 +237,10 @@ const decode = function(input) {
237
237
 
238
238
  const digit = basicToDigit(input.charCodeAt(index++));
239
239
 
240
- if (digit >= base || digit > floor((maxInt - i) / w)) {
240
+ if (digit >= base) {
241
+ error('invalid-input');
242
+ }
243
+ if (digit > floor((maxInt - i) / w)) {
241
244
  error('overflow');
242
245
  }
243
246
 
@@ -291,7 +294,7 @@ const encode = function(input) {
291
294
  input = ucs2decode(input);
292
295
 
293
296
  // Cache the length.
294
- let inputLength = input.length;
297
+ const inputLength = input.length;
295
298
 
296
299
  // Initialize the state.
297
300
  let n = initialN;
@@ -305,7 +308,7 @@ const encode = function(input) {
305
308
  }
306
309
  }
307
310
 
308
- let basicLength = output.length;
311
+ const basicLength = output.length;
309
312
  let handledCPCount = basicLength;
310
313
 
311
314
  // `handledCPCount` is the number of code points that have been handled;
package/package.json CHANGED
@@ -55,7 +55,7 @@
55
55
  "jsii-pacmak": "^1.73.0",
56
56
  "json-schema": "^0.4.0",
57
57
  "npm-check-updates": "^16",
58
- "projen": "0.67.5",
58
+ "projen": "0.67.6",
59
59
  "standard-version": "^9",
60
60
  "ts-jest": "^27",
61
61
  "typescript": "3.9.10"
@@ -65,7 +65,7 @@
65
65
  "constructs": "^10.0.5"
66
66
  },
67
67
  "dependencies": {
68
- "@aws-cdk/assert": "^2.60.0",
68
+ "@aws-cdk/assert": "^2.61.0",
69
69
  "case": "^1.6.3",
70
70
  "sync-request": "^6.1.0"
71
71
  },
@@ -83,7 +83,7 @@
83
83
  ],
84
84
  "main": "lib/index.js",
85
85
  "license": "Apache-2.0",
86
- "version": "2.0.383",
86
+ "version": "2.0.384",
87
87
  "jest": {
88
88
  "testMatch": [
89
89
  "<rootDir>/src/**/__tests__/**/*.ts?(x)",
@@ -1,24 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target":"ES2020",
4
- "module": "commonjs",
5
- "lib": ["es2016", "es2017.object", "es2017.string"],
6
- "declaration": true,
7
- "composite": true,
8
- "strict": true,
9
- "noImplicitAny": true,
10
- "strictNullChecks": true,
11
- "noImplicitThis": true,
12
- "alwaysStrict": true,
13
- "noUnusedLocals": true,
14
- "noUnusedParameters": true,
15
- "noImplicitReturns": true,
16
- "noFallthroughCasesInSwitch": false,
17
- "inlineSourceMap": true,
18
- "inlineSources": true,
19
- "experimentalDecorators": true,
20
- "strictPropertyInitialization":false
21
- },
22
- "include": ["**/*.ts" ],
23
- "exclude": ["node_modules"]
24
- }