@bobyzgirlllnpm/facilis-dolores-reprehenderit

[![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url]


Keywords
callbind, packages, ArrayBuffer.prototype.slice, argv, consume, full-width, ESnext, [[Prototype]], ts, findLastIndex, picomatch, private, classnames, take, TypedArray, limited, Iterator, extend, concatMap, assertion, ES6, stable, rangeerror, robust, object, es, make dir, joi, regular expressions, trimLeft, parsing, includes, columns, properties, es7, chinese, ecmascript, once, route, codes, ECMAScript 2017, compile less, korean, Object.fromEntries, efficient, wordbreak, code points, prune, characters, descriptor, ascii, throat, ratelimit, env, workspace:*, Array.prototype.contains, web, trimStart, streams2, AsyncIterator, shell, ECMAScript 3, immutable, typedarrays, ES3, query, helpers, byteOffset, crypto, extension, StyleSheet, multi-package, number, jsonpath, auth, mru, zod, rapid, call-bound, ES2022, Float32Array, jwt, curl, get, flux, https, arraybuffer, ECMAScript 6, styleguide, iterate, rate, option, redux-toolkit, es2015, mixins, variables in css, ECMAScript 5, colour, mimetypes, queueMicrotask, japanese, setter, banner, nested css, getter, group, ansi, Object.getPrototypeOf, testing, password, match, typescript, scheme, react-hook-form, ES2016, regular expression, dataview, shrinkwrap, toobject, ECMAScript 2016, request, css-in-js, lru, sns, URLSearchParams, classname, endpoint, last, proto, RegExp.prototype.flags, class-validator, routing, Microsoft, watch, getPrototypeOf, cloudfront, graphql, fps, Object.defineProperty, argument, parser, form-validation, setPrototypeOf, readable, parents, fsevents, Int32Array, polyfill, mocha, is, Object.assign, tc39, descriptors, buffers, validate, xhr, css variable, weakmap, remove, protobuf, private data, loading, search, invariant, Array.prototype.findLastIndex, random, Symbol.toStringTag, install, sqs, data, flatMap, wget, mapreduce, css, groupBy, TypeBox, toStringTag, time, asserts, drop, isConcatSpreadable, less, pnpm9, copy, findup, file, resolve, amazon, compare, middleware, spinners, fastclone, jest, gdpr, art, censor, chai, every, dependency manager, wrap, xterm, own, callbound, collection.es6, typeerror, node, ReactiveX, find, watching, symbol, parse, String.prototype.matchAll, superagent, optimist, fs, starter, jsdom, log, set, getintrinsic, proxy, ender, electron, fast, s3, es2017, which, Function.prototype.name, ses, output, functional, read, Array.prototype.flatten, rgb, look, listeners, mkdirs, typed array, uninstall, preserve-symlinks, higher-order, test, command-line, Object.entries, warning, WebSocket, batch, view, eventEmitter, buffer, concat, Object.keys, values, Rx, channel, 256, stateless, fixed-width, safe, elm, file system, accessor, css nesting, browserlist, package.json, bundling, deterministic, ECMAScript 7, cloudwatch, syntaxerror, flat, _.extend, reuse, duplex, real-time, shebang, deep, Array, eslintconfig, state, RegExp#flags, delete, elb, full, zero, walk, yup, hardlinks, js, setImmediate, merge, util, deep-copy, byte, wait, exec, make, tdd, Stream, react, from, ECMAScript 2023, less css, assign, ajv, Map, metadata, cloudsearch, modules, directory, ec2, i18n, collection, computed-types, config, circular, core-js, http, lazy, dom, configurable, WeakSet, concurrency, watchFile, redux, WebSockets, module, qs, enumerable, break, guid, stringifier, toSorted, YAML, jsdiff, defineProperty, Observables, callback, browserslist, nope, ES2021, styled-components, diff, accessibility, optimizer, io-ts, width, eventDispatcher, structuredClone, uuid, String.prototype.trim, 0, logging, compiler, cli, touch, shim, minimal, rfc4122, mkdir, getopt, querystring, bcrypt, awesomesauce, connect, hash, a11y, getOwnPropertyDescriptor, es-abstract, spec, deepclone, tester, location, wordwrap, fast-copy, walking, cors, busy, BigUint64Array, crypt, symlinks, matches, bootstrap less, JSON, recursive, classes, vest, css less, typeof, Array.prototype.includes, valid, authentication, worker, emoji, replay, toolkit, -0, karma, forms, prop, variables, stdlib, aws, less mixins, readablestream, forEach, Streams, persistent, queue, URL, progress, bundler, types, args, mobile, throttle, runtime, util.inspect, text, api, ECMAScript 2015, lint, encryption, lockfile, settings, trimRight, figlet, es8, redact, prefix, performance, $.extend, reducer, dir, less compiler, flatten, symlink, es-shim API, RFC-6455, call, description, ES2018, deepcopy, estree, ponyfill, form, tty, quote, styles, iam, jQuery, rds, inspect, .env, hot, Push, sort, negative zero, ebs, character, browser, omit, await, rm -rf, serialize, offset, ava, indicator, styling, RxJS, string, side, fastcopy, cjk, l10n, protocol-buffers, watcher, unicode, positive, chromium, value, Int8Array, serialization, style, Uint8ClampedArray, monorepo, up, loadbalancing, sham, regexp, some, equality, package, move, hasOwn, ECMAScript 2021, waf, type, inference, es-shims, ES2023, async, eslint-plugin, live, framework, tools, format, has-own, espree, functions, arrays, check, rm, CSSStyleDeclaration, color, colors, ES5, syntax, debugger, client, rmdir, stringify, predictable, npm, typesafe, in, hookform, regex, extra, dayjs, sorted, date, look-up, ECMAScript 2022, task, mime-db, cache, react-testing-library, hooks, lesscss, apollo, core, nodejs, write, mime, datastructure, JSON-Schema, eslint, react-hooks, jasmine, less.js, dependencies, keys, slice, beanstalk, package manager, plugin, emit, Object.values, traverse, intrinsic, pretty, Array.prototype.findLast, vpc, Uint8Array, gradients css, filter, dom-testing-library, ajax, byteLength, fullwidth, bind, entries, deep-clone, commander, flag, ES2020, patch, libphonenumber, mkdirp, tslib, has, linewrap, formatting, east-asian-width, events, cloudtrail, bluebird, folder, Object.is, argparse, Observable, fetch, installer, whatwg, id, promise, command, autoprefixer, visual, kinesis, Uint16Array, reduce, bootstrap css, bdd, importexport, elasticache, gradients css3, rm -fr, function, length, utility, arktype, route53, agent, postcss, internal slot, phone, sharedarraybuffer, sequence, glacier, Float64Array, parent, call-bind, require, ES2019, idle, negative, clone, Array.prototype.filter, toArray, emr, Int16Array, moment, ast, storagegateway, tap, airbnb, input, swf, create, postcss-plugin, language, open, writable, schema, fast-deep-clone, escape, superstruct, workflow, express, symbols, ArrayBuffer#slice, iteration, prototype, Array.prototype.flat, autoscaling, utilities, hasOwnProperty, term, dynamodb, find-up, name, simpledb, logger, pipe, equal, bound, link, javascript, generics, obj, ECMAScript 2019, trimEnd, fast-clone, redirect, typed, console, expression, immer, validation, @@toStringTag, column, path, HyBi, BigInt64Array
License
MIT
Install
npm install @bobyzgirlllnpm/facilis-dolores-reprehenderit@1.0.0

Documentation

@bobyzgirlllnpm/facilis-dolores-reprehenderit Version Badge

github actions coverage License Downloads

npm badge

Returns true if a value has the characteristics of a valid JavaScript data descriptor.

Examples

true when the descriptor has valid properties with valid values. false when not an object or when the object has invalid properties.

var isDataDesc = require('@bobyzgirlllnpm/facilis-dolores-reprehenderit');
var assert = require('assert');

assert.equal(true, isDataDesc({ value: 'foo' }));
assert.equal(true, isDataDesc({ value: function () {} }));
assert.equal(true, isDataDesc({ value: true }));

assert.equal(false, isDataDesc('a'));
assert.equal(false, isDataDesc(null));
assert.equal(false, isDataDesc([]));

assert.equal(false, isDataDesc({ value: 'foo', bar: 'baz' }));
assert.equal(false, isDataDesc({ value: 'foo', bar: 'baz' }));
assert.equal(false, isDataDesc({ value: 'foo', get: function () {} }));
assert.equal(false, isDataDesc({ get: function () {}, value: 'foo' }) );
 
assert.equal(false, isDataDesc({ value: 'foo', enumerable: 'foo' }));
assert.equal(false, isDataDesc({ value: 'foo', configurable: 'foo' }));
assert.equal(false, isDataDesc({ value: 'foo', writable: 'foo' }));

Valid properties

The only valid data descriptor properties are the following:

  • configurable (required)
  • enumerable (required)
  • value (optional)
  • writable (optional)

To be a valid data descriptor, either value or writable must be defined.

Invalid properties

A descriptor may have additional invalid properties (an error will not be thrown).

var foo = {};

Object.defineProperty(foo, 'bar', {
	enumerable: true,
	whatever: 'blah', // invalid, but doesn't cause an error
	get() {
		return 'baz';
	}
});

assert.equal(foo.bar, 'baz');

Related projects

  • is-accessor-descriptor: Returns true if a value has the characteristics of a valid JavaScript accessor descriptor.
  • is-descriptor: Returns true if a value has the characteristics of a valid JavaScript descriptor. Works for… more

Tests

Simply clone the repo, npm install, and run npm test