Skip to content

Commit

Permalink
fix:
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Sep 2, 2017
1 parent 6fe7aec commit 9006e5b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/evaluators/browserEvaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default (): EvaluatorType => {
return [].slice.apply(node.querySelectorAll(selector));
};

// eslint-disable-next-line no-unused-vars
const nextUntil = (node: HTMLElement, selector: string, filter?: string) => {
throw new Error('Not implemented.');
};
Expand Down
4 changes: 2 additions & 2 deletions src/subroutineAliasPreset.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import {
nextUntil,
nextUntilSubroutine,
readSubroutine,
selectSubroutine,
testSubroutine
} from './subroutines';

export default {
nu: (subject, values, bindle) => {
return nextUntil(subject, values, bindle);
return nextUntilSubroutine(subject, values, bindle);
},
ra: (subject, values, bindle) => {
return readSubroutine(subject, ['attribute'].concat(values), bindle);
Expand Down
12 changes: 2 additions & 10 deletions src/subroutines/nextUntilSubroutine.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
// @flow

import {
FinalResultSentinel
} from 'pianola';
import {
createDebug
} from '../utilities';
import {
parseQuantifierExpression
} from '../parsers';
import {
SelectSubroutineUnexpectedResultCountError,
SurgeonError
} from '../errors';
import type {
SelectSubroutineQuantifierType,
SubroutineType
} from '../types';

const debug = createDebug('subroutine:nextUntil');

const selectSubroutine: SubroutineType = (subject, [selectorExpression, filterExpression], {evaluator}) => {
const nextUntilSubroutine: SubroutineType = (subject, [selectorExpression, filterExpression], {evaluator}) => {
debug('selecting following siblings matching "%s" until "%s"', filterExpression, selectorExpression);

if (!evaluator.isElement(subject)) {
Expand All @@ -34,4 +26,4 @@ const selectSubroutine: SubroutineType = (subject, [selectorExpression, filterEx
return matches;
};

export default selectSubroutine;
export default nextUntilSubroutine;
2 changes: 2 additions & 0 deletions src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ export type EvaluatorType = {|
+getPropertyValue: (element: Object, name: string) => mixed,

+isElement: (maybeElement: mixed) => boolean,

// eslint-disable-next-line flowtype/no-weak-types
+nextUntil: (element: Object, selector: string, filter?: string) => Array<Object>,

// eslint-disable-next-line flowtype/no-weak-types
Expand Down
3 changes: 0 additions & 3 deletions test/surgeon/subroutines/nextUntilSubroutine.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

import test from 'ava';
import sinon from 'sinon';
import {
FinalResultSentinel
} from 'pianola';
import nextUntilSubroutine from '../../../src/subroutines/nextUntilSubroutine';

test('returns array when expecting multiple results', (t): void => {
Expand Down

0 comments on commit 9006e5b

Please sign in to comment.