yummies 3.0.30 → 3.0.32

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.
@@ -0,0 +1,6 @@
1
+ export interface CounterFn<TProcessedValue = number> {
2
+ (): TProcessedValue;
3
+ reset(): void;
4
+ }
5
+ export declare const createCounter: <TProcessedValue = number>(processValue?: (value: number) => TProcessedValue) => CounterFn<TProcessedValue>;
6
+ //# sourceMappingURL=counter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"counter.d.ts","sourceRoot":"","sources":["../../src/complex/counter.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS,CAAC,eAAe,GAAG,MAAM;IACjD,IAAI,eAAe,CAAC;IACpB,KAAK,IAAI,IAAI,CAAC;CACf;AAED,eAAO,MAAM,aAAa,GAAI,eAAe,0BAC5B,CAAC,KAAK,EAAE,MAAM,KAAK,eAAe,KAChD,SAAS,CAAC,eAAe,CAgB3B,CAAC"}
@@ -0,0 +1,14 @@
1
+ export const createCounter = (processValue) => {
2
+ let counter = 0;
3
+ let incrementFn;
4
+ if (processValue) {
5
+ incrementFn = () => processValue(counter++);
6
+ }
7
+ else {
8
+ incrementFn = () => counter++;
9
+ }
10
+ incrementFn.reset = () => {
11
+ counter = 0;
12
+ };
13
+ return incrementFn;
14
+ };
@@ -1,2 +1,3 @@
1
1
  export * from './modules-factory';
2
+ export * from './counter';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/complex/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/complex/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
package/complex/index.js CHANGED
@@ -1 +1,2 @@
1
1
  export * from './modules-factory';
2
+ export * from './counter';
package/data.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare const isShallowEqual: (a: unknown, b: unknown) => boolean;
2
+ //# sourceMappingURL=data.d.ts.map
package/data.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,MAAO,OAAO,KAAK,OAAO,YAqBpD,CAAC"}
package/data.js ADDED
@@ -0,0 +1,16 @@
1
+ import { isEqual } from 'lodash-es';
2
+ export const isShallowEqual = (a, b) => {
3
+ if (a === b) {
4
+ return true;
5
+ }
6
+ if (typeof a !== 'object' ||
7
+ typeof b !== 'object' ||
8
+ a === null ||
9
+ b === null) {
10
+ return false;
11
+ }
12
+ const aKeys = Object.keys(a);
13
+ const bKeys = Object.keys(b);
14
+ return (isEqual(aKeys, bKeys) &&
15
+ aKeys.every((key) => a[key] === b[key]));
16
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yummies",
3
- "version": "3.0.30",
3
+ "version": "3.0.32",
4
4
  "keywords": [],
5
5
  "author": "js2me",
6
6
  "license": "MIT",
@@ -48,6 +48,11 @@
48
48
  "default": "./common.js",
49
49
  "types": "./common.d.ts"
50
50
  },
51
+ "./complex/counter": {
52
+ "import": "./complex/counter.js",
53
+ "default": "./complex/counter.js",
54
+ "types": "./complex/counter.d.ts"
55
+ },
51
56
  "./complex": {
52
57
  "import": "./complex/index.js",
53
58
  "default": "./complex/index.js",
@@ -68,6 +73,11 @@
68
73
  "default": "./css.js",
69
74
  "types": "./css.d.ts"
70
75
  },
76
+ "./data": {
77
+ "import": "./data.js",
78
+ "default": "./data.js",
79
+ "types": "./data.d.ts"
80
+ },
71
81
  "./date-time.test": {
72
82
  "import": "./date-time.test.js",
73
83
  "default": "./date-time.test.js",