MCPcopy Create free account
hub / github.com/react-component/select / injectPropsWithOption

Function injectPropsWithOption

src/utils/valueUtil.ts:101–116  ·  view source on GitHub ↗
(option: T)

Source from the content-addressed store, hash-verified

99 * Inject `props` into `option` for legacy usage
100 */
101export function injectPropsWithOption<T extends object>(option: T): T {
102 const newOption = { ...option };
103 if (!('props' in newOption)) {
104 Object.defineProperty(newOption, 'props', {
105 get() {
106 warning(
107 false,
108 'Return type is option instead of Option instance. Please read value directly instead of reading from `props`.',
109 );
110 return newOption;
111 },
112 });
113 }
114
115 return newOption;
116}
117
118export const getSeparatedContent = (text: string, tokens: string[], end?: number): string[] => {
119 if (!tokens || !tokens.length) {

Callers 3

triggerChangeFunction · 0.90
getSelectEntFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…