Files
scriptc/tests/library-mode/npm-static/node_modules/mathkit/index.js
T
Chris Tate 967f2ec85d Compile minified npm entries and untyped regex arguments
Refs #1777

npm packages are no longer refused up front for minified JavaScript. A
bundle whose interop helpers lost their names is still refused by the
bundle recognizers, and a package whose attempt fails is still refused on
its own.

A `var` read in a later declarator of the statement that stores it
(`var a = {...}, b = {...a}`) runs after the store. A read in a function
body is now located at the body's own statement instead of the body, so
JavaScript `var` bindings read after their store in a function keep their
type instead of gaining undefined.

`replace` and `replaceAll` with an untyped search value and a callback
call the regex callback replacement for a RegExp and the string-search
helper otherwise. That helper now accepts untyped callback parameters,
passes undefined to parameters after the subject, and converts number,
boolean and untyped results with ToString.

In JavaScript, `||` and `&&` over primitives of different types whose
result tsc types `any` evaluate in the checked domain.
2026-10-23 05:55:39 -05:00

12 lines
358 B
JavaScript

"use strict";
// A vendored fake package for the library-mode npm posture: eligible by
// every bar (own .d.ts, no build-transform markers), with
// its OWN npm dep edge (mathdep) so the transitive fixpoint is exercised.
const steps = require("mathdep");
exports.scale = function scale(x, factor) {
return steps.twice(x) * factor;
};
exports.OFFSET = 7;