realm-js/lib/constants.js
Scott Kyle 15052985f1 Remove confusion between propTypes and objectTypes
The RPC layer now only speaks in objectTypes, since they don't always equate to propTypes. We were overloading the use of propTypes for no good purpose.
2016-01-05 13:53:54 -08:00

57 lines
828 B
JavaScript

/* Copyright 2015 Realm Inc - All Rights Reserved
* Proprietary and Confidential
*/
'use strict';
let keys = {};
let objectTypes = {};
let propTypes = {};
[
'id',
'realm',
'type',
].forEach(function(name) {
keys[name] = Symbol();
});
[
'DATA',
'DATE',
'DICT',
'FUNCTION',
'LIST',
'OBJECT',
'REALM',
'RESULTS',
'UNDEFINED',
].forEach(function(type) {
Object.defineProperty(objectTypes, type, {
value: type.toLowerCase(),
});
});
[
'BOOL',
'INT',
'FLOAT',
'DOUBLE',
'STRING',
'DATE',
'DATA',
'OBJECT',
'LIST',
].forEach(function(type) {
Object.defineProperty(propTypes, type, {
value: type.toLowerCase(),
enumerable: true,
});
});
module.exports = {
keys,
objectTypes,
propTypes
};