Skip to content

Commit

Permalink
set primitive extension internal
Browse files Browse the repository at this point in the history
  • Loading branch information
alec1o committed May 31, 2024
1 parent 0849c48 commit c7e0d27
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/src/extension/PrimitiveExtension.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Numerics;

namespace Byter
{
public static class PrimitiveExtension
internal static class PrimitiveExtension
{
internal static byte[] ToPrimitive<T>(this T value)
public static byte[] ToPrimitive<T>(this T value)
{
return ToPrimitive(value, typeof(T));
}

internal static byte[] ToPrimitive<T>(this T value, Type type)
public static byte[] ToPrimitive<T>(this T value, Type type)
{
var primitive = new Primitive();

Expand Down Expand Up @@ -116,13 +115,13 @@ internal static byte[] ToPrimitive<T>(this T value, Type type)
return primitive.Data;
}

internal static (T Value, bool IsError) FromPrimitive<T>(Primitive primitive)
public static (T Value, bool IsError) FromPrimitive<T>(Primitive primitive)
{
var result = FromPrimitive(typeof(T), primitive);
return ((T)result.Value, result.IsError);
}

internal static (object Value, bool IsError) FromPrimitive(Type type, Primitive primitive)
public static (object Value, bool IsError) FromPrimitive(Type type, Primitive primitive)
{
if (type == null || primitive == null) return (default, true);

Expand Down

0 comments on commit c7e0d27

Please sign in to comment.