soocrate-core
Version:
this is the core of soocrate application
1,249 lines • 29.1 kB
JSON
{
"type": "File",
"start": 0,
"end": 641,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 26,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 641,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 26,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 220,
"end": 250,
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 11,
"column": 30
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 227,
"end": 234,
"loc": {
"start": {
"line": 11,
"column": 7
},
"end": {
"line": 11,
"column": 14
}
},
"local": {
"type": "Identifier",
"start": 227,
"end": 234,
"loc": {
"start": {
"line": 11,
"column": 7
},
"end": {
"line": 11,
"column": 14
},
"identifierName": "shortid"
},
"name": "shortid",
"leadingComments": null
},
"leadingComments": null
}
],
"source": {
"type": "StringLiteral",
"start": 240,
"end": 249,
"loc": {
"start": {
"line": 11,
"column": 20
},
"end": {
"line": 11,
"column": 29
}
},
"extra": {
"rawValue": "shortid",
"raw": "'shortid'"
},
"value": "shortid"
},
"leadingComments": [
{
"type": "CommentBlock",
"value": "\r\n * \\url https://github.com/justayak/yutils/blob/master/yutils.js\r\n * \\author justayak\r\n ",
"start": 0,
"end": 94,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 4,
"column": 3
}
}
},
{
"type": "CommentBlock",
"value": "!\r\n * \\brief get a globally unique (with high probability) identifier\r\n * \\return a string being the identifier\r\n ",
"start": 98,
"end": 216,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 9,
"column": 3
}
}
}
]
},
{
"type": "Identifier",
"start": 255,
"end": 614,
"loc": {
"start": {
"line": 13,
"column": 0
},
"end": {
"line": 23,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 264,
"end": 268,
"loc": {
"start": {
"line": 13,
"column": 9
},
"end": {
"line": 13,
"column": 13
},
"identifierName": "GUID"
},
"name": "GUID"
},
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 270,
"end": 614,
"loc": {
"start": {
"line": 13,
"column": 15
},
"end": {
"line": 23,
"column": 1
}
},
"body": [
{
"type": "ReturnStatement",
"start": 585,
"end": 611,
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 22,
"column": 30
}
},
"argument": {
"type": "CallExpression",
"start": 592,
"end": 610,
"loc": {
"start": {
"line": 22,
"column": 11
},
"end": {
"line": 22,
"column": 29
}
},
"callee": {
"type": "MemberExpression",
"start": 592,
"end": 608,
"loc": {
"start": {
"line": 22,
"column": 11
},
"end": {
"line": 22,
"column": 27
}
},
"object": {
"type": "Identifier",
"start": 592,
"end": 599,
"loc": {
"start": {
"line": 22,
"column": 11
},
"end": {
"line": 22,
"column": 18
},
"identifierName": "shortid"
},
"name": "shortid",
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 600,
"end": 608,
"loc": {
"start": {
"line": 22,
"column": 19
},
"end": {
"line": 22,
"column": 27
},
"identifierName": "generate"
},
"name": "generate"
},
"computed": false,
"leadingComments": null
},
"arguments": [],
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": " var d = new Date().getTime();\r\n var guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\r\n var r = (d + Math.random() * 16) % 16 | 0;\r\n d = Math.floor(d / 16);\r\n return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);\r\n });\r\n return guid;",
"start": 275,
"end": 573,
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 20,
"column": 18
}
}
}
]
}
],
"directives": []
},
"name": "_",
"leadingComments": [],
"trailingComments": []
},
{
"type": "EmptyStatement",
"start": 614,
"end": 615,
"loc": {
"start": {
"line": 23,
"column": 1
},
"end": {
"line": 23,
"column": 2
}
}
},
{
"type": "Identifier",
"start": 619,
"end": 639,
"loc": {
"start": {
"line": 25,
"column": 0
},
"end": {
"line": 25,
"column": 20
}
},
"declaration": {
"type": "Identifier",
"start": 634,
"end": 638,
"loc": {
"start": {
"line": 25,
"column": 15
},
"end": {
"line": 25,
"column": 19
},
"identifierName": "GUID"
},
"name": "GUID"
},
"name": "_",
"leadingComments": [],
"trailingComments": []
},
{
"type": "ExportDefaultDeclaration",
"start": 619,
"end": 639,
"loc": {
"start": {
"line": 25,
"column": 0
},
"end": {
"line": 25,
"column": 20
}
},
"declaration": {
"type": "FunctionDeclaration",
"start": 255,
"end": 614,
"loc": {
"start": {
"line": 13,
"column": 0
},
"end": {
"line": 23,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 264,
"end": 268,
"loc": {
"start": {
"line": 13,
"column": 9
},
"end": {
"line": 13,
"column": 13
},
"identifierName": "GUID"
},
"name": "GUID"
},
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 270,
"end": 614,
"loc": {
"start": {
"line": 13,
"column": 15
},
"end": {
"line": 23,
"column": 1
}
},
"body": [
{
"type": "ReturnStatement",
"start": 585,
"end": 611,
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 22,
"column": 30
}
},
"argument": {
"type": "CallExpression",
"start": 592,
"end": 610,
"loc": {
"start": {
"line": 22,
"column": 11
},
"end": {
"line": 22,
"column": 29
}
},
"callee": {
"type": "MemberExpression",
"start": 592,
"end": 608,
"loc": {
"start": {
"line": 22,
"column": 11
},
"end": {
"line": 22,
"column": 27
}
},
"object": {
"type": "Identifier",
"start": 592,
"end": 599,
"loc": {
"start": {
"line": 22,
"column": 11
},
"end": {
"line": 22,
"column": 18
},
"identifierName": "shortid"
},
"name": "shortid",
"leadingComments": null
},
"property": {
"type": "Identifier",
"start": 600,
"end": 608,
"loc": {
"start": {
"line": 22,
"column": 19
},
"end": {
"line": 22,
"column": 27
},
"identifierName": "generate"
},
"name": "generate"
},
"computed": false,
"leadingComments": null
},
"arguments": [],
"leadingComments": null
},
"leadingComments": [
{
"type": "CommentBlock",
"value": " var d = new Date().getTime();\r\n var guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\r\n var r = (d + Math.random() * 16) % 16 | 0;\r\n d = Math.floor(d / 16);\r\n return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);\r\n });\r\n return guid;",
"start": 275,
"end": 573,
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 20,
"column": 18
}
}
}
]
}
],
"directives": []
},
"leadingComments": [],
"trailingComments": []
}
}
],
"directives": []
},
"comments": [
{
"type": "CommentBlock",
"value": "\r\n * \\url https://github.com/justayak/yutils/blob/master/yutils.js\r\n * \\author justayak\r\n ",
"start": 0,
"end": 94,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 4,
"column": 3
}
}
},
{
"type": "CommentBlock",
"value": "!\r\n * \\brief get a globally unique (with high probability) identifier\r\n * \\return a string being the identifier\r\n ",
"start": 98,
"end": 216,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 9,
"column": 3
}
}
},
{
"type": "CommentBlock",
"value": " var d = new Date().getTime();\r\n var guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\r\n var r = (d + Math.random() * 16) % 16 | 0;\r\n d = Math.floor(d / 16);\r\n return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);\r\n });\r\n return guid;",
"start": 275,
"end": 573,
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 20,
"column": 18
}
}
}
],
"tokens": [
{
"type": "CommentBlock",
"value": "\r\n * \\url https://github.com/justayak/yutils/blob/master/yutils.js\r\n * \\author justayak\r\n ",
"start": 0,
"end": 94,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 4,
"column": 3
}
}
},
{
"type": "CommentBlock",
"value": "!\r\n * \\brief get a globally unique (with high probability) identifier\r\n * \\return a string being the identifier\r\n ",
"start": 98,
"end": 216,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 9,
"column": 3
}
}
},
{
"type": {
"label": "import",
"keyword": "import",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "import",
"start": 220,
"end": 226,
"loc": {
"start": {
"line": 11,
"column": 0
},
"end": {
"line": 11,
"column": 6
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "shortid",
"start": 227,
"end": 234,
"loc": {
"start": {
"line": 11,
"column": 7
},
"end": {
"line": 11,
"column": 14
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "from",
"start": 235,
"end": 239,
"loc": {
"start": {
"line": 11,
"column": 15
},
"end": {
"line": 11,
"column": 19
}
}
},
{
"type": {
"label": "string",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "shortid",
"start": 240,
"end": 249,
"loc": {
"start": {
"line": 11,
"column": 20
},
"end": {
"line": 11,
"column": 29
}
}
},
{
"type": {
"label": ";",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 249,
"end": 250,
"loc": {
"start": {
"line": 11,
"column": 29
},
"end": {
"line": 11,
"column": 30
}
}
},
{
"type": {
"label": "function",
"keyword": "function",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "function",
"start": 255,
"end": 263,
"loc": {
"start": {
"line": 13,
"column": 0
},
"end": {
"line": 13,
"column": 8
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "GUID",
"start": 264,
"end": 268,
"loc": {
"start": {
"line": 13,
"column": 9
},
"end": {
"line": 13,
"column": 13
}
}
},
{
"type": {
"label": "(",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 268,
"end": 269,
"loc": {
"start": {
"line": 13,
"column": 13
},
"end": {
"line": 13,
"column": 14
}
}
},
{
"type": {
"label": ")",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 269,
"end": 270,
"loc": {
"start": {
"line": 13,
"column": 14
},
"end": {
"line": 13,
"column": 15
}
}
},
{
"type": {
"label": "{",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 270,
"end": 271,
"loc": {
"start": {
"line": 13,
"column": 15
},
"end": {
"line": 13,
"column": 16
}
}
},
{
"type": "CommentBlock",
"value": " var d = new Date().getTime();\r\n var guid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\r\n var r = (d + Math.random() * 16) % 16 | 0;\r\n d = Math.floor(d / 16);\r\n return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);\r\n });\r\n return guid;",
"start": 275,
"end": 573,
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 20,
"column": 18
}
}
},
{
"type": {
"label": "return",
"keyword": "return",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "return",
"start": 585,
"end": 591,
"loc": {
"start": {
"line": 22,
"column": 4
},
"end": {
"line": 22,
"column": 10
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "shortid",
"start": 592,
"end": 599,
"loc": {
"start": {
"line": 22,
"column": 11
},
"end": {
"line": 22,
"column": 18
}
}
},
{
"type": {
"label": ".",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 599,
"end": 600,
"loc": {
"start": {
"line": 22,
"column": 18
},
"end": {
"line": 22,
"column": 19
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "generate",
"start": 600,
"end": 608,
"loc": {
"start": {
"line": 22,
"column": 19
},
"end": {
"line": 22,
"column": 27
}
}
},
{
"type": {
"label": "(",
"beforeExpr": true,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 608,
"end": 609,
"loc": {
"start": {
"line": 22,
"column": 27
},
"end": {
"line": 22,
"column": 28
}
}
},
{
"type": {
"label": ")",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 609,
"end": 610,
"loc": {
"start": {
"line": 22,
"column": 28
},
"end": {
"line": 22,
"column": 29
}
}
},
{
"type": {
"label": ";",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 610,
"end": 611,
"loc": {
"start": {
"line": 22,
"column": 29
},
"end": {
"line": 22,
"column": 30
}
}
},
{
"type": {
"label": "}",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"start": 613,
"end": 614,
"loc": {
"start": {
"line": 23,
"column": 0
},
"end": {
"line": 23,
"column": 1
}
}
},
{
"type": {
"label": ";",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 614,
"end": 615,
"loc": {
"start": {
"line": 23,
"column": 1
},
"end": {
"line": 23,
"column": 2
}
}
},
{
"type": {
"label": "export",
"keyword": "export",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "export",
"start": 619,
"end": 625,
"loc": {
"start": {
"line": 25,
"column": 0
},
"end": {
"line": 25,
"column": 6
}
}
},
{
"type": {
"label": "default",
"keyword": "default",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"value": "default",
"start": 626,
"end": 633,
"loc": {
"start": {
"line": 25,
"column": 7
},
"end": {
"line": 25,
"column": 14
}
}
},
{
"type": {
"label": "name",
"beforeExpr": false,
"startsExpr": true,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null
},
"value": "GUID",
"start": 634,
"end": 638,
"loc": {
"start": {
"line": 25,
"column": 15
},
"end": {
"line": 25,
"column": 19
}
}
},
{
"type": {
"label": ";",
"beforeExpr": true,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 638,
"end": 639,
"loc": {
"start": {
"line": 25,
"column": 19
},
"end": {
"line": 25,
"column": 20
}
}
},
{
"type": {
"label": "eof",
"beforeExpr": false,
"startsExpr": false,
"rightAssociative": false,
"isLoop": false,
"isAssign": false,
"prefix": false,
"postfix": false,
"binop": null,
"updateContext": null
},
"start": 641,
"end": 641,
"loc": {
"start": {
"line": 26,
"column": 0
},
"end": {
"line": 26,
"column": 0
}
}
}
]
}