Gathering detailed insights and metrics for @odata2ts/converter-common
Gathering detailed insights and metrics for @odata2ts/converter-common
Gathering detailed insights and metrics for @odata2ts/converter-common
Gathering detailed insights and metrics for @odata2ts/converter-common
npm install @odata2ts/converter-common
@odata2ts/converter-runtime@0.5.0
Published on 25 Aug 2024
@odata2ts/converter-common@0.3.3
Published on 25 Aug 2024
@odata2ts/converter-big-number@0.2.3
Published on 25 Aug 2024
@odata2ts/converter-luxon@0.2.3
Published on 25 Aug 2024
@odata2ts/converter-decimal@0.2.3
Published on 25 Aug 2024
@odata2ts/converter-api@0.2.2
Published on 25 Aug 2024
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
3 Stars
72 Commits
2 Forks
1 Watching
6 Branches
1 Contributors
Updated on 10 Nov 2024
TypeScript (99.4%)
JavaScript (0.6%)
Cumulative downloads
Total Downloads
Last day
3.1%
330
Compared to previous day
Last week
-7.8%
1,612
Compared to previous week
Last month
18.5%
7,799
Compared to previous month
Last year
4,984.8%
26,085
Compared to previous year
1
This monorepo contains all modules relevant for odata2ts to realize data type conversions: From OData types to native JS types or third-party types and back:
converter-runtime
package realizes the loading process of convertersconverter-api
package specifies converters and serves as contract between odata2ts and any converter implementationIt also contains converters you can use:
string
to number
Edm.Int64
and Edm.Decimal
are not converted and remain type string
Edm.DateTime
is converted to Edm.DateTimeOffset
, i.e. proper ISO 8601 date and time presentationEdm.Time
is by default converted to Edm.TimeOfDay
(ISO 8601 time), but can also be relabeled as Edm.Duration
Edm.DateTimeOffset
: JavaScript Date
typeEdm.Duration
: simple duration objectEdm.Int64
: JavaScript bigint
typeEdm.DateTimeOffset
: Luxon's DateTime
typeEdm.Date
: Luxon's DateTime
typeEdm.TimeOfDay
: Luxon's DateTime
typeEdm.Duration
: Luxon's Duration
typesap.ui.model.odata.v2.ODataModel
)Converters can be picked as a package (using the default converter set) or individually by specifying each converter. If different converters handle the same data type, then the last converter wins.
Converters are chainable. This makes the v2-to-v4 converter
utterly useful, because it spares
other converters the work and headaches to cope with V2 types and lets them focus on converting V4 data types.
For example, every Edm.DateTime
gets converted to Edm.DateTimeOffset
, so that the Luxon and the common converter
only need to handle Edm.DateTimeOffset
.
While some OData types (Edm.String
, Edm.Boolean
, ...) can easily and perfectly be mapped to native JS types,
more advanced types are simply strings:
Edm.DateTimeOffset
: "1999-31-12T23:59:59Z"
Edm.Duration
: "PT10H"
As you can imagine, there are countless third-party libs and custom data structures which could be used in these cases. Thus, the choice of how to map data types must be left open to the user.
So either use an existing converter or roll your own.
Main Documentation of odata2ts: https://odata2ts.github.io/
If you have any sorts of questions use GitHub Discussions
of the main odata2ts
repository.
This project is open to feature requests, suggestions, bug reports, and the like
via GitHub issues of the main odata2ts
repository.
Contributions and feedback are encouraged and always welcome.
See the contribution guidelines for further information.
This project has been created and is maintained in the following spirit:
MIT - see License.
No vulnerabilities found.
No security vulnerabilities found.