1.0.6 • Published 1 year ago

nv-random-empty v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

nv-random-empty

  • generate a random \<empty-like> js-value
  • this is for test your runtime

  0 |0n | NaN| undefined | null | '' | false |  
  Symbol() | Symbol.for() |
  new Number(0)  | new String('') | new Boolean(false)  |
  []             | {}             | Object.create(null) | new Set() | new Map() |
  
  new Date(NaN);
  new Regexp("^$");

  new ArrayBuffer(0)      |  new DataView(new Array) |  Buffer.alloc(0)          | Buffer.allocUnsafe(0) | new SharedArrayBuffer(0) 
  new Uint8Array(0)       |  new Int8Array(0)        |  new Uint8ClampedArray(0) |
  new Uint16Array(0)      |  new Int16Array(0)       |
  new Uint32Array(0)      |  new Int32Array(0)       |                   
  new BigUint64Array(0)   |  new BigInt64Array(0)    |
  new Float32Array(0)     |  new Float64Array(0)        

  new WeakSet();
  new WeakMap();

install

  • npm install nv-random-empty

splitted

usage

    const x = require("nv-random-empty");    

example

			> x()
			BigUint64Array(0) []
			> x()
			''
			> x()
			[Boolean: false]
			> x()
			WeakMap { <items unknown> }
			> x()
			null
			> x()
			Float64Array(0) []
			> x()
			Float32Array(0) []
			> x()
			[String: '']
			> x()
			false
			> x()
			[String: '']
			> x()
			undefined
			> x()
			Int8Array(0) []
			> x()
			[Boolean: false]
			> x()
			BigUint64Array(0) []
			> x()
			0
			> x()
			Int8Array(0) []
			> x()
			WeakSet { <items unknown> }
			> x()
			Uint8ClampedArray(0) []
			> x()
			Symbol()
			> x()
			Symbol()
			> x()
			[]
			> x()
			''
			> x()
			[Object: null prototype] {}
			> x()
			undefined
			> x()
			DataView {
			  byteLength: 0,
			  byteOffset: 0,
			  buffer: ArrayBuffer { [Uint8Contents]: <>, byteLength: 0 }
			}
			> x()
			0
			> x()
			WeakMap { <items unknown> }
			> x()
			null
			> x()
			Float64Array(0) []
			> x()
			<Buffer >
			> x()
			WeakSet { <items unknown> }
			> x()
			DataView {
			  byteLength: 0,
			  byteOffset: 0,
			  buffer: ArrayBuffer { [Uint8Contents]: <>, byteLength: 0 }
			}
			> x()
			undefined
			> x()
			Map(0) {}
			> x()
			undefined
			> x()
			[Number: 0]
			> x()
			Int8Array(0) []
			> x()
			undefined
			> x()
			<Buffer >
			> x()
			WeakMap { <items unknown> }

METHODS

APIS

LICENSE

  • ISC