Skip to content

Commit e9c91ef

Browse files
committed
Fix collectRef
1 parent 65d4ccf commit e9c91ef

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@redneckz/json-ref",
3-
"version": "0.0.12",
3+
"version": "0.0.13",
44
"license": "MIT",
55
"author": {
66
"name": "redneckz",

src/collectRef.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { type JSONNode } from '@redneckz/json-op';
22
import { refEntries } from './refEntries';
3+
import { unique } from './unique';
34

4-
export const collectRef = (json: JSONNode): string[] => refEntries(json).map(([, _]) => _);
5+
export const collectRef = (json: JSONNode): string[] => unique(refEntries(json).map(([, _]) => _));

src/fileResolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as fs from 'fs';
2-
import * as path from 'path';
2+
import * as path from 'path/posix';
33
import { promisify } from 'util';
44
import type { URIResolver } from './URIResolver';
55

src/unique.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const unique = <T>(list: T[]): T[] => [...new Set(list)];

0 commit comments

Comments
 (0)