Skip to content

Commit

Permalink
Merge pull request #367 from ajthinking/fixes2
Browse files Browse the repository at this point in the history
Use get(path) in Unique
  • Loading branch information
ajthinking authored Jan 15, 2025
2 parents 0271c8f + e627a0e commit 2a42923
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 3 additions & 2 deletions packages/core/src/computers/Unique.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { json_, str } from '../Param';
import { ItemWithParams } from '../ItemWithParams';
import { Computer } from '../types/Computer';
import { get } from '../utils/get';

export const Unique: Computer = {
name: 'Unique',
Expand Down Expand Up @@ -44,7 +45,7 @@ export const Unique: Computer = {

// Count occurrences of each item
for (const item of incoming) {
const propValue = item.value[property];
const propValue = get(item.value, property);
if (!itemCounts.has(propValue)) {
itemCounts.set(propValue, 1);
} else {
Expand All @@ -54,7 +55,7 @@ export const Unique: Computer = {

// Classify items as unique or duplicate based on their counts
for (const item of incoming) {
const propValue = item.value[property];
const propValue = get(item.value, property);
if (itemCounts.get(propValue) === 1) {
unique.push(item);
} else {
Expand Down
6 changes: 0 additions & 6 deletions packages/ds-ext/src/DiagramEditorProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ export class DiagramEditorProvider implements vscode.CustomEditorProvider<Diagra
await this.observerStorage.close();
}

private async init(): Promise<void> {

}

constructor(private readonly context: vscode.ExtensionContext) {
this.config = loadConfig(this.context);

Expand Down Expand Up @@ -136,8 +132,6 @@ export class DiagramEditorProvider implements vscode.CustomEditorProvider<Diagra
}

private getWebviewContent(webview: vscode.Webview, document: DiagramDocument): string {
const diagramData = Buffer.from(document.data).toString('utf8');

const mainScript = path.join(this.context.extensionPath, 'dist', 'app', 'app.mjs');

const scriptUri = webview.asWebviewUri(
Expand Down

0 comments on commit 2a42923

Please sign in to comment.