
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
mediawiki-title
Advanced tools
Mediawiki title normalization, that conforms to the normalization rules used in MediaWiki Core. In general, the page title is converted to the mediawiki DB key format by trimming spaces, replacing whitespace symbols to underscores and applying wiki-specific capitalization rules. The namespace name is converted to a localized canonical name.
ObjectInformation about a wikimedia site required to make correct normalization. This information matches the format used by the PHP API response, however not all of the fields are required for library operation.
The list of required properties is documented here, others can be removed.
Kind: global class
numberbooleanbooleanbooleanbooleanbooleanstringbooleanNamespace | undefinedNamespaceRepresents a wiki namespace
| Param | Type | Description |
|---|---|---|
| id | number | The namespace identifier |
| siteInfo | SiteInfo | The site metadata information. |
numberReturns the numeric namespace identifier
Kind: instance method of Namespace
booleanChecks whether namespace is Media
Kind: instance method of Namespace
booleanChecks whether namespace is Special
Kind: instance method of Namespace
booleanChecks whether namespace is Main
Kind: instance method of Namespace
booleanChecks whether namespace is Talk
Kind: instance method of Namespace
booleanChecks whether namespace is UserTalk
Kind: instance method of Namespace
stringGet the canonical name string for this namespace.
Kind: instance method of Namespace
booleanDetermines whether this namespace is equal to the given ns,
based on the numeric namespace identifier.
Kind: instance method of Namespace
Namespace | undefinedCreates a namespace instance from namespace text or a namespace alias
Kind: static method of Namespace
Returns: Namespace | undefined - a namespace or undefined if it wasn't found.
| Param | Type | Description |
|---|---|---|
| text | string | Namespace name text. |
| siteInfo | SiteInfo | the site information. |
NamespaceCreates a namespace object for a Main namespace.
Kind: static method of Namespace
| Param | Type | Description |
|---|---|---|
| siteInfo | SiteInfo | the site information. |
Kind: global class
stringstring | undefinedNamespacebooleanCreates a new title object with article the dbKey and namespace
| Param | Type | Description |
|---|---|---|
| key | string | The article title in a form of the dbKey. |
| namespace | Namespace | number | The article namespace. |
| siteInfo | SiteInfo | The site metadata. |
| [fragment] | string | The fragment of the title. |
stringReturns the normalized article title and namespace.
Kind: instance method of Title
string | undefinedReturns the normalized fragment part of the original title
Kind: instance method of Title
NamespaceReturns the namespace of an article.
Kind: instance method of Title
booleanDetermines whether this title is equals to the given title2,
based on comparing namespace and key.
Kind: instance method of Title
TitleNormalize a title according to the rules of siteInfo
Kind: static method of Title
Returns: Title - The resulting title object.
| Param | Type | Description |
|---|---|---|
| title | string | The page title to normalize. |
| siteInfo | SiteInfo | The site information. |
Kind: global exception class
TitleError should be considered an opaque exception class,
which is thrown by the various methods in this library. It is exported
so that it can be identified if caught by the caller.
ObjectInformation about a wikimedia site required to make correct normalization. This information matches the format used by the PHP API response, however not all of the fields are required for library operation.
The list of required properties is documented here, others can be removed.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| general | Object | General information about the site |
| general.lang | string | Site language code. |
| general.legaltitlechars | string | A perl-like regex for characters allowed in the page title. |
| general.case | string | Whether to capitalize the first letter of the title. Could be obtained from the general section of the siteInfo php API response. |
| namespaces | Object | Site namespaces info in the same format as returned by PHP api. |
| namespacealiases | Object | Site namespace aliases in the same format as returned by PHP api. |
| specialpagealiases | Object | Site special page aliases in the same format as returned by PHP api. |
The library synchronously returns a normalized title. Wiki-specific rules should be fetched from the MediaWiki API, and cached outside of the library. The description of the required properties is available in the SiteInfo object docs.
var result = Title.newFromText('some_title', {
general: {
lang: 'en',
legaltitlechars: " %!\"$&'()*,\\-.\\/0-9:;=?@A-Z\\\\^_`a-z~\\x80-\\xFF+",
case: 'first-letter'
},
namespaces: {
"0": {
id: 0,
case: "first-letter",
content: "",
"*": ""
},
}
});
console.log(result.getPrefixedDBKey());
For bug reporting please use Phabricator
and mark the bugs with Services label or contact directly in IRC in the #wikimedia-services channel.
FAQs
Title normalization library for mediawiki
The npm package mediawiki-title receives a total of 566 weekly downloads. As such, mediawiki-title popularity was classified as not popular.
We found that mediawiki-title demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.