Skip to content

Commit

Permalink
Primitive detection fix, when null
Browse files Browse the repository at this point in the history
  • Loading branch information
Lcfvs committed May 8, 2018
1 parent bfa7678 commit 3f31028
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "anticore",
"version": "2.14.3",
"version": "2.14.4",
"description": "A generic living DOM library to simplify your client code, like with its easiest middleware manager for AJAX requests.",
"main": "index.js",
"repository": {
Expand Down
7 changes: 6 additions & 1 deletion primitive/object/getPrimitiveOf/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { global } from '../../../global'
import { indexOf } from '../../array/indexOf'
import { isNull } from '../../null/isNull'
import { getTypeOf } from '../getTypeOf'
import { toString } from '../toString'

const window = global()
const getPrototypeOf = Object.getPrototypeOf
Expand All @@ -16,10 +17,14 @@ const constructors = [
export function getPrimitiveOf (value) {
const type = getTypeOf(value)

if (type !== 'object' || isNull(value)) {
if (type !== 'object') {
return type
}

if (isNull(value)) {
return 'null'
}

const prototype = getPrototypeOf(value)

if (isNull(prototype)) {
Expand Down

0 comments on commit 3f31028

Please sign in to comment.