New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@wordpress/token-list

Package Overview
Dependencies
Maintainers
14
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wordpress/token-list - npm Package Compare versions

Comparing version 1.9.0 to 1.10.0

build-types/index.d.ts

88

build-module/index.js

@@ -15,5 +15,3 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";

var TokenList =
/*#__PURE__*/
function () {
var TokenList = /*#__PURE__*/function () {
/**

@@ -25,4 +23,2 @@ * Constructs a new instance of TokenList.

function TokenList() {
var _this = this;
var initialValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';

@@ -32,17 +28,19 @@

this.value = initialValue;
['entries', 'forEach', 'keys', 'values'].forEach(function (fn) {
_this[fn] = function () {
var _this$_valueAsArray;
this.value = initialValue; // Disable reason: These are type hints on the class.
return (_this$_valueAsArray = _this._valueAsArray)[fn].apply(_this$_valueAsArray, arguments);
};
});
}
/* eslint-disable no-unused-expressions */
/** @type {string} */
this._currentValue;
/** @type {string[]} */
this._valueAsArray;
/* eslint-enable no-unused-expressions */
} // Disable reason: JSDoc lint doesn't understand TypeScript types
/* eslint-disable jsdoc/valid-types */
/**
* Returns the associated set as string.
*
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-value
*
* @return {string} Token set as string.
* @param {Parameters<Array<string>['entries']>} args
*/

@@ -52,2 +50,52 @@

_createClass(TokenList, [{
key: "entries",
value: function entries() {
var _this$_valueAsArray;
return (_this$_valueAsArray = this._valueAsArray).entries.apply(_this$_valueAsArray, arguments);
}
/**
* @param {Parameters<Array<string>['forEach']>} args
*/
}, {
key: "forEach",
value: function forEach() {
var _this$_valueAsArray2;
return (_this$_valueAsArray2 = this._valueAsArray).forEach.apply(_this$_valueAsArray2, arguments);
}
/**
* @param {Parameters<Array<string>['keys']>} args
*/
}, {
key: "keys",
value: function keys() {
var _this$_valueAsArray3;
return (_this$_valueAsArray3 = this._valueAsArray).keys.apply(_this$_valueAsArray3, arguments);
}
/**
* @param {Parameters<Array<string>['values']>} args
*/
}, {
key: "values",
value: function values() {
var _this$_valueAsArray4;
return (_this$_valueAsArray4 = this._valueAsArray).values.apply(_this$_valueAsArray4, arguments);
}
/* eslint-enable jsdoc/valid-types */
/**
* Returns the associated set as string.
*
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-value
*
* @return {string} Token set as string.
*/
}, {
key: "toString",

@@ -76,5 +124,3 @@

key: Symbol.iterator,
value:
/*#__PURE__*/
_regeneratorRuntime.mark(function value() {
value: /*#__PURE__*/_regeneratorRuntime.mark(function value() {
return _regeneratorRuntime.wrap(function value$(_context) {

@@ -81,0 +127,0 @@ while (1) {

@@ -27,5 +27,3 @@ "use strict";

*/
var TokenList =
/*#__PURE__*/
function () {
var TokenList = /*#__PURE__*/function () {
/**

@@ -37,21 +35,21 @@ * Constructs a new instance of TokenList.

function TokenList() {
var _this = this;
var initialValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
(0, _classCallCheck2.default)(this, TokenList);
this.value = initialValue;
['entries', 'forEach', 'keys', 'values'].forEach(function (fn) {
_this[fn] = function () {
var _this$_valueAsArray;
this.value = initialValue; // Disable reason: These are type hints on the class.
return (_this$_valueAsArray = _this._valueAsArray)[fn].apply(_this$_valueAsArray, arguments);
};
});
}
/* eslint-disable no-unused-expressions */
/** @type {string} */
this._currentValue;
/** @type {string[]} */
this._valueAsArray;
/* eslint-enable no-unused-expressions */
} // Disable reason: JSDoc lint doesn't understand TypeScript types
/* eslint-disable jsdoc/valid-types */
/**
* Returns the associated set as string.
*
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-value
*
* @return {string} Token set as string.
* @param {Parameters<Array<string>['entries']>} args
*/

@@ -61,2 +59,52 @@

(0, _createClass2.default)(TokenList, [{
key: "entries",
value: function entries() {
var _this$_valueAsArray;
return (_this$_valueAsArray = this._valueAsArray).entries.apply(_this$_valueAsArray, arguments);
}
/**
* @param {Parameters<Array<string>['forEach']>} args
*/
}, {
key: "forEach",
value: function forEach() {
var _this$_valueAsArray2;
return (_this$_valueAsArray2 = this._valueAsArray).forEach.apply(_this$_valueAsArray2, arguments);
}
/**
* @param {Parameters<Array<string>['keys']>} args
*/
}, {
key: "keys",
value: function keys() {
var _this$_valueAsArray3;
return (_this$_valueAsArray3 = this._valueAsArray).keys.apply(_this$_valueAsArray3, arguments);
}
/**
* @param {Parameters<Array<string>['values']>} args
*/
}, {
key: "values",
value: function values() {
var _this$_valueAsArray4;
return (_this$_valueAsArray4 = this._valueAsArray).values.apply(_this$_valueAsArray4, arguments);
}
/* eslint-enable jsdoc/valid-types */
/**
* Returns the associated set as string.
*
* @see https://dom.spec.whatwg.org/#dom-domtokenlist-value
*
* @return {string} Token set as string.
*/
}, {
key: "toString",

@@ -85,5 +133,3 @@

key: Symbol.iterator,
value:
/*#__PURE__*/
_regenerator.default.mark(function value() {
value: /*#__PURE__*/_regenerator.default.mark(function value() {
return _regenerator.default.wrap(function value$(_context) {

@@ -90,0 +136,0 @@ while (1) {

@@ -0,1 +1,9 @@

## Master
## 1.10.0 (2020-04-15)
### New feature
- Include TypeScript type declarations ([#18942](https://github.com/WordPress/gutenberg/pull/18942))
## 1.1.0 (2018-11-20)

@@ -2,0 +10,0 @@

{
"name": "@wordpress/token-list",
"version": "1.9.0",
"version": "1.10.0",
"description": "Constructable, plain JavaScript DOMTokenList implementation, supporting non-browser runtimes.",

@@ -22,4 +22,5 @@ "author": "The WordPress Contributors",

"react-native": "src/index",
"types": "build-types",
"dependencies": {
"@babel/runtime": "^7.8.3",
"@babel/runtime": "^7.9.2",
"lodash": "^4.17.15"

@@ -30,3 +31,3 @@ },

},
"gitHead": "41fc84af285da696c65c235331ee245dfe23971d"
"gitHead": "65dbf3a9503402ca3837090dc89d0207f7d96352"
}

@@ -20,8 +20,46 @@ /**

[ 'entries', 'forEach', 'keys', 'values' ].forEach( ( fn ) => {
this[ fn ] = ( ...args ) => this._valueAsArray[ fn ]( ...args );
} );
// Disable reason: These are type hints on the class.
/* eslint-disable no-unused-expressions */
/** @type {string} */
this._currentValue;
/** @type {string[]} */
this._valueAsArray;
/* eslint-enable no-unused-expressions */
}
// Disable reason: JSDoc lint doesn't understand TypeScript types
/* eslint-disable jsdoc/valid-types */
/**
* @param {Parameters<Array<string>['entries']>} args
*/
entries( ...args ) {
return this._valueAsArray.entries( ...args );
}
/**
* @param {Parameters<Array<string>['forEach']>} args
*/
forEach( ...args ) {
return this._valueAsArray.forEach( ...args );
}
/**
* @param {Parameters<Array<string>['keys']>} args
*/
keys( ...args ) {
return this._valueAsArray.keys( ...args );
}
/**
* @param {Parameters<Array<string>['values']>} args
*/
values( ...args ) {
return this._valueAsArray.values( ...args );
}
/* eslint-enable jsdoc/valid-types */
/**
* Returns the associated set as string.

@@ -28,0 +66,0 @@ *

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc