nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: flatpickr/flatpickr
Pull request #1327 (2018-04-11 15:15:52)

Fix init on mobile with enabled confirmDatePlugin
Problem: Initialization for mobile with enabled confirmDatePlugin cause an exception, due to plugin expect property `isMobile` that setuped after plugins initialization.

Solution: setup isMobile before initialize plugins.

- [x] update test to "red"
- [x] fix problem


Patch:
diff --git a/src/index.ts b/src/index.ts
index 170de524..c1f558b6 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1853,6 +1853,17 @@ function FlatpickrInstance(
       self.config.enableTime = true;
     }
 
+    self.isMobile =
+      !self.config.disableMobile &&
+      !self.config.inline &&
+      self.config.mode === "single" &&
+      !self.config.disable.length &&
+      !self.config.enable.length &&
+      !self.config.weekNumbers &&
+      /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
+        navigator.userAgent
+      );
+
     for (let i = 0; i < self.config.plugins.length; i++) {
       const pluginConf = self.config.plugins[i](self) || ({} as Options);
       for (const key in pluginConf) {
@@ -1869,17 +1880,6 @@ function FlatpickrInstance(
       }
     }
 
-    self.isMobile =
-      !self.config.disableMobile &&
-      !self.config.inline &&
-      self.config.mode === "single" &&
-      !self.config.disable.length &&
-      !self.config.enable.length &&
-      !self.config.weekNumbers &&
-      /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
-        navigator.userAgent
-      );
-
     triggerEvent("onParseConfig");
   }
 


Test patch:
diff --git a/src/__tests__/index.spec.ts b/src/__tests__/index.spec.ts
index c671618e..f3b8c2e0 100644
--- a/src/__tests__/index.spec.ts
+++ b/src/__tests__/index.spec.ts
@@ -2,6 +2,7 @@ import flatpickr from "../index";
 import { Russian } from "../l10n/ru";
 import { Instance, DayElement } from "../types/instance";
 import { Options, DateRangeLimit } from "../types/options";
+import confirmDatePlugin from '../plugins/confirmDate/confirmDate';
 
 flatpickr.defaultConfig.animate = false;
 flatpickr.defaultConfig.closeOnSelect = true;
@@ -821,6 +822,13 @@ describe("flatpickr", () => {
           expect(mobileInput.disabled).toBe(true);
           expect(mobileInput.required).toBe(true);
         });
+
+        it('with confirmDatePlugin', () => {
+          mockAgent = 'Android';
+          createInstance({
+            plugins: [confirmDatePlugin({})]
+          });
+        })
       });
     });
Repository: flatpickr/flatpickr
Pull request #2466 (2021-06-05 06:17:43)

[fix] apply positionElement to instance._positionElement when fp.set
Related issue: #2312

### The cause of issue
The fp instance appers based on `self._positionElement`.
When executing `fp.set()`, positionElement value is set to `self.config.positionElement` but no set to `self._positionElement`.

### The fix
Setting `self.config.positionElement` to `self._positionElement` is executed in `setupInputs()` method.
so add `updatePositionElement()` function and call that in `setupInputs()` and `CALLBACKS`



