Rename truncated->coalesced
This commit is contained in:
parent
3b8b2cf500
commit
f8e46819c5
1 changed files with 5 additions and 5 deletions
|
@ -86,9 +86,9 @@ module.exports = React.createClass({
|
||||||
// Some neighbouring transitions are common, so canonicalise some into "pair" transitions
|
// Some neighbouring transitions are common, so canonicalise some into "pair" transitions
|
||||||
let canonicalTransitions = this._getCanonicalTransitions(splitTransitions);
|
let canonicalTransitions = this._getCanonicalTransitions(splitTransitions);
|
||||||
// Transform into consecutive repetitions of the same transition (like 5 consecutive 'joined_and_left's)
|
// Transform into consecutive repetitions of the same transition (like 5 consecutive 'joined_and_left's)
|
||||||
let truncatedTransitions = this._getTruncatedTransitions(canonicalTransitions);
|
let coalescedTransitions = this._coalesceRepeatedTransitions(canonicalTransitions);
|
||||||
|
|
||||||
let descs = truncatedTransitions.map((t) => {
|
let descs = coalescedTransitions.map((t) => {
|
||||||
return this._getDescriptionForTransition(t.transitionType, plural, t.repeats);
|
return this._getDescriptionForTransition(t.transitionType, plural, t.repeats);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -167,12 +167,12 @@ module.exports = React.createClass({
|
||||||
* [{
|
* [{
|
||||||
* transitionType: "joined_and_left"
|
* transitionType: "joined_and_left"
|
||||||
* repeats: 123
|
* repeats: 123
|
||||||
* }, ... ]
|
* }]
|
||||||
* ```
|
* ```
|
||||||
* @param {string[]} transitions the array of transitions to transform.
|
* @param {string[]} transitions the array of transitions to transform.
|
||||||
* @returns {object[]} an array of truncated transitions.
|
* @returns {object[]} an array of coalesced transitions.
|
||||||
*/
|
*/
|
||||||
_getTruncatedTransitions: function(transitions) {
|
_coalesceRepeatedTransitions: function(transitions) {
|
||||||
let res = [];
|
let res = [];
|
||||||
for (let i = 0; i < transitions.length; i++) {
|
for (let i = 0; i < transitions.length; i++) {
|
||||||
if (res.length > 0 && res[res.length - 1].transitionType === transitions[i]) {
|
if (res.length > 0 && res[res.length - 1].transitionType === transitions[i]) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue