An open API service indexing awesome lists of open source software.

https://github.com/aretecode/stress-test

combination of most data types that can break some things
https://github.com/aretecode/stress-test

Last synced: 11 months ago
JSON representation

combination of most data types that can break some things

Awesome Lists containing this project

README

          

# stress-test

> combination of most data types that can break some things

```js
module.exports = cb => {
const fullmap = new Map()
const fullset = new Set()
fullset.add('eh')
fullset.add(1)
fullmap.set(1, 2)
fullmap.set('bool', true)
fullmap.set('obj', {})

const datas = [
class {},
[],
[1],
new Array(),
new Array([1].length),
arguments,
function() {},
new Function(),
function() {
throw Error('threw')
},
Object.assign(() => {}, {keys: true}),
new Object(),
Object.create(null),
new Error(),
typeof global ? global : window,
Symbol('symbols'),
Symbol.toPrimative,
'',
new String('str'),
'actual string',
JSON.stringify({stringified: true}),
null,
false,
'',
undefined,
void 0,
new Boolean(0),
new Boolean(1),
!0,
new Date(),
new RegExp(),
new RegExp('.*', 'gmi'),
/me/,
NaN,
new Number(1),
Infinity,
1,
0,
-1,
+1,
new Promise(res => res(true)),
new Map(),
fullmap,
fullmap.entries(),
new Set(),
fullset,
fullset.values(),
Math,
Int8Array,
Uint8Array,
Uint8ClampedArray,
Int16Array,
Uint16Array,
Int32Array,
Uint32Array,
Float32Array,
Float64Array,
Promise,
Reflect,
Proxy,
JSON,
Function,
eval,
Object,
Date,
RegExp,
Array,
Set,
Map,
]

if (cb) return datas.map(data => cb(data))
return datas
}
```