Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Commit

Permalink
fix: removeDupesFromArray util use file instead
Browse files Browse the repository at this point in the history
  • Loading branch information
aidenybai committed Feb 11, 2021
1 parent 0464c0e commit 380c718
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/core/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import { DIRECTIVE_PREFIX, DIRECTIVE_SHORTHANDS } from '../models/generics';
import { State, DirectiveKV, ASTNode } from '../models/structs';
import { expressionPropRE, hasDirectiveRE, eventDirectivePrefixRE } from './utils/patterns';
import { getCustomProp, setCustomProp } from './utils/customProp';
import removeDupesFromArray from './utils/removeDupesFromArray';
import compute from './utils/computeExpression';

export const removeDupesFromArray = (array: any[]): any[] => [...new Set(array)];

export const isListRenderScope = (el: HTMLElement): boolean => {
return el.hasAttribute(`${DIRECTIVE_PREFIX}for`);
};
Expand Down
3 changes: 1 addition & 2 deletions src/core/directives/for.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { directives } from '../../core/directive';

import { expressionPropRE, parenthesisWrapReplaceRE } from '../utils/patterns';
import { getCustomProp, setCustomProp } from '../utils/customProp';

export const removeDupesFromArray = (array: any[]): any[] => [...new Set(array)];
import removeDupesFromArray from '../utils/removeDupesFromArray';

export const forDirective = ({ el, data, state, node }: DirectiveProps) => {
node = node!;
Expand Down
3 changes: 1 addition & 2 deletions src/core/directives/if.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import render from '../../core/render';
import { directives } from '../../core/directive';

import { getCustomProp, setCustomProp } from '../utils/customProp';

export const removeDupesFromArray = (array: any[]): any[] => [...new Set(array)];
import removeDupesFromArray from '../utils/removeDupesFromArray';

export const ifDirective = ({ el, data, state, node }: DirectiveProps) => {
node = node!;
Expand Down

0 comments on commit 380c718

Please # to comment.