path-serializer 0.1.2 → 0.1.3

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
@@ -1,5 +1,7 @@
1
1
  # path-serializer
2
2
 
3
+ <a href="https://www.npmjs.com/package/path-serializer"><img src="https://img.shields.io/npm/v/path-serializer?style=flat-square&color=98c379" alt="latest version" /></a>
4
+
3
5
  ```ts
4
6
  // __snapshots__/index.test.ts.snap
5
7
  {
@@ -881,7 +881,7 @@ function __webpack_require__(moduleId) {
881
881
  test (val) {
882
882
  return 'string' == typeof val;
883
883
  },
884
- serialize (val, _config, _indentation, _depth, _refs, _printer) {
884
+ serialize (val) {
885
885
  const normalized = transformCodeToPosixPath(val);
886
886
  let replaced = applyMatcherReplacement(pathMatchers, normalized);
887
887
  if (ansiDoubleQuotes) replaced = replaced.replace(/"/g, '\\"');
@@ -1,5 +1,3 @@
1
- import { SnapshotSerializer } from '@vitest/snapshot';
2
-
3
1
  export declare function createSnapshotSerializer(options?: SnapshotSerializerOptions): SnapshotSerializer;
4
2
 
5
3
  declare interface Features {
@@ -36,6 +34,11 @@ declare interface PathMatcher {
36
34
 
37
35
  declare type PathMatchExpression = string | RegExp;
38
36
 
37
+ declare interface SnapshotSerializer {
38
+ serialize: (val: any) => string;
39
+ test: (arg0: any) => boolean;
40
+ }
41
+
39
42
  declare interface SnapshotSerializerOptions {
40
43
  cwd?: string;
41
44
  workspace?: string;
@@ -1,5 +1,3 @@
1
- import { SnapshotSerializer } from '@vitest/snapshot';
2
-
3
1
  export declare function createSnapshotSerializer(options?: SnapshotSerializerOptions): SnapshotSerializer;
4
2
 
5
3
  declare interface Features {
@@ -36,6 +34,11 @@ declare interface PathMatcher {
36
34
 
37
35
  declare type PathMatchExpression = string | RegExp;
38
36
 
37
+ declare interface SnapshotSerializer {
38
+ serialize: (val: any) => string;
39
+ test: (arg0: any) => boolean;
40
+ }
41
+
39
42
  declare interface SnapshotSerializerOptions {
40
43
  cwd?: string;
41
44
  workspace?: string;
package/dist/esm/index.js CHANGED
@@ -856,7 +856,7 @@ function createSnapshotSerializer(options) {
856
856
  test (val) {
857
857
  return 'string' == typeof val;
858
858
  },
859
- serialize (val, _config, _indentation, _depth, _refs, _printer) {
859
+ serialize (val) {
860
860
  const normalized = transformCodeToPosixPath(val);
861
861
  let replaced = applyMatcherReplacement(pathMatchers, normalized);
862
862
  if (ansiDoubleQuotes) replaced = replaced.replace(/"/g, '\\"');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "path-serializer",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "path-serializer",
5
5
  "keywords": [
6
6
  "snapshot",