Skip to content

Commit

Permalink
Merge pull request #6 from Critical-Impact/api11
Browse files Browse the repository at this point in the history
Api11
  • Loading branch information
Critical-Impact authored Nov 13, 2024
2 parents 16910ae + 703ba95 commit a414479
Show file tree
Hide file tree
Showing 73 changed files with 35,328 additions and 15,299 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer

- name: Download Dalamud
run: |
mkdir -p ${{ env.DALAMUD_HOME }}
curl -L https://goatcorp.github.io/dalamud-distrib/latest.zip -o latest.zip
curl -L https://goatcorp.github.io/dalamud-distrib/api11/latest.zip -o latest.zip
unzip latest.zip -d ${{ env.DALAMUD_HOME }}
# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v4

# Create the NuGet package in the folder from the environment variable NuGetDirectory
- run: |
$env:DALAMUD_HOME = "${{ env.DALAMUD_HOME }}"
dotnet pack --configuration Release --output ${{ env.NuGetDirectory }} src
# Publish the NuGet package as an artifact, so they can be used in the following jobs
- uses: actions/upload-artifact@v3
with:
Expand Down
20 changes: 20 additions & 0 deletions src/LuminaSupplemental.Excel/Extensions/EnumerableExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;

namespace LuminaSupplemental.Excel.Extensions;

public static class EnumerableExtensions
{
public static T? FirstOrNull<T>(this IEnumerable<T> source) where T : struct
{
return source.Cast<T?>().FirstOrDefault();
}

public static T? FirstOrNull<T>(this IEnumerable<T> source, Func<T, bool> predicate) where T : struct
{
ArgumentNullException.ThrowIfNull(source);
ArgumentNullException.ThrowIfNull(predicate);
return source.Where(predicate).Cast<T?>().FirstOrDefault();
}
}
Loading

0 comments on commit a414479

Please sign in to comment.