NMV 0.8.0 - Big refactor and linting fixes

This commit is contained in:
Casper Warden
2025-01-17 23:37:54 +00:00
parent 3870861b0a
commit 53659008ac
210 changed files with 17588 additions and 18300 deletions

View File

@@ -1,6 +1,6 @@
import * as LLSD from '@caspertech/llsd';
import { LLGLTFMaterialData } from './LLGLTFMaterialData';
import type { LLGLTFMaterialData } from './LLGLTFMaterialData';
export class LLGLTFMaterial
{
public type?: string;
@@ -11,13 +11,13 @@ export class LLGLTFMaterial
{
if (data !== undefined)
{
const header = data.slice(0, 18).toString('utf-8');
const header = data.subarray(0, 18).toString('utf-8');
if (header.length !== 18 || header !== '<? LLSD/Binary ?>\n')
{
throw new Error('Failed to parse LLGLTFMaterial');
}
const body = new LLSD.Binary(Array.from(data.slice(18)), 'BINARY');
const body = new LLSD.Binary(Array.from(data.subarray(18)), 'BINARY');
const llsd = LLSD.LLSD.parseBinary(body);
if (!llsd.result)
{