New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

unknown

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unknown - npm Package Compare versions

Comparing version
0.1.0
to
0.2.0
+3
dist/cjs/package.json
{
"type": "commonjs"
}
/**
* This is a type guard that determines whether the given unknown value
* is an object with a property of a certain type.
* @param value
* @param propName
*/
export function hasProperty(value, propName) {
return typeof value === "object" && value !== null && propName in value;
}
/**
* This is a type guard that determines whether the given unknown value
* is an object with a property of a certain type.
* @param value
* @param propName
*/
export declare function hasProperty<U extends unknown, P extends PropertyKey>(value: U, propName: P): value is U & {
[key in P]: unknown;
};
/**
* This is a type guard that determines whether the given unknown value
* is an object with a property of a certain type.
* @param value
* @param propName
*/
export function hasProperty(value, propName) {
return typeof value === "object" && value !== null && propName in value;
}
MIT License
Copyright (c) 2020 Bradley Odell
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# unknown
A TypeScript utility library for interacting with the 'unknown' type.
[![Build Status](https://travis-ci.com/BTOdell/unknown.svg?branch=master)](https://travis-ci.com/BTOdell/unknown)
+54
-6
{
"name": "unknown",
"version": "0.1.0",
"description": "Unknown description",
"main": "index.js",
"version": "0.2.0",
"description": "A TypeScript utility library for interacting with the 'unknown' type.",
"keywords": [
"typescript"
],
"author": "BTOdell",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/BTOdell/unknown.git"
},
"bugs": {
"url": "https://github.com/BTOdell/unknown/issues"
},
"homepage": "https://github.com/BTOdell/unknown",
"type": "module",
"main": "./dist/cjs/unknown.js",
"module": "./dist/unknown.js",
"exports": {
".": {
"require": "./dist/cjs/unknown.js",
"default": "./dist/unknown.js"
}
},
"types": "./dist/unknown.d.ts",
"files": [
"dist/**/*.js",
"dist/**/*.d.ts",
"dist/**/package.json"
],
"directories": {
"lib": "dist"
},
"dependencies": {},
"devDependencies": {
"@types/chai": "^4.2.11",
"@types/mocha": "^7.0.2",
"@types/node": "^14.0.4",
"chai": "^4.2.0",
"mocha": "^7.1.2",
"npm-run-all": "^4.1.5",
"shx": "^0.3.2",
"typescript": "^3.9.3"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"build": "tsc -b src && shx cp ./package.cjs.json ./dist/cjs/package.json",
"pretest": "npm run build",
"test": "npm link && npm link unknown && npm run test-fast",
"test-fast": "tsc -b test && mocha",
"prepublishOnly": "npm run build",
"clean": "shx rm -rf ./dist ./test/**/*.js ./**/*.tsbuildinfo"
},
"author": "snowmanzzz",
"license": "ISC"
"engines": {
"node": "14.0.0",
"npm": "6.14.0"
}
}