mirror of
https://github.com/StikDebug/StikJIT.git
synced 2026-10-15 20:10:31 +00:00
Initial commit
Initial commit
This commit is contained in:
commit
99f2db2161
16 changed files with 8699 additions and 0 deletions
16
Sources/BundledScript.swift
Normal file
16
Sources/BundledScript.swift
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
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 {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue