Skip to main content

Home > git-documentdb > Validator

Validator class#

Validator Class

Signature:
export declare class Validator

Constructors#

ConstructorModifiersDescription
(constructor)(workingDir)Constructs a new instance of the Validator class

Properties#

PropertyModifiersTypeDescription
byteLengthOfstatic(str: string) => number

Methods#

MethodModifiersDescription
maxCollectionPathLength()Return the max length of collectionPath
maxIdLength()Return the max length of _id
maxWorkingDirectoryLength()staticReturn the max length of working directory path
normalizeCollectionPath(collectionPath)staticNormalized collectionPath is '' or path strings that have a trailing slash and no heading slash. Root ('/') is not allowed. Backslash \ or yen ¥ is replaced with slash /.
testWindowsInvalidFileNameCharacter(name, options)Return false if the given name includes Windows invalid filename character
testWindowsReservedFileName(name, options)Return false if the given name equals Windows reserved filename
validateCollectionPath(collectionPath)Validate collectionPath
validateDbName(dbName)Validate dbName
validateDocument(doc)Validate document
validateId(_id)Validate _id _id = collectionPath + shortId (not including postfix '.json')
validateLocalDir(localDir)Validate localDir