type
stringclasses 7
values | content
stringlengths 4
9.55k
| repo
stringlengths 7
96
| path
stringlengths 4
178
| language
stringclasses 1
value |
---|---|---|---|---|
ArrowFunction |
path =>
fsStat$(path).pipe(
// Filter out non-directory entries from target directories, it's expected that
// these directories may contain files (e.g. `README.md` or `package.json`).
// We shouldn't silently ignore the entries we couldn't get stat for though.
mergeMap(pathStat => (pathStat.isDirectory() ? [path] : [])),
catchError(err => [PluginDiscoveryError.invalidPluginPath(path, err)])
) | ChanghunKang/kibana | src/core/server/plugins/discovery/plugins_discovery.ts | TypeScript |
ArrowFunction |
pathStat => (pathStat.isDirectory() ? [path] : []) | ChanghunKang/kibana | src/core/server/plugins/discovery/plugins_discovery.ts | TypeScript |
ArrowFunction |
err => [PluginDiscoveryError.invalidPluginPath(path, err)] | ChanghunKang/kibana | src/core/server/plugins/discovery/plugins_discovery.ts | TypeScript |
ArrowFunction |
err => [PluginDiscoveryError.invalidSearchPath(dir, err)] | ChanghunKang/kibana | src/core/server/plugins/discovery/plugins_discovery.ts | TypeScript |
ArrowFunction |
manifest => {
log.debug(`Successfully discovered plugin "${manifest.id}" at "${path}"`);
const opaqueId = Symbol(manifest.id);
return new PluginWrapper({
path,
manifest,
opaqueId,
initializerContext: createPluginInitializerContext(coreContext, opaqueId, manifest),
});
} | ChanghunKang/kibana | src/core/server/plugins/discovery/plugins_discovery.ts | TypeScript |
ArrowFunction |
err => [err] | ChanghunKang/kibana | src/core/server/plugins/discovery/plugins_discovery.ts | TypeScript |
FunctionDeclaration | //turns image name like books to images/books.png
function ImageNamesToFileNames(imageName) {
return "images/" + imageName + ".png";
} | PorkyProductions/porkyproductions.github.io | ts/models.ts | TypeScript |
FunctionDeclaration |
function ImageNamesArrayToFileNamesArray(imageNamesArray) {
const fileNames = [];
for (var i = 0; i < imageNamesArray.length; i++) {
imageName = imageNamesArray[i];
fileName = ImageNamesToFileNames(imageName);
fileNames.push(fileName);
}
return fileNames;
} | PorkyProductions/porkyproductions.github.io | ts/models.ts | TypeScript |
FunctionDeclaration |
function OnStart(): void {
//runs when page loads
var HedgehogModelPreview = new ImagePreview("hedgehogModelPreview", ["HedgehogPreview_Front", "HedgehogPreview_Side", "HedgehogPreview_Top", "HedgehogPreview_Back"]);
$("#button_HedgehogPreviewLeft").click(function () {
HedgehogModelPreview.OnSwitchLeft();
})
$("#button_HedgehogPreviewRight").click(function () {
HedgehogModelPreview.OnSwitchRight();
})
} | PorkyProductions/porkyproductions.github.io | ts/models.ts | TypeScript |
ClassDeclaration |
class ImagePreview {
constructor(ID, imageNames) {
this.elementID = "#" + ID;
this.files = ImageNamesArrayToFileNamesArray(imageNames)
this.pointer = 0;
this.length = this.files.length;
}
GetCurrentImage() {
return this.files[this.pointer];
}
MovePointerRight() {
this.pointer++;
this.pointer = this.pointer % this.length;
}
MovePointerLeft() {
this.pointer--;
if (this.pointer < 0) {
this.pointer = this.length - 1;
}
}
OnSwitchRight() {
this.MovePointerRight();
$(this.elementID).attr("src", this.GetCurrentImage());
}
OnSwitchLeft() {
this.MovePointerLeft();
$(this.elementID).attr("src", this.GetCurrentImage());
}
} | PorkyProductions/porkyproductions.github.io | ts/models.ts | TypeScript |
MethodDeclaration |
GetCurrentImage() {
return this.files[this.pointer];
} | PorkyProductions/porkyproductions.github.io | ts/models.ts | TypeScript |
MethodDeclaration |
MovePointerRight() {
this.pointer++;
this.pointer = this.pointer % this.length;
} | PorkyProductions/porkyproductions.github.io | ts/models.ts | TypeScript |
MethodDeclaration |
MovePointerLeft() {
this.pointer--;
if (this.pointer < 0) {
this.pointer = this.length - 1;
}
} | PorkyProductions/porkyproductions.github.io | ts/models.ts | TypeScript |
MethodDeclaration |
OnSwitchRight() {
this.MovePointerRight();
$(this.elementID).attr("src", this.GetCurrentImage());
} | PorkyProductions/porkyproductions.github.io | ts/models.ts | TypeScript |
MethodDeclaration |
OnSwitchLeft() {
this.MovePointerLeft();
$(this.elementID).attr("src", this.GetCurrentImage());
} | PorkyProductions/porkyproductions.github.io | ts/models.ts | TypeScript |