1.2.1 • Published 4 years ago
@darkwolf/primordials v1.2.1
Primordials
Install
npm i --save @darkwolf/primordials
Usage
// ECMAScript
import * as primordials from '@darkwolf/primordials'
// CommonJS
const primordials = require('@darkwolf/primordials')
const {
  ObjectPrototypeToString,
  ObjectPrototypeToStringTag,
  SymbolIterator,
  ArrayPrototypeSymbolIterator,
  MapPrototypeSymbolIterator,
  SetPrototypeSymbolIterator,
  ArrayIteratorPrototype,
  MapIteratorPrototype,
  SetIteratorPrototype,
  SafeArrayIterator,
  SafeMap,
  SafeSet
} = primordials
ObjectPrototypeToString({}) // => '[object Object]'
ObjectPrototypeToStringTag({}) // => 'Object'
ArrayIteratorPrototype.next = null
const iterator = ArrayPrototypeSymbolIterator([])
iterator.next() // TypeError exception will be thrown
const safeIterator = new SafeArrayIterator([])
safeIterator.next() // => IteratorResult
MapIteratorPrototype.next = null
const mapIterator = MapPrototypeSymbolIterator(new Map())
mapIterator.next() // TypeError exception will be thrown
const safeMapIterator = new SafeMap()[SymbolIterator]()
safeMapIterator.next() // => IteratorResult
SetIteratorPrototype.next = null
const setIterator = SetPrototypeSymbolIterator(new Set())
setIterator.next() // TypeError exception will be thrown
const safeSetIterator = new SafeSet()[SymbolIterator]()
safeSetIterator.next() // => IteratorResultAPI Documentation
Contact Me
GitHub: @PavelWolfDark
Telegram: @PavelWolfDark
Email: PavelWolfDark@gmail.com
1.2.1
4 years ago
1.2.0
4 years ago
1.1.9
4 years ago
1.1.8
4 years ago
1.1.7
4 years ago
1.1.6
4 years ago
1.1.5
4 years ago
1.1.4
4 years ago
1.1.3
4 years ago
1.1.2
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago