跳到主要内容
版本号:Next

Namespace: validatioUtils

Functions

isObject

isObject(obj): boolean

Check whether an element is an Object

Parameters

NameTypeDescription
objanythe element

Returns

boolean

Defined in

validation-utils.ts:100


isPackageNameScoped

isPackageNameScoped(name): boolean

Parameters

NameType
namestring

Returns

boolean

Defined in

validation-utils.ts:9


normalizeMetadata

normalizeMetadata(manifest, name): Manifest

Validate the package metadata, add additional properties whether are missing within the metadata properties.

Parameters

NameType
manifestManifest
namestring

Returns

Manifest

the object with additional properties as dist-tags ad versions

Defined in

validation-utils.ts:71


validateName

validateName(name): boolean

From normalize-package-data/lib/fixer.js

Parameters

NameTypeDescription
namestringthe package name

Returns

boolean

whether is valid or not

Defined in

validation-utils.ts:18


validatePackage

validatePackage(name): boolean

Validate a package.

Parameters

NameType
namestring

Returns

boolean

whether the package is valid or not

Defined in

validation-utils.ts:54


validatePassword

validatePassword(password, validation?): boolean

Parameters

NameTypeDefault value
passwordstringundefined
validationRegExpDEFAULT_PASSWORD_VALIDATION

Returns

boolean

Defined in

validation-utils.ts:112


validatePublishSingleVersion

validatePublishSingleVersion(manifest): boolean

Validate if a manifest has the correct structure when a new package is being created. The properties name, versions and _attachments must contain 1 element.

Parameters

NameType
manifestany

Returns

boolean

boolean

Defined in

schemes/publish-manifest.ts:33


validateUserName

validateUserName(userName, expectedName): boolean

Parameters

NameType
userNameany
expectedNamestring

Returns

boolean

Defined in

validation-utils.ts:121