@slimlib/smart-mock 0.1.3 → 0.1.5

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
@@ -2,7 +2,9 @@
2
2
 
3
3
  Yet another proxy mock (YAPM?). Still in a very early state (EXPECT BUGS!).
4
4
 
5
- Mock that records operations for code generation later. Idea is somewhat similar to `prepack` but instead of interpreting code by other JS code we run it in JS VM and later use mock to repeat same operations. Ideally combined with terser like optimizer. Please check example in `pkgbld` how it is used to eject config.
5
+ Mock that records operations for code generation later. Idea is somewhat similar to `prepack` but instead of interpreting code by other JS code we run it in JS VM and later use mock to repeat the same operations. Ideally combined with a terser like optimizer. Please check the example in `pkgbld` how it is used to eject config.
6
+
7
+ [Changelog](./CHANGELOG.md)
6
8
 
7
9
  ## API
8
10
 
@@ -12,7 +14,7 @@ Default export function is a factory that creates 3 other functions with shared
12
14
 
13
15
  ### `createMock<T extends object>(object: T, name: string): T`
14
16
 
15
- Function to create mock wrapper around object and defining global name for later usage. `object` can be real original object or a pure mock object with same behavior for the specific situation. All operations on this object will be recorded by mock.
17
+ Function to create mock wrapper around object and defining global name for later usage. `object` can be a real original object or a pure mock object with the same behavior for the specific situation. All operations on this object will be recorded by mock.
16
18
 
17
19
  ### `generate(object: unknown): string`
18
20
 
package/dist/index.cjs CHANGED
@@ -127,7 +127,6 @@ function createRecordingMockFactory() {
127
127
  mockDatas.push(mockData);
128
128
  target[mock] = mockData;
129
129
  return new Proxy(target, {
130
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
131
130
  set(target, p, value, receiver) {
132
131
  const realValue = unwrapValue(value);
133
132
  if (!mockData.sideEffects) {
package/dist/index.mjs CHANGED
@@ -125,7 +125,6 @@ function createRecordingMockFactory() {
125
125
  mockDatas.push(mockData);
126
126
  target[mock] = mockData;
127
127
  return new Proxy(target, {
128
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
129
128
  set(target, p, value, receiver) {
130
129
  const realValue = unwrapValue(value);
131
130
  if (!mockData.sideEffects) {
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
- "version": "0.1.3",
3
- "license": "MIT",
2
+ "type": "module",
3
+ "version": "0.1.5",
4
4
  "name": "@slimlib/smart-mock",
5
+ "description": "One more proxy based mock",
6
+ "license": "MIT",
5
7
  "author": "Konstantin Shutkin",
6
- "type": "module",
8
+ "main": "./dist/index.cjs",
9
+ "module": "./dist/index.mjs",
7
10
  "exports": {
8
11
  ".": {
9
12
  "require": "./dist/index.cjs",
@@ -11,26 +14,21 @@
11
14
  },
12
15
  "./package.json": "./package.json"
13
16
  },
14
- "main": "./dist/index.cjs",
15
- "module": "./dist/index.mjs",
16
- "typings": "./dist/index.d.ts",
17
+ "types": "./dist/index.d.ts",
17
18
  "files": [
18
- "dist",
19
- "LICENSE"
19
+ "dist"
20
20
  ],
21
21
  "engines": {
22
22
  "node": ">=15"
23
23
  },
24
24
  "repository": {
25
25
  "type": "git",
26
- "url": "git+https://github.com/kshutkin/slimlib.git"
27
- },
28
- "bugs": {
29
- "url": "https://github.com/kshutkin/slimlib/issues"
26
+ "url": "git+https://github.com/kshutkin/slimlib.git",
27
+ "directory": "smart-mock"
30
28
  },
29
+ "bugs": "https://github.com/kshutkin/slimlib/issues",
31
30
  "homepage": "https://github.com/kshutkin/slimlib/blob/main/smart-mock/README.md",
32
31
  "readme": "README.md",
33
- "description": "One more proxy based mock",
34
32
  "keywords": [
35
33
  "@slimlib",
36
34
  "mock",