-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
the code is
const shebangRegex = /^#!(.*)/;
the biggest consumer is cross-spawn through a transitive dep (I've opened a PR there to inline their tiny deps, but I think this is still a good option to add to microutillities manifest)
I think we can do something like and adapt based on the use case?
export function once(fn) {
if (typeof fn !== 'function') throw new TypeError('Expected a function');
let called = false;
let value;
return function (...args) {
if (called) return value;
called = true;
value = fn.apply(this, args);
return value;
};
}
const isCustomElementName = name => /^[a-z](?:[\.0-9_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*-(?:[\x2D\.0-9_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/.test(name);
- sinon -> tinyspy?
for basic stuff tinyspy is good enough as is, for network you should be able to take nock/MSW, take @sinonjs/fake-timers for timers, for module mocking either rely on your test runner or use esmock/mock-require and most folks should be good to go? (idk what to do with Sinon sandboxes though)
Metadata
Metadata
Assignees
Labels
No labels