Skip to content

Commit a4343ac

Browse files
committed
pretend lodash is a function
1 parent bc8d579 commit a4343ac

4 files changed

Lines changed: 18 additions & 25 deletions

File tree

packages/common/src/Adaptor.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,24 @@ import { expandReferences as newExpandReferences, parseDate } from './util';
1515

1616
const schemaCache = {};
1717

18+
/**
19+
* Lodash utility library.
20+
* All lodash v4.17 functions are available on the `_` namespace, eg,
21+
* `_.map`, `_.cloneDeep`, etc.
22+
*
23+
* @see https://lodash.com/docs/
24+
* @public
25+
* @function
26+
* @alias lodash
27+
* @example <caption>Split an array into chunks of 2 items each</caption>
28+
* fn(state => {
29+
* const items = [1, 2, 3, 4, 5];
30+
* const chunks = _.chunk(items, 2);
31+
* return { ...state, chunks };
32+
* });
33+
*/
34+
export * as _ from 'lodash';
35+
1836
/**
1937
* Execute a sequence of operations.
2038
* Main outer API for executing expressions.

packages/common/src/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ export default Adaptor;
33

44
export * from './Adaptor';
55

6-
export * from './lodash';
7-
86
export * as beta from './beta';
97
export * as http from './http';
108
export * as util from './util/index.js';

packages/common/src/lodash.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/common/src/util/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ export { default as parseDate } from './parse-date';
55
export { default as throwError } from './throw-error';
66
export { encode, decode } from './base64';
77
export { uuid } from './uuid';
8-
9-

0 commit comments

Comments
 (0)