Skip to content

More entries to the manifests #247

@outslept

Description

@outslept
  1. shebang-regex

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)

  1. once

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;
  };
}
  1. is-potential-custom-element-name
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);
  1. 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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions