nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: ViacomInc/data-point
Pull request #44 (2017-12-13 16:25:39)

Do not pass original acc.value into _.defaults
#43


Patch:
diff --git a/packages/data-point/lib/core/transform.js b/packages/data-point/lib/core/transform.js
index dd3f04c..f9c6c49 100644
--- a/packages/data-point/lib/core/transform.js
+++ b/packages/data-point/lib/core/transform.js
@@ -14,15 +14,12 @@ function getOptions (spec) {
 }
 
 function resolve (manager, transformSource, value, options) {
-  const values = manager.values.getStore()
-
   const contextOptions = getOptions(options)
-
   const context = AccumulatorFactory.create({
-    value: _.defaults(value, {}),
+    value: value,
     locals: contextOptions.locals,
     trace: contextOptions.trace,
-    values
+    values: manager.values.getStore()
   })
 
   const transform = TransformExpression.create(transformSource)


Test patch:
diff --git a/packages/data-point/lib/core/transform.test.js b/packages/data-point/lib/core/transform.test.js
index 61047e1..130410a 100644
--- a/packages/data-point/lib/core/transform.test.js
+++ b/packages/data-point/lib/core/transform.test.js
@@ -32,6 +32,94 @@ test('transform - throw error in invalid id(promise)', () => {
     })
 })
 
