@inlang/core
Advanced tools
Comparing version 0.3.0-prerelease.5 to 0.3.0-prerelease.6
@@ -29,3 +29,2 @@ /** | ||
export type Resource = Node<"Resource"> & { | ||
id: Identifier; | ||
languageTag: LanguageTag; | ||
@@ -32,0 +31,0 @@ body: Array<Message>; |
@@ -22,2 +22,4 @@ /** | ||
async function $import(uri, environment) { | ||
// avoiding browser built-in shadowing of fetch as global variable | ||
const _fetch = environment.fetch; | ||
// polyfill for environments that don't support dynamic | ||
@@ -27,3 +29,3 @@ // http imports yet like VSCode. | ||
if (uri.startsWith("http")) { | ||
moduleAsText = await (await environment.fetch(uri)).text(); | ||
moduleAsText = await (await _fetch(uri)).text(); | ||
} | ||
@@ -30,0 +32,0 @@ else { |
@@ -56,3 +56,3 @@ import { Result } from "@inlang/core/utilities"; | ||
if (get(copy, { id: args.message.id.name })) { | ||
return Result.err(Error(`Message ${args.message.id.name} already exists in resource ${resource.id.name}.`)); | ||
return Result.err(Error(`Message ${args.message.id.name} already exists in resource ${resource.languageTag.language}.`)); | ||
} | ||
@@ -93,3 +93,3 @@ copy.body.push(args.message); | ||
} | ||
return Result.err(Error(`Message ${args.id} does not exist in resource ${resource.id.name}.`)); | ||
return Result.err(Error(`Message ${args.id} does not exist in resource ${resource.languageTag.language}.`)); | ||
} | ||
@@ -109,3 +109,3 @@ // using underscore to circumvent javascript reserved keyword 'delete' | ||
} | ||
return Result.err(Error(`Message ${args.id} does not exist in resource ${resource.id.name}.`)); | ||
return Result.err(Error(`Message ${args.id} does not exist in resource ${resource.languageTag.language}.`)); | ||
} | ||
@@ -112,0 +112,0 @@ function includedMessageIds(resource) { |
{ | ||
"name": "@inlang/core", | ||
"type": "module", | ||
"version": "0.3.0-prerelease.5", | ||
"version": "0.3.0-prerelease.6", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "publishConfig": { |
26738
697