yummies 3.0.16 → 3.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,6 +20,9 @@ Yummies - a set of various utilities for JavaScript projects with open source co
20
20
  ## [yummies/async](src/async.ts)
21
21
  Utilities for working with asynchronous code
22
22
 
23
+ ## [yummies/common](src/common.ts)
24
+ All other utilities without groupping
25
+
23
26
  ## [yummies/cookie](src/cookie.ts)
24
27
  Utilities for working with cookies
25
28
 
package/common.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ export type FnValue<TValue, TArgs extends any[] = []> = TValue | ((...args: TArgs) => TValue);
2
+ export declare const resolveFnValue: <TValue, TArgs extends any[] = []>(fn: FnValue<TValue, TArgs>, ...args: TArgs) => TValue;
3
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,CAAC,MAAM,EAAE,KAAK,SAAS,GAAG,EAAE,GAAG,EAAE,IAChD,MAAM,GACN,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,MAAM,CAAC,CAAC;AAEjC,eAAO,MAAM,cAAc,GAAI,MAAM,EAAE,KAAK,SAAS,GAAG,EAAE,WACpD,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,WACjB,KAAK,WAOf,CAAC"}
package/common.js ADDED
@@ -0,0 +1,6 @@
1
+ export const resolveFnValue = (fn, ...args) => {
2
+ if (typeof fn === 'function') {
3
+ return fn(...args);
4
+ }
5
+ return fn;
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yummies",
3
- "version": "3.0.16",
3
+ "version": "3.0.17",
4
4
  "keywords": [],
5
5
  "author": "js2me",
6
6
  "license": "MIT",
@@ -38,6 +38,11 @@
38
38
  "default": "./async.js",
39
39
  "types": "./async.d.ts"
40
40
  },
41
+ "./common": {
42
+ "import": "./common.js",
43
+ "default": "./common.js",
44
+ "types": "./common.d.ts"
45
+ },
41
46
  "./complex": {
42
47
  "import": "./complex/index.js",
43
48
  "default": "./complex/index.js",