Skip to content

Conversation

@richardscarrott
Copy link
Owner

@richardscarrott richardscarrott commented Sep 14, 2022

Input:

import { string } from "ok-computer";

console.log(string(1));

$ rollup

Output:

(function () {
  'use strict';

  var INTROSPECT = Symbol.for("ok-computer.introspect");
  var create = (predicate) => (err2) => (value, ...parents) => value === INTROSPECT || !predicate(value, ...parents) ? err2 : void 0;
  var typeOf = (str) => create((value) => typeof value === str)(`Expected typeof ${str}`);
  var string = typeOf("string");

  console.log(string(1));

})();
//# sourceMappingURL=bundle.js.map

);

export const nullish = err(or(undef, nul), 'Expected nullish');
export const nullish = err(
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why, but sideEffects: false isn't enough and the following PURE annotations are needed also...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants