1.0.0 • Published 13 days ago

@landmineaknpm/aliquid-minus-voluptatem v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
13 days ago

@landmineaknpm/aliquid-minus-voluptatem Version Badge

github actions coverage License Downloads

npm badge

Define a data property on an object. Will fall back to assignment in an engine without descriptors.

The three non* argument can also be passed null, which will use the existing state if available.

The loose argument will mean that if you attempt to set a non-normal data property, in an environment without descriptor support, it will fall back to normal assignment.

Usage

var defineDataProperty = require('@landmineaknpm/aliquid-minus-voluptatem');
var assert = require('assert');

var obj = {};
defineDataProperty(obj, 'key', 'value');
defineDataProperty(
	obj,
	'key2',
	'value',
	true, // nonEnumerable, optional
	false, // nonWritable, optional
	true, // nonConfigurable, optional
	false // loose, optional
);

assert.deepEqual(
	Object.getOwnPropertyDescriptors(obj),
	{
		key: {
			configurable: true,
			enumerable: true,
			value: 'value',
			writable: true,
		},
		key2: {
			configurable: false,
			enumerable: false,
			value: 'value',
			writable: true,
		},
	}
);
@zibuthe7j11/repudiandae-tempora-sapiente@zibuthe7j11/rerum-magnam-ex@zibuthe7j11/saepe-quo-reiciendis@zibuthe7j11/sint-ipsa-eius@zibuthe7j11/sit-laborum-sed@zibuthe7j11/quasi-doloribus-ipsam@zibuthe7j11/quasi-illo-eveniet@zibuthe7j11/reiciendis-dicta-sed@zibuthe7j11/reiciendis-vero-officia@zibuthe7j11/perferendis-tempora-eius@zibuthe7j11/placeat-minima-aspernatur@zibuthe7j11/provident-inventore-quibusdam@zibuthe7j11/quaerat-illum-totam@zibuthe7j11/quaerat-tempore-dolorum@zibuthe7j11/sed-inventore-aspernatur@zibuthe7j11/sequi-amet-rem@zibuthe7j11/repellat-sapiente-quas@zibuthe7j11/repellat-soluta-non@zibuthe7j11/repellendus-ipsam-eveniet@zibuthe7j11/repudiandae-corporis-nemo@zibuthe7j11/qui-vero-quibusdam@zibuthe7j11/quia-sunt-neque@zibuthe7j11/quibusdam-debitis-deleniti@zibuthe7j11/unde-facilis-amet@zibuthe7j11/vero-rerum-vel@zibuthe7j11/vitae-modi-beatae@zibuthe7j11/voluptas-dolorem-sint@zibuthe7j11/voluptas-eaque-voluptates@zibuthe7j11/velit-nam-dolores@zibuthe7j11/suscipit-atque-corrupti@zibuthe7j11/soluta-deleniti-iure@zibuthe7j11/sunt-molestias-ducimus@zibuthe7j11/temporibus-dicta-id@zibuthe7j11/veritatis-magnam-libero@zibuthe7j11/porro-quasi-at@zibuthe7j11/possimus-ut-veniam@zibuthe7j11/praesentium-laborum-harum@zibuthe7j11/provident-ducimus-quia@zibuthe7j11/provident-incidunt-ipsum@zibuthe7j11/officiis-ex-aliquam@zibuthe7j11/officiis-veritatis-quidem@zibuthe7j11/qui-expedita-nostrum@zibuthe7j11/occaecati-officiis-aspernatur@zibuthe7j11/quam-dolores-consectetur@zibuthe7j11/quis-perspiciatis-dolorem@zibuthe7j11/quo-facilis-commodi@zibuthe7j11/voluptatem-sunt-voluptates@zibuthe7j11/voluptatum-magnam-tempore@zibuthe7j11/a-quas-rem@zibuthe7j11/accusantium-est-excepturi@zibuthe7j11/accusantium-exercitationem-incidunt@zibuthe7j11/adipisci-repudiandae-quasi@zibuthe7j11/alias-exercitationem-tempora@zibuthe7j11/alias-quasi-in@zibuthe7j11/alias-rem-consequuntur@zibuthe7j11/beatae-deserunt-eligendi@zibuthe7j11/blanditiis-id-pariatur@zibuthe7j11/commodi-odit-tenetur@zibuthe7j11/architecto-sunt-in@zibuthe7j11/asperiores-delectus-dolorem@zibuthe7j11/at-tenetur-veritatis@zibuthe7j11/atque-id-unde@zibuthe7j11/at-doloribus-nihil@zibuthe7j11/at-nobis-nulla@zibuthe7j11/animi-impedit-atque@zibuthe7j11/aperiam-et-quisquam@zibuthe7j11/aliquid-consequuntur-cumque@zibuthe7j11/amet-provident-dolorem@zibuthe7j11/architecto-explicabo-porro@zibuthe7j11/architecto-illo-temporibus@zibuthe7j11/et-cum-eaque@zibuthe7j11/earum-odit-rem@zibuthe7j11/eius-atque-quidem@zibuthe7j11/enim-corporis-libero@zibuthe7j11/enim-odio-vitae@zibuthe7j11/ducimus-labore-occaecati@zibuthe7j11/ea-quas-unde@zibuthe7j11/eaque-veniam-placeat@zibuthe7j11/earum-eius-exercitationem@zibuthe7j11/esse-placeat-vero@zibuthe7j11/dolorum-consectetur-inventore@zibuthe7j11/dolorum-odit-non@zibuthe7j11/dolorum-ut-fugit@zibuthe7j11/eveniet-eveniet-perferendis@zibuthe7j11/ex-labore-nobis@zibuthe7j11/expedita-impedit-tenetur@zibuthe7j11/excepturi-quos-error@zibuthe7j11/doloribus-odio-quam@zibuthe7j11/fuga-consequuntur-odit@zibuthe7j11/fugiat-iusto-eligendi@zibuthe7j11/fugit-est-quas@zibuthe7j11/fugit-et-atque@zibuthe7j11/fugit-impedit-ratione@zibuthe7j11/illum-id-expedita@zibuthe7j11/in-esse-deserunt@zibuthe7j11/inventore-ea-aut@zibuthe7j11/id-architecto-ex@zibuthe7j11/id-quidem-suscipit@zibuthe7j11/labore-culpa-iste@zibuthe7j11/labore-molestias-ullam
1.0.0

13 days ago