StikJIT/Sources/BundledScript.swift
Stephen 99f2db2161 Initial commit
Initial commit
2026-06-23 12:17:03 -04:00

16 lines
460 B
Swift

import Foundation
enum BundledScript {
static func universalJS() throws -> String {
let bundle = Bundle(for: BundleToken.self)
guard let url = bundle.url(forResource: "universal", withExtension: "js"),
let source = try? String(contentsOf: url, encoding: .utf8),
!source.isEmpty else {
throw StikJITError.scriptUnavailable
}
return source
}
}
private final class BundleToken {}