+describe('transform - should attach input value to accumulator', () => {
+  test('passing undefined', () => {
+    return transform(dataPoint, acc => {
+      expect(acc.value).toBe(undefined)
+    })
+  })
+
+  test('passing 0', () => {
+    return transform(
+      dataPoint,
+      acc => {
+        expect(acc.value).toBe(0)
+      },
+      0
+    )
+  })
+
+  test('passing 1', () => {
+    return transform(
+      dataPoint,
+      acc => {
+        expect(acc.value).toBe(1)
+      },
+      1
+    )
+  })
+
+  test('passing empty string', () => {
+    return transform(
+      dataPoint,
+      acc => {
+        expect(acc.value).toBe('')
+      },
+      ''
+    )
+  })
+
+  test('passing a string', () => {
+    return transform(
+      dataPoint,
+      acc => {
+        expect(acc.value).toBe('Hello World')
+      },
+      'Hello World'
+    )
+  })
+
+  test('passing false', () => {
+    return transform(
+      dataPoint,
+      acc => {
+        expect(acc.value).toBe(false)
+      },
+      false
+    )
+  })
+
+  test('passing true', () => {
+    return transform(
+      dataPoint,
+      acc => {
+        expect(acc.value).toBe(true)
+      },
+      true
+    )
+  })
+
+  test('passing an array', () => {
+    return transform(
+      dataPoint,
+      acc => {
+        expect(acc.value).toEqual(['Hello World'])
+      },
+      ['Hello World']
+    )
+  })
+
+  test('passing an object', () => {
+    return transform(
+      dataPoint,
+      acc => {
+        expect(acc.value).toEqual({ message: 'Hello World' })
+      },
+      { message: 'Hello World' }
+    )
+  })
+})
+
 test('transform - single reducer', () => {
   const reducer = (acc, next) => {
     next(null, acc.value + ' World')
Repository: ViacomInc/data-point
Pull request #97 (2018-01-01 15:53:57)

Use default when ReducerPath.name is empty string
<!-- What changes are being made? (What feature/bug is being fixed here?) -->
**What**: Do not use _.defaultTo when setting ReducerPath#name

<!-- Why are these changes necessary? -->
**Why**: _.defaultTo does not replace empty strings, so the `'$'` reducer path would end up with an empty string for its name.

<!-- Have you done all of these things?  -->
**Checklist**:
<!-- add "N/A" to the end of each line that's irrelevant to your changes -->
<!-- to check an item, place an "x" in the box like so: "- [x] Documentation" -->
- [ ] Documentation n/a
- [x] Tests
- [x] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->

coveralls: 
[![Coverage Status](https://coveralls.io/builds/14858682/badge)](https://coveralls.io/builds/14858682)

Coverage remained the same at 100.0% when pulling **7c40f649c5c744c344d82f1b61204e88f634af5f on raingerber:fix-default-reducer-path-name** into **ce851a75793d16daa4a25fe904295218e6b7245c on ViacomInc:master**.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/14865052/badge)](https://coveralls.io/builds/14865052)

Coverage increased (+0.06%) to 100.0% when pulling **482e9d41f745b015243f7181ebbddc8ca45c66a8 on raingerber:fix-default-reducer-path-name** into **deb5b1e66ae719c6840d99473ad3e27f9941deb3 on ViacomInc:master**.


Patch:
diff --git a/packages/data-point/lib/reducer-path/factory.js b/packages/data-point/lib/reducer-path/factory.js
index f517de0..4deec6d 100644
--- a/packages/data-point/lib/reducer-path/factory.js
+++ b/packages/data-point/lib/reducer-path/factory.js
@@ -110,7 +110,7 @@ function create (source) {
   const reducer = new ReducerPath()
 
   reducer.asCollection = source.slice(-2) === '[]'
-  reducer.name = _.defaultTo(source.substr(1), '.').replace(/\[]$/, '')
+  reducer.name = (source.substr(1) || '.').replace(/\[]$/, '')
   reducer.body = getPathReducerFunction(reducer.name, reducer.asCollection)
 
   return Object.freeze(reducer)


Test patch:
diff --git a/packages/data-point/lib/reducer-path/factory.test.js b/packages/data-point/lib/reducer-path/factory.test.js
index 14aef8b..331ecaf 100644
--- a/packages/data-point/lib/reducer-path/factory.test.js
+++ b/packages/data-point/lib/reducer-path/factory.test.js
@@ -67,6 +67,14 @@ describe('reducer/reducer-path#create', () => {
     const reducer = factory.create('$a')
     expect(reducer.type).toBe('ReducerPath')
     expect(reducer.name).toBe('a')
+    expect(reducer.asCollection).toBe(false)
+  })
+
+  it('empty path', () => {
+    const reducer = factory.create('$')
+    expect(reducer.type).toBe('ReducerPath')
+    expect(reducer.name).toBe('.')
+    expect(reducer.asCollection).toBe(false)
   })
 
   it('compound path', () => {
Repository: ViacomInc/data-point
Pull request #171 (2018-01-23 20:04:20)

refactor(pacakges/data-point/lib/reducer-types/reducer-entity/factory…
….js): Changed this.withEmptyCon

#143

<!--
Thanks for your interest in the project. We appreciate bugs filed and PRs submitted!

Please make sure that you are familiar with and follow the Code of Conduct for
this project (found in the CODE_OF_CONDUCT.md file).

Also, please make sure you're familiar with and follow the instructions in the
contributing guidelines (found in the CONTRIBUTING.md file).

Please fill out the information below to expedite the review and (hopefully)
merge of your pull request!
-->

<!-- What changes are being made? (What feature/bug is being fixed here?) -->
**What**:  Changed  this.withEmptyConditional to this.hasEmptyConditional in Reducer Entity

<!-- Why are these changes necessary? -->
**Why**: To prevent reduncancy

<!-- How were these changes implemented? -->
**How**: Replaced this.withEmptyConditional with this.hasEmptyConditional in line 19

<!-- Have you done all of these things?  -->
**Checklist**:
<!-- add "N/A" to the end of each line that's irrelevant to your changes -->
<!-- to check an item, place an "x" in the box like so: "- [x] Documentation" -->
- [x] Documentation
- [x] Tests
- [x] Ready to be merged <!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->
- [ ] Added username to **all-contributors** list

<!-- feel free to add additional comments -->


coveralls: 
[![Coverage Status](https://coveralls.io/builds/15185289/badge)](https://coveralls.io/builds/15185289)

Coverage remained the same at 100.0% when pulling **ba823183138b7eb862f257b50fc3525590bac338 on victorsingh:refector/reducer-entitiy-withEmptyConditional-property** into **ae1db444a485e2fbabf4839c279da5ecd36b7cf0 on ViacomInc:master**.


Patch:
diff --git a/packages/data-point/lib/reducer-types/reducer-entity/factory.js b/packages/data-point/lib/reducer-types/reducer-entity/factory.js
index 92dd186..1a0bca6 100644
--- a/packages/data-point/lib/reducer-types/reducer-entity/factory.js
+++ b/packages/data-point/lib/reducer-types/reducer-entity/factory.js
@@ -16,7 +16,7 @@ function ReducerEntity () {
   this.name = ''
   this.entityType = null
   this.asCollection = false
-  this.withEmptyConditional = false
+  this.hasEmptyConditional = false
 }
 
 module.exports.ReducerEntity = ReducerEntity


Test patch:
diff --git a/packages/data-point/lib/reducer-types/reducer-object/__snapshots__/factory.test.js.snap b/packages/data-point/lib/reducer-types/reducer-object/__snapshots__/factory.test.js.snap
index 530a4f5..5cf1525 100644
--- a/packages/data-point/lib/reducer-types/reducer-object/__snapshots__/factory.test.js.snap
+++ b/packages/data-point/lib/reducer-types/reducer-object/__snapshots__/factory.test.js.snap
@@ -56,7 +56,6 @@ Array [
             "id": "transform:entity-name",
             "name": "entity-name",
             "type": "ReducerEntity",
-            "withEmptyConditional": false,
             Symbol(reducer): true,
           },
         },