This file contains hidden or 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
function traverseChildren(node, fn, paths = []) { | |
const children = node.children || []; | |
let i = 0; | |
for (const child of children) { | |
const currentPaths = [...paths, i++]; | |
let stop = fn(child, currentPaths); | |
if (!stop) { | |
stop = traverseChildren(child, fn, currentPaths); | |
} |
This file contains hidden or 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
/** | |
* @file Validator for custom data | |
* @author treelite([email protected]) | |
*/ | |
const STATE_IDLE = 0; | |
const STATE_SPLIT = 1; | |
const STATE_TOKEN = 2; | |
const STATE_NEWLINE = 3; |
This file contains hidden or 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
#! /bin/bash | |
BASE_URL="http://bigota.miwifi.com/xiaoqiang/sdk" | |
EXT_NAME=".zip" | |
TMP_DIR="tmp" | |
TOOL_CHAIN="xiaomi_toolchain" |
This file contains hidden or 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
#!/bin/bash | |
# | |
# path: .git/hooks/pre-commit | |
echo "\n\x1B[33mCommit checking ...\x1B[0m\n" | |
npm test | |
exitCode=$? | |
if [ $exitCode -ne 0 ] |
This file contains hidden or 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
/** | |
* @file nextTick | |
* @author treelite([email protected]) | |
*/ | |
define(function () { | |
var res; | |
var Observer; | |
var callbacks = []; |