Source code

Revision control

Copy as Markdown

Other Tools

{
"tests": {
"Relative URL specifier keys should absolutize strings prefixed with ./, ../, or / into the corresponding URLs": {
"importMap": {
"imports": {
"./foo": "/dotslash",
"../foo": "/dotdotslash",
"/foo": "/slash"
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Relative URL specifier keys should not absolutize strings prefixed with ./, ../, or / with a data: URL base": {
"importMap": {
"imports": {
}
},
"importMapBaseURL": "data:text/html,",
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Relative URL specifier keys should absolutize the literal strings ./, ../, or / with no suffix": {
"importMap": {
"imports": {
"./": "/dotslash/",
"../": "/dotdotslash/",
"/": "/slash/"
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Relative URL specifier keys should work with /s, ?s, and #s": {
"importMap": {
"imports": {
"./foo/bar?baz#qux": "/foo"
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Relative URL specifier keys should ignore an empty string key": {
"importMap": {
"imports": {
"": "/foo"
}
},
"expectedParsedImportMap": {
"imports": {},
"scopes": {}
}
},
"Relative URL specifier keys should treat percent-encoded variants of ./, ../, or / as bare specifiers": {
"importMap": {
"imports": {
"%2E/": "/dotSlash1/",
"%2E%2E/": "/dotDotSlash1/",
".%2F": "/dotSlash2",
"..%2F": "/dotDotSlash2",
"%2F": "/slash2",
"%2E%2F": "/dotSlash3",
"%2E%2E%2F": "/dotDotSlash3"
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Relative URL specifier keys should deduplicate based on URL parsing rules": {
"importMap": {
"imports": {
"./foo/\\": "/foo1",
"./foo//": "/foo2",
"./foo\\\\": "/foo3"
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Absolute URL specifier keys should accept all absolute URL specifier keys, with or without fetch schemes": {
"importMap": {
"imports": {
"about:good": "/about",
"blob:good": "/blob",
"data:good": "/data",
"file:///good": "/file",
"filesystem:http://example.com/good/": "/filesystem/",
"http://good/": "/http/",
"https://good/": "/https/",
"ftp://good/": "/ftp/",
"import:bad": "/import",
"mailto:bad": "/mailto",
"javascript:bad": "/javascript",
"wss:bad": "/wss"
}
},
"expectedParsedImportMap": {
"imports": {
"about:good": "https://base.example/about",
"blob:good": "https://base.example/blob",
"data:good": "https://base.example/data",
"import:bad": "https://base.example/import",
"mailto:bad": "https://base.example/mailto",
"javascript:bad": "https://base.example/javascript",
},
"scopes": {}
}
},
"Absolute URL specifier keys should parse absolute URLs, treating unparseable ones as bare specifiers": {
"importMap": {
"imports": {
"https://example.com:demo": "/unparseable2",
"http://[www.example.com]/": "/unparseable3/",
"https:example.org": "/invalidButParseable1/",
"https://///example.com///": "/invalidButParseable2/",
"https://example.net": "/prettyNormal/",
"https://ex%41mple.com/": "/percentDecoding/"
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Specifier keys should be sort correctly (issue #181) - Test #1": {
"importMap": {
"imports": {
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
},
"Specifier keys should be sort correctly (issue #181) - Test #2": {
"importMap": {
"imports": {
}
},
"expectedParsedImportMap": {
"imports": {
},
"scopes": {}
}
}
}
}