-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1805a49
commit 2791a85
Showing
36 changed files
with
132 additions
and
65 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { findLast } from '../../../../src/inline-loops.macro'; | ||
|
||
const lastEven = findLast(array, fn); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
let _match; | ||
for (let _key = array.length, _value, _result; --_key >= 0; ) { | ||
_value = array[_key]; | ||
_result = fn(_value, _key, array); | ||
if (_result) { | ||
_match = _value; | ||
break; | ||
} | ||
} | ||
const lastEven = _match; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { findLastIndex } from '../../../../src/inline-loops.macro'; | ||
|
||
const firstEven = findLastIndex(array, fn); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
let _match = -1; | ||
for (let _key = array.length, _value, _result; --_key >= 0; ) { | ||
_value = array[_key]; | ||
_result = fn(_value, _key, array); | ||
if (_result) { | ||
_match = _key; | ||
break; | ||
} | ||
} | ||
const firstEven = _match; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
__tests__/__fixtures__/inlined-arrow-expression/findIndexRight/code.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
__tests__/__fixtures__/inlined-arrow-expression/findIndexRight/output.js
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
__tests__/__fixtures__/inlined-arrow-expression/findLast/code.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { findLast } from '../../../../src/inline-loops.macro'; | ||
|
||
const lastEven = findLast(array, (value) => value % 2 === 0); |
10 changes: 10 additions & 0 deletions
10
__tests__/__fixtures__/inlined-arrow-expression/findLast/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
let _match; | ||
for (let _key = array.length, _value, _result; --_key >= 0; ) { | ||
_value = array[_key]; | ||
_result = _value % 2 === 0; | ||
if (_result) { | ||
_match = _value; | ||
break; | ||
} | ||
} | ||
const lastEven = _match; |
3 changes: 0 additions & 3 deletions
3
__tests__/__fixtures__/inlined-arrow-expression/findRight/code.js
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
__tests__/__fixtures__/inlined-arrow-expression/findRight/output.js
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
__tests__/__fixtures__/inlined-arrow-return/findIndexRight/code.js
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
__tests__/__fixtures__/inlined-arrow-return/findIndexRight/output.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { findLast } from '../../../../src/inline-loops.macro'; | ||
|
||
const lastEven = findLast(array, (value) => { | ||
return value % 2 === 0; | ||
}); |
10 changes: 10 additions & 0 deletions
10
__tests__/__fixtures__/inlined-arrow-return/findLast/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
let _match; | ||
for (let _key = array.length, _value, _result; --_key >= 0; ) { | ||
_value = array[_key]; | ||
_result = _value % 2 === 0; | ||
if (_result) { | ||
_match = _value; | ||
break; | ||
} | ||
} | ||
const lastEven = _match; |
5 changes: 5 additions & 0 deletions
5
__tests__/__fixtures__/inlined-arrow-return/findLastIndex/code.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { findLastIndex } from '../../../../src/inline-loops.macro'; | ||
|
||
const firstEven = findLastIndex(array, (value) => { | ||
return value % 2 === 0; | ||
}); |
10 changes: 10 additions & 0 deletions
10
__tests__/__fixtures__/inlined-arrow-return/findLastIndex/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
let _match = -1; | ||
for (let _key = array.length, _value, _result; --_key >= 0; ) { | ||
_value = array[_key]; | ||
_result = _value % 2 === 0; | ||
if (_result) { | ||
_match = _key; | ||
break; | ||
} | ||
} | ||
const firstEven = _match; |
5 changes: 0 additions & 5 deletions
5
__tests__/__fixtures__/inlined-arrow-return/findRight/code.js
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
__tests__/__fixtures__/inlined-arrow-return/findRight/output.js
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
__tests__/__fixtures__/inlined-function-return/findIndexRight/code.js
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
__tests__/__fixtures__/inlined-function-return/findIndexRight/output.js
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
__tests__/__fixtures__/inlined-function-return/findLast/code.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { findLast } from '../../../../src/inline-loops.macro'; | ||
|
||
const lastEven = findLast(array, function (value) { | ||
return value % 2 === 0; | ||
}); |
10 changes: 10 additions & 0 deletions
10
__tests__/__fixtures__/inlined-function-return/findLast/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
let _match; | ||
for (let _key = array.length, _value, _result; --_key >= 0; ) { | ||
_value = array[_key]; | ||
_result = _value % 2 === 0; | ||
if (_result) { | ||
_match = _value; | ||
break; | ||
} | ||
} | ||
const lastEven = _match; |
5 changes: 5 additions & 0 deletions
5
__tests__/__fixtures__/inlined-function-return/findLastIndex/code.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { findLastIndex } from '../../../../src/inline-loops.macro'; | ||
|
||
const firstEven = findLastIndex(array, function (value) { | ||
return value % 2 === 0; | ||
}); |
10 changes: 10 additions & 0 deletions
10
__tests__/__fixtures__/inlined-function-return/findLastIndex/output.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
let _match = -1; | ||
for (let _key = array.length, _value, _result; --_key >= 0; ) { | ||
_value = array[_key]; | ||
_result = _value % 2 === 0; | ||
if (_result) { | ||
_match = _key; | ||
break; | ||
} | ||
} | ||
const firstEven = _match; |
5 changes: 0 additions & 5 deletions
5
__tests__/__fixtures__/inlined-function-return/findRight/code.js
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
__tests__/__fixtures__/inlined-function-return/findRight/output.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
const firstEven = findIndexRight([1, 2, 3, 4], (value) => { | ||
const isValueEven = value % 2 === 0; | ||
return isValueEven; | ||
}); | ||
const _collection = [1, 2, 3, 4]; | ||
let _match = -1; | ||
for (let _key = _collection.length, _value, _result; --_key >= 0; ) { | ||
_value = _collection[_key]; | ||
const _isValueEven = _value % 2 === 0; | ||
_result = _isValueEven; | ||
if (_result) { | ||
_match = _key; | ||
break; | ||
} | ||
} | ||
const firstEven = _match; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { findLast } from '../../../../src/inline-loops.macro'; | ||
|
||
const lastEven = findLast([1, 2, 3, 4], (value) => { | ||
const isValueEven = value % 2 === 0; | ||
|
||
return isValueEven; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const _collection = [1, 2, 3, 4]; | ||
let _match; | ||
for (let _key = _collection.length, _value, _result; --_key >= 0; ) { | ||
_value = _collection[_key]; | ||
const _isValueEven = _value % 2 === 0; | ||
_result = _isValueEven; | ||
if (_result) { | ||
_match = _value; | ||
break; | ||
} | ||
} | ||
const lastEven = _match; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.