Skip to content

Instantly share code, notes, and snippets.

@EmpeRoar
Created July 19, 2022 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EmpeRoar/c04e964718c5cc9f988b30cdd426b089 to your computer and use it in GitHub Desktop.
Save EmpeRoar/c04e964718c5cc9f988b30cdd426b089 to your computer and use it in GitHub Desktop.
scan
private scanner(data: any, select: string, d = null) {
if(data && select) {
const pointer = select.split('.');
while(data && pointer.length) {
const x = pointer.shift();
if(x) {
data = data[x];
}
}
return data;
}
return d;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment