diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames')
5 files changed, 263 insertions, 0 deletions
diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames/LICENSE b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames/LICENSE new file mode 100644 index 0000000000..e6620b5895 --- /dev/null +++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Jed Watson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames/bind.js b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames/bind.js new file mode 100644 index 0000000000..d8ae13b954 --- /dev/null +++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames/bind.js @@ -0,0 +1,48 @@ +/*! + Copyright (c) 2016 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +/* global define */ + +(function () { + 'use strict'; + + var hasOwn = {}.hasOwnProperty; + + function classNames () { + var classes = []; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; + + var argType = typeof arg; + + if (argType === 'string' || argType === 'number') { + classes.push(this && this[arg] || arg); + } else if (Array.isArray(arg)) { + classes.push(classNames.apply(this, arg)); + } else if (argType === 'object') { + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes.push(this && this[key] || key); + } + } + } + } + + return classes.join(' '); + } + + if (typeof module !== 'undefined' && module.exports) { + module.exports = classNames; + } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) { + // register as 'classnames', consistent with npm package name + define('classnames', [], function () { + return classNames; + }); + } else { + window.classNames = classNames; + } +}()); diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames/bower.json b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames/bower.json new file mode 100644 index 0000000000..0619a48f8c --- /dev/null +++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames/bower.json @@ -0,0 +1,37 @@ +{ + "name": "classnames", + "version": "2.2.5", + "description": "A simple utility for conditionally joining classNames together", + "main": [ + "index.js", + "bind.js", + "dedupe.js" + ], + "homepage": "https://github.com/JedWatson/classnames", + "authors": [ + "Jed Watson" + ], + "moduleType": [ + "amd", + "globals", + "node" + ], + "keywords": [ + "react", + "css", + "classes", + "classname", + "classnames", + "util", + "utility" + ], + "license": "MIT", + "ignore": [ + ".editorconfig", + ".gitignore", + "gulpfile.js", + "package.json", + "node_modules", + "tests.js" + ] +} diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames/dedupe.js b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames/dedupe.js new file mode 100644 index 0000000000..9546f8e3a1 --- /dev/null +++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames/dedupe.js @@ -0,0 +1,109 @@ +/*! + Copyright (c) 2016 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +/* global define */ + +(function () { + 'use strict'; + + var classNames = (function () { + // don't inherit from Object so we can skip hasOwnProperty check later + // http://stackoverflow.com/questions/15518328/creating-js-object-with-object-createnull#answer-21079232 + function StorageObject() {} + StorageObject.prototype = Object.create(null); + + function _parseArray (resultSet, array) { + var length = array.length; + + for (var i = 0; i < length; ++i) { + _parse(resultSet, array[i]); + } + } + + var hasOwn = {}.hasOwnProperty; + + function _parseNumber (resultSet, num) { + resultSet[num] = true; + } + + function _parseObject (resultSet, object) { + for (var k in object) { + if (hasOwn.call(object, k)) { + // set value to false instead of deleting it to avoid changing object structure + // https://www.smashingmagazine.com/2012/11/writing-fast-memory-efficient-javascript/#de-referencing-misconceptions + resultSet[k] = !!object[k]; + } + } + } + + var SPACE = /\s+/; + function _parseString (resultSet, str) { + var array = str.split(SPACE); + var length = array.length; + + for (var i = 0; i < length; ++i) { + resultSet[array[i]] = true; + } + } + + function _parse (resultSet, arg) { + if (!arg) return; + var argType = typeof arg; + + // 'foo bar' + if (argType === 'string') { + _parseString(resultSet, arg); + + // ['foo', 'bar', ...] + } else if (Array.isArray(arg)) { + _parseArray(resultSet, arg); + + // { 'foo': true, ... } + } else if (argType === 'object') { + _parseObject(resultSet, arg); + + // '130' + } else if (argType === 'number') { + _parseNumber(resultSet, arg); + } + } + + function _classNames () { + // don't leak arguments + // https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments + var len = arguments.length; + var args = Array(len); + for (var i = 0; i < len; i++) { + args[i] = arguments[i]; + } + + var classSet = new StorageObject(); + _parseArray(classSet, args); + + var list = []; + + for (var k in classSet) { + if (classSet[k]) { + list.push(k) + } + } + + return list.join(' '); + } + + return _classNames; + })(); + + if (typeof module !== 'undefined' && module.exports) { + module.exports = classNames; + } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) { + // register as 'classnames', consistent with npm package name + define('classnames', [], function () { + return classNames; + }); + } else { + window.classNames = classNames; + } +}()); diff --git a/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames/index.js b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames/index.js new file mode 100644 index 0000000000..38f0ff2bf9 --- /dev/null +++ b/third_party/webkit/PerformanceTests/Speedometer/resources/todomvc/architecture-examples/react/node_modules/classnames/index.js @@ -0,0 +1,48 @@ +/*! + Copyright (c) 2016 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/ +/* global define */ + +(function () { + 'use strict'; + + var hasOwn = {}.hasOwnProperty; + + function classNames () { + var classes = []; + + for (var i = 0; i < arguments.length; i++) { + var arg = arguments[i]; + if (!arg) continue; + + var argType = typeof arg; + + if (argType === 'string' || argType === 'number') { + classes.push(arg); + } else if (Array.isArray(arg)) { + classes.push(classNames.apply(null, arg)); + } else if (argType === 'object') { + for (var key in arg) { + if (hasOwn.call(arg, key) && arg[key]) { + classes.push(key); + } + } + } + } + + return classes.join(' '); + } + + if (typeof module !== 'undefined' && module.exports) { + module.exports = classNames; + } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) { + // register as 'classnames', consistent with npm package name + define('classnames', [], function () { + return classNames; + }); + } else { + window.classNames = classNames; + } +}()); |