Skip to content

Commit 3800f5f

Browse files
authored
expandable-blocks-util.js: ➕ Create
1 parent a015580 commit 3800f5f

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

src/util/expandable-blocks-util.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class ExpandableBlocksUtil {
2+
static getArgsStartedWith (args, argStart) {
3+
if (!(
4+
typeof args === 'object' &&
5+
args instanceof Object &&
6+
!Array.isArray(args)
7+
)) return [];
8+
const findedArgs = [];
9+
for (let i = 1, done = false; !done; i++) {
10+
done = !(`${argStart}${i}` in args);
11+
if (!done) findedArgs.push(args[`${argStart}${i}`]);
12+
}
13+
return findedArgs;
14+
}
15+
}
16+
17+
module.exports = ExpandableBlocksUtil;

0 commit comments

Comments
 (0)