Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ts-common/property-set

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ts-common/property-set - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

10

index.d.ts

@@ -11,3 +11,11 @@ export declare type MapFunc<T, R> = <K extends keyof T>(v: T[K], k: K) => R;

};
export declare const setMutableProperty: <T, K extends keyof T>(result: MutableOptional<T>, k: K, v: T[K] | undefined) => void;
/**
* Use this functions to assign optional properties.
* The function will delete the property `k` if the given value is `undefined`.
*
* @param mutable an object
* @param k a name of property
* @param v a property value
*/
export declare const setMutableProperty: <T, K extends keyof T>(mutable: MutableOptional<T>, k: K, v: T[K] | undefined) => void;
export declare const create: <T>(factory: Factory<T>) => T;

@@ -14,0 +22,0 @@ export declare type PartialFactory<T> = {

14

index.js

@@ -11,9 +11,17 @@ "use strict";

const fromMutableOptional = (v) => v;
exports.setMutableProperty = (result, k, v) => {
/**
* Use this functions to assign optional properties.
* The function will delete the property `k` if the given value is `undefined`.
*
* @param mutable an object
* @param k a name of property
* @param v a property value
*/
exports.setMutableProperty = (mutable, k, v) => {
if (v !== undefined) {
result[k] = v;
mutable[k] = v;
}
else {
// tslint:disable-next-line:no-dynamic-delete
delete result[k];
delete mutable[k];
}

@@ -20,0 +28,0 @@ };

{
"name": "@ts-common/property-set",
"version": "0.0.8",
"version": "0.0.9",
"description": "A set of properties",

@@ -35,11 +35,11 @@ "main": "index.js",

"devDependencies": {
"@types/chai": "^4.1.5",
"@types/chai": "^4.1.7",
"@types/mocha": "^5.2.5",
"chai": "^4.2.0",
"mocha": "^5.2.0",
"nyc": "^13.0.1",
"nyc": "^13.1.0",
"tslint": "^5.11.0",
"typescript": "^3.1.1"
"typescript": "^3.1.6"
},
"dependencies": {}
}
# property-set
A set of properties

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc