@brandup/ui-helpers
v1.0.40
Published
JavaScript helpers
Maintainers
Readme
brandup-ui-helpers
Installation
Install NPM package @brandup/ui-helpers.
npm i @brandup/ui-helpers@latestString helpers
Format text
Format with model values:
const text = "Hello, {name}";
const result = text.format({ name: "Dmitry" }); // Hello, DmitryFormat with arguments:
const text = "Hello, {0}";
const result = text.format("Dmitry"); // Hello, DmitryObject helpers
Get value by property path
const model = {
header: {
value: "Item"
}
}
const value = Object.prop(model, "header.value"); // return "Item"
const hasValue = Object.hasProp(model, "header.value"); // return true