From 814bc9a0567bd23b902e371bc6de31ba417a0412 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Mon, 26 May 2025 01:07:29 +0100 Subject: [PATCH 1/2] feat: export escapeIRI --- index.ts | 2 ++ lib/TermUtil.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index a55068c..4bdcea5 100644 --- a/index.ts +++ b/index.ts @@ -8,6 +8,7 @@ import { stringQuadToQuad, stringToTerm, termToString, + escapeIRI, } from './lib/TermUtil'; export { getLiteralLanguage, @@ -19,4 +20,5 @@ export { stringQuadToQuad, stringToTerm, termToString, + escapeIRI, }; diff --git a/lib/TermUtil.ts b/lib/TermUtil.ts index eb28ac4..30f3a3e 100644 --- a/lib/TermUtil.ts +++ b/lib/TermUtil.ts @@ -226,7 +226,7 @@ export function stringQuadToQuad( ); } -function escapeIRI(iriValue: string): string { +export function escapeIRI(iriValue: string): string { return iriValue.replace(escapePattern, replaceEscapedCharacter); } From 73bc4161682425cd956bb7f701aa424b88b16ac2 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Mon, 26 May 2025 01:18:02 +0100 Subject: [PATCH 2/2] feat: also export escapeStringRDF --- index.ts | 2 ++ lib/TermUtil.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 4bdcea5..757e572 100644 --- a/index.ts +++ b/index.ts @@ -9,6 +9,7 @@ import { stringToTerm, termToString, escapeIRI, + escapeStringRDF, } from './lib/TermUtil'; export { getLiteralLanguage, @@ -21,4 +22,5 @@ export { stringToTerm, termToString, escapeIRI, + escapeStringRDF, }; diff --git a/lib/TermUtil.ts b/lib/TermUtil.ts index 30f3a3e..1770cb2 100644 --- a/lib/TermUtil.ts +++ b/lib/TermUtil.ts @@ -230,7 +230,7 @@ export function escapeIRI(iriValue: string): string { return iriValue.replace(escapePattern, replaceEscapedCharacter); } -function escapeStringRDF(stringValue: string): string { +export function escapeStringRDF(stringValue: string): string { if (escapePattern.test(stringValue)) { stringValue = stringValue.replace(escapePattern, replaceEscapedCharacter); }