Patch:
diff --git a/src/index.ts b/src/index.ts
index 1e493705..a19acd74 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -2382,6 +2382,7 @@ function FlatpickrInstance(
     showMonths: [buildMonths, setCalendarWidth, buildWeekdays],
     minDate: [jumpToDate],
     maxDate: [jumpToDate],
+    positionElement: [updatePositionElement],
     clickOpens: [
       () => {
         if (self.config.clickOpens === true) {
@@ -2615,6 +2616,10 @@ function FlatpickrInstance(
     if (!self.config.allowInput)
       self._input.setAttribute("readonly", "readonly");
 
+    updatePositionElement();
+  }
+
+  function updatePositionElement() {
     self._positionElement = self.config.positionElement || self._input;
   }
 


Test patch:
diff --git a/__tests__/src/index.spec.ts b/__tests__/src/index.spec.ts
index e22f78f8..f8ba8635 100644
--- a/__tests__/src/index.spec.ts
+++ b/__tests__/src/index.spec.ts
@@ -513,6 +513,10 @@ describe("flatpickr", () => {
 
       fp.set("mode", "range");
       expect(fp.config.mode).toEqual("range");
+
+      const elem = document.createElement("div");
+      fp.set("positionElement", elem);
+      expect(fp._positionElement).toEqual(elem);
     });
 
     it("set() minDate/maxDate updates current view", () => {
Repository: typedorm/typedorm
Pull request #391 (2024-09-22 19:10:19)

feat(core): Add support for autogenerated epoch milliseconds (#390)
Adds a new enum value and generator support for epoch milliseconds fields.


Patch:
diff --git a/README.md b/README.md
index c88d4f8..aeaced6 100644
--- a/README.md
+++ b/README.md
@@ -178,7 +178,7 @@ export class Organisation {
 
 #### Initialize default connection
 
-The connection initialization steps slightly defers when using AWS SDK V2 vs V3.
+The connection initialization steps slightly differs when using AWS SDK V2 vs V3.
 
 ##### When using AWS SDK V2
 
diff --git a/packages/common/src/enums.ts b/packages/common/src/enums.ts
index e74431b..c5a93b9 100644
--- a/packages/common/src/enums.ts
+++ b/packages/common/src/enums.ts
@@ -27,6 +27,7 @@ export enum AUTO_GENERATE_ATTRIBUTE_STRATEGY {
   KSUID = 'KSUID',
   EPOCH_DATE = 'EPOCH_DATE',
   ISO_DATE = 'ISO_DATE',
+  EPOCH_MILLIS = 'EPOCH_MILLIS',
 }
 
 export enum INTERNAL_ENTITY_ATTRIBUTE {
diff --git a/packages/core/src/helpers/auto-generate-attribute-value.ts b/packages/core/src/helpers/auto-generate-attribute-value.ts
index f2ff3c7..a527a8c 100644
--- a/packages/core/src/helpers/auto-generate-attribute-value.ts
+++ b/packages/core/src/helpers/auto-generate-attribute-value.ts
@@ -41,6 +41,9 @@ export function autoGenerateValue(strategy: AUTO_GENERATE_ATTRIBUTE_STRATEGY) {
     case AUTO_GENERATE_ATTRIBUTE_STRATEGY.EPOCH_DATE: {
       return Math.ceil(new Date().valueOf() / 1000);
     }
+    case AUTO_GENERATE_ATTRIBUTE_STRATEGY.EPOCH_MILLIS: {
+      return Date.now();
+    }
     default: {
       throw new UnknownAttributeValueGenerationStrategyError(strategy);
     }


Test patch:
diff --git a/packages/core/src/helpers/__test__/auto-generate-attribute-value.spec.ts b/packages/core/src/helpers/__test__/auto-generate-attribute-value.spec.ts
index 4032c13..bc86fb3 100644
--- a/packages/core/src/helpers/__test__/auto-generate-attribute-value.spec.ts
+++ b/packages/core/src/helpers/__test__/auto-generate-attribute-value.spec.ts
@@ -34,6 +34,15 @@ test('returns generated attribute value using iso date strategy', () => {
   expect(value).toEqual('2020-01-01T00:00:00.000Z');
 });
 
+test('returns generated attribute value using epoch strategy', () => {
+  jest.useFakeTimers().setSystemTime(new Date('2020-01-01'));
+
+  const value = autoGenerateValue(
+    AUTO_GENERATE_ATTRIBUTE_STRATEGY.EPOCH_MILLIS
+  );
+  expect(value).toEqual(1577836800000);
+});
+
 test('throws for unknown strategy', () => {
   const valueCreator = () => autoGenerateValue('INVALID' as any);
Repository: bxcodec/faker
Pull request #150 (2021-10-21 20:05:13)

fix docs for randomInt and update code to support documented third argument
The documentation on randomInt was confusing and said it could accept a third parameter. In reality, it threw an error if you gave a third parameter. This change makes that third parameter work and rewords the documentation.

("Number of digits" suggested that it was about 1-digit numbers like 7 versus 3-digit numbers like 152. It's about the minimum integer and maximum integer, though, so I changed the docs and variable names to reflect that.)



Patch:
diff --git a/faker.go b/faker.go
index 33b8556..410d929 100644
--- a/faker.go
+++ b/faker.go
@@ -1161,24 +1161,34 @@ func randomStringNumber(n int) string {
 }
 
 // RandomInt Get three parameters , only first mandatory and the rest are optional
-// 		If only set one parameter :  This means the minimum number of digits and the total number
-// 		If only set two parameters : First this is min digit and second max digit and the total number the difference between them
-// 		If only three parameters: the third argument set Max count Digit
+// (minimum_int, maximum_int, count)
+// 		If only set one parameter :  An integer greater than minimum_int will be returned
+// 		If only set two parameters : All integers between minimum_int and maximum_int will be returned, in a random order.
+// 		If three parameters: `count` integers between minimum_int and maximum_int will be returned.
 func RandomInt(parameters ...int) (p []int, err error) {
 	switch len(parameters) {
 	case 1:
-		minCount := parameters[0]
-		p = rand.Perm(minCount)
+		minInt := parameters[0]
+		p = rand.Perm(minInt)
 		for i := range p {
-			p[i] += minCount
+			p[i] += minInt
 		}
 	case 2:
-		minDigit, maxDigit := parameters[0], parameters[1]
-		p = rand.Perm(maxDigit - minDigit + 1)
+		minInt, maxInt := parameters[0], parameters[1]
+		p = rand.Perm(maxInt - minInt + 1)
 
 		for i := range p {
-			p[i] += minDigit
+			p[i] += minInt
 		}
+	case 3:
+		minInt, maxInt := parameters[0], parameters[1]
+		count := parameters[2]
+		p = rand.Perm(maxInt - minInt + 1)
+
+		for i := range p {
+			p[i] += minInt
+		}
+		p = p[0:count]
 	default:
 		err = fmt.Errorf(ErrMoreArguments, len(parameters))
 	}


Test patch:
diff --git a/faker_test.go b/faker_test.go
index e50d4ed..0d3c977 100644
--- a/faker_test.go
+++ b/faker_test.go
@@ -857,6 +857,25 @@ func TestRandomIntOnlySecondParameters(t *testing.T) {
 	}
 }
 
+func TestRandomIntThreeParameters(t *testing.T) {
+	first := rand.Intn(50)
+	second := rand.Intn(100) + first
+	third := rand.Intn(5)
+	res, _ := RandomInt(first, second, third)
+	if len(res) != (third) {
+		t.Errorf("Incorrect number of results returned. Expected %v. Got %v.", third, len(res))
+	}
+
+	for _, v := range res {
+		if v < first {
+			t.Errorf("Found value %v below minimum %v.", v, first)
+		}
+		if v > second {
+			t.Errorf("Found value %v above maximum %v.", v, second)
+		}
+	}
+}
+
 func TestRandomIntOnlyError(t *testing.T) {
 	arguments := []int{1, 3, 4, 5, 6}
 	_, err := RandomInt(arguments...)
Repository: aws-actions/configure-aws-credentials
Pull request #26 (2020-02-11 23:59:13)

fix: change sanitization character from '*' to '_' for assume role tags
Tags must conform to the pattern `[\p{L}\p{Z}\p{N}_.:/=+\-@]*`, so replacing with `*` isn't sufficient for sanitization.

I think underscore should work fine.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.



Patch:
diff --git a/index.js b/index.js
index 94db945..a6dd5e2 100644
--- a/index.js
+++ b/index.js
@@ -8,7 +8,7 @@ const util = require('util');
 const MAX_ACTION_RUNTIME = 6 * 3600;
 const USER_AGENT = 'configure-aws-credentials-for-github-actions';
 const MAX_TAG_VALUE_LENGTH = 256;
-const SANITIZATION_CHARACTER = '*'
+const SANITIZATION_CHARACTER = '_'
 
 async function assumeRole(params) {
   // Assume a role to get short-lived credentials using longer-lived credentials.


Test patch:
diff --git a/index.test.js b/index.test.js
index ede3904..4fd6747 100644
--- a/index.test.js
+++ b/index.test.js
@@ -23,7 +23,7 @@ const ENVIRONMENT_VARIABLE_OVERRIDES = {
     GITHUB_REF: 'MY-BRANCH',
     GITHUB_SHA: 'MY-COMMIT-ID',
 };
-const GITHUB_ACTOR_SANITIZED = 'MY-USERNAME*bot*'
+const GITHUB_ACTOR_SANITIZED = 'MY-USERNAME_bot_'
 
 function mockGetInput(requestResponse) {
     return function (name, options) { // eslint-disable-line no-unused-vars
@@ -245,7 +245,7 @@ describe('Configure AWS Credentials', () => {
         
         process.env = {...process.env, GITHUB_WORKFLOW: 'Workflow!"#$%&\'()*+, -./:;<=>?@[]^_`{|}~🙂💥🍌1yFvMOeD3ZHYsHrGjCceOboMYzBPo0CRNFdcsVRG6UgR3A912a8KfcBtEVvkAS7kRBq80umGff8mux5IN1y55HQWPNBNyaruuVr4islFXte4FDQZexGJRUSMyHQpxJ8OmZnET84oDmbvmIjgxI6IBrdihX9PHMapT4gQvRYnLqNiKb18rEMWDNoZRy51UPX5sWK2GKPipgKSO9kqLckZai9D2AN2RlWCxtMqChNtxuxjqeqhoQZo0oaq39sjcRZgAAAAAAA'};
 
-        const sanitizedWorkflowName = 'Workflow**********+, -./:;<=>?@***_********1yFvMOeD3ZHYsHrGjCceOboMYzBPo0CRNFdcsVRG6UgR3A912a8KfcBtEVvkAS7kRBq80umGff8mux5IN1y55HQWPNBNyaruuVr4islFXte4FDQZexGJRUSMyHQpxJ8OmZnET84oDmbvmIjgxI6IBrdihX9PHMapT4gQvRYnLqNiKb18rEMWDNoZRy51UPX5sWK2GKPipgKSO9kqLckZa'
+        const sanitizedWorkflowName = 'Workflow__________+, -./:;<=>?@____________1yFvMOeD3ZHYsHrGjCceOboMYzBPo0CRNFdcsVRG6UgR3A912a8KfcBtEVvkAS7kRBq80umGff8mux5IN1y55HQWPNBNyaruuVr4islFXte4FDQZexGJRUSMyHQpxJ8OmZnET84oDmbvmIjgxI6IBrdihX9PHMapT4gQvRYnLqNiKb18rEMWDNoZRy51UPX5sWK2GKPipgKSO9kqLckZa'
 
         await run();
         expect(mockStsAssumeRole).toHaveBeenCalledWith({
Repository: aws-actions/configure-aws-credentials
Pull request #44 (2020-03-06 21:57:20)

fix: validate region input string
Related to #43 

Use a fairly permissive regex to check if the given region could feasibly be a valid region string.  Whether it is actually a valid region will be checked when `https://sts.$region.amazonaws.com` is called to get the account ID.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.



Patch:
diff --git a/index.js b/index.js
index b4455d9..3efaab2 100644
--- a/index.js
+++ b/index.js
@@ -10,6 +10,7 @@ const USER_AGENT = 'configure-aws-credentials-for-github-actions';
 const MAX_TAG_VALUE_LENGTH = 256;
 const SANITIZATION_CHARACTER = '_';
 const ROLE_SESSION_NAME = 'GitHubActions';
+const REGION_REGEX = /^[a-z0-9-]+$/g;
 
 async function assumeRole(params) {
   // Assume a role to get short-lived credentials using longer-lived credentials.
@@ -151,6 +152,10 @@ async function run() {
     const roleDurationSeconds = core.getInput('role-duration-seconds', {required: false}) || MAX_ACTION_RUNTIME;
     const roleSessionName = core.getInput('role-session-name', { required: false }) || ROLE_SESSION_NAME;
 
+    if (!region.match(REGION_REGEX)) {
+      throw new Error(`Region is not valid: ${region}`);
+    }
+
     exportRegion(region);
 
     // Always export the source credentials and account ID.


Test patch:
diff --git a/index.test.js b/index.test.js
index f3f24aa..bc06e22 100644
--- a/index.test.js
+++ b/index.test.js
@@ -154,6 +154,19 @@ describe('Configure AWS Credentials', () => {
         expect(core.setSecret).toHaveBeenCalledWith(FAKE_ACCOUNT_ID);
     });
 
+    test('validates region name', async () => {
+        process.env.SHOW_STACK_TRACE = 'false';
+
+        const mockInputs = {...CREDS_INPUTS, 'aws-region': '$AWS_REGION'};
+        core.getInput = jest
+            .fn()
+            .mockImplementation(mockGetInput(mockInputs));
+
+        await run();
+
+        expect(core.setFailed).toHaveBeenCalledWith('Region is not valid: $AWS_REGION');
+    });
+
     test('can opt out of masking account ID', async () => {
         const mockInputs = {...CREDS_INPUTS, 'aws-region': 'us-east-1', 'mask-aws-account-id': 'false'};
         core.getInput = jest
Repository: aws-actions/configure-aws-credentials
Pull request #78 (2020-06-17 00:18:48)

fix: add comma to set of special characters
Fixes: #77 


This change  makes it so the regular expression also matches commas


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.



Patch:
diff --git a/index.js b/index.js
index 9b0cc52..068db30 100644
--- a/index.js
+++ b/index.js
@@ -82,7 +82,7 @@ function sanitizeGithubWorkflowName(name) {
   // Workflow names can be almost any valid UTF-8 string, but tags are more restrictive.
   // This replaces anything not conforming to the tag restrictions by inverting the regular expression.
   // See the AWS documentation for constraint specifics https://docs.aws.amazon.com/STS/latest/APIReference/API_Tag.html.
-  const nameWithoutSpecialCharacters = name.replace(/[^\p{L}\p{Z}\p{N}_.:/=+-@]/gu, SANITIZATION_CHARACTER);
+  const nameWithoutSpecialCharacters = name.replace(/[^\p{L}\p{Z}\p{N}_:/=+.-@-]/gu, SANITIZATION_CHARACTER);
   const nameTruncated = nameWithoutSpecialCharacters.slice(0, MAX_TAG_VALUE_LENGTH)
   return nameTruncated
 }


Test patch:
diff --git a/index.test.js b/index.test.js
index 8fb01a7..22a254f 100644
--- a/index.test.js
+++ b/index.test.js
@@ -504,7 +504,7 @@ describe('Configure AWS Credentials', () => {
 
         process.env = {...process.env, GITHUB_WORKFLOW: 'Workflow!"#$%&\'()*+, -./:;<=>?@[]^_`{|}~🙂💥🍌1yFvMOeD3ZHYsHrGjCceOboMYzBPo0CRNFdcsVRG6UgR3A912a8KfcBtEVvkAS7kRBq80umGff8mux5IN1y55HQWPNBNyaruuVr4islFXte4FDQZexGJRUSMyHQpxJ8OmZnET84oDmbvmIjgxI6IBrdihX9PHMapT4gQvRYnLqNiKb18rEMWDNoZRy51UPX5sWK2GKPipgKSO9kqLckZai9D2AN2RlWCxtMqChNtxuxjqeqhoQZo0oaq39sjcRZgAAAAAAA'};
 
-        const sanitizedWorkflowName = 'Workflow__________+, -./:;<=>?@____________1yFvMOeD3ZHYsHrGjCceOboMYzBPo0CRNFdcsVRG6UgR3A912a8KfcBtEVvkAS7kRBq80umGff8mux5IN1y55HQWPNBNyaruuVr4islFXte4FDQZexGJRUSMyHQpxJ8OmZnET84oDmbvmIjgxI6IBrdihX9PHMapT4gQvRYnLqNiKb18rEMWDNoZRy51UPX5sWK2GKPipgKSO9kqLckZa'
+        const sanitizedWorkflowName = 'Workflow__________+_ -./:;<=>?@____________1yFvMOeD3ZHYsHrGjCceOboMYzBPo0CRNFdcsVRG6UgR3A912a8KfcBtEVvkAS7kRBq80umGff8mux5IN1y55HQWPNBNyaruuVr4islFXte4FDQZexGJRUSMyHQpxJ8OmZnET84oDmbvmIjgxI6IBrdihX9PHMapT4gQvRYnLqNiKb18rEMWDNoZRy51UPX5sWK2GKPipgKSO9kqLckZa'
 
         await run();
         expect(mockStsAssumeRole).toHaveBeenCalledWith({
Repository: aws-actions/configure-aws-credentials
Pull request #209 (2021-05-11 18:29:38)

fix: skips session tagging
This PR fix the issue #199

Description of changes:
This issue was occurring due to incorrect data type of the `role-skip-session-tagging` parameter.
In order to fix this issue need to type caste the value of the `role-skip-session-tagging `parameter from string to boolean.

when `role-skip-session-tagging` is false

<img width="381" alt="Screen Shot 2021-05-11 at 2 53 31 PM" src="https://user-images.githubusercontent.com/18301288/117869441-cd8f5e00-b268-11eb-9ab2-ff2ffc3b4c47.png">

when `role-skip-session-tagging` is true

<img width="388" alt="Screen Shot 2021-05-11 at 2 53 11 PM" src="https://user-images.githubusercontent.com/18301288/117869443-cd8f5e00-b268-11eb-8fe9-ea81470c186e.png">



Patch:
diff --git a/index.js b/index.js
index 5aa4bb7..018aac3 100644
--- a/index.js
+++ b/index.js
@@ -57,6 +57,12 @@ async function assumeRole(params) {
 
   const roleSessionTags = roleSkipSessionTagging ? undefined : tagArray;
 
+  if(roleSessionTags == undefined){
+    core.debug("Role session tagging has been skipped.")
+  } else {
+    core.debug(roleSessionTags.length + " role session tags are being used.")
+  }
+
   const assumeRoleRequest = {
     RoleArn: roleArn,
     RoleSessionName: roleSessionName,
@@ -203,8 +209,9 @@ async function run() {
     const roleExternalId = core.getInput('role-external-id', { required: false });
     const roleDurationSeconds = core.getInput('role-duration-seconds', {required: false}) || MAX_ACTION_RUNTIME;
     const roleSessionName = core.getInput('role-session-name', { required: false }) || ROLE_SESSION_NAME;
-    const roleSkipSessionTagging = core.getInput('role-skip-session-tagging', { required: false });
-  
+    const roleSkipSessionTaggingInput = core.getInput('role-skip-session-tagging', { required: false })|| 'false';
+    const roleSkipSessionTagging = roleSkipSessionTaggingInput.toLowerCase() === 'true';
+
     if (!region.match(REGION_REGEX)) {
       throw new Error(`Region is not valid: ${region}`);
     }


Test patch:
diff --git a/index.test.js b/index.test.js
index 8fa322a..f2295c9 100644
--- a/index.test.js
+++ b/index.test.js
@@ -559,7 +559,7 @@ describe('Configure AWS Credentials', () => {
     test('skip tagging provided as true', async () => {
         core.getInput = jest
             .fn()
-            .mockImplementation(mockGetInput({...ASSUME_ROLE_INPUTS, 'role-skip-session-tagging': true}));
+            .mockImplementation(mockGetInput({...ASSUME_ROLE_INPUTS, 'role-skip-session-tagging': 'true'}));
 
         await run();
         expect(mockStsAssumeRole).toHaveBeenCalledWith({
@@ -573,7 +573,7 @@ describe('Configure AWS Credentials', () => {
     test('skip tagging provided as false', async () => {
         core.getInput = jest
             .fn()
-            .mockImplementation(mockGetInput({...ASSUME_ROLE_INPUTS, 'role-skip-session-tagging': false}));
+            .mockImplementation(mockGetInput({...ASSUME_ROLE_INPUTS, 'role-skip-session-tagging': 'false'}));
 
         await run();
         expect(mockStsAssumeRole).toHaveBeenCalledWith({
Repository: sql-formatter-org/sql-formatter
Pull request #400 (2022-08-17 19:25:43)

Remove braces and brackets from operators
Another small thing I discovered when working with Nearley integration.

This can cause ambiguity in parser, and really they shouldn't have been there in the first place.

This is somewhat of a breaking change, in a sense that code that got previously formatted without crashing will now cause an error to be thrown. But that'll only effect you when you used a `langauge` option that didn't support curly-bracws/square-brackets to parse code which contained them.


Patch:
diff --git a/src/lexer/Tokenizer.ts b/src/lexer/Tokenizer.ts
index 90f8a9e0..223aa9e5 100644
--- a/src/lexer/Tokenizer.ts
+++ b/src/lexer/Tokenizer.ts
@@ -106,7 +106,7 @@ export default class Tokenizer {
       },
       [TokenType.DELIMITER]: { regex: /[;]/uy },
       [TokenType.OPERATOR]: {
-        regex: regex.operator('+-/%&|^><=.:$@#?~![]{}', [
+        regex: regex.operator('+-/%&|^><=.:$@#?~!', [
           '<>',
           '<=',
           '>=',


Test patch:
diff --git a/test/sql.test.ts b/test/sql.test.ts
index aae81c0a..a2f42e19 100644
--- a/test/sql.test.ts
+++ b/test/sql.test.ts
@@ -60,17 +60,25 @@ describe('SqlFormatter', () => {
   it('does not crash when encountering characters or operators it does not recognize', () => {
     expect(
       format(`
-        SELECT @name, :bar FROM {foo};
+        SELECT @name, :bar FROM foo;
       `)
     ).toBe(dedent`
       SELECT
         @ name,
       : bar
       FROM
-        { foo };
+        foo;
     `);
   });
 
+  it('crashes when encountering unsupported curly braces', () => {
+    expect(() =>
+      format(`
+        SELECT {foo};
+      `)
+    ).toThrowError('Parse error: Unexpected "{foo};');
+  });
+
   it('formats ALTER TABLE ... ALTER COLUMN', () => {
     expect(
       format(