1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

strip_shebang

This commit is contained in:
Ryan Dahl 2021-09-24 14:08:58 -04:00
parent 6c3b474b32
commit c1100c92d0

View file

@ -213,7 +213,7 @@ pub fn map_content_type(
}
/// Remove shebangs from the start of source code strings
pub fn strip_shebang(mut value: String) -> String {
fn strip_shebang(mut value: String) -> String {
if value.starts_with("#!") {
if let Some(mid) = value.find('\n') {
let (_, rest) = value.split_at(mid);