Some checks failed
CI/CD Pipeline / unit-tests (push) Failing after 1m16s
CI/CD Pipeline / integration-tests (push) Failing after 2m32s
CI/CD Pipeline / lint (push) Successful in 5m22s
CI/CD Pipeline / e2e-tests (push) Has been skipped
CI/CD Pipeline / build (push) Has been skipped
18 lines
497 B
TypeScript
18 lines
497 B
TypeScript
import memoize from '@emotion/memoize'
|
|
|
|
declare const codegen: { require: (path: string) => any }
|
|
|
|
// eslint-disable-next-line no-undef
|
|
const reactPropsRegex: RegExp = codegen.require('./props')
|
|
|
|
// https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
|
|
const isPropValid = /* #__PURE__ */ memoize(
|
|
prop =>
|
|
reactPropsRegex.test(prop) ||
|
|
(prop.charCodeAt(0) === 111 /* o */ &&
|
|
prop.charCodeAt(1) === 110 /* n */ &&
|
|
prop.charCodeAt(2) < 91) /* Z+1 */
|
|
)
|
|
|
|
export default isPropValid
|