MCPcopy Create free account
hub / github.com/JPeer264/node-rcs-core / replaceAttributeSelector

Method replaceAttributeSelector

lib/attributeLibrary.ts:353–369  ·  view source on GitHub ↗
(selector: string)

Source from the content-addressed store, hash-verified

351 }
352
353 replaceAttributeSelector(selector: string): string | false {
354 if (!this.isValidSelector(selector)) {
355 return false;
356 }
357
358 const slicedSelector = selector.replace(/^[.#]/, '');
359
360 return (
361 Object.entries(this.attributeSelectors)
362 .reduce<string | false>(
363 (a, entry) => (
364 AttributeLibrary.replaceAnAttributeSelector(a, entry[0], entry[1], slicedSelector)
365 ),
366 false,
367 )
368 );
369 }
370}
371
372export default new AttributeLibrary();

Callers 2

prepareValueMethod · 0.95

Calls 2

isValidSelectorMethod · 0.95

Tested by

no test coverage detected