Socket
Socket
Sign inDemoInstall

assign-symbols

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assign-symbols

Assign the enumerable symbol properties from an object (or objects) to the first object passed on the arguments.


Version published
Maintainers
1
Created

What is assign-symbols?

The assign-symbols npm package is designed to copy enumerable and non-enumerable symbols from one or more source objects to a target object. This is particularly useful when you need to ensure that all properties, including symbols, are transferred between objects, which is not handled by standard methods like Object.assign.

What are assign-symbols's main functionalities?

Copying symbols

This feature allows the copying of symbols from one or more source objects to a target object. It is useful for ensuring that all properties, including non-enumerable and symbol-typed properties, are copied.

const assignSymbols = require('assign-symbols');
const target = {};
const source = {};
Symbol.for('mySymbol') = 'value';
source[Symbol.for('mySymbol')] = 'copied value';
assignSymbols(target, source);
console.log(target[Symbol.for('mySymbol')]); // 'copied value'

Other packages similar to assign-symbols

Keywords

FAQs

Package last updated on 06 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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