Skip to content

Commit

Permalink
Revert "refactor: remove unused first/lastIn2Array function" (nhn#687)
Browse files Browse the repository at this point in the history
This reverts commit ad71a41.
  • Loading branch information
jungeun-cho committed Jul 31, 2020
1 parent ad71a41 commit 7995de4
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/js/common/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,27 @@ module.exports = {
return str.replace(/<([^>]+)>/ig, '');
},

/**
* Get first value in 2-dimentional array.
* @param {Array.<Array>} arr2d - 2-dimentional array
* @returns {*} first value in 2d array
*/
firstIn2dArray: function(arr2d) {
return util.pick(arr2d, '0', '0');
},

/**
* Get last value in 2-dimentional array.
* @param {Array.<Array>} arr2d - 2-dimentional array
* @returns {*} last value in 2d array
*/
lastIn2dArray: function(arr2d) {
var lastRow = arr2d.length - 1,
lastCol = arr2d[lastRow].length - 1;

return util.pick(arr2d, lastRow, lastCol);
},

/**
* Set 'title' attribute for all elements that have exceeded content in
* container
Expand Down

0 comments on commit 7995de4

Please sign in to comment.