sqry-lang-javascript 8.0.7

JavaScript language plugin for sqry
Documentation
1
2
3
4
5
6
7
8
9
10
use std::path::PathBuf;
use std::sync::atomic::{AtomicU64, Ordering};

/// Generate a unique in-memory file path for tests to prevent key collisions.
#[allow(dead_code)]
pub fn unique_js_path(prefix: &str) -> PathBuf {
    static COUNTER: AtomicU64 = AtomicU64::new(0);
    let id = COUNTER.fetch_add(1, Ordering::Relaxed);
    PathBuf::from(format!("{prefix}_{id}.js"))
}