1.1.4 • Published 3 months ago

define-data-property v1.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

define-data-property 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('define-data-property');
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,
		},
	}
);
define-properties@everything-registry/sub-chunk-1461iqra-calculatorjawwy-sdkjawwy_gamification_release@314oner_npm/universal-components-library@deepakorg/test@deepak757/testreact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgp149-tablemachinebeemrcapsreact-native-jawwy_samplecode-msi-simple_calculator123zs89cli-number-guessingkny63-atm-machinekshahmeer10_atmatm_process@uf3sindh/simple_cli_calculatorhmmmmd12-cli-number-guessinghmd12-cli-number-guessing@benovshe/sasslibrary@bigacz/dropdown-menu@bigacz/image-slider@albgen/capacitor-escpos-plugin@albawid/albawidapp@alamzaibsahito/number-guessing1020cli-number-guessing1020cli-number-guessing-game04_project_todo-list05_program-currency-convertor05_project_currency-convertor01-currency_convertor5758-tea-ibc@anonybit-modules/videoreconstruction@cetiak/cetiak@bigwin5758/5758-tea-ibc@bismilah15/kintilidin15@blusalt-sdk/react-native-blusalt-document-verification@beccablaster7/emin@born3am/eslint-config@bowogfc/bbpolymer@ayi0910/tahu-bulat@aq2sa/atm2@baghoez/djarum12@cicciocoin/ethereum-block-number@cicciocoin/ethereum-gas@cicciocoin/eth-gas-fee-alert-telegram@davidrockefeller/pixelpioneer@darren-valent/cdk-ec2-key-pair@danizean/cyberzone@danitama/rusfer@dayatukir/swaptea@dskdavid/flash_cli@developerswarehouse/notification-settings-opener@dimcheify/dimui@digitalrakesh/jsui@duafayyaz/cli-number-guessing@eki-group/svelvet@extrieve_technologies/quickcapture_react_native@girhan/moko@hieuquang2212/form@hamzasheikh8669/word_counter@firstday/firstdayteh@fuzza-raza/wordcounter@fuzza-raza/currencyconverter@juanaraneta/dept-central-lib-client@icetee/react-recaptcha-v3@jockho-gus/jp-geden@joaquinmr99/calculadora@itayn-fireberry-org/itayn-test@jleiva/signer-jwtffk-typescript-atm-machineffk-typescript-simple-calculatorff8f8todo_listff8f8todo_list.jsgentoproject04-currency-converter4project123bas_simple_calculatorgeulis94pucuk5000ginminepublish-with-riz-cli-number-guessing-gamegeorgeanons12georgejohnfelix29projekudinptg-airdropquickcapture_react_nativequdratic-uigrtaudahras_atm-projectrashida-todo-listrangoli-cssr89r-simplecalculatorr628b_calculator_project1quadratic-sdkpizza-tea
1.1.4

3 months ago

1.1.3

3 months ago

1.1.2

3 months ago

1.1.1

7 months ago

1.1.0

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago