mirror of
https://github.com/StikDebug/StikJIT.git
synced 2026-10-15 20:10:31 +00:00
16 lines
460 B
Swift
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 {}
|