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
- Host: GitHub
- URL: https://github.com/aretecode/stress-test
- Owner: aretecode
- Created: 2017-06-17T01:03:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-17T01:04:55.000Z (over 8 years ago)
- Last Synced: 2025-02-07T23:11:04.939Z (12 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
}
```