function interopEsm(raw, ns, allowExportDefault) {
    const getters = Object.create(null);
    for(let current = raw; (typeof current === 'object' || typeof current === 'function') && !LEAF_PROTOTYPES.includes(current); current = getProto(current)){
        for (const key of Object.getOwnPropertyNames(current)){
            getters[key] = createGetter(raw, key);
        }
    }
    // this is not really correct
    // we should set the `default` getter if the imported module is a `.cjs file`
    if (!(allowExportDefault && 'default' in getters)) {
        getters['default'] = ()=>raw;
    }
    esm(ns, getters);
    return ns;
}
@param raw
@param ns
@param allowExportDefault
  * `false`: will have the raw module as default export
  * `true`: will have the default property as default export