ord-schema 0.3.40 → 0.3.41-rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/bundle.js +24 -0
- package/dist/main.js +1 -0
- package/index.js +4 -2
- package/ord-schema-0.3.41-rc1.tgz +0 -0
- package/package.json +4 -2
- package/proto/dataset_pb.test.js +8 -8
- package/proto/reaction_pb.test.js +3 -3
package/index.js
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ord-schema",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.41-rc2",
|
|
4
4
|
"description": "Schema for the Open Reaction Database",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://open-reaction-database.org",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"google-protobuf": "<3.20"
|
|
20
|
+
"google-protobuf": "<3.20"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
21
23
|
"jest": "^29.3.1"
|
|
22
24
|
}
|
|
23
25
|
}
|
package/proto/dataset_pb.test.js
CHANGED
|
@@ -14,28 +14,28 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const ord = require('..');
|
|
18
18
|
|
|
19
19
|
test('round-trip', () => {
|
|
20
|
-
const dataset = new
|
|
20
|
+
const dataset = new ord.Dataset();
|
|
21
21
|
dataset.setName('test');
|
|
22
22
|
dataset.setDescription('test dataset');
|
|
23
23
|
// Add a reaction directly to the dataset.
|
|
24
24
|
const reaction1 = dataset.addReactions();
|
|
25
25
|
const identifier1 = reaction1.addIdentifiers();
|
|
26
26
|
identifier1.setValue('C(C)Cl.Br>>C(C)Br.Cl');
|
|
27
|
-
identifier1.setType(
|
|
27
|
+
identifier1.setType(ord.ReactionIdentifier.ReactionIdentifierType.REACTION_SMILES);
|
|
28
28
|
// Copy a reaction created elsewhere.
|
|
29
|
-
const reaction2 = new
|
|
29
|
+
const reaction2 = new ord.Reaction();
|
|
30
30
|
const identifier2 = reaction2.addIdentifiers();
|
|
31
31
|
identifier2.setValue('amide coupling');
|
|
32
|
-
identifier2.setType(
|
|
32
|
+
identifier2.setType(ord.ReactionIdentifier.ReactionIdentifierType.NAME);
|
|
33
33
|
dataset.addReactions(reaction2);
|
|
34
34
|
const serialized = dataset.serializeBinary();
|
|
35
|
-
const other =
|
|
35
|
+
const other = ord.Dataset.deserializeBinary(serialized);
|
|
36
36
|
expect(other.getName()).toBe('test');
|
|
37
37
|
expect(other.getDescription()).toBe('test dataset');
|
|
38
38
|
expect(other.getReactionsList()).toHaveLength(2);
|
|
39
|
-
expect(other.getReactionsList()[0].getIdentifiersList()[0].getType()).toBe(
|
|
40
|
-
expect(other.getReactionsList()[1].getIdentifiersList()[0].getType()).toBe(
|
|
39
|
+
expect(other.getReactionsList()[0].getIdentifiersList()[0].getType()).toBe(ord.ReactionIdentifier.ReactionIdentifierType.REACTION_SMILES);
|
|
40
|
+
expect(other.getReactionsList()[1].getIdentifiersList()[0].getType()).toBe(ord.ReactionIdentifier.ReactionIdentifierType.NAME);
|
|
41
41
|
});
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const ord = require('..');
|
|
18
18
|
|
|
19
19
|
test('simple', () => {
|
|
20
|
-
const reaction = new
|
|
20
|
+
const reaction = new ord.Reaction();
|
|
21
21
|
const identifier = reaction.addIdentifiers();
|
|
22
22
|
identifier.setValue('C(C)Cl.Br>>C(C)Br.Cl');
|
|
23
|
-
identifier.setType(
|
|
23
|
+
identifier.setType(ord.ReactionIdentifier.ReactionIdentifierType.REACTION_SMILES);
|
|
24
24
|
expect(reaction.getIdentifiersList()).toHaveLength(1);
|
|
25
25
|
expect(reaction.getSetup()).toBeUndefined();
|
|
26
26
|
});
|