fix(core): enterprise hardening, null-safety guards, readonly enum support & v2.0.0 sync#7
Open
Iradukunda-Fils wants to merge 8 commits into
Open
fix(core): enterprise hardening, null-safety guards, readonly enum support & v2.0.0 sync#7Iradukunda-Fils wants to merge 8 commits into
Iradukunda-Fils wants to merge 8 commits into
Conversation
… in validation pipeline
…and require constructor function type
fix(core): enterprise hardening, null-safety guards, readonly enum support & v2.0.0 sync
|
The PR documentation doesn't match the latest changes on your commit that align with version 2.0, Please update the documentation as I will use Squash and Merge to only take your latest changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Null-Safety Guards, Readonly Schema Support & Upstream v2.0.0 Alignment
Executive Summary
This pull request brings
@bufferpunk/modelcoreup to enterprise-grade stability (v2.0.0). It addresses runtime null-pointer vulnerabilities, string character-splitting in Union types, readonly schema enum support foras constarrays, defensive input sanitization, and full synchronization with the upstream modularsrc/architecture.1. Summary of Changes & Technical Explanations
A. Readonly Array Support for Enum Definitions (
src/typing.d.ts&src/typing.ts)as constassertions (readonly string[]) or frozen arrays (Object.freeze([...])), the TypeScript compiler threw strict type errors (TS2530/TS4104) becauseFieldConfig.enumstrictly expected a mutableany[].B. Defensive Null & Degenerate Schema Guarding (
src/utils.ts&src/base.ts){ type: undefined },{ type: null }, or{ type: "string" }) into field configs resulted in raw Node.js runtime crashes:TypeError: Cannot read properties of undefined (reading 'prototype').C. Null-Prototype Input Protection (
Object.create(null))Object.create(null)lackObject.prototypemethods and.constructor. Passing them as inputs triggered unhandled exceptions duringisOfType()property lookups.D. Union Type Structural Discrimination (
src/typing.ts&src/utils.ts)Union(Array, String)field caused the string to enter the Array iteration block, converting"hello"into['h','e','l','l','o']. Passing a string toUnion(Object, String)evaluated object key rules against string properties.2. Upgrade & Migration Notes (v1.x -> v2.0.0)
3. Verification & Testing
npm test