CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-setprototypeof

A small polyfill for Object.setPrototypeOf with cross-platform compatibility

82

1.02x
Overview
Eval results
Files

rubric.jsonevals/scenario-2/

{
  "context": "Evaluates how well the solution leverages the setprototypeof package to manage prototype reassignment for both in-place and cloned objects with proper TypeScript typing and null-safe behavior.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Import usage",
      "description": "Imports the package's default `setPrototypeOf` helper (ES import or CommonJS require) rather than reimplementing or relying solely on `Object.setPrototypeOf` or `__proto__` assignments.",
      "max_score": 20
    },
    {
      "name": "In-place calls",
      "description": "`attachPrototype` delegates to `setPrototypeOf` to mutate the original object and returns that same reference without substituting custom prototype logic.",
      "max_score": 25
    },
    {
      "name": "Clone calls",
      "description": "`cloneWithPrototype` constructs a fresh shallow copy and applies `setPrototypeOf` to the copy so the original remains unchanged while inheriting from the provided prototype.",
      "max_score": 20
    },
    {
      "name": "Null handling",
      "description": "Passes `null` through to `setPrototypeOf` when requested, demonstrating the package's support for null prototypes instead of blocking or coalescing to an object.",
      "max_score": 15
    },
    {
      "name": "Typed signature",
      "description": "Uses TypeScript types aligned with the declaration `setPrototypeOf(o: any, proto: object | null): any`, keeping the `proto` parameter typed as `object | null` and ensuring return types preserve the input object shape.",
      "max_score": 20
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-setprototypeof

tile.json