AddImportFromSpecifier adds an import from a specifier to the import map.
(specifier string, noSRI bool)
| 293 | |
| 294 | // AddImportFromSpecifier adds an import from a specifier to the import map. |
| 295 | func (im *ImportMap) AddImportFromSpecifier(specifier string, noSRI bool) (warnings []string, errors []error) { |
| 296 | imp, err := im.ParseImport(specifier) |
| 297 | if err != nil { |
| 298 | errors = append(errors, err) |
| 299 | return |
| 300 | } |
| 301 | return im.AddImport(imp, noSRI) |
| 302 | } |
| 303 | |
| 304 | // AddImport adds an import to the import map. |
| 305 | func (im *ImportMap) AddImport(imp ImportMeta, noSRI bool) (warnings []string, errors []error) { |