Equivalent of `supportedLocalesOf` for letter-case conversion (`toLocaleLowerCase`, `toLocaleUpperCase`)?

In JavaScript, you can introspect support for various internationalization functionality by use of static methods of the various classes namespaced under Intl. For example:

Intl.PluralRules.supportedLocalesOf(['pt', 'yue', 'hyw']) // ['pt', 'yue']
Intl.Segmenter.supportedLocalesOf(['pt', 'yue', 'hyw']) // ['pt']

Is there any equivalent way to introspect locale support for letter-case conversion (toLocaleLowerCase, toLocaleUpperCase), given that there is no equivalent namespaced class under Intl for these methods?

I’m not asking about feature detection, which can be done on an ad-hoc basis if you know how to feature detect specific characteristics of the locale:

const turkishIsSupported = 'i'.toLocaleUpperCase('tr') === 'İ'

However, checking like this for many locales requires lots of custom logic and knowing what features to test for, whereas I’m interested in a simple way of checking that a given locale is supported, without prior knowledge of that locale’s features.

main.tsx:1 Failed to load module script:

Error – main.tsx:1 Failed to load module script: Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of “application/octet-stream”. Strict MIME type checking is enforced for module scripts per HTML spec.

I don’t know why I am getting this error but I have edited almost all files but unable to resolve it can somebody help me out with this

project – https://github.com/ayushi68/IskconSeva

I had tried to update package.json, index.ts , tsconfig.json and all files in the server to setup this but unable to get it

Please let me know if someone can figure out where the error actually occuring
the deployment was sucessful but unable to see any pages in site

problem -> npm http-server dowloading file

I’m new to npm and I tried to start a new simple project. Initially it just had index.html with h1 Hello world. When I try to start a server using http-server ./index.html it works to some extent but when I try to open the path http://127.0.0.1:3131 it downloads a file instead of running an HTML in my browser.

The browser I am using is Chrome, I tried Mozilla but the result is the same.

Best way to structure variables in vanilla javaScript for a small project

