id
int32
0
58k
repo
stringlengths
5
67
path
stringlengths
4
116
func_name
stringlengths
0
58
original_string
stringlengths
52
373k
language
stringclasses
1 value
code
stringlengths
52
373k
code_tokens
list
docstring
stringlengths
4
11.8k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
86
226
9,000
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
DocumentTransform
function DocumentTransform(properties) { this.fieldTransforms = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys...
javascript
function DocumentTransform(properties) { this.fieldTransforms = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys...
[ "function", "DocumentTransform", "(", "properties", ")", "{", "this", ".", "fieldTransforms", "=", "[", "]", ";", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i...
Properties of a DocumentTransform. @memberof google.firestore.v1 @interface IDocumentTransform @property {string|null} [document] DocumentTransform document @property {Array.<google.firestore.v1.DocumentTransform.IFieldTransform>|null} [fieldTransforms] DocumentTransform fieldTransforms Constructs a new DocumentTrans...
[ "Properties", "of", "a", "DocumentTransform", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L5860-L5866
9,001
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
FieldTransform
function FieldTransform(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; ...
javascript
function FieldTransform(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; ...
[ "function", "FieldTransform", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")", ...
Properties of a FieldTransform. @memberof google.firestore.v1.DocumentTransform @interface IFieldTransform @property {string|null} [fieldPath] FieldTransform fieldPath @property {google.firestore.v1.DocumentTransform.FieldTransform.ServerValue|null} [setToServerValue] FieldTransform setToServerValue @property {google.f...
[ "Properties", "of", "a", "FieldTransform", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L5907-L5912
9,002
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
WriteResult
function WriteResult(properties) { this.transformResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] ...
javascript
function WriteResult(properties) { this.transformResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] ...
[ "function", "WriteResult", "(", "properties", ")", "{", "this", ".", "transformResults", "=", "[", "]", ";", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", ...
Properties of a WriteResult. @memberof google.firestore.v1 @interface IWriteResult @property {google.protobuf.ITimestamp|null} [updateTime] WriteResult updateTime @property {Array.<google.firestore.v1.IValue>|null} [transformResults] WriteResult transformResults Constructs a new WriteResult. @memberof google.firestor...
[ "Properties", "of", "a", "WriteResult", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L6022-L6028
9,003
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
DocumentChange
function DocumentChange(properties) { this.targetIds = []; this.removedTargetIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) ...
javascript
function DocumentChange(properties) { this.targetIds = []; this.removedTargetIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) ...
[ "function", "DocumentChange", "(", "properties", ")", "{", "this", ".", "targetIds", "=", "[", "]", ";", "this", ".", "removedTargetIds", "=", "[", "]", ";", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "p...
Properties of a DocumentChange. @memberof google.firestore.v1 @interface IDocumentChange @property {google.firestore.v1.IDocument|null} [document] DocumentChange document @property {Array.<number>|null} [targetIds] DocumentChange targetIds @property {Array.<number>|null} [removedTargetIds] DocumentChange removedTargetI...
[ "Properties", "of", "a", "DocumentChange", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L6068-L6075
9,004
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
DocumentDelete
function DocumentDelete(properties) { this.removedTargetIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i...
javascript
function DocumentDelete(properties) { this.removedTargetIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i...
[ "function", "DocumentDelete", "(", "properties", ")", "{", "this", ".", "removedTargetIds", "=", "[", "]", ";", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i",...
Properties of a DocumentDelete. @memberof google.firestore.v1 @interface IDocumentDelete @property {string|null} [document] DocumentDelete document @property {Array.<number>|null} [removedTargetIds] DocumentDelete removedTargetIds @property {google.protobuf.ITimestamp|null} [readTime] DocumentDelete readTime Construc...
[ "Properties", "of", "a", "DocumentDelete", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L6123-L6129
9,005
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
DocumentRemove
function DocumentRemove(properties) { this.removedTargetIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i...
javascript
function DocumentRemove(properties) { this.removedTargetIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i...
[ "function", "DocumentRemove", "(", "properties", ")", "{", "this", ".", "removedTargetIds", "=", "[", "]", ";", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i",...
Properties of a DocumentRemove. @memberof google.firestore.v1 @interface IDocumentRemove @property {string|null} [document] DocumentRemove document @property {Array.<number>|null} [removedTargetIds] DocumentRemove removedTargetIds @property {google.protobuf.ITimestamp|null} [readTime] DocumentRemove readTime Construc...
[ "Properties", "of", "a", "DocumentRemove", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L6177-L6183
9,006
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
ExistenceFilter
function ExistenceFilter(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function ExistenceFilter(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "ExistenceFilter", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")", ...
Properties of an ExistenceFilter. @memberof google.firestore.v1 @interface IExistenceFilter @property {number|null} [targetId] ExistenceFilter targetId @property {number|null} [count] ExistenceFilter count Constructs a new ExistenceFilter. @memberof google.firestore.v1 @classdesc Represents an ExistenceFilter. @imple...
[ "Properties", "of", "an", "ExistenceFilter", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L6230-L6235
9,007
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
Http
function Http(properties) { this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function Http(properties) { this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "Http", "(", "properties", ")", "{", "this", ".", "rules", "=", "[", "]", ";", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", "...
Properties of a Http. @memberof google.api @interface IHttp @property {Array.<google.api.IHttpRule>|null} [rules] Http rules Constructs a new Http. @memberof google.api @classdesc Represents a Http. @implements IHttp @constructor @param {google.api.IHttp=} [properties] Properties to set
[ "Properties", "of", "a", "Http", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L6288-L6294
9,008
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
HttpRule
function HttpRule(properties) { this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]...
javascript
function HttpRule(properties) { this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]...
[ "function", "HttpRule", "(", "properties", ")", "{", "this", ".", "additionalBindings", "=", "[", "]", ";", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "...
Properties of a HttpRule. @memberof google.api @interface IHttpRule @property {string|null} [get] HttpRule get @property {string|null} [put] HttpRule put @property {string|null} [post] HttpRule post @property {string|null} ["delete"] HttpRule delete @property {string|null} [patch] HttpRule patch @property {google.api.I...
[ "Properties", "of", "a", "HttpRule", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L6332-L6338
9,009
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
CustomHttpPattern
function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "CustomHttpPattern", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")"...
Properties of a CustomHttpPattern. @memberof google.api @interface ICustomHttpPattern @property {string|null} [kind] CustomHttpPattern kind @property {string|null} [path] CustomHttpPattern path Constructs a new CustomHttpPattern. @memberof google.api @classdesc Represents a CustomHttpPattern. @implements ICustomHttpP...
[ "Properties", "of", "a", "CustomHttpPattern", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L6447-L6452
9,010
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
LatLng
function LatLng(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function LatLng(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "LatLng", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")", "if", ...
Properties of a LatLng. @memberof google.type @interface ILatLng @property {number|null} [latitude] LatLng latitude @property {number|null} [longitude] LatLng longitude Constructs a new LatLng. @memberof google.type @classdesc Represents a LatLng. @implements ILatLng @constructor @param {google.type.ILatLng=} [proper...
[ "Properties", "of", "a", "LatLng", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L6503-L6508
9,011
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
Status
function Status(properties) { this.details = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; ...
javascript
function Status(properties) { this.details = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; ...
[ "function", "Status", "(", "properties", ")", "{", "this", ".", "details", "=", "[", "]", ";", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys",...
Properties of a Status. @memberof google.rpc @interface IStatus @property {number|null} [code] Status code @property {string|null} [message] Status message @property {Array.<google.protobuf.IAny>|null} [details] Status details Constructs a new Status. @memberof google.rpc @classdesc Represents a Status. @implements I...
[ "Properties", "of", "a", "Status", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L6560-L6566
9,012
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
Operation
function Operation(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function Operation(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "Operation", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")", "if"...
Properties of an Operation. @memberof google.longrunning @interface IOperation @property {string|null} [name] Operation name @property {google.protobuf.IAny|null} [metadata] Operation metadata @property {boolean|null} [done] Operation done @property {google.rpc.IStatus|null} [error] Operation error @property {google.pr...
[ "Properties", "of", "an", "Operation", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L6814-L6819
9,013
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
GetOperationRequest
function GetOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function GetOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "GetOperationRequest", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", "...
Properties of a GetOperationRequest. @memberof google.longrunning @interface IGetOperationRequest @property {string|null} [name] GetOperationRequest name Constructs a new GetOperationRequest. @memberof google.longrunning @classdesc Represents a GetOperationRequest. @implements IGetOperationRequest @constructor @param...
[ "Properties", "of", "a", "GetOperationRequest", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L6895-L6900
9,014
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
ListOperationsRequest
function ListOperationsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function ListOperationsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "ListOperationsRequest", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ...
Properties of a ListOperationsRequest. @memberof google.longrunning @interface IListOperationsRequest @property {string|null} [name] ListOperationsRequest name @property {string|null} [filter] ListOperationsRequest filter @property {number|null} [pageSize] ListOperationsRequest pageSize @property {string|null} [pageTok...
[ "Properties", "of", "a", "ListOperationsRequest", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L6933-L6938
9,015
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
ListOperationsResponse
function ListOperationsResponse(properties) { this.operations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[ke...
javascript
function ListOperationsResponse(properties) { this.operations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[ke...
[ "function", "ListOperationsResponse", "(", "properties", ")", "{", "this", ".", "operations", "=", "[", "]", ";", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i...
Properties of a ListOperationsResponse. @memberof google.longrunning @interface IListOperationsResponse @property {Array.<google.longrunning.IOperation>|null} [operations] ListOperationsResponse operations @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken Constructs a new ListOperationsResp...
[ "Properties", "of", "a", "ListOperationsResponse", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L6993-L6999
9,016
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
CancelOperationRequest
function CancelOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function CancelOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "CancelOperationRequest", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ...
Properties of a CancelOperationRequest. @memberof google.longrunning @interface ICancelOperationRequest @property {string|null} [name] CancelOperationRequest name Constructs a new CancelOperationRequest. @memberof google.longrunning @classdesc Represents a CancelOperationRequest. @implements ICancelOperationRequest @...
[ "Properties", "of", "a", "CancelOperationRequest", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L7037-L7042
9,017
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
DeleteOperationRequest
function DeleteOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function DeleteOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "DeleteOperationRequest", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ...
Properties of a DeleteOperationRequest. @memberof google.longrunning @interface IDeleteOperationRequest @property {string|null} [name] DeleteOperationRequest name Constructs a new DeleteOperationRequest. @memberof google.longrunning @classdesc Represents a DeleteOperationRequest. @implements IDeleteOperationRequest @...
[ "Properties", "of", "a", "DeleteOperationRequest", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L7072-L7077
9,018
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
WaitOperationRequest
function WaitOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function WaitOperationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "WaitOperationRequest", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ...
Properties of a WaitOperationRequest. @memberof google.longrunning @interface IWaitOperationRequest @property {string|null} [name] WaitOperationRequest name @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout Constructs a new WaitOperationRequest. @memberof google.longrunning @classdesc ...
[ "Properties", "of", "a", "WaitOperationRequest", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L7108-L7113
9,019
googleapis/nodejs-firestore
dev/protos/firestore_proto_api.js
OperationInfo
function OperationInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
javascript
function OperationInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; }
[ "function", "OperationInfo", "(", "properties", ")", "{", "if", "(", "properties", ")", "for", "(", "var", "keys", "=", "Object", ".", "keys", "(", "properties", ")", ",", "i", "=", "0", ";", "i", "<", "keys", ".", "length", ";", "++", "i", ")", ...
Properties of an OperationInfo. @memberof google.longrunning @interface IOperationInfo @property {string|null} [responseType] OperationInfo responseType @property {string|null} [metadataType] OperationInfo metadataType Constructs a new OperationInfo. @memberof google.longrunning @classdesc Represents an OperationInfo...
[ "Properties", "of", "an", "OperationInfo", "." ]
c1192504e2d2ebe505aaf952227f377017f43bdc
https://github.com/googleapis/nodejs-firestore/blob/c1192504e2d2ebe505aaf952227f377017f43bdc/dev/protos/firestore_proto_api.js#L7152-L7157
9,020
mapbox/mapbox-gl-leaflet
leaflet-mapbox-gl.js
function (fn, time, context) { var lock, args, wrapperFn, later; later = function () { // reset lock and call if queued lock = false; if (args) { wrapperFn.apply(context, args); a...
javascript
function (fn, time, context) { var lock, args, wrapperFn, later; later = function () { // reset lock and call if queued lock = false; if (args) { wrapperFn.apply(context, args); a...
[ "function", "(", "fn", ",", "time", ",", "context", ")", "{", "var", "lock", ",", "args", ",", "wrapperFn", ",", "later", ";", "later", "=", "function", "(", ")", "{", "// reset lock and call if queued", "lock", "=", "false", ";", "if", "(", "args", ")...
Create a version of `fn` that only fires once every `time` millseconds. @param {Function} fn the function to be throttled @param {number} time millseconds required between function calls @param {*} context the value of `this` with which the function is called @returns {Function} debounced function @private
[ "Create", "a", "version", "of", "fn", "that", "only", "fires", "once", "every", "time", "millseconds", "." ]
8920b4b7c30682bec372581b878e21ec4edd4d33
https://github.com/mapbox/mapbox-gl-leaflet/blob/8920b4b7c30682bec372581b878e21ec4edd4d33/leaflet-mapbox-gl.js#L36-L62
9,021
kelvinhokk/cordova-plugin-localization-strings
scripts/create_android_strings.js
processResult
function processResult(context, lang, langJson, stringXmlJson) { var path = require('path'); var q = require('q'); var deferred = q.defer(); var mapObj = {}; // create a map to the actual string _.forEach(stringXmlJson.resources.string, function (val) { if (_.has(val, "$") && _.has(val[...
javascript
function processResult(context, lang, langJson, stringXmlJson) { var path = require('path'); var q = require('q'); var deferred = q.defer(); var mapObj = {}; // create a map to the actual string _.forEach(stringXmlJson.resources.string, function (val) { if (_.has(val, "$") && _.has(val[...
[ "function", "processResult", "(", "context", ",", "lang", ",", "langJson", ",", "stringXmlJson", ")", "{", "var", "path", "=", "require", "(", "'path'", ")", ";", "var", "q", "=", "require", "(", "'q'", ")", ";", "var", "deferred", "=", "q", ".", "de...
process the modified xml and put write to file
[ "process", "the", "modified", "xml", "and", "put", "write", "to", "file" ]
c545daf8142e871fbcb311fdf2ad27ce5c94aadf
https://github.com/kelvinhokk/cordova-plugin-localization-strings/blob/c545daf8142e871fbcb311fdf2ad27ce5c94aadf/scripts/create_android_strings.js#L202-L260
9,022
99xt/serverless-dynamodb-local
src/seeder.js
writeSeedBatch
function writeSeedBatch(dynamodbWriteFunction, tableName, seeds) { const params = { RequestItems: { [tableName]: seeds.map((seed) => ({ PutRequest: { Item: seed, }, })), }, }; return new BbPromise((resolve, reject) => { // interval lets us know how much time we ha...
javascript
function writeSeedBatch(dynamodbWriteFunction, tableName, seeds) { const params = { RequestItems: { [tableName]: seeds.map((seed) => ({ PutRequest: { Item: seed, }, })), }, }; return new BbPromise((resolve, reject) => { // interval lets us know how much time we ha...
[ "function", "writeSeedBatch", "(", "dynamodbWriteFunction", ",", "tableName", ",", "seeds", ")", "{", "const", "params", "=", "{", "RequestItems", ":", "{", "[", "tableName", "]", ":", "seeds", ".", "map", "(", "(", "seed", ")", "=>", "(", "{", "PutReque...
Writes a batch chunk of migration seeds to DynamoDB. DynamoDB has a limit on the number of items that may be written in a batch operation. @param {function} dynamodbWriteFunction The DynamoDB DocumentClient.batchWrite or DynamoDB.batchWriteItem function @param {string} tableName The table name being written to @param {...
[ "Writes", "a", "batch", "chunk", "of", "migration", "seeds", "to", "DynamoDB", ".", "DynamoDB", "has", "a", "limit", "on", "the", "number", "of", "items", "that", "may", "be", "written", "in", "a", "batch", "operation", "." ]
8278a7ea86d809bdc9857194269bf0747b27a956
https://github.com/99xt/serverless-dynamodb-local/blob/8278a7ea86d809bdc9857194269bf0747b27a956/src/seeder.js#L22-L51
9,023
99xt/serverless-dynamodb-local
src/seeder.js
writeSeeds
function writeSeeds(dynamodbWriteFunction, tableName, seeds) { if (!dynamodbWriteFunction) { throw new Error("dynamodbWriteFunction argument must be provided"); } if (!tableName) { throw new Error("table name argument must be provided"); } if (!seeds) { throw new Error("seeds argument must be prov...
javascript
function writeSeeds(dynamodbWriteFunction, tableName, seeds) { if (!dynamodbWriteFunction) { throw new Error("dynamodbWriteFunction argument must be provided"); } if (!tableName) { throw new Error("table name argument must be provided"); } if (!seeds) { throw new Error("seeds argument must be prov...
[ "function", "writeSeeds", "(", "dynamodbWriteFunction", ",", "tableName", ",", "seeds", ")", "{", "if", "(", "!", "dynamodbWriteFunction", ")", "{", "throw", "new", "Error", "(", "\"dynamodbWriteFunction argument must be provided\"", ")", ";", "}", "if", "(", "!",...
Writes a seed corpus to the given database table @param {function} dynamodbWriteFunction The DynamoDB DocumentClient.batchWrite or DynamoDB.batchWriteItem function @param {string} tableName The table name @param {any[]} seeds The seed values
[ "Writes", "a", "seed", "corpus", "to", "the", "given", "database", "table" ]
8278a7ea86d809bdc9857194269bf0747b27a956
https://github.com/99xt/serverless-dynamodb-local/blob/8278a7ea86d809bdc9857194269bf0747b27a956/src/seeder.js#L59-L79
9,024
99xt/serverless-dynamodb-local
src/seeder.js
fileExists
function fileExists(fileName) { return new BbPromise((resolve) => { fs.exists(fileName, (exists) => resolve(exists)); }); }
javascript
function fileExists(fileName) { return new BbPromise((resolve) => { fs.exists(fileName, (exists) => resolve(exists)); }); }
[ "function", "fileExists", "(", "fileName", ")", "{", "return", "new", "BbPromise", "(", "(", "resolve", ")", "=>", "{", "fs", ".", "exists", "(", "fileName", ",", "(", "exists", ")", "=>", "resolve", "(", "exists", ")", ")", ";", "}", ")", ";", "}"...
A promise-based function that determines if a file exists @param {string} fileName The path to the file
[ "A", "promise", "-", "based", "function", "that", "determines", "if", "a", "file", "exists" ]
8278a7ea86d809bdc9857194269bf0747b27a956
https://github.com/99xt/serverless-dynamodb-local/blob/8278a7ea86d809bdc9857194269bf0747b27a956/src/seeder.js#L85-L89
9,025
99xt/serverless-dynamodb-local
src/seeder.js
unmarshalBuffer
function unmarshalBuffer(json) { _.forEach(json, function(value, key) { // Null check to prevent creation of Buffer when value is null if (value !== null && value.type==="Buffer") { json[key]= new Buffer(value.data); } }); return json; }
javascript
function unmarshalBuffer(json) { _.forEach(json, function(value, key) { // Null check to prevent creation of Buffer when value is null if (value !== null && value.type==="Buffer") { json[key]= new Buffer(value.data); } }); return json; }
[ "function", "unmarshalBuffer", "(", "json", ")", "{", "_", ".", "forEach", "(", "json", ",", "function", "(", "value", ",", "key", ")", "{", "// Null check to prevent creation of Buffer when value is null", "if", "(", "value", "!==", "null", "&&", "value", ".", ...
Transform all selerialized Buffer value in a Buffer value inside a json object @param {json} json with serialized Buffer value. @return {json} json with Buffer object.
[ "Transform", "all", "selerialized", "Buffer", "value", "in", "a", "Buffer", "value", "inside", "a", "json", "object" ]
8278a7ea86d809bdc9857194269bf0747b27a956
https://github.com/99xt/serverless-dynamodb-local/blob/8278a7ea86d809bdc9857194269bf0747b27a956/src/seeder.js#L97-L105
9,026
99xt/serverless-dynamodb-local
src/seeder.js
getSeedsAtLocation
function getSeedsAtLocation(location) { // load the file as JSON const result = require(location); // Ensure the output is an array if (Array.isArray(result)) { return _.forEach(result, unmarshalBuffer); } else { return [ unmarshalBuffer(result) ]; } }
javascript
function getSeedsAtLocation(location) { // load the file as JSON const result = require(location); // Ensure the output is an array if (Array.isArray(result)) { return _.forEach(result, unmarshalBuffer); } else { return [ unmarshalBuffer(result) ]; } }
[ "function", "getSeedsAtLocation", "(", "location", ")", "{", "// load the file as JSON", "const", "result", "=", "require", "(", "location", ")", ";", "// Ensure the output is an array", "if", "(", "Array", ".", "isArray", "(", "result", ")", ")", "{", "return", ...
Scrapes seed files out of a given location. This file may contain either a simple json object, or an array of simple json objects. An array of json objects is returned. @param {any} location the filename to read seeds from.
[ "Scrapes", "seed", "files", "out", "of", "a", "given", "location", ".", "This", "file", "may", "contain", "either", "a", "simple", "json", "object", "or", "an", "array", "of", "simple", "json", "objects", ".", "An", "array", "of", "json", "objects", "is"...
8278a7ea86d809bdc9857194269bf0747b27a956
https://github.com/99xt/serverless-dynamodb-local/blob/8278a7ea86d809bdc9857194269bf0747b27a956/src/seeder.js#L114-L124
9,027
99xt/serverless-dynamodb-local
src/seeder.js
locateSeeds
function locateSeeds(sources, cwd) { sources = sources || []; cwd = cwd || process.cwd(); const locations = sources.map((source) => path.join(cwd, source)); return BbPromise.map(locations, (location) => { return fileExists(location).then((exists) => { if(!exists) { throw new Error("source fil...
javascript
function locateSeeds(sources, cwd) { sources = sources || []; cwd = cwd || process.cwd(); const locations = sources.map((source) => path.join(cwd, source)); return BbPromise.map(locations, (location) => { return fileExists(location).then((exists) => { if(!exists) { throw new Error("source fil...
[ "function", "locateSeeds", "(", "sources", ",", "cwd", ")", "{", "sources", "=", "sources", "||", "[", "]", ";", "cwd", "=", "cwd", "||", "process", ".", "cwd", "(", ")", ";", "const", "locations", "=", "sources", ".", "map", "(", "(", "source", ")...
Locates seeds given a set of files to scrape @param {string[]} sources The filenames to scrape for seeds
[ "Locates", "seeds", "given", "a", "set", "of", "files", "to", "scrape" ]
8278a7ea86d809bdc9857194269bf0747b27a956
https://github.com/99xt/serverless-dynamodb-local/blob/8278a7ea86d809bdc9857194269bf0747b27a956/src/seeder.js#L130-L144
9,028
ipfs/interface-js-ipfs-core
src/utils/spawn.js
spawnNodeWithId
function spawnNodeWithId (factory, callback) { waterfall([(cb) => factory.spawnNode(cb), identify], callback) }
javascript
function spawnNodeWithId (factory, callback) { waterfall([(cb) => factory.spawnNode(cb), identify], callback) }
[ "function", "spawnNodeWithId", "(", "factory", ",", "callback", ")", "{", "waterfall", "(", "[", "(", "cb", ")", "=>", "factory", ".", "spawnNode", "(", "cb", ")", ",", "identify", "]", ",", "callback", ")", "}" ]
Spawn a node, get it's id and set it as `peerId` on the node
[ "Spawn", "a", "node", "get", "it", "s", "id", "and", "set", "it", "as", "peerId", "on", "the", "node" ]
b90d6352ad88ea7c388f2b2c32e8ff562724f14f
https://github.com/ipfs/interface-js-ipfs-core/blob/b90d6352ad88ea7c388f2b2c32e8ff562724f14f/src/utils/spawn.js#L16-L18
9,029
ipfs/interface-js-ipfs-core
src/utils/spawn.js
spawnNodes
function spawnNodes (n, factory, callback) { timesSeries(n, (_, cb) => factory.spawnNode(cb), callback) }
javascript
function spawnNodes (n, factory, callback) { timesSeries(n, (_, cb) => factory.spawnNode(cb), callback) }
[ "function", "spawnNodes", "(", "n", ",", "factory", ",", "callback", ")", "{", "timesSeries", "(", "n", ",", "(", "_", ",", "cb", ")", "=>", "factory", ".", "spawnNode", "(", "cb", ")", ",", "callback", ")", "}" ]
Spawn n nodes
[ "Spawn", "n", "nodes" ]
b90d6352ad88ea7c388f2b2c32e8ff562724f14f
https://github.com/ipfs/interface-js-ipfs-core/blob/b90d6352ad88ea7c388f2b2c32e8ff562724f14f/src/utils/spawn.js#L23-L25
9,030
ipfs/interface-js-ipfs-core
src/utils/spawn.js
spawnNodesWithId
function spawnNodesWithId (n, factory, callback) { spawnNodes(n, factory, (err, nodes) => { if (err) return callback(err) map(nodes, identify, callback) }) }
javascript
function spawnNodesWithId (n, factory, callback) { spawnNodes(n, factory, (err, nodes) => { if (err) return callback(err) map(nodes, identify, callback) }) }
[ "function", "spawnNodesWithId", "(", "n", ",", "factory", ",", "callback", ")", "{", "spawnNodes", "(", "n", ",", "factory", ",", "(", "err", ",", "nodes", ")", "=>", "{", "if", "(", "err", ")", "return", "callback", "(", "err", ")", "map", "(", "n...
Spawn n nodes, getting their id's and setting them as `peerId` on the nodes
[ "Spawn", "n", "nodes", "getting", "their", "id", "s", "and", "setting", "them", "as", "peerId", "on", "the", "nodes" ]
b90d6352ad88ea7c388f2b2c32e8ff562724f14f
https://github.com/ipfs/interface-js-ipfs-core/blob/b90d6352ad88ea7c388f2b2c32e8ff562724f14f/src/utils/spawn.js#L30-L35
9,031
mourner/rbush
index.js
function (insertPath, level) { var node = insertPath[level], M = node.children.length, m = this._minEntries; this._chooseSplitAxis(node, m, M); var splitIndex = this._chooseSplitIndex(node, m, M); var newNode = createNode(node.children.splice(splitIndex, node....
javascript
function (insertPath, level) { var node = insertPath[level], M = node.children.length, m = this._minEntries; this._chooseSplitAxis(node, m, M); var splitIndex = this._chooseSplitIndex(node, m, M); var newNode = createNode(node.children.splice(splitIndex, node....
[ "function", "(", "insertPath", ",", "level", ")", "{", "var", "node", "=", "insertPath", "[", "level", "]", ",", "M", "=", "node", ".", "children", ".", "length", ",", "m", "=", "this", ".", "_minEntries", ";", "this", ".", "_chooseSplitAxis", "(", "...
split overflowed node into two
[ "split", "overflowed", "node", "into", "two" ]
175cb6a0201eda595d485d2ce38a3199a1b9ed7b
https://github.com/mourner/rbush/blob/175cb6a0201eda595d485d2ce38a3199a1b9ed7b/index.js#L318-L337
9,032
mourner/rbush
index.js
function (node, m, M) { var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX, compareMinY = node.leaf ? this.compareMinY : compareNodeMinY, xMargin = this._allDistMargin(node, m, M, compareMinX), yMargin = this._allDistMargin(node, m, M, compareMinY); //...
javascript
function (node, m, M) { var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX, compareMinY = node.leaf ? this.compareMinY : compareNodeMinY, xMargin = this._allDistMargin(node, m, M, compareMinX), yMargin = this._allDistMargin(node, m, M, compareMinY); //...
[ "function", "(", "node", ",", "m", ",", "M", ")", "{", "var", "compareMinX", "=", "node", ".", "leaf", "?", "this", ".", "compareMinX", ":", "compareNodeMinX", ",", "compareMinY", "=", "node", ".", "leaf", "?", "this", ".", "compareMinY", ":", "compare...
sorts node children by the best axis for split
[ "sorts", "node", "children", "by", "the", "best", "axis", "for", "split" ]
175cb6a0201eda595d485d2ce38a3199a1b9ed7b
https://github.com/mourner/rbush/blob/175cb6a0201eda595d485d2ce38a3199a1b9ed7b/index.js#L380-L390
9,033
mourner/rbush
index.js
function (node, m, M, compare) { node.children.sort(compare); var toBBox = this.toBBox, leftBBox = distBBox(node, 0, m, toBBox), rightBBox = distBBox(node, M - m, M, toBBox), margin = bboxMargin(leftBBox) + bboxMargin(rightBBox), i, child; for (...
javascript
function (node, m, M, compare) { node.children.sort(compare); var toBBox = this.toBBox, leftBBox = distBBox(node, 0, m, toBBox), rightBBox = distBBox(node, M - m, M, toBBox), margin = bboxMargin(leftBBox) + bboxMargin(rightBBox), i, child; for (...
[ "function", "(", "node", ",", "m", ",", "M", ",", "compare", ")", "{", "node", ".", "children", ".", "sort", "(", "compare", ")", ";", "var", "toBBox", "=", "this", ".", "toBBox", ",", "leftBBox", "=", "distBBox", "(", "node", ",", "0", ",", "m",...
total margin of all possible split distributions where each node is at least m full
[ "total", "margin", "of", "all", "possible", "split", "distributions", "where", "each", "node", "is", "at", "least", "m", "full" ]
175cb6a0201eda595d485d2ce38a3199a1b9ed7b
https://github.com/mourner/rbush/blob/175cb6a0201eda595d485d2ce38a3199a1b9ed7b/index.js#L393-L416
9,034
mourner/rbush
index.js
calcBBox
function calcBBox(node, toBBox) { distBBox(node, 0, node.children.length, toBBox, node); }
javascript
function calcBBox(node, toBBox) { distBBox(node, 0, node.children.length, toBBox, node); }
[ "function", "calcBBox", "(", "node", ",", "toBBox", ")", "{", "distBBox", "(", "node", ",", "0", ",", "node", ".", "children", ".", "length", ",", "toBBox", ",", "node", ")", ";", "}" ]
calculate node's bbox from bboxes of its children
[ "calculate", "node", "s", "bbox", "from", "bboxes", "of", "its", "children" ]
175cb6a0201eda595d485d2ce38a3199a1b9ed7b
https://github.com/mourner/rbush/blob/175cb6a0201eda595d485d2ce38a3199a1b9ed7b/index.js#L469-L471
9,035
mourner/rbush
index.js
distBBox
function distBBox(node, k, p, toBBox, destNode) { if (!destNode) destNode = createNode(null); destNode.minX = Infinity; destNode.minY = Infinity; destNode.maxX = -Infinity; destNode.maxY = -Infinity; for (var i = k, child; i < p; i++) { child = node.children[i]; extend(destNode,...
javascript
function distBBox(node, k, p, toBBox, destNode) { if (!destNode) destNode = createNode(null); destNode.minX = Infinity; destNode.minY = Infinity; destNode.maxX = -Infinity; destNode.maxY = -Infinity; for (var i = k, child; i < p; i++) { child = node.children[i]; extend(destNode,...
[ "function", "distBBox", "(", "node", ",", "k", ",", "p", ",", "toBBox", ",", "destNode", ")", "{", "if", "(", "!", "destNode", ")", "destNode", "=", "createNode", "(", "null", ")", ";", "destNode", ".", "minX", "=", "Infinity", ";", "destNode", ".", ...
min bounding rectangle of node children from k to p-1
[ "min", "bounding", "rectangle", "of", "node", "children", "from", "k", "to", "p", "-", "1" ]
175cb6a0201eda595d485d2ce38a3199a1b9ed7b
https://github.com/mourner/rbush/blob/175cb6a0201eda595d485d2ce38a3199a1b9ed7b/index.js#L474-L487
9,036
mourner/rbush
index.js
multiSelect
function multiSelect(arr, left, right, n, compare) { var stack = [left, right], mid; while (stack.length) { right = stack.pop(); left = stack.pop(); if (right - left <= n) continue; mid = left + Math.ceil((right - left) / n / 2) * n; quickselect(arr, mid, left,...
javascript
function multiSelect(arr, left, right, n, compare) { var stack = [left, right], mid; while (stack.length) { right = stack.pop(); left = stack.pop(); if (right - left <= n) continue; mid = left + Math.ceil((right - left) / n / 2) * n; quickselect(arr, mid, left,...
[ "function", "multiSelect", "(", "arr", ",", "left", ",", "right", ",", "n", ",", "compare", ")", "{", "var", "stack", "=", "[", "left", ",", "right", "]", ",", "mid", ";", "while", "(", "stack", ".", "length", ")", "{", "right", "=", "stack", "."...
sort an array so that items come in groups of n unsorted items, with groups sorted between each other; combines selection algorithm with binary divide & conquer approach
[ "sort", "an", "array", "so", "that", "items", "come", "in", "groups", "of", "n", "unsorted", "items", "with", "groups", "sorted", "between", "each", "other", ";", "combines", "selection", "algorithm", "with", "binary", "divide", "&", "conquer", "approach" ]
175cb6a0201eda595d485d2ce38a3199a1b9ed7b
https://github.com/mourner/rbush/blob/175cb6a0201eda595d485d2ce38a3199a1b9ed7b/index.js#L547-L562
9,037
davidmarkclements/0x
visualizer/actions.js
jumpToState
function jumpToState () { return ({ merged, nodeId, excludeTypes }) => { state.focusedNodeId = nodeId state.control.merged = merged state.typeFilters.enableInlinable = !merged state.key.enableOptUnopt = !merged // Diff type exclude state to reach the one described by the entry c...
javascript
function jumpToState () { return ({ merged, nodeId, excludeTypes }) => { state.focusedNodeId = nodeId state.control.merged = merged state.typeFilters.enableInlinable = !merged state.key.enableOptUnopt = !merged // Diff type exclude state to reach the one described by the entry c...
[ "function", "jumpToState", "(", ")", "{", "return", "(", "{", "merged", ",", "nodeId", ",", "excludeTypes", "}", ")", "=>", "{", "state", ".", "focusedNodeId", "=", "nodeId", "state", ".", "control", ".", "merged", "=", "merged", "state", ".", "typeFilte...
Jump to a state based on a history entry.
[ "Jump", "to", "a", "state", "based", "on", "a", "history", "entry", "." ]
9863309871a805536c86d7027c7345bb2e9ac40b
https://github.com/davidmarkclements/0x/blob/9863309871a805536c86d7027c7345bb2e9ac40b/visualizer/actions.js#L143-L174
9,038
davidmarkclements/0x
visualizer/actions.js
tagNodesWithIds
function tagNodesWithIds (data) { let id = 0 const idsToNodes = new Map() const nodesToIds = new Map() tagNodes(data) return { idsToNodes, nodesToIds } function tag (node) { idsToNodes.set(id, node) nodesToIds.set(node, id) id++ } function tagNodes (node) { tag(node) if (...
javascript
function tagNodesWithIds (data) { let id = 0 const idsToNodes = new Map() const nodesToIds = new Map() tagNodes(data) return { idsToNodes, nodesToIds } function tag (node) { idsToNodes.set(id, node) nodesToIds.set(node, id) id++ } function tagNodes (node) { tag(node) if (...
[ "function", "tagNodesWithIds", "(", "data", ")", "{", "let", "id", "=", "0", "const", "idsToNodes", "=", "new", "Map", "(", ")", "const", "nodesToIds", "=", "new", "Map", "(", ")", "tagNodes", "(", "data", ")", "return", "{", "idsToNodes", ",", "nodesT...
This just uses incrementing IDs but it will only be used for a single dataset, and it's deterministic enough for that
[ "This", "just", "uses", "incrementing", "IDs", "but", "it", "will", "only", "be", "used", "for", "a", "single", "dataset", "and", "it", "s", "deterministic", "enough", "for", "that" ]
9863309871a805536c86d7027c7345bb2e9ac40b
https://github.com/davidmarkclements/0x/blob/9863309871a805536c86d7027c7345bb2e9ac40b/visualizer/actions.js#L179-L199
9,039
davidmarkclements/0x
lib/v8-log-to-ticks.js
fixLines
function fixLines (line) { // Node 11+ are fine if (nodeMajorV > 10) return line // Work around a bug in Node 10's V8 --preprocess -j that breaks strings containing \\ if (nodeMajorV === 10) { // Look for backslashes that aren't escaping a unicode character code, like \\u01a2 // Small risk of false pos...
javascript
function fixLines (line) { // Node 11+ are fine if (nodeMajorV > 10) return line // Work around a bug in Node 10's V8 --preprocess -j that breaks strings containing \\ if (nodeMajorV === 10) { // Look for backslashes that aren't escaping a unicode character code, like \\u01a2 // Small risk of false pos...
[ "function", "fixLines", "(", "line", ")", "{", "// Node 11+ are fine", "if", "(", "nodeMajorV", ">", "10", ")", "return", "line", "// Work around a bug in Node 10's V8 --preprocess -j that breaks strings containing \\\\", "if", "(", "nodeMajorV", "===", "10", ")", "{", ...
Fixes node-version-specific issues with isolate log text
[ "Fixes", "node", "-", "version", "-", "specific", "issues", "with", "isolate", "log", "text" ]
9863309871a805536c86d7027c7345bb2e9ac40b
https://github.com/davidmarkclements/0x/blob/9863309871a805536c86d7027c7345bb2e9ac40b/lib/v8-log-to-ticks.js#L37-L68
9,040
harc/ohm
src/util.js
padNumbersToEqualLength
function padNumbersToEqualLength(arr) { var maxLen = 0; var strings = arr.map(function(n) { var str = n.toString(); maxLen = Math.max(maxLen, str.length); return str; }); return strings.map(function(s) { return common.padLeft(s, maxLen); }); }
javascript
function padNumbersToEqualLength(arr) { var maxLen = 0; var strings = arr.map(function(n) { var str = n.toString(); maxLen = Math.max(maxLen, str.length); return str; }); return strings.map(function(s) { return common.padLeft(s, maxLen); }); }
[ "function", "padNumbersToEqualLength", "(", "arr", ")", "{", "var", "maxLen", "=", "0", ";", "var", "strings", "=", "arr", ".", "map", "(", "function", "(", "n", ")", "{", "var", "str", "=", "n", ".", "toString", "(", ")", ";", "maxLen", "=", "Math...
Given an array of numbers `arr`, return an array of the numbers as strings, right-justified and padded to the same length.
[ "Given", "an", "array", "of", "numbers", "arr", "return", "an", "array", "of", "the", "numbers", "as", "strings", "right", "-", "justified", "and", "padded", "to", "the", "same", "length", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/util.js#L15-L23
9,041
harc/ohm
src/util.js
strcpy
function strcpy(dest, src, offset) { var origDestLen = dest.length; var start = dest.slice(0, offset); var end = dest.slice(offset + src.length); return (start + src + end).substr(0, origDestLen); }
javascript
function strcpy(dest, src, offset) { var origDestLen = dest.length; var start = dest.slice(0, offset); var end = dest.slice(offset + src.length); return (start + src + end).substr(0, origDestLen); }
[ "function", "strcpy", "(", "dest", ",", "src", ",", "offset", ")", "{", "var", "origDestLen", "=", "dest", ".", "length", ";", "var", "start", "=", "dest", ".", "slice", "(", "0", ",", "offset", ")", ";", "var", "end", "=", "dest", ".", "slice", ...
Produce a new string that would be the result of copying the contents of the string `src` onto `dest` at offset `offest`.
[ "Produce", "a", "new", "string", "that", "would", "be", "the", "result", "of", "copying", "the", "contents", "of", "the", "string", "src", "onto", "dest", "at", "offset", "offest", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/util.js#L27-L32
9,042
harc/ohm
src/util.js
appendLine
function appendLine(num, content, prefix) { sb.append(prefix + lineNumbers[num] + ' | ' + content + '\n'); }
javascript
function appendLine(num, content, prefix) { sb.append(prefix + lineNumbers[num] + ' | ' + content + '\n'); }
[ "function", "appendLine", "(", "num", ",", "content", ",", "prefix", ")", "{", "sb", ".", "append", "(", "prefix", "+", "lineNumbers", "[", "num", "]", "+", "' | '", "+", "content", "+", "'\\n'", ")", ";", "}" ]
Helper for appending formatting input lines to the buffer.
[ "Helper", "for", "appending", "formatting", "input", "lines", "to", "the", "buffer", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/util.js#L127-L129
9,043
harc/ohm
src/pexprs.js
Extend
function Extend(superGrammar, name, body) { this.superGrammar = superGrammar; this.name = name; this.body = body; var origBody = superGrammar.rules[name].body; this.terms = [body, origBody]; }
javascript
function Extend(superGrammar, name, body) { this.superGrammar = superGrammar; this.name = name; this.body = body; var origBody = superGrammar.rules[name].body; this.terms = [body, origBody]; }
[ "function", "Extend", "(", "superGrammar", ",", "name", ",", "body", ")", "{", "this", ".", "superGrammar", "=", "superGrammar", ";", "this", ".", "name", "=", "name", ";", "this", ".", "body", "=", "body", ";", "var", "origBody", "=", "superGrammar", ...
Extend is an implementation detail of rule extension
[ "Extend", "is", "an", "implementation", "detail", "of", "rule", "extension" ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/pexprs.js#L68-L74
9,044
harc/ohm
src/Semantics.js
ASemantics
function ASemantics(matchResult) { if (!(matchResult instanceof MatchResult)) { throw new TypeError( 'Semantics expected a MatchResult, but got ' + common.unexpectedObjToString(matchResult)); } if (matchResult.failed()) { throw new TypeError('cannot apply Semantics to ' + matchResult.t...
javascript
function ASemantics(matchResult) { if (!(matchResult instanceof MatchResult)) { throw new TypeError( 'Semantics expected a MatchResult, but got ' + common.unexpectedObjToString(matchResult)); } if (matchResult.failed()) { throw new TypeError('cannot apply Semantics to ' + matchResult.t...
[ "function", "ASemantics", "(", "matchResult", ")", "{", "if", "(", "!", "(", "matchResult", "instanceof", "MatchResult", ")", ")", "{", "throw", "new", "TypeError", "(", "'Semantics expected a MatchResult, but got '", "+", "common", ".", "unexpectedObjToString", "("...
To enable clients to invoke a semantics like a function, return a function that acts as a proxy for `s`, which is the real `Semantics` instance.
[ "To", "enable", "clients", "to", "invoke", "a", "semantics", "like", "a", "function", "return", "a", "function", "that", "acts", "as", "a", "proxy", "for", "s", "which", "is", "the", "real", "Semantics", "instance", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/Semantics.js#L514-L531
9,045
harc/ohm
src/Semantics.js
Attribute
function Attribute(name, actionDict, builtInDefault) { this.name = name; this.formals = []; this.actionDict = actionDict; this.builtInDefault = builtInDefault; }
javascript
function Attribute(name, actionDict, builtInDefault) { this.name = name; this.formals = []; this.actionDict = actionDict; this.builtInDefault = builtInDefault; }
[ "function", "Attribute", "(", "name", ",", "actionDict", ",", "builtInDefault", ")", "{", "this", ".", "name", "=", "name", ";", "this", ".", "formals", "=", "[", "]", ";", "this", ".", "actionDict", "=", "actionDict", ";", "this", ".", "builtInDefault",...
Attributes are Operations whose results are memoized. This means that, for any given semantics, the semantic action for a CST node will be invoked no more than once.
[ "Attributes", "are", "Operations", "whose", "results", "are", "memoized", ".", "This", "means", "that", "for", "any", "given", "semantics", "the", "semantic", "action", "for", "a", "CST", "node", "will", "be", "invoked", "no", "more", "than", "once", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/Semantics.js#L666-L671
9,046
harc/ohm
src/Grammar.js
function(what, name, actionDict) { function isSpecialAction(a) { return a === '_iter' || a === '_terminal' || a === '_nonterminal' || a === '_default'; } var problems = []; for (var k in actionDict) { var v = actionDict[k]; if (!isSpecialAction(k) && !(k in this.rules)) { prob...
javascript
function(what, name, actionDict) { function isSpecialAction(a) { return a === '_iter' || a === '_terminal' || a === '_nonterminal' || a === '_default'; } var problems = []; for (var k in actionDict) { var v = actionDict[k]; if (!isSpecialAction(k) && !(k in this.rules)) { prob...
[ "function", "(", "what", ",", "name", ",", "actionDict", ")", "{", "function", "isSpecialAction", "(", "a", ")", "{", "return", "a", "===", "'_iter'", "||", "a", "===", "'_terminal'", "||", "a", "===", "'_nonterminal'", "||", "a", "===", "'_default'", ";...
Check that every key in `actionDict` corresponds to a semantic action, and that it maps to a function of the correct arity. If not, throw an exception.
[ "Check", "that", "every", "key", "in", "actionDict", "corresponds", "to", "a", "semantic", "action", "and", "that", "it", "maps", "to", "a", "function", "of", "the", "correct", "arity", ".", "If", "not", "throw", "an", "exception", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/Grammar.js#L106-L137
9,047
harc/ohm
src/Grammar.js
function(str) { var app; if (str.indexOf('<') === -1) { // simple application app = new pexprs.Apply(str); } else { // parameterized application var cst = ohmGrammar.match(str, 'Base_application'); app = buildGrammar(cst, {}); } // Ensure that the application is valid....
javascript
function(str) { var app; if (str.indexOf('<') === -1) { // simple application app = new pexprs.Apply(str); } else { // parameterized application var cst = ohmGrammar.match(str, 'Base_application'); app = buildGrammar(cst, {}); } // Ensure that the application is valid....
[ "function", "(", "str", ")", "{", "var", "app", ";", "if", "(", "str", ".", "indexOf", "(", "'<'", ")", "===", "-", "1", ")", "{", "// simple application", "app", "=", "new", "pexprs", ".", "Apply", "(", "str", ")", ";", "}", "else", "{", "// par...
Parse a string which expresses a rule application in this grammar, and return the resulting Apply node.
[ "Parse", "a", "string", "which", "expresses", "a", "rule", "application", "in", "this", "grammar", "and", "return", "the", "resulting", "Apply", "node", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/Grammar.js#L264-L285
9,048
harc/ohm
src/MatchState.js
function(pos, expr) { var posInfo = this.memoTable[pos]; if (posInfo && expr.ruleName) { var memoRec = posInfo.memo[expr.toMemoKey()]; if (memoRec && memoRec.traceEntry) { var entry = memoRec.traceEntry.cloneWithExpr(expr); entry.isMemoized = true; return entry; } }...
javascript
function(pos, expr) { var posInfo = this.memoTable[pos]; if (posInfo && expr.ruleName) { var memoRec = posInfo.memo[expr.toMemoKey()]; if (memoRec && memoRec.traceEntry) { var entry = memoRec.traceEntry.cloneWithExpr(expr); entry.isMemoized = true; return entry; } }...
[ "function", "(", "pos", ",", "expr", ")", "{", "var", "posInfo", "=", "this", ".", "memoTable", "[", "pos", "]", ";", "if", "(", "posInfo", "&&", "expr", ".", "ruleName", ")", "{", "var", "memoRec", "=", "posInfo", ".", "memo", "[", "expr", ".", ...
Returns the memoized trace entry for `expr` at `pos`, if one exists, `null` otherwise.
[ "Returns", "the", "memoized", "trace", "entry", "for", "expr", "at", "pos", "if", "one", "exists", "null", "otherwise", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/MatchState.js#L220-L231
9,049
harc/ohm
src/MatchState.js
function(pos, expr, succeeded, bindings) { if (expr instanceof pexprs.Apply) { var app = this.currentApplication(); var actuals = app ? app.args : []; expr = expr.substituteParams(actuals); } return this.getMemoizedTraceEntry(pos, expr) || new Trace(this.input, pos, this.inputSt...
javascript
function(pos, expr, succeeded, bindings) { if (expr instanceof pexprs.Apply) { var app = this.currentApplication(); var actuals = app ? app.args : []; expr = expr.substituteParams(actuals); } return this.getMemoizedTraceEntry(pos, expr) || new Trace(this.input, pos, this.inputSt...
[ "function", "(", "pos", ",", "expr", ",", "succeeded", ",", "bindings", ")", "{", "if", "(", "expr", "instanceof", "pexprs", ".", "Apply", ")", "{", "var", "app", "=", "this", ".", "currentApplication", "(", ")", ";", "var", "actuals", "=", "app", "?...
Returns a new trace entry, with the currently active trace array as its children.
[ "Returns", "a", "new", "trace", "entry", "with", "the", "currently", "active", "trace", "array", "as", "its", "children", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/MatchState.js#L234-L242
9,050
harc/ohm
examples/operators/operator-example.js
binaryExpression
function binaryExpression(first, ops, rest) { if (associativity[ops[0]] === 'L') { const applyLeft = (x, y) => new BinaryExpression(x, ops.shift(), y); return [first].concat(rest).reduce(applyLeft); } else { const applyRight = (x, y) => new BinaryExpression(y, ops.pop(), x); return [first].concat(re...
javascript
function binaryExpression(first, ops, rest) { if (associativity[ops[0]] === 'L') { const applyLeft = (x, y) => new BinaryExpression(x, ops.shift(), y); return [first].concat(rest).reduce(applyLeft); } else { const applyRight = (x, y) => new BinaryExpression(y, ops.pop(), x); return [first].concat(re...
[ "function", "binaryExpression", "(", "first", ",", "ops", ",", "rest", ")", "{", "if", "(", "associativity", "[", "ops", "[", "0", "]", "]", "===", "'L'", ")", "{", "const", "applyLeft", "=", "(", "x", ",", "y", ")", "=>", "new", "BinaryExpression", ...
We know that all lists will have ops at the same precedence levels.
[ "We", "know", "that", "all", "lists", "will", "have", "ops", "at", "the", "same", "precedence", "levels", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/examples/operators/operator-example.js#L127-L135
9,051
harc/ohm
examples/operators/operator-example.js
makeTree
function makeTree(left, ops, rights, minPrecedence = 0) { while (ops.length > 0 && precedence[ops[0]] >= minPrecedence) { let op = ops.shift(); let right = rights.shift(); while (ops.length > 0 && (precedence[ops[0]] > precedence[op] || associativity[ops[0]] === 'R' && precedence[ops[0]] === prece...
javascript
function makeTree(left, ops, rights, minPrecedence = 0) { while (ops.length > 0 && precedence[ops[0]] >= minPrecedence) { let op = ops.shift(); let right = rights.shift(); while (ops.length > 0 && (precedence[ops[0]] > precedence[op] || associativity[ops[0]] === 'R' && precedence[ops[0]] === prece...
[ "function", "makeTree", "(", "left", ",", "ops", ",", "rights", ",", "minPrecedence", "=", "0", ")", "{", "while", "(", "ops", ".", "length", ">", "0", "&&", "precedence", "[", "ops", "[", "0", "]", "]", ">=", "minPrecedence", ")", "{", "let", "op"...
Modified Richards and Whitby-Stevens precedence climbing method.
[ "Modified", "Richards", "and", "Whitby", "-", "Stevens", "precedence", "climbing", "method", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/examples/operators/operator-example.js#L207-L218
9,052
harc/ohm
src/Trace.js
getInputExcerpt
function getInputExcerpt(input, pos, len) { var excerpt = asEscapedString(input.slice(pos, pos + len)); // Pad the output if necessary. if (excerpt.length < len) { return excerpt + common.repeat(' ', len - excerpt.length).join(''); } return excerpt; }
javascript
function getInputExcerpt(input, pos, len) { var excerpt = asEscapedString(input.slice(pos, pos + len)); // Pad the output if necessary. if (excerpt.length < len) { return excerpt + common.repeat(' ', len - excerpt.length).join(''); } return excerpt; }
[ "function", "getInputExcerpt", "(", "input", ",", "pos", ",", "len", ")", "{", "var", "excerpt", "=", "asEscapedString", "(", "input", ".", "slice", "(", "pos", ",", "pos", "+", "len", ")", ")", ";", "// Pad the output if necessary.", "if", "(", "excerpt",...
Return a string representation of a portion of `input` at offset `pos`. The result will contain exactly `len` characters.
[ "Return", "a", "string", "representation", "of", "a", "portion", "of", "input", "at", "offset", "pos", ".", "The", "result", "will", "contain", "exactly", "len", "characters", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/Trace.js#L38-L46
9,053
harc/ohm
src/main.js
getScriptElementContents
function getScriptElementContents(el) { if (!isElement(el)) { throw new TypeError('Expected a DOM Node, got ' + common.unexpectedObjToString(el)); } if (el.type !== 'text/ohm-js') { throw new Error('Expected a script tag with type="text/ohm-js", got ' + el); } return el.getAttribute('src') ? load(el.g...
javascript
function getScriptElementContents(el) { if (!isElement(el)) { throw new TypeError('Expected a DOM Node, got ' + common.unexpectedObjToString(el)); } if (el.type !== 'text/ohm-js') { throw new Error('Expected a script tag with type="text/ohm-js", got ' + el); } return el.getAttribute('src') ? load(el.g...
[ "function", "getScriptElementContents", "(", "el", ")", "{", "if", "(", "!", "isElement", "(", "el", ")", ")", "{", "throw", "new", "TypeError", "(", "'Expected a DOM Node, got '", "+", "common", ".", "unexpectedObjToString", "(", "el", ")", ")", ";", "}", ...
Return the contents of a script element, fetching it via XHR if necessary.
[ "Return", "the", "contents", "of", "a", "script", "element", "fetching", "it", "via", "XHR", "if", "necessary", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/main.js#L264-L272
9,054
harc/ohm
src/Interval.js
function(that) { if (this.sourceString !== that.sourceString) { throw errors.intervalSourcesDontMatch(); } else if (this.startIdx === that.startIdx && this.endIdx === that.endIdx) { // `this` and `that` are the same interval! return [ ]; } else if (this.startIdx < that.startIdx && th...
javascript
function(that) { if (this.sourceString !== that.sourceString) { throw errors.intervalSourcesDontMatch(); } else if (this.startIdx === that.startIdx && this.endIdx === that.endIdx) { // `this` and `that` are the same interval! return [ ]; } else if (this.startIdx < that.startIdx && th...
[ "function", "(", "that", ")", "{", "if", "(", "this", ".", "sourceString", "!==", "that", ".", "sourceString", ")", "{", "throw", "errors", ".", "intervalSourcesDontMatch", "(", ")", ";", "}", "else", "if", "(", "this", ".", "startIdx", "===", "that", ...
Returns an array of 0, 1, or 2 intervals that represents the result of the interval difference operation.
[ "Returns", "an", "array", "of", "0", "1", "or", "2", "intervals", "that", "represents", "the", "result", "of", "the", "interval", "difference", "operation", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/Interval.js#L59-L88
9,055
harc/ohm
src/Interval.js
function(that) { if (this.sourceString !== that.sourceString) { throw errors.intervalSourcesDontMatch(); } assert(this.startIdx >= that.startIdx && this.endIdx <= that.endIdx, 'other interval does not cover this one'); return new Interval(this.sourceString, this....
javascript
function(that) { if (this.sourceString !== that.sourceString) { throw errors.intervalSourcesDontMatch(); } assert(this.startIdx >= that.startIdx && this.endIdx <= that.endIdx, 'other interval does not cover this one'); return new Interval(this.sourceString, this....
[ "function", "(", "that", ")", "{", "if", "(", "this", ".", "sourceString", "!==", "that", ".", "sourceString", ")", "{", "throw", "errors", ".", "intervalSourcesDontMatch", "(", ")", ";", "}", "assert", "(", "this", ".", "startIdx", ">=", "that", ".", ...
Returns a new Interval that has the same extent as this one, but which is relative to `that`, an Interval that fully covers this one.
[ "Returns", "a", "new", "Interval", "that", "has", "the", "same", "extent", "as", "this", "one", "but", "which", "is", "relative", "to", "that", "an", "Interval", "that", "fully", "covers", "this", "one", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/Interval.js#L92-L101
9,056
harc/ohm
examples/ecmascript/es5.js
flattenIterNodes
function flattenIterNodes(nodes) { var result = []; for (var i = 0; i < nodes.length; ++i) { if (nodes[i]._node.ctorName === '_iter') { result.push.apply(result, flattenIterNodes(nodes[i].children)); } else { result.push(nodes[i]); } } return result; }
javascript
function flattenIterNodes(nodes) { var result = []; for (var i = 0; i < nodes.length; ++i) { if (nodes[i]._node.ctorName === '_iter') { result.push.apply(result, flattenIterNodes(nodes[i].children)); } else { result.push(nodes[i]); } } return result; }
[ "function", "flattenIterNodes", "(", "nodes", ")", "{", "var", "result", "=", "[", "]", ";", "for", "(", "var", "i", "=", "0", ";", "i", "<", "nodes", ".", "length", ";", "++", "i", ")", "{", "if", "(", "nodes", "[", "i", "]", ".", "_node", "...
Take an Array of nodes, and whenever an _iter node is encountered, splice in its recursively-flattened children instead.
[ "Take", "an", "Array", "of", "nodes", "and", "whenever", "an", "_iter", "node", "is", "encountered", "splice", "in", "its", "recursively", "-", "flattened", "children", "instead", "." ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/examples/ecmascript/es5.js#L20-L30
9,057
harc/ohm
src/errors.js
duplicateRuleDeclaration
function duplicateRuleDeclaration(ruleName, grammarName, declGrammarName, optSource) { var message = "Duplicate declaration for rule '" + ruleName + "' in grammar '" + grammarName + "'"; if (grammarName !== declGrammarName) { message += " (originally declared in '" + declGrammarName + "')"; } return c...
javascript
function duplicateRuleDeclaration(ruleName, grammarName, declGrammarName, optSource) { var message = "Duplicate declaration for rule '" + ruleName + "' in grammar '" + grammarName + "'"; if (grammarName !== declGrammarName) { message += " (originally declared in '" + declGrammarName + "')"; } return c...
[ "function", "duplicateRuleDeclaration", "(", "ruleName", ",", "grammarName", ",", "declGrammarName", ",", "optSource", ")", "{", "var", "message", "=", "\"Duplicate declaration for rule '\"", "+", "ruleName", "+", "\"' in grammar '\"", "+", "grammarName", "+", "\"'\"", ...
Duplicate rule declaration
[ "Duplicate", "rule", "declaration" ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/errors.js#L90-L97
9,058
harc/ohm
src/errors.js
wrongNumberOfParameters
function wrongNumberOfParameters(ruleName, expected, actual, source) { return createError( 'Wrong number of parameters for rule ' + ruleName + ' (expected ' + expected + ', got ' + actual + ')', source); }
javascript
function wrongNumberOfParameters(ruleName, expected, actual, source) { return createError( 'Wrong number of parameters for rule ' + ruleName + ' (expected ' + expected + ', got ' + actual + ')', source); }
[ "function", "wrongNumberOfParameters", "(", "ruleName", ",", "expected", ",", "actual", ",", "source", ")", "{", "return", "createError", "(", "'Wrong number of parameters for rule '", "+", "ruleName", "+", "' (expected '", "+", "expected", "+", "', got '", "+", "ac...
Wrong number of parameters
[ "Wrong", "number", "of", "parameters" ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/errors.js#L101-L106
9,059
harc/ohm
src/errors.js
wrongNumberOfArguments
function wrongNumberOfArguments(ruleName, expected, actual, expr) { return createError( 'Wrong number of arguments for rule ' + ruleName + ' (expected ' + expected + ', got ' + actual + ')', expr.source); }
javascript
function wrongNumberOfArguments(ruleName, expected, actual, expr) { return createError( 'Wrong number of arguments for rule ' + ruleName + ' (expected ' + expected + ', got ' + actual + ')', expr.source); }
[ "function", "wrongNumberOfArguments", "(", "ruleName", ",", "expected", ",", "actual", ",", "expr", ")", "{", "return", "createError", "(", "'Wrong number of arguments for rule '", "+", "ruleName", "+", "' (expected '", "+", "expected", "+", "', got '", "+", "actual...
Wrong number of arguments
[ "Wrong", "number", "of", "arguments" ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/errors.js#L110-L115
9,060
harc/ohm
src/errors.js
invalidParameter
function invalidParameter(ruleName, expr) { return createError( 'Invalid parameter to rule ' + ruleName + ': ' + expr + ' has arity ' + expr.getArity() + ', but parameter expressions must have arity 1', expr.source); }
javascript
function invalidParameter(ruleName, expr) { return createError( 'Invalid parameter to rule ' + ruleName + ': ' + expr + ' has arity ' + expr.getArity() + ', but parameter expressions must have arity 1', expr.source); }
[ "function", "invalidParameter", "(", "ruleName", ",", "expr", ")", "{", "return", "createError", "(", "'Invalid parameter to rule '", "+", "ruleName", "+", "': '", "+", "expr", "+", "' has arity '", "+", "expr", ".", "getArity", "(", ")", "+", "', but parameter ...
Invalid parameter expression
[ "Invalid", "parameter", "expression" ]
9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f
https://github.com/harc/ohm/blob/9fd4fabc135c1303b9a8cb5ed47d2eb5fa1aef8f/src/errors.js#L127-L132
9,061
senecajs/seneca
lib/logging.js
log_level_plus
function log_level_plus(logLevel) { let index = log_levels.indexOf(logLevel) if (index < 0) { return [] } else { return log_levels.slice(index, log_levels.length) } }
javascript
function log_level_plus(logLevel) { let index = log_levels.indexOf(logLevel) if (index < 0) { return [] } else { return log_levels.slice(index, log_levels.length) } }
[ "function", "log_level_plus", "(", "logLevel", ")", "{", "let", "index", "=", "log_levels", ".", "indexOf", "(", "logLevel", ")", "if", "(", "index", "<", "0", ")", "{", "return", "[", "]", "}", "else", "{", "return", "log_levels", ".", "slice", "(", ...
It returns the levels above the argument @param {String} logLevel the log level to calculate @return {Array} the list of logs above the argument
[ "It", "returns", "the", "levels", "above", "the", "argument" ]
98af1536196d4461e050ab6b71ca7563ea79ed8f
https://github.com/senecajs/seneca/blob/98af1536196d4461e050ab6b71ca7563ea79ed8f/lib/logging.js#L242-L249
9,062
senecajs/seneca
seneca.js
api_act
function api_act() { var argsarr = new Array(arguments.length) for (var l = 0; l < argsarr.length; ++l) { argsarr[l] = arguments[l] } var self = this var spec = Common.build_message(self, argsarr, 'reply:f?', self.fixedargs) var msg = spec.msg var reply = spec.reply if (opts.$.de...
javascript
function api_act() { var argsarr = new Array(arguments.length) for (var l = 0; l < argsarr.length; ++l) { argsarr[l] = arguments[l] } var self = this var spec = Common.build_message(self, argsarr, 'reply:f?', self.fixedargs) var msg = spec.msg var reply = spec.reply if (opts.$.de...
[ "function", "api_act", "(", ")", "{", "var", "argsarr", "=", "new", "Array", "(", "arguments", ".", "length", ")", "for", "(", "var", "l", "=", "0", ";", "l", "<", "argsarr", ".", "length", ";", "++", "l", ")", "{", "argsarr", "[", "l", "]", "=...
Perform an action. The properties of the first argument are matched against known patterns, and the most specific one wins.
[ "Perform", "an", "action", ".", "The", "properties", "of", "the", "first", "argument", "are", "matched", "against", "known", "patterns", "and", "the", "most", "specific", "one", "wins", "." ]
98af1536196d4461e050ab6b71ca7563ea79ed8f
https://github.com/senecajs/seneca/blob/98af1536196d4461e050ab6b71ca7563ea79ed8f/seneca.js#L755-L778
9,063
senecajs/seneca
seneca.js
api_close
function api_close(done) { var seneca = this var safe_done = _.once(function(err) { if (_.isFunction(done)) { return done.call(seneca, err) } }) // don't try to close twice if (seneca.flags.closed) { return safe_done() } seneca.ready(do_close) var close_timeo...
javascript
function api_close(done) { var seneca = this var safe_done = _.once(function(err) { if (_.isFunction(done)) { return done.call(seneca, err) } }) // don't try to close twice if (seneca.flags.closed) { return safe_done() } seneca.ready(do_close) var close_timeo...
[ "function", "api_close", "(", "done", ")", "{", "var", "seneca", "=", "this", "var", "safe_done", "=", "_", ".", "once", "(", "function", "(", "err", ")", "{", "if", "(", "_", ".", "isFunction", "(", "done", ")", ")", "{", "return", "done", ".", ...
close seneca instance sets public seneca.closed property
[ "close", "seneca", "instance", "sets", "public", "seneca", ".", "closed", "property" ]
98af1536196d4461e050ab6b71ca7563ea79ed8f
https://github.com/senecajs/seneca/blob/98af1536196d4461e050ab6b71ca7563ea79ed8f/seneca.js#L808-L871
9,064
senecajs/seneca
seneca.js
make_private
function make_private() { return { stats: { start: Date.now(), act: { calls: 0, done: 0, fails: 0, cache: 0 }, actmap: {} }, actdef: {}, transport: { register: [] }, plugins: {}, ignore_plugins: {} } }
javascript
function make_private() { return { stats: { start: Date.now(), act: { calls: 0, done: 0, fails: 0, cache: 0 }, actmap: {} }, actdef: {}, transport: { register: [] }, plugins: {}, ignore_plugins: {} } }
[ "function", "make_private", "(", ")", "{", "return", "{", "stats", ":", "{", "start", ":", "Date", ".", "now", "(", ")", ",", "act", ":", "{", "calls", ":", "0", ",", "done", ":", "0", ",", "fails", ":", "0", ",", "cache", ":", "0", "}", ",",...
Private member variables of Seneca object.
[ "Private", "member", "variables", "of", "Seneca", "object", "." ]
98af1536196d4461e050ab6b71ca7563ea79ed8f
https://github.com/senecajs/seneca/blob/98af1536196d4461e050ab6b71ca7563ea79ed8f/seneca.js#L1091-L1110
9,065
senecajs/seneca
docs/examples/custom-logger.js
adapter
function adapter (context, payload) { var when = payload.when.toString() var kind = pad(payload.kind || '-', 8).toUpperCase() var type = pad(payload.case || '-', 8).toUpperCase() var text = payload.pattern || payload.notice || '-' console.log(when, kind, type, text) }
javascript
function adapter (context, payload) { var when = payload.when.toString() var kind = pad(payload.kind || '-', 8).toUpperCase() var type = pad(payload.case || '-', 8).toUpperCase() var text = payload.pattern || payload.notice || '-' console.log(when, kind, type, text) }
[ "function", "adapter", "(", "context", ",", "payload", ")", "{", "var", "when", "=", "payload", ".", "when", ".", "toString", "(", ")", "var", "kind", "=", "pad", "(", "payload", ".", "kind", "||", "'-'", ",", "8", ")", ".", "toUpperCase", "(", ")"...
Everything something is logged it calls whatever custom adapter is set. Adapters are passed the current instance of Seneca plus the raw payload.
[ "Everything", "something", "is", "logged", "it", "calls", "whatever", "custom", "adapter", "is", "set", ".", "Adapters", "are", "passed", "the", "current", "instance", "of", "Seneca", "plus", "the", "raw", "payload", "." ]
98af1536196d4461e050ab6b71ca7563ea79ed8f
https://github.com/senecajs/seneca/blob/98af1536196d4461e050ab6b71ca7563ea79ed8f/docs/examples/custom-logger.js#L30-L37
9,066
senecajs/seneca
lib/inward.js
inward_act_cache
function inward_act_cache(ctxt, data) { var so = ctxt.options var meta = data.meta var actid = meta.id var private$ = ctxt.seneca.private$ if (actid != null && so.history.active) { var actdetails = private$.history.get(actid) if (actdetails) { private$.stats.act.cache++ var latest = ac...
javascript
function inward_act_cache(ctxt, data) { var so = ctxt.options var meta = data.meta var actid = meta.id var private$ = ctxt.seneca.private$ if (actid != null && so.history.active) { var actdetails = private$.history.get(actid) if (actdetails) { private$.stats.act.cache++ var latest = ac...
[ "function", "inward_act_cache", "(", "ctxt", ",", "data", ")", "{", "var", "so", "=", "ctxt", ".", "options", "var", "meta", "=", "data", ".", "meta", "var", "actid", "=", "meta", ".", "id", "var", "private$", "=", "ctxt", ".", "seneca", ".", "privat...
Check if actid has already been seen, and if action cache is active, then provide cached result, if any. Return true in this case.
[ "Check", "if", "actid", "has", "already", "been", "seen", "and", "if", "action", "cache", "is", "active", "then", "provide", "cached", "result", "if", "any", ".", "Return", "true", "in", "this", "case", "." ]
98af1536196d4461e050ab6b71ca7563ea79ed8f
https://github.com/senecajs/seneca/blob/98af1536196d4461e050ab6b71ca7563ea79ed8f/lib/inward.js#L199-L233
9,067
mourner/simplify-js
simplify.js
getSqSegDist
function getSqSegDist(p, p1, p2) { var x = p1.x, y = p1.y, dx = p2.x - x, dy = p2.y - y; if (dx !== 0 || dy !== 0) { var t = ((p.x - x) * dx + (p.y - y) * dy) / (dx * dx + dy * dy); if (t > 1) { x = p2.x; y = p2.y; } else if (t > 0) { ...
javascript
function getSqSegDist(p, p1, p2) { var x = p1.x, y = p1.y, dx = p2.x - x, dy = p2.y - y; if (dx !== 0 || dy !== 0) { var t = ((p.x - x) * dx + (p.y - y) * dy) / (dx * dx + dy * dy); if (t > 1) { x = p2.x; y = p2.y; } else if (t > 0) { ...
[ "function", "getSqSegDist", "(", "p", ",", "p1", ",", "p2", ")", "{", "var", "x", "=", "p1", ".", "x", ",", "y", "=", "p1", ".", "y", ",", "dx", "=", "p2", ".", "x", "-", "x", ",", "dy", "=", "p2", ".", "y", "-", "y", ";", "if", "(", ...
square distance from a point to a segment
[ "square", "distance", "from", "a", "point", "to", "a", "segment" ]
d5aae2be69835719d33eca21c229a286559c1664
https://github.com/mourner/simplify-js/blob/d5aae2be69835719d33eca21c229a286559c1664/simplify.js#L22-L47
9,068
mourner/simplify-js
simplify.js
simplifyRadialDist
function simplifyRadialDist(points, sqTolerance) { var prevPoint = points[0], newPoints = [prevPoint], point; for (var i = 1, len = points.length; i < len; i++) { point = points[i]; if (getSqDist(point, prevPoint) > sqTolerance) { newPoints.push(point); ...
javascript
function simplifyRadialDist(points, sqTolerance) { var prevPoint = points[0], newPoints = [prevPoint], point; for (var i = 1, len = points.length; i < len; i++) { point = points[i]; if (getSqDist(point, prevPoint) > sqTolerance) { newPoints.push(point); ...
[ "function", "simplifyRadialDist", "(", "points", ",", "sqTolerance", ")", "{", "var", "prevPoint", "=", "points", "[", "0", "]", ",", "newPoints", "=", "[", "prevPoint", "]", ",", "point", ";", "for", "(", "var", "i", "=", "1", ",", "len", "=", "poin...
rest of the code doesn't care about point format basic distance-based simplification
[ "rest", "of", "the", "code", "doesn", "t", "care", "about", "point", "format", "basic", "distance", "-", "based", "simplification" ]
d5aae2be69835719d33eca21c229a286559c1664
https://github.com/mourner/simplify-js/blob/d5aae2be69835719d33eca21c229a286559c1664/simplify.js#L51-L69
9,069
mourner/simplify-js
simplify.js
simplifyDouglasPeucker
function simplifyDouglasPeucker(points, sqTolerance) { var last = points.length - 1; var simplified = [points[0]]; simplifyDPStep(points, 0, last, sqTolerance, simplified); simplified.push(points[last]); return simplified; }
javascript
function simplifyDouglasPeucker(points, sqTolerance) { var last = points.length - 1; var simplified = [points[0]]; simplifyDPStep(points, 0, last, sqTolerance, simplified); simplified.push(points[last]); return simplified; }
[ "function", "simplifyDouglasPeucker", "(", "points", ",", "sqTolerance", ")", "{", "var", "last", "=", "points", ".", "length", "-", "1", ";", "var", "simplified", "=", "[", "points", "[", "0", "]", "]", ";", "simplifyDPStep", "(", "points", ",", "0", ...
simplification using Ramer-Douglas-Peucker algorithm
[ "simplification", "using", "Ramer", "-", "Douglas", "-", "Peucker", "algorithm" ]
d5aae2be69835719d33eca21c229a286559c1664
https://github.com/mourner/simplify-js/blob/d5aae2be69835719d33eca21c229a286559c1664/simplify.js#L92-L100
9,070
estools/escodegen
benchmark/old.js
isExpression
function isExpression(node) { switch (node.type) { case Syntax.AssignmentExpression: case Syntax.ArrayExpression: case Syntax.ArrayPattern: case Syntax.BinaryExpression: case Syntax.CallExpression: case Syntax.ConditionalExpression: case Syntax.ClassExpres...
javascript
function isExpression(node) { switch (node.type) { case Syntax.AssignmentExpression: case Syntax.ArrayExpression: case Syntax.ArrayPattern: case Syntax.BinaryExpression: case Syntax.CallExpression: case Syntax.ConditionalExpression: case Syntax.ClassExpres...
[ "function", "isExpression", "(", "node", ")", "{", "switch", "(", "node", ".", "type", ")", "{", "case", "Syntax", ".", "AssignmentExpression", ":", "case", "Syntax", ".", "ArrayExpression", ":", "case", "Syntax", ".", "ArrayPattern", ":", "case", "Syntax", ...
Generation is done by generateExpression.
[ "Generation", "is", "done", "by", "generateExpression", "." ]
4a93ffc24378722dbfd8859d633746ef5916ce86
https://github.com/estools/escodegen/blob/4a93ffc24378722dbfd8859d633746ef5916ce86/benchmark/old.js#L136-L169
9,071
estools/escodegen
benchmark/old.js
isStatement
function isStatement(node) { switch (node.type) { case Syntax.BlockStatement: case Syntax.BreakStatement: case Syntax.CatchClause: case Syntax.ContinueStatement: case Syntax.ClassDeclaration: case Syntax.ClassBody: case Syntax.DirectiveStatement: c...
javascript
function isStatement(node) { switch (node.type) { case Syntax.BlockStatement: case Syntax.BreakStatement: case Syntax.CatchClause: case Syntax.ContinueStatement: case Syntax.ClassDeclaration: case Syntax.ClassBody: case Syntax.DirectiveStatement: c...
[ "function", "isStatement", "(", "node", ")", "{", "switch", "(", "node", ".", "type", ")", "{", "case", "Syntax", ".", "BlockStatement", ":", "case", "Syntax", ".", "BreakStatement", ":", "case", "Syntax", ".", "CatchClause", ":", "case", "Syntax", ".", ...
Generation is done by generateStatement.
[ "Generation", "is", "done", "by", "generateStatement", "." ]
4a93ffc24378722dbfd8859d633746ef5916ce86
https://github.com/estools/escodegen/blob/4a93ffc24378722dbfd8859d633746ef5916ce86/benchmark/old.js#L172-L204
9,072
estools/escodegen
benchmark/old.js
flattenToString
function flattenToString(arr) { var i, iz, elem, result = ''; for (i = 0, iz = arr.length; i < iz; ++i) { elem = arr[i]; result += isArray(elem) ? flattenToString(elem) : elem; } return result; }
javascript
function flattenToString(arr) { var i, iz, elem, result = ''; for (i = 0, iz = arr.length; i < iz; ++i) { elem = arr[i]; result += isArray(elem) ? flattenToString(elem) : elem; } return result; }
[ "function", "flattenToString", "(", "arr", ")", "{", "var", "i", ",", "iz", ",", "elem", ",", "result", "=", "''", ";", "for", "(", "i", "=", "0", ",", "iz", "=", "arr", ".", "length", ";", "i", "<", "iz", ";", "++", "i", ")", "{", "elem", ...
flatten an array to a string, where the array can contain either strings or nested arrays
[ "flatten", "an", "array", "to", "a", "string", "where", "the", "array", "can", "contain", "either", "strings", "or", "nested", "arrays" ]
4a93ffc24378722dbfd8859d633746ef5916ce86
https://github.com/estools/escodegen/blob/4a93ffc24378722dbfd8859d633746ef5916ce86/benchmark/old.js#L586-L593
9,073
estools/escodegen
benchmark/old.js
toSourceNodeWhenNeeded
function toSourceNodeWhenNeeded(generated, node) { if (!sourceMap) { // with no source maps, generated is either an // array or a string. if an array, flatten it. // if a string, just return it if (isArray(generated)) { return flattenToString(gene...
javascript
function toSourceNodeWhenNeeded(generated, node) { if (!sourceMap) { // with no source maps, generated is either an // array or a string. if an array, flatten it. // if a string, just return it if (isArray(generated)) { return flattenToString(gene...
[ "function", "toSourceNodeWhenNeeded", "(", "generated", ",", "node", ")", "{", "if", "(", "!", "sourceMap", ")", "{", "// with no source maps, generated is either an", "// array or a string. if an array, flatten it.", "// if a string, just return it", "if", "(", "isArray", "...
convert generated to a SourceNode when source maps are enabled.
[ "convert", "generated", "to", "a", "SourceNode", "when", "source", "maps", "are", "enabled", "." ]
4a93ffc24378722dbfd8859d633746ef5916ce86
https://github.com/estools/escodegen/blob/4a93ffc24378722dbfd8859d633746ef5916ce86/benchmark/old.js#L598-L620
9,074
TonyGermaneri/canvas-datagrid
lib/draw.js
fillArray
function fillArray(low, high, step, def) { step = step || 1; var i = [], x; for (x = low; x <= high; x += step) { i[x] = def === undefined ? x : (typeof def === 'function' ? def(x) : def); } return i; }
javascript
function fillArray(low, high, step, def) { step = step || 1; var i = [], x; for (x = low; x <= high; x += step) { i[x] = def === undefined ? x : (typeof def === 'function' ? def(x) : def); } return i; }
[ "function", "fillArray", "(", "low", ",", "high", ",", "step", ",", "def", ")", "{", "step", "=", "step", "||", "1", ";", "var", "i", "=", "[", "]", ",", "x", ";", "for", "(", "x", "=", "low", ";", "x", "<=", "high", ";", "x", "+=", "step",...
more heavyweight version than fillArray defined in intf.js
[ "more", "heavyweight", "version", "than", "fillArray", "defined", "in", "intf", ".", "js" ]
71217ae00f26cadbbfa884bc94617435762d24d3
https://github.com/TonyGermaneri/canvas-datagrid/blob/71217ae00f26cadbbfa884bc94617435762d24d3/lib/draw.js#L16-L23
9,075
TonyGermaneri/canvas-datagrid
tutorials/tutorials.js
createData
function createData() { var x, y, d = []; for (x = 0; x < 100; x += 1) { d[x] = {}; for (y = 0; y < 20; y += 1) { d[x][y] = y * x; } } return d; }
javascript
function createData() { var x, y, d = []; for (x = 0; x < 100; x += 1) { d[x] = {}; for (y = 0; y < 20; y += 1) { d[x][y] = y * x; } } return d; }
[ "function", "createData", "(", ")", "{", "var", "x", ",", "y", ",", "d", "=", "[", "]", ";", "for", "(", "x", "=", "0", ";", "x", "<", "100", ";", "x", "+=", "1", ")", "{", "d", "[", "x", "]", "=", "{", "}", ";", "for", "(", "y", "=",...
this is not a real mode, just for fun you'll probably have to refresh the page to get rid of this timer
[ "this", "is", "not", "a", "real", "mode", "just", "for", "fun", "you", "ll", "probably", "have", "to", "refresh", "the", "page", "to", "get", "rid", "of", "this", "timer" ]
71217ae00f26cadbbfa884bc94617435762d24d3
https://github.com/TonyGermaneri/canvas-datagrid/blob/71217ae00f26cadbbfa884bc94617435762d24d3/tutorials/tutorials.js#L1017-L1026
9,076
TonyGermaneri/canvas-datagrid
lib/events.js
checkScrollBoxVisibility
function checkScrollBoxVisibility() { self.scrollBox.horizontalBarVisible = (self.style.width !== 'auto' && dataWidth > self.scrollBox.width && self.style.overflowX !== 'hidden') || self.style.overflowX === 'scroll'; self.scrollBox.horizontalBoxVisible = dataWidth > s...
javascript
function checkScrollBoxVisibility() { self.scrollBox.horizontalBarVisible = (self.style.width !== 'auto' && dataWidth > self.scrollBox.width && self.style.overflowX !== 'hidden') || self.style.overflowX === 'scroll'; self.scrollBox.horizontalBoxVisible = dataWidth > s...
[ "function", "checkScrollBoxVisibility", "(", ")", "{", "self", ".", "scrollBox", ".", "horizontalBarVisible", "=", "(", "self", ".", "style", ".", "width", "!==", "'auto'", "&&", "dataWidth", ">", "self", ".", "scrollBox", ".", "width", "&&", "self", ".", ...
sets actual DOM canvas element
[ "sets", "actual", "DOM", "canvas", "element" ]
71217ae00f26cadbbfa884bc94617435762d24d3
https://github.com/TonyGermaneri/canvas-datagrid/blob/71217ae00f26cadbbfa884bc94617435762d24d3/lib/events.js#L123-L130
9,077
architect/architect
src/create/aws/create-events/index.js
createTopic
function createTopic(env, callback) { sns.createTopic({ Name: `${params.app}-${env}-${params.event}`, }, function _createTopic(err) { if (err) { console.log(err) } setTimeout(callback, 0) }) }
javascript
function createTopic(env, callback) { sns.createTopic({ Name: `${params.app}-${env}-${params.event}`, }, function _createTopic(err) { if (err) { console.log(err) } setTimeout(callback, 0) }) }
[ "function", "createTopic", "(", "env", ",", "callback", ")", "{", "sns", ".", "createTopic", "(", "{", "Name", ":", "`", "${", "params", ".", "app", "}", "${", "env", "}", "${", "params", ".", "event", "}", "`", ",", "}", ",", "function", "_createT...
creates an sns topic
[ "creates", "an", "sns", "topic" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/create/aws/create-events/index.js#L22-L32
9,078
architect/architect
src/deploy/lambda-all/00-read.js
filter
function filter(p) { if (filters.length === 0) return true let predicate = false filters.forEach(section=> { let current = path.join('src', section) if (p.startsWith(current)) { predicate = true } }) return p...
javascript
function filter(p) { if (filters.length === 0) return true let predicate = false filters.forEach(section=> { let current = path.join('src', section) if (p.startsWith(current)) { predicate = true } }) return p...
[ "function", "filter", "(", "p", ")", "{", "if", "(", "filters", ".", "length", "===", "0", ")", "return", "true", "let", "predicate", "=", "false", "filters", ".", "forEach", "(", "section", "=>", "{", "let", "current", "=", "path", ".", "join", "(",...
if filters exist only deploy functions of that type
[ "if", "filters", "exist", "only", "deploy", "functions", "of", "that", "type" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/deploy/lambda-all/00-read.js#L11-L22
9,079
architect/architect
src/sandbox/db/index.js
start
function start(callback) { let handle = {close(){server.close()}} check(function _check(err, inUse) { if (err) throw err if (inUse) { server = {close(){}} init(callback) } else { server = dynalite({ createTableMs: 0 }).listen(5000, function _server(err) { if (...
javascript
function start(callback) { let handle = {close(){server.close()}} check(function _check(err, inUse) { if (err) throw err if (inUse) { server = {close(){}} init(callback) } else { server = dynalite({ createTableMs: 0 }).listen(5000, function _server(err) { if (...
[ "function", "start", "(", "callback", ")", "{", "let", "handle", "=", "{", "close", "(", ")", "{", "server", ".", "close", "(", ")", "}", "}", "check", "(", "function", "_check", "(", "err", ",", "inUse", ")", "{", "if", "(", "err", ")", "throw",...
starts an in-memory dynalite dynamodb server - automatically creates any tables or indexes defined by the arcfile - also creates a local session table
[ "starts", "an", "in", "-", "memory", "dynalite", "dynamodb", "server" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/sandbox/db/index.js#L12-L34
9,080
architect/architect
src/sandbox/events/index.js
start
function start(callback) { let {arc} = readArc() let close = x=> !x // if .arc has events and we're not clobbering with ARC_LOCAL flag if (arc.events || arc.queues) { // start a little web server let server = http.createServer(function listener(req, res) { let body = '' req.on('data', chun...
javascript
function start(callback) { let {arc} = readArc() let close = x=> !x // if .arc has events and we're not clobbering with ARC_LOCAL flag if (arc.events || arc.queues) { // start a little web server let server = http.createServer(function listener(req, res) { let body = '' req.on('data', chun...
[ "function", "start", "(", "callback", ")", "{", "let", "{", "arc", "}", "=", "readArc", "(", ")", "let", "close", "=", "x", "=>", "!", "x", "// if .arc has events and we're not clobbering with ARC_LOCAL flag", "if", "(", "arc", ".", "events", "||", "arc", "....
creates a little web server that listens for events on 3334
[ "creates", "a", "little", "web", "server", "that", "listens", "for", "events", "on", "3334" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/sandbox/events/index.js#L12-L64
9,081
architect/architect
src/sandbox/env/index.js
_readArc
function _readArc(callback) { let parsed = readArc() arc = parsed.arc inventory(arc, null, function _arc(err, result) { if (err) callback(err) else { pathToCode = result.localPaths callback() } }) }
javascript
function _readArc(callback) { let parsed = readArc() arc = parsed.arc inventory(arc, null, function _arc(err, result) { if (err) callback(err) else { pathToCode = result.localPaths callback() } }) }
[ "function", "_readArc", "(", "callback", ")", "{", "let", "parsed", "=", "readArc", "(", ")", "arc", "=", "parsed", ".", "arc", "inventory", "(", "arc", ",", "null", ",", "function", "_arc", "(", "err", ",", "result", ")", "{", "if", "(", "err", ")...
Shared copier and env need Arc inventory
[ "Shared", "copier", "and", "env", "need", "Arc", "inventory" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/sandbox/env/index.js#L12-L22
9,082
architect/architect
src/hydrate/shared/_arc.js
copy
function copy(source, destination, callback) { cp(source, destination, {overwrite: true}, function done(err) { if (err) callback(err) else callback() }) }
javascript
function copy(source, destination, callback) { cp(source, destination, {overwrite: true}, function done(err) { if (err) callback(err) else callback() }) }
[ "function", "copy", "(", "source", ",", "destination", ",", "callback", ")", "{", "cp", "(", "source", ",", "destination", ",", "{", "overwrite", ":", "true", "}", ",", "function", "done", "(", "err", ")", "{", "if", "(", "err", ")", "callback", "(",...
Reusable copier, always overwrites
[ "Reusable", "copier", "always", "overwrites" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/hydrate/shared/_arc.js#L47-L52
9,083
architect/architect
src/create/aws/create-event-lambda-deployments/_get-sns-topic-arn.js
listTopics
function listTopics(next, done) { let params = next? {NextToken:next} : {} sns.listTopics(params, function _listTopics(err, result) { if (err) { done(err) } else { // keep track of our current iteration let index = 0 let tidy = t=> t.TopicArn.split(':').reverse(...
javascript
function listTopics(next, done) { let params = next? {NextToken:next} : {} sns.listTopics(params, function _listTopics(err, result) { if (err) { done(err) } else { // keep track of our current iteration let index = 0 let tidy = t=> t.TopicArn.split(':').reverse(...
[ "function", "listTopics", "(", "next", ",", "done", ")", "{", "let", "params", "=", "next", "?", "{", "NextToken", ":", "next", "}", ":", "{", "}", "sns", ".", "listTopics", "(", "params", ",", "function", "_listTopics", "(", "err", ",", "result", ")...
aws-sdk isn't the friendliest api we need to recurse thru topics searching for the arn
[ "aws", "-", "sdk", "isn", "t", "the", "friendliest", "api", "we", "need", "to", "recurse", "thru", "topics", "searching", "for", "the", "arn" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/create/aws/create-event-lambda-deployments/_get-sns-topic-arn.js#L10-L38
9,084
architect/architect
src/audit/_sync-role.js
read
function read(callback) { let raw = fs.readFileSync(thing.path).toString() //let json = thing.path.split('.').reverse()[0] === 'json' // TODO add support for role.yaml let policies = JSON.parse(raw).policies callback(null, policies || []) }
javascript
function read(callback) { let raw = fs.readFileSync(thing.path).toString() //let json = thing.path.split('.').reverse()[0] === 'json' // TODO add support for role.yaml let policies = JSON.parse(raw).policies callback(null, policies || []) }
[ "function", "read", "(", "callback", ")", "{", "let", "raw", "=", "fs", ".", "readFileSync", "(", "thing", ".", "path", ")", ".", "toString", "(", ")", "//let json = thing.path.split('.').reverse()[0] === 'json'", "// TODO add support for role.yaml", "let", "policies"...
read the managed policies
[ "read", "the", "managed", "policies" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/audit/_sync-role.js#L20-L26
9,085
architect/architect
src/audit/_sync-role.js
removes
function removes(result, callback) { let fns = result.AttachedPolicies.map(p=> { return function maybeRemove(callback) { let PolicyArn = p.PolicyArn if (policies.includes(PolicyArn)) { callback() } ...
javascript
function removes(result, callback) { let fns = result.AttachedPolicies.map(p=> { return function maybeRemove(callback) { let PolicyArn = p.PolicyArn if (policies.includes(PolicyArn)) { callback() } ...
[ "function", "removes", "(", "result", ",", "callback", ")", "{", "let", "fns", "=", "result", ".", "AttachedPolicies", ".", "map", "(", "p", "=>", "{", "return", "function", "maybeRemove", "(", "callback", ")", "{", "let", "PolicyArn", "=", "p", ".", "...
if not in the list remove it
[ "if", "not", "in", "the", "list", "remove", "it" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/audit/_sync-role.js#L63-L79
9,086
architect/architect
src/audit/_sync-role.js
adds
function adds(result, callback) { let fns = policies.map(PolicyArn=> { return function maybeAdd(callback) { iam.attachRolePolicy({ RoleName, PolicyArn }, callback) } })...
javascript
function adds(result, callback) { let fns = policies.map(PolicyArn=> { return function maybeAdd(callback) { iam.attachRolePolicy({ RoleName, PolicyArn }, callback) } })...
[ "function", "adds", "(", "result", ",", "callback", ")", "{", "let", "fns", "=", "policies", ".", "map", "(", "PolicyArn", "=>", "{", "return", "function", "maybeAdd", "(", "callback", ")", "{", "iam", ".", "attachRolePolicy", "(", "{", "RoleName", ",", ...
attaches policies from role.json
[ "attaches", "policies", "from", "role", ".", "json" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/audit/_sync-role.js#L81-L91
9,087
architect/architect
src/deploy/lambda-one/_zip-impl.js
_read
function _read(callback) { glob(path.join(process.cwd(), pathToCode, '/*'), {dot:true}, callback) }
javascript
function _read(callback) { glob(path.join(process.cwd(), pathToCode, '/*'), {dot:true}, callback) }
[ "function", "_read", "(", "callback", ")", "{", "glob", "(", "path", ".", "join", "(", "process", ".", "cwd", "(", ")", ",", "pathToCode", ",", "'/*'", ")", ",", "{", "dot", ":", "true", "}", ",", "callback", ")", "}" ]
get a handle on the files to zip
[ "get", "a", "handle", "on", "the", "files", "to", "zip" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/deploy/lambda-one/_zip-impl.js#L19-L21
9,088
architect/architect
src/create/aws/create-ws-router/create/route.js
createIntegration
function createIntegration(callback) { setTimeout(function throttle() { let uri = `arn:aws:apigateway:${region}:lambda:path/2015-03-31/functions/${arn}/invocations` // console.log(api) gateway.createIntegration({ ApiId: api.ApiId, IntegrationMethod: 'POST', In...
javascript
function createIntegration(callback) { setTimeout(function throttle() { let uri = `arn:aws:apigateway:${region}:lambda:path/2015-03-31/functions/${arn}/invocations` // console.log(api) gateway.createIntegration({ ApiId: api.ApiId, IntegrationMethod: 'POST', In...
[ "function", "createIntegration", "(", "callback", ")", "{", "setTimeout", "(", "function", "throttle", "(", ")", "{", "let", "uri", "=", "`", "${", "region", "}", "${", "arn", "}", "`", "// console.log(api)", "gateway", ".", "createIntegration", "(", "{", ...
setup the integration
[ "setup", "the", "integration" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/create/aws/create-ws-router/create/route.js#L18-L29
9,089
architect/architect
src/create/aws/create-ws-router/create/route.js
createRoute
function createRoute(result, callback) { setTimeout(function throttle() { gateway.createRoute({ ApiId: api.ApiId, RouteKey, Target: `integrations/${integrationId}` }, callback) }, 1000) }
javascript
function createRoute(result, callback) { setTimeout(function throttle() { gateway.createRoute({ ApiId: api.ApiId, RouteKey, Target: `integrations/${integrationId}` }, callback) }, 1000) }
[ "function", "createRoute", "(", "result", ",", "callback", ")", "{", "setTimeout", "(", "function", "throttle", "(", ")", "{", "gateway", ".", "createRoute", "(", "{", "ApiId", ":", "api", ".", "ApiId", ",", "RouteKey", ",", "Target", ":", "`", "${", "...
create the route
[ "create", "the", "route" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/create/aws/create-ws-router/create/route.js#L50-L58
9,090
architect/architect
src/create/aws/create-http-static-proxy/read.js
getBucket
function getBucket(env, static) { let staging let production static.forEach(thing=> { if (thing[0] === 'staging') { staging = thing[1] } if (thing[0] === 'production') { production = thing[1] } }) if (env === 'staging') return staging if (env === 'production') return prod...
javascript
function getBucket(env, static) { let staging let production static.forEach(thing=> { if (thing[0] === 'staging') { staging = thing[1] } if (thing[0] === 'production') { production = thing[1] } }) if (env === 'staging') return staging if (env === 'production') return prod...
[ "function", "getBucket", "(", "env", ",", "static", ")", "{", "let", "staging", "let", "production", "static", ".", "forEach", "(", "thing", "=>", "{", "if", "(", "thing", "[", "0", "]", "===", "'staging'", ")", "{", "staging", "=", "thing", "[", "1"...
helper returns the @static value for the current NODE_ENV
[ "helper", "returns", "the" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/create/aws/create-http-static-proxy/read.js#L36-L51
9,091
architect/architect
src/dns/basic/_domains-create.js
reads
function reads(callback) { parallel({ cert(callback) { acm.listCertificates({}, callback) }, apis(callback) { gw.getRestApis({ limit: 500, }, callback) } }, callback) }
javascript
function reads(callback) { parallel({ cert(callback) { acm.listCertificates({}, callback) }, apis(callback) { gw.getRestApis({ limit: 500, }, callback) } }, callback) }
[ "function", "reads", "(", "callback", ")", "{", "parallel", "(", "{", "cert", "(", "callback", ")", "{", "acm", ".", "listCertificates", "(", "{", "}", ",", "callback", ")", "}", ",", "apis", "(", "callback", ")", "{", "gw", ".", "getRestApis", "(", ...
get the cert and the restapiid
[ "get", "the", "cert", "and", "the", "restapiid" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/dns/basic/_domains-create.js#L17-L28
9,092
architect/architect
src/dns/route53/03-alias.js
getRecordSetsAndDomains
function getRecordSetsAndDomains(result, callback) { HostedZoneId = result.HostedZones.find(i=>i.Name === `${domain}.`).Id parallel({ apis(callback) { gateway.getDomainNames({ limit: 500, }, callback) }, records(callback) { route53.listResour...
javascript
function getRecordSetsAndDomains(result, callback) { HostedZoneId = result.HostedZones.find(i=>i.Name === `${domain}.`).Id parallel({ apis(callback) { gateway.getDomainNames({ limit: 500, }, callback) }, records(callback) { route53.listResour...
[ "function", "getRecordSetsAndDomains", "(", "result", ",", "callback", ")", "{", "HostedZoneId", "=", "result", ".", "HostedZones", ".", "find", "(", "i", "=>", "i", ".", "Name", "===", "`", "${", "domain", "}", "`", ")", ".", "Id", "parallel", "(", "{...
read route53 recordsets and apigateway domains
[ "read", "route53", "recordsets", "and", "apigateway", "domains" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/dns/route53/03-alias.js#L22-L36
9,093
architect/architect
src/deploy/helpers/delta.js
stringify
function stringify(arc) { let fmtTbl = obj=> { let name = Object.keys(obj)[0] let keys = Object.keys(obj[name]) let result = `${name}\n` keys.forEach(key=> { let val = obj[name][key] result += ` ${key} ${val}\n` }) return result } let str = `@app\n${arc.app[0]}\n` //////////...
javascript
function stringify(arc) { let fmtTbl = obj=> { let name = Object.keys(obj)[0] let keys = Object.keys(obj[name]) let result = `${name}\n` keys.forEach(key=> { let val = obj[name][key] result += ` ${key} ${val}\n` }) return result } let str = `@app\n${arc.app[0]}\n` //////////...
[ "function", "stringify", "(", "arc", ")", "{", "let", "fmtTbl", "=", "obj", "=>", "{", "let", "name", "=", "Object", ".", "keys", "(", "obj", ")", "[", "0", "]", "let", "keys", "=", "Object", ".", "keys", "(", "obj", "[", "name", "]", ")", "let...
create a .arc string from arc object
[ "create", "a", ".", "arc", "string", "from", "arc", "object" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/deploy/helpers/delta.js#L103-L135
9,094
architect/architect
src/create/aws/_get-iam-role.js
_createRole
function _createRole(callback) { var iam = new aws.IAM iam.createRole({ AssumeRolePolicyDocument: JSON.stringify({ Version: '2012-10-17', Statement: [{ Sid: '', Effect: 'Allow', Principal: { Service: 'lambda.amazonaws.com' }, Action: 'sts:AssumeRole'...
javascript
function _createRole(callback) { var iam = new aws.IAM iam.createRole({ AssumeRolePolicyDocument: JSON.stringify({ Version: '2012-10-17', Statement: [{ Sid: '', Effect: 'Allow', Principal: { Service: 'lambda.amazonaws.com' }, Action: 'sts:AssumeRole'...
[ "function", "_createRole", "(", "callback", ")", "{", "var", "iam", "=", "new", "aws", ".", "IAM", "iam", ".", "createRole", "(", "{", "AssumeRolePolicyDocument", ":", "JSON", ".", "stringify", "(", "{", "Version", ":", "'2012-10-17'", ",", "Statement", ":...
create arc-role
[ "create", "arc", "-", "role" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/create/aws/_get-iam-role.js#L34-L98
9,095
architect/architect
src/inventory/index.js
getName
function getName(tuple) { if (Array.isArray(tuple)) { var verb = tuple[0] var path = getLambdaName(tuple[1]) return [`${app}-production-${verb}${path}`, `${app}-staging-${verb}${path}`] } else { var path = getLambdaName(tuple) return [`${app}-production-get${path}`, `${app}-sta...
javascript
function getName(tuple) { if (Array.isArray(tuple)) { var verb = tuple[0] var path = getLambdaName(tuple[1]) return [`${app}-production-${verb}${path}`, `${app}-staging-${verb}${path}`] } else { var path = getLambdaName(tuple) return [`${app}-production-get${path}`, `${app}-sta...
[ "function", "getName", "(", "tuple", ")", "{", "if", "(", "Array", ".", "isArray", "(", "tuple", ")", ")", "{", "var", "verb", "=", "tuple", "[", "0", "]", "var", "path", "=", "getLambdaName", "(", "tuple", "[", "1", "]", ")", "return", "[", "`",...
gets an http lambda name
[ "gets", "an", "http", "lambda", "name" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/inventory/index.js#L56-L66
9,096
architect/architect
src/inventory/index.js
getSystemName
function getSystemName(tuple) { if (Array.isArray(tuple)) { var verb = tuple[0] var path = getLambdaName(tuple[1]) return `${verb}${path}` } else { var path = getLambdaName(tuple) return `get${path}` } }
javascript
function getSystemName(tuple) { if (Array.isArray(tuple)) { var verb = tuple[0] var path = getLambdaName(tuple[1]) return `${verb}${path}` } else { var path = getLambdaName(tuple) return `get${path}` } }
[ "function", "getSystemName", "(", "tuple", ")", "{", "if", "(", "Array", ".", "isArray", "(", "tuple", ")", ")", "{", "var", "verb", "=", "tuple", "[", "0", "]", "var", "path", "=", "getLambdaName", "(", "tuple", "[", "1", "]", ")", "return", "`", ...
gets an http filesystem name
[ "gets", "an", "http", "filesystem", "name" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/inventory/index.js#L83-L93
9,097
architect/architect
src/inventory/index.js
getLegacyName
function getLegacyName(tuple) { if (Array.isArray(tuple)) { var verb = tuple[0] var path = getLegacyLambdaName(tuple[1]) return [`${app}-production-${verb}${path}`, `${app}-staging-${verb}${path}`] } else { var path = getLegacyLambdaName(tuple) return [`${app}-production-get${p...
javascript
function getLegacyName(tuple) { if (Array.isArray(tuple)) { var verb = tuple[0] var path = getLegacyLambdaName(tuple[1]) return [`${app}-production-${verb}${path}`, `${app}-staging-${verb}${path}`] } else { var path = getLegacyLambdaName(tuple) return [`${app}-production-get${p...
[ "function", "getLegacyName", "(", "tuple", ")", "{", "if", "(", "Array", ".", "isArray", "(", "tuple", ")", ")", "{", "var", "verb", "=", "tuple", "[", "0", "]", "var", "path", "=", "getLegacyLambdaName", "(", "tuple", "[", "1", "]", ")", "return", ...
gets an legacy lambda name
[ "gets", "an", "legacy", "lambda", "name" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/inventory/index.js#L96-L106
9,098
architect/architect
src/inventory/index.js
getLegacySystemName
function getLegacySystemName(tuple) { if (Array.isArray(tuple)) { var verb = tuple[0] var path = getLegacyLambdaName(tuple[1]) return `${verb}${path}` } else { var path = getLegacyLambdaName(tuple) return `get${path}` } }
javascript
function getLegacySystemName(tuple) { if (Array.isArray(tuple)) { var verb = tuple[0] var path = getLegacyLambdaName(tuple[1]) return `${verb}${path}` } else { var path = getLegacyLambdaName(tuple) return `get${path}` } }
[ "function", "getLegacySystemName", "(", "tuple", ")", "{", "if", "(", "Array", ".", "isArray", "(", "tuple", ")", ")", "{", "var", "verb", "=", "tuple", "[", "0", "]", "var", "path", "=", "getLegacyLambdaName", "(", "tuple", "[", "1", "]", ")", "retu...
gets an legacy filesystem name
[ "gets", "an", "legacy", "filesystem", "name" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/inventory/index.js#L109-L119
9,099
architect/architect
src/inventory/index.js
getScheduledName
function getScheduledName(arr) { var name = arr.slice(0).shift() return [`${app}-production-${name}`, `${app}-staging-${name}`] }
javascript
function getScheduledName(arr) { var name = arr.slice(0).shift() return [`${app}-production-${name}`, `${app}-staging-${name}`] }
[ "function", "getScheduledName", "(", "arr", ")", "{", "var", "name", "=", "arr", ".", "slice", "(", "0", ")", ".", "shift", "(", ")", "return", "[", "`", "${", "app", "}", "${", "name", "}", "`", ",", "`", "${", "app", "}", "${", "name", "}", ...
get a scheduled lambda name
[ "get", "a", "scheduled", "lambda", "name" ]
c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd
https://github.com/architect/architect/blob/c5fd0b9b73ce57f2a34cf854ff8e49cc671468dd/src/inventory/index.js#L127-L130