@@ -6,7 +6,7 @@ export function stripSlashes(name: string) {
6
6
export type KeyValueCallback < T > = ( value : any , key : string ) => T
7
7
8
8
/**
9
- * If the object is an array, it will iterate over every element.
9
+ * If the object is an array, it will iterate over every element.
10
10
* Otherwise, it will iterate over every key in the object.
11
11
*/
12
12
export function each ( obj : Record < string , any > | any [ ] , callback : KeyValueCallback < void > ) {
@@ -19,9 +19,9 @@ export function each(obj: Record<string, any> | any[], callback: KeyValueCallbac
19
19
20
20
/**
21
21
* Check if some values in the object pass the test implemented by the provided function
22
- *
22
+ *
23
23
* returns true if some values pass the test, otherwise false
24
- *
24
+ *
25
25
* returns false if the object is empty
26
26
*/
27
27
export function some ( value : Record < string , any > , callback : KeyValueCallback < boolean > ) {
@@ -36,9 +36,9 @@ export function some(value: Record<string, any>, callback: KeyValueCallback<bool
36
36
37
37
/**
38
38
* Check if all values in the object pass the test implemented by the provided function
39
- *
39
+ *
40
40
* returns true if all values pass the test, otherwise false
41
- *
41
+ *
42
42
* returns true if the object is empty
43
43
*/
44
44
export function every ( value : any , callback : KeyValueCallback < boolean > ) {
@@ -67,7 +67,7 @@ export function values(obj: any) {
67
67
68
68
/**
69
69
* Check if values in the source object are equal to the target object
70
- *
70
+ *
71
71
* Does a shallow comparison
72
72
*/
73
73
export function isMatch ( target : any , source : any ) {
@@ -162,9 +162,9 @@ export function createSymbol(name: string) {
162
162
/**
163
163
* A set of lodash-y utility functions that use ES6
164
164
*
165
- * @deprecated Don't use `import { _ } from '@feathersjs/commons'`. You're importing a bunch of functions. You probably only need a few.
165
+ * @deprecated Don't use `import { _ } from '@feathersjs/commons'`. You're importing a bunch of functions. You probably only need a few.
166
166
* Import them directly instead. For example: `import { merge } from '@feathersjs/commons'`.
167
- *
167
+ *
168
168
* If you really want to import all functions or do not care about cherry picking, you can use `import * as _ from '@feathersjs/commons'`.
169
169
*/
170
170
export const _ = {
@@ -180,7 +180,13 @@ export const _ = {
180
180
extend,
181
181
omit,
182
182
pick,
183
- merge
183
+ merge,
184
+ isPromise,
185
+ createSymbol
184
186
}
185
187
186
188
export * from './debug'
189
+
190
+ if ( typeof module !== 'undefined' ) {
191
+ module . exports = Object . assign ( _ , module . exports )
192
+ }
0 commit comments