I am new to learning frontend web dev and i am working on a simple pomodoro web app although it has many settings and states to keep track of i want to know if it’s common use to let functions modify global variables such as the settings variables directly or is it better to keep all the variables as properties to a ” status ” object and pass that object to functions
here are the starter variables i have with the second approach

  timer: {
    pomoCount: 0,
    currCycle: 0,
    timerDisp: { min: 25, sec: 0 },
    totalSec: 25 * 60,
    over: 0,
    paused: 1,
    countDown : null  
  },
  task: {
    tskShown: 0,
    taskList: [],
  },
  settings: {
    lbInterval: 4,
    cycleList: [25, 5, 15],
    autoCheckTsk: 0,
    autoSwitchTsk: false,
    autoStrtPomo: false,
    autoStrtBrk: false,
  },
};``` 

Visual Studio Code not giving the output I’m looking for

When I write this code”

const selenium = require(“selenium-webdriver”)

myFirstTest = async function(){
console.log("hello");
};

I should receive a “hello” output after I execute line below, but I get nothing.

PS C:Selenium Automation1_Selenium Test> node ./index.js

How else can I call this function to give the output I’m looking for??

Frida gives the error “not a TypeError: not a function” on a simple call to Java.perform

I trying to learn frida so I’m doing some basic tutorial from the web.

This is the script I’ve written:

Java.perform(function() {
    const MainActivity = Java.use('group.cognisys.fridame.MainActivity');
    
    MainActivity.isAdmin.implementation = function () {
        console.log("Hooking isAdmin Method...");   // print a message on our terminal
        return true;
    };
});

As you can see it’s quite basic.
I’m running the command “frida -U -l my_script.js -f group.cognisys.fridame” from my Windows that has version “17.1.5”.
The server is an android emulator of Pixel 6, with Android 14, version 17.1.5 of the frida-server, and it’s also rooted.

The full error stack:

Spawned `group.cognisys.fridame`. Resuming main thread!
TypeError: not a function
    at <anonymous> (/frida/bridges/java.js:8)
    at <anonymous> (/frida/bridges/java.js:1)
    at _performPendingVmOpsWhenReady (/frida/bridges/java.js:8)
    at perform (/frida/bridges/java.js:8)
    at <eval> (C:UsersgabonDownloadshacker.js:22)

No idea why. From looking in the web it supposed to work.

The frida generally works okay since I can trace function with frida-trace and so on.
Moreover, I checked the value of Java.available and it returns true.

Firebase both Firestore and RTDB runTransaction so slow 2-5 minutes

Firestore transaction is taking 2 minutes consistently.

So my 1 cloud function is taking several minutes to execute. I just changed it all without transactions, and it is executed within seconds.

I am handling promises by reading first and then write correctly. But it seems like the issue is that Firestore only allows running transaction from the root and RTDB transaction starting from close to root is causing this even though I don’t have many users. I feel pretty confident that this is Firebase’s bug. In the mean time the only solution seems to be not to use transactions when you are doing a lot of things. I am running just some data manipulations like moving them around and rejigging them. I am using second generation of cloud functions.

What I am doing is creating a new chat room after a user adds a new member. I tried to use Transaction, but if I do that the function takes several minutes, so I had no choice but to not use Transaction.

Firestore codes:

    await admin.firestore().runTransaction(async (t) => {
                const document = await t.get(truthRef);
                if (document.data() !== undefined) {
const firestorePromises: any = []
// change data of this first room to contain more data blah blah blah
firestorePromises.push(admin.firestore().collection("a").doc(b).set(c).then( () => {
                        const firestoreInnerPromises = [];
                        firestoreInnerPromises.push(admin.firestore().collection("a").doc(b).update({
                             messages: allMessagesHistory
                         }))
                       firestoreInnerPromises.push(oldTruthHistoryRef.delete());
                       return Promise.all(firestoreInnerPromises)
                    }));
return Promise.all(firestorePromises); // also tried to do await here same results

                 }

              });

js v8 function inlining

It mentioned, that v8 can inline function, i get how it works in obvious cases, like this

// object with persistent shape
class Obj {
    prop = 42
}
// function always called with persistent types/shapes of args
function obj_accessor(obj) {
    return obj.prop;
}

function main() {
    const obj = new Obj();
    // this call is highly likely to be inlined
    const val = obj_accessor(obj);
    console.log(val);
}

but if i use higher order functions, in what cases it will perform inlining, if in any?

I have some examples

class Foo {
    bar = 42;
}

class Bar {
    foo = 42;
}

function foo_accessor(obj) {
    return obj.bar;
}
function bar_accessor(obj) {
    return obj.foo;
}

function main(obj, accessor) {
    // will inlining be performed at all ?
    // is it per call site or per function
    // so after passing more then single accessor it
    // can not be optimized any more ?
    const val = accessor(obj);
    console.log(val)
}

// accessor not statically know -> no inlining ? 
main(...(Math.random() < 0.5 ? [new Foo(), foo_accessor] : [new Bar(), bar_accessor])); 

// accessor statically know -> it can be inlined
main(new Foo(), foo_accessor);

// accessor statically know -> it can be inlined
main(new Bar(), bar_accessor);

Laravel Filepond not including file input with Post or Put in Request

I had this filepond instance:

<input type="file" name="files[]" class="filepond" multiple />

<script src="https://unpkg.com/filepond-plugin-image-preview/dist/filepond-plugin-image-preview.js"></script>
<script src="https://unpkg.com/filepond-plugin-image-exif-orientation/dist/filepond-plugin-image-exif-orientation.js"></script>
<script src="https://unpkg.com/filepond-plugin-file-validate-type/dist/filepond-plugin-file-validate-type.js"></script>
<script src="https://unpkg.com/filepond/dist/filepond.js"></script>
<script>
            const inputElement = document.querySelector('input[type="file"].filepond');
            
            FilePond.registerPlugin(FilePondPluginImagePreview,
                                    FilePondPluginImageExifOrientation,
                                    FilePondPluginFileValidateType);
            FilePond.create(inputElement).setOptions({
                allowMultiple: true,
                maxFiles: 3,
                acceptedFileTypes: ['image/*'],
                allowImagePreview: true,
                server: {
                    process: '/upload/process',
                    revert: '/upload/remove',
                    load: '/upload/load/',
                    remove: (source, load, error) => {
                        $.ajax({
                            type:'DELETE',
                            url:'/upload/removelocal',
                            headers: {
                                'X-CSRF-TOKEN': '{{ csrf_token() }}'  
                            },
                            data: { filename: source, userid: {{ auth()->user()->id }} },
                        });
                        load();
                    },
                    headers: {
                        'X-CSRF-TOKEN': '{{ csrf_token() }}',
                    },
                },
                files: [
                    @foreach ($attachments as $attachment)
                        {source: '{{ $attachment->filename }}', options: {type: 'local'}},
                    @endforeach
                ],
            });

I was working on this project and then stopped and started again recently. When I did, I updated everything including going from Laravel 11 to 12. Everything else works, the file initially gets copied to a tmp location (from my process function), the remove function, the prepopulate with existing images, everything, except filepond isn’t including the files[] input in my post back to my Update function. The Request object has all my other fields except file[]. It used to be there. This same code worked perfectly.

My process function (/upload/process): (This is still working, the file makes it to my tmp area)

public function process(Request $request): string
{
     $file = $request['files'][0];
     $ext = pathinfo($file->getClientOriginalName(), PATHINFO_EXTENSION);

     $path = $file->storeAs('tmp', now()->timestamp.'-'.Str::random(20).'.'.$ext, "private");

     return $path;
}

My Controller: No sign of files[], which used to be there. This is where I would copy from tmp to it’s permanent folder.

public function update(Request $request, string $id)
{
     Log::Debug($request->all());
     dd($request);
}

No errors in Chrome debugger console, Looking at the request post from network tab shows just the other fields on the form, not files[]. No errors in Laravel Log:

[2025-06-15 16:52:56] local.DEBUG: array (
  '_method' => 'PUT',
  '_token' => 'DxmXn00LeEZ7Qc1FqV6dFft8m4pkjTSvj7Y8N5un',
  'title' => 'aaa rtfgf',
  'text' => '<p>fgdfgdf</p>',
  'tag_list' => 
  array (
    0 => '11',
  ),
  'contact_list' => 
  array (
    0 => '13',
    1 => '18',
  ),
)  

Any help would be greatly appreciated! Thanks.

How can I integrate an AI to check the validity of posts and answers made in an app(Quora) [closed]

I have a school project to clone an application (Quora) and we’re asked to implement something that isn’t already in the app. I decided on an AI fact checker that will check the validity of posts and answers.It would take the answer or post then use relevant sources like wikipedia or google to check its validity. But I don’t really know how I’ll integrate an ai( I don’t even have an AI in mind). So I wanted to ask for directions and hints on how I could accomplish this task.Also I’m supposed to use react-native and javascript exclusively, so I would appreciate it if answers were relevant to it. THANK YOU

inserted Google map can’t click transport station only

I inserted google map into website using javascript. But I can click everything such as resturant, school, park and it will show me pop up provided from google map place api. However only transport are not click able. Train station, airport, subways I can’t click those on the map.

I haven’t changed anything from google map flatforms, using libraries=places&callback api.
Also style sheet does nothing to map except sizing again.

window.initMap = function() {
        map = new google.maps.Map(document.getElementById('map'), {
            center: { lat: 20, lng: 90 }, // 서울의 위도, 경도
            zoom: 2.3,
            minZoom: 2.3,
            mapTypeId: "roadmap",
            restriction: {
                latLngBounds: {
                    north: 85,
                    south: -85,
                    west: 0,
                    east: 360
                },
                strictBounds: true
            },
            zoomControl: false,
            mapTypeControl: false,
            scaleControl: true,
            streetViewControl: false,
            rotateControl: false,
            fullscreenControl: true,
            clickableIcons: true,
        });

Wix Visual Glitch After Minify

So i have been building a Website on Wix for a while. i work with alot of iFrames and Velo. Today i decided to to minify everything which made the Site way faster, however switching Tabs on my Tabbed Site sometimes (not every time and kinda random) causes a visual Glitch where within a split second the Tabs switch multiple times before the Final Tab is shown.
Basically if i go from tab A to B it might do A->B->A->B super fast, barely visible but still irritating.

First i tried to set a timeout before Pageload which didnt fix the Glitch, then i also tried using the Unminified Code for the Menu + Site Code but it still does the same Glitch now.

Background:
-My Site uses Wix #Tabs to split Content into Sections.
-Each Section is filled with HTML iFrames mostly.
-I Created a Custom TabMenu using an iFrame, which posts a message with the TabID to my Site when a Item is selected
-My Site Code then hides the Menu and triggers a TabChange + updates breadcrumbs.
-also theres a button to open the menu

I know the Approach isnt optimal but it works well, or atleast did until today.
Heres the Frontend Snippet that Handles everything on the Message.


let lastTabId = null;
let debounceTimeout = null;

$w.onReady(function () {
    const Ticker = session.getItem("selectedTicker");
    const companyName = session.getItem("selectedCompanyName");

    const tabMap = {
        "#singleTab4": ["Company Snapshot", "Overview"],
        "#singleTab12": ["Company Snapshot", "Company Profile"],
        "#singleTab8": ["Company Snapshot", "News"],
        "#singleTab6": ["Market & Valuation", "Valuation / Forecast"],
        "#singleTab5": ["Market & Valuation", "Volatility"],
        "#singleTab15": ["Financial Health", "Financials"],
        "#singleTab24": ["Financial Health", "Profitability"],
        "#singleTab9": ["Ownership & Sustainability", "ESG Score"],
        "#singleTab14": ["Ownership & Sustainability", "Holding Structure"],
        "#singleTab16": ["Ownership & Sustainability", "Dividends"],
        "#singleTab21": ["Filings & Insider Data", "Financial Statements"],
        "#singleTab10": ["Filings & Insider Data", "SEC Filings"],
        "#singleTab17": ["Filings & Insider Data", "Insider Activity"],
        "#singleTab13": ["Strategic Analysis", "SWOT Analysis"],
        "#singleTab22": ["Strategic Analysis", "PESTEL Analysis"],
        "#singleTab23": ["Strategic Analysis", "Porters 5 Forces"],
        "#singleTab19": ["Strategic Analysis", "Scenario Analysis"],
        "#singleTab18": ["Advanced Tools", "Monte Carlo"],
        "#singleTab20": ["Advanced Tools", "Custom Ratios"],
        "#singleTab25": ["Advanced Tools", "AI Analysts"],
        "#singleTab26": ["Advanced Tools", "Compare"]
    };

    // Set initial breadcrumb
    $w("#html115").postMessage({
        breadcrumb: `<span style="color:#fd6262;font-weight:500;">${Ticker}</span> > Company Snapshot > Overview`
    });

    // Toggle menu iframe visibility
    $w('#button5').onClick(() => {
        const iframe = $w('#html113');
        iframe.hidden ? iframe.show() : iframe.hide();
    });

    // Handle messages from the menu iframe
    $w('#html113').onMessage(event => {
        const data = event.data;

       if (data?.type === "selectTab") {
            const tabId = data.tabId;
            const hideMenu = data.hideMenu;

            if (tabId !== lastTabId) {
                clearTimeout(debounceTimeout);
                debounceTimeout = setTimeout(() => {
                    lastTabId = tabId;
                    $w("#tabs1").changeTab($w(tabId));

                    const [category, tabName] = tabMap[tabId] || ["Unknown Category", "Unknown Tab"];
                    $w("#html115").postMessage({
                        breadcrumb: `<span style="color:#fd6262;font-weight:500;">${Ticker}</span> > ${category} > ${tabName}`
                    });

                    if (hideMenu) {
                        $w('#html113').hide();
                    }
                }, 60);  // Added this in trying to resolve the issue, does nothing
            }
        }
    });
});

New line in a X post

I wrote a browser extention for social media handling.

You can e.g. reformulate your given text to make it more positive etc.

Now if I insert the response to the X – Reply Textarea back it does not react to “n” chars… makes the text just in one block. I already tried “rn” and pressing the “enter” button.

Does anyone know how to work around this?

Current code:

function copyText(replyText, replyTextarea) {
                replyTextarea.focus();
                document.execCommand('insertText', false, replyText);
                replyTextarea.dispatchEvent(new Event('input', { bubbles: true }));
                clickedButton.innerHTML = originalContent;
                clickedButton.disabled = false;
                clickedButton.style.borderColor = '#666666';
                clickedButton.style.color = '#666666';
            }

Also tried:

function copyText(replyText, replyTextarea) {
                replyTextarea.focus();
                const parts = replyText.split('n');
                parts.forEach((part, index) => {
                    document.execCommand('insertText', false, part);
                    if (index < parts.length - 1) {
                        const enterEvent = new KeyboardEvent('keydown', {
                            key: 'Enter',
                            code: 'Enter',
                            keyCode: 13,
                            which: 13,
                            bubbles: true
                        });
                        replyTextarea.dispatchEvent(enterEvent);
                    }
                });
                
                replyTextarea.dispatchEvent(new Event('input', { bubbles: true }));
                clickedButton.innerHTML = originalContent;
                clickedButton.disabled = false;
                clickedButton.style.borderColor = '#666666';
                clickedButton.style.color = '#666666';
            }

Why is the response empty when handling an XmlHttpRequest load event?

I have an XmlHttpRequest with a listener on the load event:

xhr.upload.addEventListener('load', () => {
  if (xhr.status === 200) {
    resolve(UPLOAD_OK);
  }
  else {
    const message = JSON.parse(xhr.response)?.error;
    reject(new APIError(xhr.status, xhr.statusText, message));
  }
});

When I call JSON.parse(xhr.response), I get an exception:

Uncaught SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

This is the exception you’d expect from calling JSON.parse on the empty string, but what I see as the response body in the browser console is {"error": "Already exists"}—which is the response I am expecting.

Why does this happen? Shouldn’t the response be set by the time the load event fires? If not, where is this documented and what event is the correct event for getting the response?