Repository: ViacomInc/data-point (js)

Issue:
Export type check function separately from reducer helpers
**Problem description**:

We export type check functions (`isString`, `isNumber`, etc) in the same object as the reducer helpers. However, these are just plain functions whereas the reducer helpers generate a "reducer stub":

https://github.com/ViacomInc/data-point/blob/master/packages/data-point/lib/helpers/helpers.js#L19

**Suggested solution**:

Functions that return a "stub" should be exported in a single object, and the type check functions should be exported in a separate object (something like `DataPoint.typeCheckFunctions`?). 

Another solution is to just stop exporting these functions completely, because they're already used internally for creating the `inputType` and `outputType` reducers. These functions have not technically been released yet, so it might be good to keep them internal for now and export them later if that becomes necessary.



Pull request description:
feat(data-point/helpers): Do not export type check functions

<!-- What changes are being made? (What feature/bug is being fixed here?) -->
**What**: closes #215; this would be a breaking change, accept that we haven't done a release with these type check functions in the public API

<!-- Why are these changes necessary? -->
**Why**: the type check functions are used internally, but exporting them probably does not add much value

<!-- How were these changes implemented? -->
**How**: removed type check functions from export object

<!-- 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" -->
- [ ] Has Breaking changes
- [ ] 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 -->


Patch:
diff --git a/packages/data-point/lib/helpers/helpers.js b/packages/data-point/lib/helpers/helpers.js
index 8d39ac2..59b27a0 100644
--- a/packages/data-point/lib/helpers/helpers.js
+++ b/packages/data-point/lib/helpers/helpers.js
@@ -4,7 +4,6 @@ const resolveReducer = require('../reducer-types').resolve
 const AccumulatorFactory = require('../accumulator/factory')
 
 const { stubFactories } = require('../reducer-types/reducer-helpers')
-const typeCheckFunctionReducers = require('./type-check-functions')
 
 module.exports.helpers = {
   assign: stubFactories.assign,
@@ -15,14 +14,7 @@ module.exports.helpers = {
   omit: stubFactories.omit,
   parallel: stubFactories.parallel,
   pick: stubFactories.pick,
-  withDefault: stubFactories.withDefault,
-  isString: typeCheckFunctionReducers.isString,
-  isNumber: typeCheckFunctionReducers.isNumber,
-  isBoolean: typeCheckFunctionReducers.isBoolean,
-  isFunction: typeCheckFunctionReducers.isFunction,
-  isError: typeCheckFunctionReducers.isError,
-  isArray: typeCheckFunctionReducers.isArray,
-  isObject: typeCheckFunctionReducers.isObject
+  withDefault: stubFactories.withDefault
 }
 
 module.exports.isReducer = require('../reducer-types').isReducer


Test patch:
diff --git a/packages/data-point/lib/__snapshots__/index.test.js.snap b/packages/data-point/lib/__snapshots__/index.test.js.snap
index ac64b38..755a2a1 100644
--- a/packages/data-point/lib/__snapshots__/index.test.js.snap
+++ b/packages/data-point/lib/__snapshots__/index.test.js.snap
@@ -10,13 +10,6 @@ Object {
     "constant": [Function],
     "filter": [Function],
     "find": [Function],
-    "isArray": [Function],
-    "isBoolean": [Function],
-    "isError": [Function],
-    "isFunction": [Function],
-    "isNumber": [Function],
-    "isObject": [Function],
-    "isString": [Function],
     "map": [Function],
     "omit": [Function],
     "parallel": [Function],
diff --git a/packages/data-point/lib/helpers/__snapshots__/helpers.test.js.snap b/packages/data-point/lib/helpers/__snapshots__/helpers.test.js.snap
index 434f917..0c788f4 100644
--- a/packages/data-point/lib/helpers/__snapshots__/helpers.test.js.snap
+++ b/packages/data-point/lib/helpers/__snapshots__/helpers.test.js.snap
@@ -1,6 +1,6 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`Helpers API 1`] = `
+exports[`helpers API check what methods are exported in the helpers modules 1`] = `
 Object {
   "createAccumulator": [Function],
   "createEntity": [Function],
@@ -11,13 +11,6 @@ Object {
     "constant": [Function],
     "filter": [Function],
     "find": [Function],
-    "isArray": [Function],
-    "isBoolean": [Function],
-    "isError": [Function],
-    "isFunction": [Function],
-    "isNumber": [Function],
-    "isObject": [Function],
-    "isString": [Function],
     "map": [Function],
     "omit": [Function],
     "parallel": [Function],
diff --git a/packages/data-point/lib/helpers/helpers.test.js b/packages/data-point/lib/helpers/helpers.test.js
index 2548972..38e3723 100644
--- a/packages/data-point/lib/helpers/helpers.test.js
+++ b/packages/data-point/lib/helpers/helpers.test.js
@@ -3,9 +3,10 @@
 const _ = require('lodash')
 const helpers = require('./helpers')
 
-test('Helpers API', () => {
-  // To keep an eye on new methods added to the helpers module
-  expect(helpers).toMatchSnapshot()
+describe('helpers API', () => {
+  test('check what methods are exported in the helpers modules', () => {
+    expect(helpers).toMatchSnapshot()
+  })
 })
 
 describe('helpers.reducify', () => {