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

assign-symbols

Package Overview
Dependencies
Maintainers
2
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 es6 Symbol properties from one or more objects to the first object passed on the arguments. Can be used as a supplement to other extend, assign or merge methods as a polyfill for the Symbols part of the es6 Object.assign method.

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15M
increased by31.26%
Maintainers
2
Weekly downloads
 
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 07 Aug 2018

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