diff --git a/ExternalMethods/ExternalMethods.csproj b/ExternalMethods/ExternalMethods.csproj
index 767f7fe..7977d1b 100644
--- a/ExternalMethods/ExternalMethods.csproj
+++ b/ExternalMethods/ExternalMethods.csproj
@@ -1,7 +1,7 @@
- net6.0-windows8.0
+ netstandard2.0
diff --git a/JUST.net/JUST.net.csproj b/JUST.net/JUST.net.csproj
index efed904..684cc47 100644
--- a/JUST.net/JUST.net.csproj
+++ b/JUST.net/JUST.net.csproj
@@ -2,7 +2,7 @@
JUST - JSON Under Simple Transformation
- net6.0-windows8.0
+ netstandard2.0
This a cool .NET Standard library which enables you to transform a JSON document into another JSON document using JSON transformations using JSON path. This is the JSON equivalent of XSLT.
This will repace the JUST and JUST.NETCore packages.
This is the JSON equivalent of XSLT
diff --git a/JUST.net/Properties/PublishProfiles/FolderProfile.pubxml b/JUST.net/Properties/PublishProfiles/FolderProfile.pubxml
index 5672e42..296ffbd 100644
--- a/JUST.net/Properties/PublishProfiles/FolderProfile.pubxml
+++ b/JUST.net/Properties/PublishProfiles/FolderProfile.pubxml
@@ -7,7 +7,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
FileSystem
Release
- netstandard1.6
+ netstandard2.0
bin\Release\PublishOutput
\ No newline at end of file
diff --git a/JUST.net/Transformer.cs b/JUST.net/Transformer.cs
index 440aa23..07d8a2b 100644
--- a/JUST.net/Transformer.cs
+++ b/JUST.net/Transformer.cs
@@ -712,6 +712,11 @@ public static object tointeger(object val, JUSTContext context)
return ReflectionHelper.GetTypedValue(typeof(int), val, context.EvaluationMode);
}
+ public static object tolong(object val, JUSTContext context)
+ {
+ return ReflectionHelper.GetTypedValue(typeof(long), val, context.EvaluationMode);
+ }
+
public static object tostring(object val, JUSTContext context)
{
return ReflectionHelper.GetTypedValue(typeof(string), val, context.EvaluationMode);
diff --git a/UnitTestForExternalAssemblyBug/UnitTestForExternalAssemblyBug.csproj b/UnitTestForExternalAssemblyBug/UnitTestForExternalAssemblyBug.csproj
index 4a22afc..d255ec2 100644
--- a/UnitTestForExternalAssemblyBug/UnitTestForExternalAssemblyBug.csproj
+++ b/UnitTestForExternalAssemblyBug/UnitTestForExternalAssemblyBug.csproj
@@ -1,7 +1,7 @@
- net6.0-windows8.0
+ net6.0
false
diff --git a/UnitTests/JUST.net.UnitTests.csproj b/UnitTests/JUST.net.UnitTests.csproj
index 0d9320e..f454097 100644
--- a/UnitTests/JUST.net.UnitTests.csproj
+++ b/UnitTests/JUST.net.UnitTests.csproj
@@ -1,7 +1,7 @@
- net6.0-windows8.0
+ net6.0
false
diff --git a/UnitTests/TypeConversionTests.cs b/UnitTests/TypeConversionTests.cs
index 5a83fd5..91b4712 100644
--- a/UnitTests/TypeConversionTests.cs
+++ b/UnitTests/TypeConversionTests.cs
@@ -58,6 +58,23 @@ public void ToIntegerConvertion(string typedValue, string expectedResult)
Assert.AreEqual($"{{\"result\":{expectedResult}}}", result);
}
+ [TestCase("\"12345678901\"", "12345678901")]
+ [TestCase("\"-12345678901\"", "-12345678901")]
+ [TestCase("\"0\"", "0")]
+ [TestCase("12345678901.23", "12345678901")]
+ [TestCase("-12345678901.56", "-12345678902")]
+ [TestCase("true", "1")]
+ [TestCase("false", "0")]
+ public void ToLongConversion(string typedValue, string expectedResult)
+ {
+ var input = $"{{ \"value\": {typedValue} }}";
+ const string transformer = "{ \"result\": \"#tolong(#valueof($.value))\" }";
+
+ var result = new JsonTransformer().Transform(transformer, input);
+
+ Assert.AreEqual($"{{\"result\":{expectedResult}}}", result);
+ }
+
[TestCase("\"0\"", "0.0")]
[TestCase("\"1.01\"", "1.01")]
[TestCase("123", "123.0")]