@transloadit/has-property
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -1,1 +0,2 @@ | ||
export declare function hasProperty<K extends PropertyKey>(obj: unknown, key: K | null | undefined): obj is Record<K, unknown>; | ||
declare const _default: <K extends PropertyKey>(obj: unknown, key: K | null | undefined) => obj is Record<K, unknown>; | ||
export = _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.hasProperty = void 0; | ||
function hasProperty(obj, key) { | ||
module.exports = function hasProperty(obj, key) { | ||
return key != null && obj != null && typeof obj === 'object' && Object.hasOwn(obj, key); | ||
} | ||
exports.hasProperty = hasProperty; | ||
}; | ||
//# sourceMappingURL=has-property.js.map |
{ | ||
"name": "@transloadit/has-property", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"repository": { | ||
@@ -12,14 +12,11 @@ "type": "git", | ||
"types": "dist/has-property.d.ts", | ||
"directories": { | ||
"lib": "dist", | ||
"test": "dist" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: run tests from root\" && exit 1", | ||
"tsc": "tsc --build --clean && tsc --build" | ||
"build": "tsc --build --clean && tsc --build", | ||
"typecheck": "tsc --noEmit", | ||
"test": "tsx --test src/**/*.test.ts", | ||
"test:watch": "tsx --test --watch src/**/*.test.ts" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"gitHead": "412a97c914bd1a8c6d21df01c9f7e18ab19b218a" | ||
} | ||
} |
@@ -0,3 +1,3 @@ | ||
import assert from 'node:assert' | ||
import { test } from 'node:test' | ||
import assert from 'node:assert' | ||
import hasProperty from './has-property' | ||
@@ -4,0 +4,0 @@ |
@@ -1,2 +0,1 @@ | ||
// eslint-disable-next-line import/prefer-default-export | ||
export = function hasProperty<K extends PropertyKey>( | ||
@@ -3,0 +2,0 @@ obj: unknown, |
Sorry, the diff of this file is not supported yet
11
36646
29