CollectionFS, Base package
API documentation automatically generated by docmeteor.
#############################################################################
HELPERS
This method cloneFileRecord is defined in FS.Utility
Arguments
options {Object} (Optional)
Set true
to prevent certain properties from being omitted from the clone.
Returns {Object} Cloned filerecord
Makes a shallow clone of rec
, filtering out some properties that might be present if
it's an FS.File instance, but which we never want to be part of the stored
filerecord.
This is a blacklist clone rather than a whitelist because we want the user to be able to specify whatever additional properties they wish.
In general, we expect the following whitelist properties used by the internal and external APIs:
_id, name, size, type, chunkCount, chunkSize, chunkSum, copies, createdAt, updatedAt, uploadedAt
Those properties, and any additional properties added by the user, should be present in the returned object, which is suitable for inserting into the backing collection or extending an FS.File instance.
FS.Utility.cloneFileRecord = function(rec, options) { ...
base-common.js:71
-
This method defaultCallback is defined in FS.Utility
Arguments
Returns {undefined}
Can be used as a default callback for client methods that need a callback. Simply throws the provided error if there is one.
FS.Utility.defaultCallback = function defaultCallback(err) { ...
base-common.js:96
-
This method defaultCallback is defined in FS.Utility
Arguments
A callback function, if you have one. Can be undefined or null.
Error or error message (string)
Returns {Any} the callback result if any
Handle Error, creates an Error instance with the given text. If callback is a function, passes the error to that function. Otherwise throws it. Useful for dealing with errors in methods that optionally accept a callback.
FS.Utility.handleError = function(f, err, result) { ...
base-common.js:120
-
This method noop is defined in FS.Utility
Use this to hand a no operation / empty function
FS.Utility.noop = function() { ...
base-common.js:134
-
This method getFileExtension is defined in FS.Utility
Arguments
A filename, filepath, or URL that may or may not have an extension.
Returns {String} The extension or an empty string if no extension found.
FS.Utility.getFileExtension = function utilGetFileExtension(name) { ...
base-common.js:205
-
This method setFileExtension is defined in FS.Utility
Arguments
A filename that may or may not already have an extension.
An extension without leading period, which you want to be the new extension on name
.
Returns {String} The filename with changed extension.
FS.Utility.setFileExtension = function utilSetFileExtension(name, ext) { ...
base-common.js:222
-
This method binaryToBuffer is defined in FS.Utility
Arguments
Returns {Buffer}
Converts a Uint8Array instance to a Node Buffer instance
FS.Utility.binaryToBuffer = function(data) { ...
base-server.js:9
-
This method bufferToBinary is defined in FS.Utility
Arguments
Returns {Uint8Array}
Converts a Node Buffer instance to a Uint8Array instance
FS.Utility.bufferToBinary = function(data) { ...
base-server.js:26
-
This method eachFile is defined in FS.Utility
Arguments
Browser event
Function to run for each file found in the event.
Returns {undefined}
Utility for iteration over files in event
FS.Utility.eachFile = function(e, f) { ...
base-client.js:37