nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: League-of-Foundry-Developers/foundry-vtt-types
Pull request #3175 (2025-02-17 02:34:43)

Minor improvement to PointSourcePolygon tests
account for default mode in PSP#testCollision. noticed this when WallsLayer had a deprecated wrapper to this method.


Patch:
diff --git a/src/foundry/client/pixi/core/shapes/source-polygon.d.mts b/src/foundry/client/pixi/core/shapes/source-polygon.d.mts
index af3d361a5..ce9181171 100644
--- a/src/foundry/client/pixi/core/shapes/source-polygon.d.mts
+++ b/src/foundry/client/pixi/core/shapes/source-polygon.d.mts
@@ -1,4 +1,4 @@
-import type { Brand, InexactPartial, NullishProps } from "fvtt-types/utils";
+import type { Brand, Coalesce, InexactPartial, NullishProps } from "fvtt-types/utils";
 import type PointEffectSourceMixin from "../../../../client-esm/canvas/sources/point-effect-source.d.mts";
 
 declare global {
@@ -120,11 +120,11 @@ declare global {
      *          * all: returns a sorted array of PolygonVertex instances
      *          * closest: returns a PolygonVertex instance or null
      */
-    static testCollision<Mode extends PointSourcePolygon.CollisionModes>(
+    static testCollision<Mode extends PointSourcePolygon.CollisionModes | undefined = undefined>(
       origin: Canvas.Point,
       destination: Canvas.Point,
       { mode, ...config }: PointSourcePolygon.TestCollisionConfig<Mode>,
-    ): PointSourcePolygon.TestCollision<Mode>;
+    ): PointSourcePolygon.TestCollision<Coalesce<Mode, "all">>;
 
     /**
      * Determine the set of collisions which occurs for a Ray.


Test patch:
diff --git a/tests/foundry/client/pixi/perception/clockwise-sweep.test-d.ts b/tests/foundry/client/pixi/perception/clockwise-sweep.test-d.ts
index 927a3989e..8874cc983 100644
--- a/tests/foundry/client/pixi/perception/clockwise-sweep.test-d.ts
+++ b/tests/foundry/client/pixi/perception/clockwise-sweep.test-d.ts
@@ -9,6 +9,7 @@ declare const someCircle: PIXI.Circle;
 declare const someEdge: foundry.canvas.edges.Edge;
 declare const somePV: foundry.canvas.edges.PolygonVertex;
 
+expectTypeOf(ClockwiseSweepPolygon.testCollision(pointA, pointB, { type: "light" })).toEqualTypeOf<PolygonVertex[]>();
 expectTypeOf(
   ClockwiseSweepPolygon.testCollision(pointA, pointB, { mode: "any", type: "light" }),
 ).toEqualTypeOf<boolean>();
Repository: washingtonpost/ans-schema
Pull request #132 (2017-04-24 20:51:37)

Fixes bug in upverter where empty string status code gets converted t…


Patch:
diff --git a/lib/upvert/0.5.7.js b/lib/upvert/0.5.7.js
index 5d24072..bb51a1e 100644
--- a/lib/upvert/0.5.7.js
+++ b/lib/upvert/0.5.7.js
@@ -141,8 +141,11 @@ var workflowFromPlanning = function workflowFromPlanning(old_planning) {
   var workflow = {};
   var modified = false;
   if (_.has(old_planning, 'additional_properties.status.workflow')) {
-    workflow.status_code = _.toInteger(_.get(old_planning, 'additional_properties.status.workflow'));
-    modified = true;
+    var old_status = _.get(old_planning, 'additional_properties.status.workflow');
+    if (_.toInteger(old_status) >= 1) {
+      workflow.status_code = _.toInteger(old_status);
+      modified = true;
+    }
   }
   if (_.has(old_planning, 'additional_properties.status.note')) {
     workflow.note = '' + _.get(old_planning, 'additional_properties.status.note');


Test patch:
diff --git a/tests/fixtures/transforms/0.5.7/story-fixture-planning-status-code-is-invalid.json b/tests/fixtures/transforms/0.5.7/story-fixture-planning-status-code-is-invalid.json
new file mode 100644
index 0000000..baea31c
--- /dev/null
+++ b/tests/fixtures/transforms/0.5.7/story-fixture-planning-status-code-is-invalid.json
@@ -0,0 +1,36 @@
+{
+  "type": "story",
+  "version": "0.5.7",
+  "content_elements": [
+    {
+      "type": "text",
+      "content": "Plans are in motion."
+    }
+  ],
+  "headlines": {
+    "basic": "A simple story with big plans.."
+  },
+
+  "planning": {
+    "scheduling": {
+      "planned_publish_date": "2015-06-24T09:49:00.10Z",
+      "scheduled_publish_date": "2015-06-24T09:49:00.10Z",
+      "will_have_gallery": true,
+      "will_have_graphic": false,
+      "will_have_image": true,
+      "will_have_video": false
+    },
+    "story_length": {
+      "word_count_planned": 2400,
+      "word_count_actual": 3000,
+      "inch_count_planned": 6,
+      "inch_count_actual": 8
+    },
+    "additional_properties": {
+      "status": {
+        "workflow": "",
+        "note": "This is a private note."
+      }
+    }
+  }
+}
diff --git a/tests/transform-tests.js b/tests/transform-tests.js
index 4d1cedd..803a651 100644
--- a/tests/transform-tests.js
+++ b/tests/transform-tests.js
@@ -648,6 +648,14 @@ describe("Transformations: ", function() {
           result.workflow.note.should.eql("This is a private note.");
         });
 
+        it("should not add workflow status code of 0", function() {
+          var result = transforms.upvert(fixtures['0.5.7']['story-fixture-planning-status-code-is-invalid'], '0.5.8');
+
+          result.workflow.should.not.have.property('status_code');
+          result.workflow.note.should.eql("This is a private note.");
+        });
+
+
       });
 
       it("should not drop fields", function() {
Repository: showdownjs/showdown
Pull request #628 (2018-12-15 18:50:30)

fix(extension-registering) removeExtension implementation
Was trying to make a type safe version of showdown (https://github.com/dennisss/showdown/tree/ts) and spotted this error.


Patch:
diff --git a/src/converter.js b/src/converter.js
index 06550fa..983e648 100644
--- a/src/converter.js
+++ b/src/converter.js
@@ -532,12 +532,12 @@ showdown.Converter = function (converterOptions) {
       var ext = extension[a];
       for (var i = 0; i < langExtensions.length; ++i) {
         if (langExtensions[i] === ext) {
-          langExtensions[i].splice(i, 1);
+          langExtensions.splice(i, 1);
         }
       }
-      for (var ii = 0; ii < outputModifiers.length; ++i) {
+      for (var ii = 0; ii < outputModifiers.length; ++ii) {
         if (outputModifiers[ii] === ext) {
-          outputModifiers[ii].splice(i, 1);
+          outputModifiers.splice(ii, 1);
         }
       }
     }


Test patch:
diff --git a/test/unit/showdown.Converter.js b/test/unit/showdown.Converter.js
index b6ee9ee..0b8c7e0 100644
--- a/test/unit/showdown.Converter.js
+++ b/test/unit/showdown.Converter.js
@@ -122,6 +122,14 @@ describe('showdown.Converter', function () {
       converter.getAllExtensions().language.should.contain(extObjMock);
       showdown.resetExtensions();
     });
+
+    it('removeExtension() should remove an added extension', function () {
+      var converter = new showdown.Converter();
+      converter.addExtension(extObjMock);
+
+      converter.removeExtension(extObjMock);
+      converter.getAllExtensions().language.should.not.contain(extObjMock);
+    });
   });
 
   describe('events', function () {