
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
ui5-typed-model
Advanced tools
A strictly typed wrapper of a UI5 JSON model.
Use npm to install:
npm install ui5-typed-model
Please note that this library works with TypeScript v5.0 or higher and depends
on the official ESM-style UI5 types
@openui5/types or @sapui5/types which will not be automatically installed.
Furthermore, a code transformation is needed to transform UI5-style ESM imports into valid UI5 code, e.g. with Babel and either babel-plugin-ui5-esm or babel-plugin-transform-modules-ui5.
Create a new TypedModel with an underlying JSONModel by calling the
constructor function and optionally provide a type:
import { TypedModel } from "ui5-typed-model";
interface Model {
message: string;
name: string;
contacts: {
name: string;
email: string;
}[];
}
const model = new TypedModel<Model>({
message: "Greetings",
name: "Universe",
contacts: [
{ name: "Yichuan", email: "me@site.com" },
{ name: "Ryan", email: "you@site.com" },
],
});
// Binding the model to core for simplicity
model.bindTo(sap.ui.getCore());
You can safely get and set property values using typed path builders:
const name = model.get((data) => data.name);
// name: string
const contactEmail = model.get(
(data) => data.contacts[0].email
);
// contactEmail: string | undefined
model.set((data) => data.message, "Hello");
There are convenience methods to create PropertyBindingInfo and
AggregationBindingInfo objects:
import Text from "sap/m/Text";
import VBox from "sap/m/VBox";
// ...
const text = new Text();
text.bindProperty(
"text",
model.binding((data) => data.message)
);
const vbox = new VBox();
vbox.bindAggregation(
"items",
model.aggregationBinding(
(data) => data.contacts,
(id, model) => {
const text = new Text(id);
text.setBindingContext(model.context);
text.bindProperty(
"text",
model.binding((_, context) => context.email)
);
return text;
}
)
);
You can use map to transform bindings:
const text = new Text();
text.bindProperty(
"text",
model
.binding((data) => data.message)
.map((message) => `${message}! And Goodbye!`)
);
It is possible to create composite bindings with the helper function
expressionBinding:
import { compositeBinding } from "ui5-typed-model";
// ...
const text = new Text();
text.bindProperty(
"text",
compositeBinding(
[model.binding((data) => data.message), model.binding((data) => data.name)],
(message, name) => `${message}, ${name}!`
)
);
FAQs
A strictly typed wrapper of a UI5 JSON model
We found that ui5-typed-model demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.