sequelize
Version:
Multi dialect ORM for Node.JS/io.js
1,466 lines (1,465 loc) • 301 kB
JSON
{
"type": "File",
"start": 0,
"end": 1646,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 60,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 1646,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 60,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "VariableDeclaration",
"start": 15,
"end": 43,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 28
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 21,
"end": 42,
"loc": {
"start": {
"line": 3,
"column": 6
},
"end": {
"line": 3,
"column": 27
}
},
"id": {
"type": "Identifier",
"start": 21,
"end": 22,
"loc": {
"start": {
"line": 3,
"column": 6
},
"end": {
"line": 3,
"column": 7
},
"identifierName": "_"
},
"name": "_"
},
"init": {
"type": "CallExpression",
"start": 25,
"end": 42,
"loc": {
"start": {
"line": 3,
"column": 10
},
"end": {
"line": 3,
"column": 27
}
},
"callee": {
"type": "Identifier",
"start": 25,
"end": 32,
"loc": {
"start": {
"line": 3,
"column": 10
},
"end": {
"line": 3,
"column": 17
},
"identifierName": "require"
},
"name": "require"
},
"arguments": [
{
"type": "StringLiteral",
"start": 33,
"end": 41,
"loc": {
"start": {
"line": 3,
"column": 18
},
"end": {
"line": 3,
"column": 26
}
},
"extra": {
"rawValue": "lodash",
"raw": "'lodash'"
},
"value": "lodash"
}
]
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 44,
"end": 73,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 29
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 50,
"end": 72,
"loc": {
"start": {
"line": 4,
"column": 6
},
"end": {
"line": 4,
"column": 28
}
},
"id": {
"type": "Identifier",
"start": 50,
"end": 54,
"loc": {
"start": {
"line": 4,
"column": 6
},
"end": {
"line": 4,
"column": 10
},
"identifierName": "util"
},
"name": "util"
},
"init": {
"type": "CallExpression",
"start": 57,
"end": 72,
"loc": {
"start": {
"line": 4,
"column": 13
},
"end": {
"line": 4,
"column": 28
}
},
"callee": {
"type": "Identifier",
"start": 57,
"end": 64,
"loc": {
"start": {
"line": 4,
"column": 13
},
"end": {
"line": 4,
"column": 20
},
"identifierName": "require"
},
"name": "require"
},
"arguments": [
{
"type": "StringLiteral",
"start": 65,
"end": 71,
"loc": {
"start": {
"line": 4,
"column": 21
},
"end": {
"line": 4,
"column": 27
}
},
"extra": {
"rawValue": "util",
"raw": "'util'"
},
"value": "util"
}
]
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 74,
"end": 108,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 34
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 80,
"end": 107,
"loc": {
"start": {
"line": 5,
"column": 6
},
"end": {
"line": 5,
"column": 33
}
},
"id": {
"type": "Identifier",
"start": 80,
"end": 85,
"loc": {
"start": {
"line": 5,
"column": 6
},
"end": {
"line": 5,
"column": 11
},
"identifierName": "Utils"
},
"name": "Utils"
},
"init": {
"type": "CallExpression",
"start": 88,
"end": 107,
"loc": {
"start": {
"line": 5,
"column": 14
},
"end": {
"line": 5,
"column": 33
}
},
"callee": {
"type": "Identifier",
"start": 88,
"end": 95,
"loc": {
"start": {
"line": 5,
"column": 14
},
"end": {
"line": 5,
"column": 21
},
"identifierName": "require"
},
"name": "require"
},
"arguments": [
{
"type": "StringLiteral",
"start": 96,
"end": 106,
"loc": {
"start": {
"line": 5,
"column": 22
},
"end": {
"line": 5,
"column": 32
}
},
"extra": {
"rawValue": "../utils",
"raw": "'../utils'"
},
"value": "../utils"
}
]
}
}
],
"kind": "const"
},
{
"type": "FunctionDeclaration",
"start": 110,
"end": 567,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 20,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 119,
"end": 138,
"loc": {
"start": {
"line": 7,
"column": 9
},
"end": {
"line": 7,
"column": 28
},
"identifierName": "validateDeprecation"
},
"name": "validateDeprecation"
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 139,
"end": 144,
"loc": {
"start": {
"line": 7,
"column": 29
},
"end": {
"line": 7,
"column": 34
},
"identifierName": "value"
},
"name": "value"
},
{
"type": "Identifier",
"start": 146,
"end": 157,
"loc": {
"start": {
"line": 7,
"column": 36
},
"end": {
"line": 7,
"column": 47
},
"identifierName": "expectation"
},
"name": "expectation"
},
{
"type": "Identifier",
"start": 159,
"end": 166,
"loc": {
"start": {
"line": 7,
"column": 49
},
"end": {
"line": 7,
"column": 56
},
"identifierName": "options"
},
"name": "options"
}
],
"body": {
"type": "BlockStatement",
"start": 168,
"end": 567,
"loc": {
"start": {
"line": 7,
"column": 58
},
"end": {
"line": 20,
"column": 1
}
},
"body": [
{
"type": "IfStatement",
"start": 172,
"end": 214,
"loc": {
"start": {
"line": 8,
"column": 2
},
"end": {
"line": 10,
"column": 3
}
},
"test": {
"type": "UnaryExpression",
"start": 176,
"end": 195,
"loc": {
"start": {
"line": 8,
"column": 6
},
"end": {
"line": 8,
"column": 25
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "MemberExpression",
"start": 177,
"end": 195,
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 8,
"column": 25
}
},
"object": {
"type": "Identifier",
"start": 177,
"end": 184,
"loc": {
"start": {
"line": 8,
"column": 7
},
"end": {
"line": 8,
"column": 14
},
"identifierName": "options"
},
"name": "options"
},
"property": {
"type": "Identifier",
"start": 185,
"end": 195,
"loc": {
"start": {
"line": 8,
"column": 15
},
"end": {
"line": 8,
"column": 25
},
"identifierName": "deprecated"
},
"name": "deprecated"
},
"computed": false
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {
"type": "BlockStatement",
"start": 197,
"end": 214,
"loc": {
"start": {
"line": 8,
"column": 27
},
"end": {
"line": 10,
"column": 3
}
},
"body": [
{
"type": "ReturnStatement",
"start": 203,
"end": 210,
"loc": {
"start": {
"line": 9,
"column": 4
},
"end": {
"line": 9,
"column": 11
}
},
"argument": null
}
],
"directives": []
},
"alternate": null
},
{
"type": "VariableDeclaration",
"start": 218,
"end": 371,
"loc": {
"start": {
"line": 12,
"column": 2
},
"end": {
"line": 12,
"column": 155
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 224,
"end": 370,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 154
}
},
"id": {
"type": "Identifier",
"start": 224,
"end": 229,
"loc": {
"start": {
"line": 12,
"column": 8
},
"end": {
"line": 12,
"column": 13
},
"identifierName": "valid"
},
"name": "valid"
},
"init": {
"type": "LogicalExpression",
"start": 232,
"end": 370,
"loc": {
"start": {
"line": 12,
"column": 16
},
"end": {
"line": 12,
"column": 154
}
},
"left": {
"type": "BinaryExpression",
"start": 232,
"end": 267,
"loc": {
"start": {
"line": 12,
"column": 16
},
"end": {
"line": 12,
"column": 51
}
},
"left": {
"type": "Identifier",
"start": 232,
"end": 237,
"loc": {
"start": {
"line": 12,
"column": 16
},
"end": {
"line": 12,
"column": 21
},
"identifierName": "value"
},
"name": "value"
},
"operator": "instanceof",
"right": {
"type": "MemberExpression",
"start": 249,
"end": 267,
"loc": {
"start": {
"line": 12,
"column": 33
},
"end": {
"line": 12,
"column": 51
}
},
"object": {
"type": "Identifier",
"start": 249,
"end": 256,
"loc": {
"start": {
"line": 12,
"column": 33
},
"end": {
"line": 12,
"column": 40
},
"identifierName": "options"
},
"name": "options"
},
"property": {
"type": "Identifier",
"start": 257,
"end": 267,
"loc": {
"start": {
"line": 12,
"column": 41
},
"end": {
"line": 12,
"column": 51
},
"identifierName": "deprecated"
},
"name": "deprecated"
},
"computed": false
}
},
"operator": "||",
"right": {
"type": "BinaryExpression",
"start": 271,
"end": 370,
"loc": {
"start": {
"line": 12,
"column": 55
},
"end": {
"line": 12,
"column": 154
}
},
"left": {
"type": "CallExpression",
"start": 271,
"end": 308,
"loc": {
"start": {
"line": 12,
"column": 55
},
"end": {
"line": 12,
"column": 92
}
},
"callee": {
"type": "MemberExpression",
"start": 271,
"end": 301,
"loc": {
"start": {
"line": 12,
"column": 55
},
"end": {
"line": 12,
"column": 85
}
},
"object": {
"type": "MemberExpression",
"start": 271,
"end": 296,
"loc": {
"start": {
"line": 12,
"column": 55
},
"end": {
"line": 12,
"column": 80
}
},
"object": {
"type": "MemberExpression",
"start": 271,
"end": 287,
"loc": {
"start": {
"line": 12,
"column": 55
},
"end": {
"line": 12,
"column": 71
}
},
"object": {
"type": "Identifier",
"start": 271,
"end": 277,
"loc": {
"start": {
"line": 12,
"column": 55
},
"end": {
"line": 12,
"column": 61
},
"identifierName": "Object"
},
"name": "Object"
},
"property": {
"type": "Identifier",
"start": 278,
"end": 287,
"loc": {
"start": {
"line": 12,
"column": 62
},
"end": {
"line": 12,
"column": 71
},
"identifierName": "prototype"
},
"name": "prototype"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 288,
"end": 296,
"loc": {
"start": {
"line": 12,
"column": 72
},
"end": {
"line": 12,
"column": 80
},
"identifierName": "toString"
},
"name": "toString"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 297,
"end": 301,
"loc": {
"start": {
"line": 12,
"column": 81
},
"end": {
"line": 12,
"column": 85
},
"identifierName": "call"
},
"name": "call"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 302,
"end": 307,
"loc": {
"start": {
"line": 12,
"column": 86
},
"end": {
"line": 12,
"column": 91
},
"identifierName": "value"
},
"name": "value"
}
]
},
"operator": "===",
"right": {
"type": "CallExpression",
"start": 313,
"end": 370,
"loc": {
"start": {
"line": 12,
"column": 97
},
"end": {
"line": 12,
"column": 154
}
},
"callee": {
"type": "MemberExpression",
"start": 313,
"end": 343,
"loc": {
"start": {
"line": 12,
"column": 97
},
"end": {
"line": 12,
"column": 127
}
},
"object": {
"type": "MemberExpression",
"start": 313,
"end": 338,
"loc": {
"start": {
"line": 12,
"column": 97
},
"end": {
"line": 12,
"column": 122
}
},
"object": {
"type": "MemberExpression",
"start": 313,
"end": 329,
"loc": {
"start": {
"line": 12,
"column": 97
},
"end": {
"line": 12,
"column": 113
}
},
"object": {
"type": "Identifier",
"start": 313,
"end": 319,
"loc": {
"start": {
"line": 12,
"column": 97
},
"end": {
"line": 12,
"column": 103
},
"identifierName": "Object"
},
"name": "Object"
},
"property": {
"type": "Identifier",
"start": 320,
"end": 329,
"loc": {
"start": {
"line": 12,
"column": 104
},
"end": {
"line": 12,
"column": 113
},
"identifierName": "prototype"
},
"name": "prototype"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 330,
"end": 338,
"loc": {
"start": {
"line": 12,
"column": 114
},
"end": {
"line": 12,
"column": 122
},
"identifierName": "toString"
},
"name": "toString"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 339,
"end": 343,
"loc": {
"start": {
"line": 12,
"column": 123
},
"end": {
"line": 12,
"column": 127
},
"identifierName": "call"
},
"name": "call"
},
"computed": false
},
"arguments": [
{
"type": "CallExpression",
"start": 344,
"end": 369,
"loc": {
"start": {
"line": 12,
"column": 128
},
"end": {
"line": 12,
"column": 153
}
},
"callee": {
"type": "MemberExpression",
"start": 344,
"end": 367,
"loc": {
"start": {
"line": 12,
"column": 128
},
"end": {
"line": 12,
"column": 151
}
},
"object": {
"type": "MemberExpression",
"start": 344,
"end": 362,
"loc": {
"start": {
"line": 12,
"column": 128
},
"end": {
"line": 12,
"column": 146
}
},
"object": {
"type": "Identifier",
"start": 344,
"end": 351,
"loc": {
"start": {
"line": 12,
"column": 128
},
"end": {
"line": 12,
"column": 135
},
"identifierName": "options"
},
"name": "options"
},
"property": {
"type": "Identifier",
"start": 352,
"end": 362,
"loc": {
"start": {
"line": 12,
"column": 136
},
"end": {
"line": 12,
"column": 146
},
"identifierName": "deprecated"
},
"name": "deprecated"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 363,
"end": 367,
"loc": {
"start": {
"line": 12,
"column": 147
},
"end": {
"line": 12,
"column": 151
},
"identifierName": "call"
},
"name": "call"
},
"computed": false
},
"arguments": []
}
]
}
}
}
}
],
"kind": "const"
},
{
"type": "IfStatement",
"start": 375,
"end": 548,
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 17,
"column": 3
}
},
"test": {
"type": "Identifier",
"start": 379,
"end": 384,
"loc": {
"start": {
"line": 14,
"column": 6
},
"end": {
"line": 14,
"column": 11
},
"identifierName": "valid"
},
"name": "valid"
},
"consequent": {
"type": "BlockStatement",
"start": 386,
"end": 548,
"loc": {
"start": {
"line": 14,
"column": 13
},
"end": {
"line": 17,
"column": 3
}
},
"body": [
{
"type": "VariableDeclaration",
"start": 392,
"end": 484,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 96
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 398,
"end": 483,
"loc": {
"start": {
"line": 15,
"column": 10
},
"end": {
"line": 15,
"column": 95
}
},
"id": {
"type": "Identifier",
"start": 398,
"end": 405,
"loc": {
"start": {
"line": 15,
"column": 10
},
"end": {
"line": 15,
"column": 17
},
"identifierName": "message"
},
"name": "message"
},
"init": {
"type": "TemplateLiteral",
"start": 408,
"end": 483,
"loc": {
"start": {
"line": 15,
"column": 20
},
"end": {
"line": 15,
"column": 95
}
},
"expressions": [
{
"type": "CallExpression",
"start": 411,
"end": 430,
"loc": {
"start": {
"line": 15,
"column": 23
},
"end": {
"line": 15,
"column": 42
}
},
"callee": {
"type": "MemberExpression",
"start": 411,
"end": 423,
"loc": {
"start": {
"line": 15,
"column": 23
},
"end": {
"line": 15,
"column": 35
}
},
"object": {
"type": "Identifier",
"start": 411,
"end": 415,
"loc": {
"start": {
"line": 15,
"column": 23
},
"end": {
"line": 15,
"column": 27
},
"identifierName": "util"
},
"name": "util"
},
"property": {
"type": "Identifier",
"start": 416,
"end": 423,
"loc": {
"start": {
"line": 15,
"column": 28
},
"end": {
"line": 15,
"column": 35
},
"identifierName": "inspect"
},
"name": "inspect"
},
"computed": false
},
"arguments": [
{
"type": "Identifier",
"start": 424,
"end": 429,
"loc": {
"start": {
"line": 15,
"column": 36
},
"end": {
"line": 15,
"column": 41
},
"identifierName": "value"
},
"name": "value"
}
]
},
{
"type": "MemberExpression",
"start": 457,
"end": 480,
"loc": {
"start": {
"line": 15,
"column": 69
},
"end": {
"line": 15,
"column": 92
}
},
"object": {
"type": "MemberExpression",
"start": 457,
"end": 475,
"loc": {
"start": {
"line": 15,
"column": 69
},
"end": {
"line": 15,
"column": 87
}
},
"object": {
"type": "Identifier",
"start": 457,
"end": 464,
"loc": {
"start": {
"line": 15,
"column": 69
},
"end": {
"line": 15,
"column": 76
},
"identifierName": "options"
},
"name": "options"
},
"property": {
"type": "Identifier",
"start": 465,
"end": 475,
"loc": {
"start": {
"line": 15,
"column": 77
},
"end": {
"line": 15,
"column": 87
},
"identifierName": "deprecated"
},
"name": "deprecated"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 476,
"end": 480,
"loc": {
"start": {
"line": 15,
"column": 88
},
"end": {
"line": 15,
"column": 92
},
"identifierName": "name"
},
"name": "name"
},
"computed": false
}
],
"quasis": [
{
"type": "TemplateElement",
"start": 409,
"end": 409,
"loc": {
"start": {
"line": 15,
"column": 21
},
"end": {
"line": 15,
"column": 21
}
},
"value": {
"raw": "",
"cooked": ""
},
"tail": false
},
{
"type": "TemplateElement",
"start": 431,
"end": 455,
"loc": {
"start": {
"line": 15,
"column": 43
},
"end": {
"line": 15,
"column": 67
}
},
"value": {
"raw": " should not be of type \"",
"cooked": " should not be of type \""
},
"tail": false
},
{
"type": "TemplateElement",
"start": 481,
"end": 482,
"loc": {
"start": {
"line": 15,
"column": 93
},
"end": {
"line": 15,
"column": 94
}
},
"value": {
"raw": "\"",
"cooked": "\""
},
"tail": true
}
]
}
}
],
"kind": "const"
},
{
"type": "ExpressionStatement",
"start": 489,
"end": 544,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 59