Page MenuHomePhabricator

Fix return type for trimByteLength in JSDoc
Closed, ResolvedPublic

Description

On the documentation page for trimByteLength, the return type is documented incorrectly as: return.newVal and return.trimmed. In addition, there in no link in the deprecated tag to the correct method.

To do:

  1. In the jquery.lengthLimit.js file, replace lines 37-39:
	 * @return {Object}
	 * @return {string} return.newVal
	 * @return {boolean} return.trimmed

with:

	 * @return {StringTrimmed}
  1. Replace line 30:
	 * @deprecated Use `require( 'mediawiki.String' ).trimByteLength` instead.

with:

	 * @deprecated Use {@link module:mediawiki.String.trimByteLength require( 'mediawiki.String' ).trimByteLength} instead.
  1. Run npm install and npm run doc to build the docs site
  2. Open docs/js/jQueryPlugins.html#.trimByteLength to confirm that both the type and deprecated links work