https://github.com/pfgray/ims-casa-js
https://github.com/pfgray/ims-casa-js
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pfgray/ims-casa-js
- Owner: pfgray
- Created: 2015-08-14T04:00:44.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-09T17:10:40.000Z (over 9 years ago)
- Last Synced: 2025-01-25T06:26:17.197Z (4 months ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ims-casa
=====
This library eases the translation of casa entities. more info on casa [here](http://imsglobal.github.io/casa/)var casa = require('ims-casa');
casa.translate(customProperties)(entity)A call to `casa.translate()` will return a function that translates an entity. This comes in handy when you have a list of entities that you'd like to translate, for example:
var entities = [];
var translatedEntities = entities.map(casa.translate());
As it's first parameter, `casa.translate` accepts a map of custom guids that will be used in translation.The translator will translate:
{
"identity":{"originator_id":"guid","id":"ident"},
"original":{
"timestamp":"2015-06-16T20:34:13.874Z",
"uri":"http://example.com",
"share":true,
"propagate":true,
"use":{
"1f2625c2-615f-11e3-bf13-d231feb1dc81":"Title of App"
},"require":{}
},
"journal":[]
}
to:
{
"identity":{"originator_id":"guid","id":"ident"},
"original":{
"timestamp":"2015-06-16T20:34:13.874Z",
"uri":"http://example.com",
"share":true,
"propagate":true,
"use":{
"title":"Title of App"
},"require":{}
},
"journal":[]
}