Current Dev State

This commit is contained in:
Tim Lorsbach
2025-06-23 20:13:54 +02:00
parent b4f9bb277d
commit ded50edaa2
22617 changed files with 4345095 additions and 174 deletions

31
static/js/ketcher2/node_modules/parent-module/index.js generated vendored Normal file
View File

@ -0,0 +1,31 @@
'use strict';
var callsites = require('callsites');
module.exports = function (filepath) {
var stacks = callsites();
if (!filepath) {
return stacks[2].getFileName();
}
var seenVal = false;
// skip the first stack as it's this function
for (var i = 1; i < stacks.length; i++) {
var parentFilepath = stacks[i].getFileName();
if (parentFilepath === filepath) {
seenVal = true;
continue;
}
// skip native modules
if (parentFilepath === 'module.js') {
continue;
}
if (seenVal && parentFilepath !== filepath) {
return parentFilepath;
}
}
};