Skip to content

Instantly share code, notes, and snippets.

View maxired's full-sized avatar

Maxence Dalmais maxired

View GitHub Profile
@maxired
maxired / cubeInspect.js
Created September 11, 2012 08:59 — forked from temsa/cubeInspect.js
How to get introspection of square's "cube" events values for avent type, that you can use in your queries. this is a modified version for working with patch 5e7f122d1fccc942efa76cb9be947df8e11d8e05 Use ObjectID timestamps instead of dedicated field
var isArray = function (v) {
return v && typeof v === 'object' && typeof v.length === 'number' && !(v.propertyIsEnumerable('length'));
}
var isDate = function (v) {
return v && typeof v === 'object' && v instanceof Date;
}
var isObjectId = function (v) {
return v && typeof v === 'object' && v instanceof ObjectId;