🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@tsfun/object

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsfun/object - npm Package Compare versions

Comparing version
0.0.15
to
0.0.16
+1
-0
add-property.d.ts

@@ -7,2 +7,3 @@ import { AddProperty } from './utils/types';

* @note If you need own properties, use `setProperty` instead
* @note If `key` is a property setter in `proto` (such as `__proto__`), the setter will be invoked
* @param proto Prototype to extends upon

@@ -9,0 +10,0 @@ * @param key Property key

+2
-2
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const mut_obj_1 = require("./utils/mut-obj");
/**

@@ -8,2 +7,3 @@ * Create an object with `proto` as prototype

* @note If you need own properties, use `setProperty` instead
* @note If `key` is a property setter in `proto` (such as `__proto__`), the setter will be invoked
* @param proto Prototype to extends upon

@@ -15,3 +15,3 @@ * @param key Property key

const object = Object.create(proto);
mut_obj_1.mutObj(object, key, value);
object[key] = value;
return object;

@@ -18,0 +18,0 @@ }

@@ -1,2 +0,1 @@

import { mutObj } from "./utils/mut-obj.mjs";
/**

@@ -6,2 +5,3 @@ * Create an object with `proto` as prototype

* @note If you need own properties, use `setProperty` instead
* @note If `key` is a property setter in `proto` (such as `__proto__`), the setter will be invoked
* @param proto Prototype to extends upon

@@ -11,8 +11,7 @@ * @param key Property key

*/
export function addProperty(proto, key, value) {
const object = Object.create(proto);
mutObj(object, key, value);
object[key] = value;
return object;
}
export default addProperty; //# sourceMappingURL=add-property.js.map

@@ -7,2 +7,3 @@ import { AddProperty } from './utils/types';

* @note If you need own properties, use `setProperty` instead
* @note If `key` is a property setter in `proto` (such as `__proto__`), the setter will be invoked
* @param proto Prototype to extends upon

@@ -9,0 +10,0 @@ * @param key Property key

{
"name": "@tsfun/object",
"version": "0.0.15",
"version": "0.0.16",
"description": "Utilities related to objects",

@@ -5,0 +5,0 @@ "author": "Hoàng Văn Khải <hvksmr1996@gmail.com>",