Download pool/shard006/JavaScript/0037637_object.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 885 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard006/JavaScript/0037637_object.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard006/JavaScript/0037637_object.js
-
curl -L -o 0037637_object.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard006/JavaScript/0037637_object.js
885 Bytes
| var should = require('should'), | |
| dino = require('../../'); | |
| describe('object', function(){ | |
| var type; | |
| beforeEach(function(){ | |
| type = Object.create(dino.types.object); | |
| }); | |
| describe('parseValue', function(){ | |
| it('parses the value', function(){ | |
| should.not.exist(type.deserialize()); | |
| should.not.exist(type.deserialize(null)); | |
| type.deserialize(1).should.equal(1); | |
| should.not.exist(type.deserialize('a')); | |
| }); | |
| }); | |
| describe('transformValue', function(){ | |
| it('transforms the value', function(){ | |
| should.not.exist(type.serialize()); | |
| should.not.exist(type.serialize(null)); | |
| type.serialize(1).should.eql('1'); | |
| var obj = { test: 'test' }; | |
| type.serialize(obj).should.eql(JSON.stringify(obj)); | |
| }); | |
| }); | |
| }); |