2016-02-18 19:59:34 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright 2016 Realm Inc.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////////
|
2015-10-28 17:37:17 +00:00
|
|
|
|
2015-10-19 23:19:43 +00:00
|
|
|
'use strict';
|
|
|
|
|
2016-02-28 20:36:30 +00:00
|
|
|
export const keys = {};
|
|
|
|
export const objectTypes = {};
|
|
|
|
export const propTypes = {};
|
2015-10-19 23:19:43 +00:00
|
|
|
|
|
|
|
[
|
|
|
|
'id',
|
|
|
|
'realm',
|
|
|
|
'type',
|
|
|
|
].forEach(function(name) {
|
|
|
|
keys[name] = Symbol();
|
|
|
|
});
|
|
|
|
|
|
|
|
[
|
2015-11-03 06:16:50 +00:00
|
|
|
'DATA',
|
|
|
|
'DATE',
|
2015-11-03 00:36:24 +00:00
|
|
|
'DICT',
|
2015-10-19 23:19:43 +00:00
|
|
|
'FUNCTION',
|
2015-11-03 06:16:50 +00:00
|
|
|
'LIST',
|
|
|
|
'OBJECT',
|
2015-10-19 23:19:43 +00:00
|
|
|
'REALM',
|
|
|
|
'RESULTS',
|
2015-11-03 06:16:50 +00:00
|
|
|
'UNDEFINED',
|
2015-10-19 23:19:43 +00:00
|
|
|
].forEach(function(type) {
|
|
|
|
Object.defineProperty(objectTypes, type, {
|
2015-11-03 06:16:50 +00:00
|
|
|
value: type.toLowerCase(),
|
2015-10-19 23:19:43 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
[
|
|
|
|
'BOOL',
|
|
|
|
'INT',
|
|
|
|
'FLOAT',
|
|
|
|
'DOUBLE',
|
|
|
|
'STRING',
|
|
|
|
'DATE',
|
|
|
|
'DATA',
|
|
|
|
'OBJECT',
|
|
|
|
'LIST',
|
|
|
|
].forEach(function(type) {
|
|
|
|
Object.defineProperty(propTypes, type, {
|
2015-11-19 01:55:30 +00:00
|
|
|
value: type.toLowerCase(),
|
2015-10-19 23:19:43 +00:00
|
|
|
enumerable: true,
|
|
|
|
});
|
|
|
|
});
|