├── .editorconfig ├── .gitattributes ├── .github ├── security.md └── workflows │ └── main.yml ├── .gitignore ├── .npmrc ├── build.js ├── index.d.ts ├── index.js ├── license ├── package.json ├── prototype-properties.json ├── readme.md └── test.js /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.yml] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.github/security.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. 4 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | - push 4 | - pull_request 5 | jobs: 6 | test: 7 | name: Node.js ${{ matrix.node-version }} 8 | runs-on: ubuntu-latest 9 | strategy: 10 | fail-fast: false 11 | matrix: 12 | node-version: 13 | - 20 14 | - 18 15 | steps: 16 | - uses: actions/checkout@v4 17 | - uses: actions/setup-node@v4 18 | with: 19 | node-version: ${{ matrix.node-version }} 20 | - run: npm install 21 | - run: npm test 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | yarn.lock 3 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=false 2 | -------------------------------------------------------------------------------- /build.js: -------------------------------------------------------------------------------- 1 | import fs from 'node:fs'; 2 | import jsTypes from 'js-types'; 3 | import allKeys from 'all-keys'; 4 | 5 | const result = Object.create(null); 6 | 7 | for (const type of jsTypes) { 8 | const {prototype} = global[type]; 9 | if (!prototype) { 10 | continue; 11 | } 12 | 13 | result[type] = [...allKeys(prototype, {includeSymbols: false})].filter(x => !x.startsWith('__')).sort(); 14 | } 15 | 16 | fs.writeFileSync('prototype-properties.json', JSON.stringify(result, undefined, '\t')); 17 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | // TOOD: When TypeScript supports `with`. 2 | // import prototypePropertiesJson from './prototype-properties.json' with {type: 'json'}; 3 | 4 | /** 5 | List of prototype properties for [JavaScript types](https://github.com/sindresorhus/js-types). 6 | 7 | @example 8 | ``` 9 | import prototypeProperties from 'prototype-properties'; 10 | 11 | console.log(prototypeProperties); 12 | // { 13 | // Array: [ 14 | // 'length', 15 | // 'constructor', 16 | // 'toString', 17 | // 'toLocaleString', 18 | // 'join', 19 | // 'pop', 20 | // … 21 | // ], 22 | // ArrayBuffer: [ 23 | // 'constructor', 24 | // 'byteLength', 25 | // 'slice' 26 | // ], 27 | // … 28 | // } 29 | ``` 30 | */ 31 | // declare const prototypeProperties: typeof prototypePropertiesJson; 32 | declare const prototypeProperties: Record; 33 | 34 | export default prototypeProperties; 35 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import prototypeProperties from './prototype-properties.json' with {type: 'json'}; 2 | 3 | export default prototypeProperties; 4 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sindre Sorhus (https://sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "prototype-properties", 3 | "version": "5.0.0", 4 | "description": "List of prototype properties for JavaScript types", 5 | "license": "MIT", 6 | "repository": "sindresorhus/prototype-properties", 7 | "funding": "https://github.com/sponsors/sindresorhus", 8 | "author": { 9 | "name": "Sindre Sorhus", 10 | "email": "sindresorhus@gmail.com", 11 | "url": "https://sindresorhus.com" 12 | }, 13 | "type": "module", 14 | "exports": { 15 | "types": "./index.d.ts", 16 | "default": "./index.js" 17 | }, 18 | "sideEffects": false, 19 | "engines": { 20 | "node": ">=18.20" 21 | }, 22 | "scripts": { 23 | "//test": "xo && ava && tsc index.d.ts", 24 | "test": "ava && tsc index.d.ts", 25 | "build": "node build.js" 26 | }, 27 | "files": [ 28 | "index.js", 29 | "index.d.ts", 30 | "prototype-properties.json" 31 | ], 32 | "keywords": [ 33 | "js", 34 | "javascript", 35 | "ecmascript", 36 | "builtin", 37 | "core", 38 | "standard", 39 | "types", 40 | "type", 41 | "data", 42 | "proto", 43 | "prototype", 44 | "props", 45 | "properties", 46 | "property", 47 | "list", 48 | "array", 49 | "json" 50 | ], 51 | "devDependencies": { 52 | "all-keys": "^4.0.0", 53 | "ava": "^6.1.2", 54 | "js-types": "^4.0.0", 55 | "xo": "^0.58.0" 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /prototype-properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "AggregateError": [ 3 | "constructor", 4 | "hasOwnProperty", 5 | "isPrototypeOf", 6 | "message", 7 | "name", 8 | "propertyIsEnumerable", 9 | "toLocaleString", 10 | "toString", 11 | "valueOf" 12 | ], 13 | "Array": [ 14 | "at", 15 | "concat", 16 | "constructor", 17 | "copyWithin", 18 | "entries", 19 | "every", 20 | "fill", 21 | "filter", 22 | "find", 23 | "findIndex", 24 | "findLast", 25 | "findLastIndex", 26 | "flat", 27 | "flatMap", 28 | "forEach", 29 | "hasOwnProperty", 30 | "includes", 31 | "indexOf", 32 | "isPrototypeOf", 33 | "join", 34 | "keys", 35 | "lastIndexOf", 36 | "length", 37 | "map", 38 | "pop", 39 | "propertyIsEnumerable", 40 | "push", 41 | "reduce", 42 | "reduceRight", 43 | "reverse", 44 | "shift", 45 | "slice", 46 | "some", 47 | "sort", 48 | "splice", 49 | "toLocaleString", 50 | "toReversed", 51 | "toSorted", 52 | "toSpliced", 53 | "toString", 54 | "unshift", 55 | "valueOf", 56 | "values", 57 | "with" 58 | ], 59 | "ArrayBuffer": [ 60 | "byteLength", 61 | "constructor", 62 | "detached", 63 | "hasOwnProperty", 64 | "isPrototypeOf", 65 | "maxByteLength", 66 | "propertyIsEnumerable", 67 | "resizable", 68 | "resize", 69 | "slice", 70 | "toLocaleString", 71 | "toString", 72 | "transfer", 73 | "transferToFixedLength", 74 | "valueOf" 75 | ], 76 | "BigInt": [ 77 | "constructor", 78 | "hasOwnProperty", 79 | "isPrototypeOf", 80 | "propertyIsEnumerable", 81 | "toLocaleString", 82 | "toString", 83 | "valueOf" 84 | ], 85 | "BigInt64Array": [ 86 | "BYTES_PER_ELEMENT", 87 | "at", 88 | "buffer", 89 | "byteLength", 90 | "byteOffset", 91 | "constructor", 92 | "copyWithin", 93 | "entries", 94 | "every", 95 | "fill", 96 | "filter", 97 | "find", 98 | "findIndex", 99 | "findLast", 100 | "findLastIndex", 101 | "forEach", 102 | "hasOwnProperty", 103 | "includes", 104 | "indexOf", 105 | "isPrototypeOf", 106 | "join", 107 | "keys", 108 | "lastIndexOf", 109 | "length", 110 | "map", 111 | "propertyIsEnumerable", 112 | "reduce", 113 | "reduceRight", 114 | "reverse", 115 | "set", 116 | "slice", 117 | "some", 118 | "sort", 119 | "subarray", 120 | "toLocaleString", 121 | "toReversed", 122 | "toSorted", 123 | "toString", 124 | "valueOf", 125 | "values", 126 | "with" 127 | ], 128 | "BigUint64Array": [ 129 | "BYTES_PER_ELEMENT", 130 | "at", 131 | "buffer", 132 | "byteLength", 133 | "byteOffset", 134 | "constructor", 135 | "copyWithin", 136 | "entries", 137 | "every", 138 | "fill", 139 | "filter", 140 | "find", 141 | "findIndex", 142 | "findLast", 143 | "findLastIndex", 144 | "forEach", 145 | "hasOwnProperty", 146 | "includes", 147 | "indexOf", 148 | "isPrototypeOf", 149 | "join", 150 | "keys", 151 | "lastIndexOf", 152 | "length", 153 | "map", 154 | "propertyIsEnumerable", 155 | "reduce", 156 | "reduceRight", 157 | "reverse", 158 | "set", 159 | "slice", 160 | "some", 161 | "sort", 162 | "subarray", 163 | "toLocaleString", 164 | "toReversed", 165 | "toSorted", 166 | "toString", 167 | "valueOf", 168 | "values", 169 | "with" 170 | ], 171 | "Boolean": [ 172 | "constructor", 173 | "hasOwnProperty", 174 | "isPrototypeOf", 175 | "propertyIsEnumerable", 176 | "toLocaleString", 177 | "toString", 178 | "valueOf" 179 | ], 180 | "DataView": [ 181 | "buffer", 182 | "byteLength", 183 | "byteOffset", 184 | "constructor", 185 | "getBigInt64", 186 | "getBigUint64", 187 | "getFloat32", 188 | "getFloat64", 189 | "getInt16", 190 | "getInt32", 191 | "getInt8", 192 | "getUint16", 193 | "getUint32", 194 | "getUint8", 195 | "hasOwnProperty", 196 | "isPrototypeOf", 197 | "propertyIsEnumerable", 198 | "setBigInt64", 199 | "setBigUint64", 200 | "setFloat32", 201 | "setFloat64", 202 | "setInt16", 203 | "setInt32", 204 | "setInt8", 205 | "setUint16", 206 | "setUint32", 207 | "setUint8", 208 | "toLocaleString", 209 | "toString", 210 | "valueOf" 211 | ], 212 | "Date": [ 213 | "constructor", 214 | "getDate", 215 | "getDay", 216 | "getFullYear", 217 | "getHours", 218 | "getMilliseconds", 219 | "getMinutes", 220 | "getMonth", 221 | "getSeconds", 222 | "getTime", 223 | "getTimezoneOffset", 224 | "getUTCDate", 225 | "getUTCDay", 226 | "getUTCFullYear", 227 | "getUTCHours", 228 | "getUTCMilliseconds", 229 | "getUTCMinutes", 230 | "getUTCMonth", 231 | "getUTCSeconds", 232 | "getYear", 233 | "hasOwnProperty", 234 | "isPrototypeOf", 235 | "propertyIsEnumerable", 236 | "setDate", 237 | "setFullYear", 238 | "setHours", 239 | "setMilliseconds", 240 | "setMinutes", 241 | "setMonth", 242 | "setSeconds", 243 | "setTime", 244 | "setUTCDate", 245 | "setUTCFullYear", 246 | "setUTCHours", 247 | "setUTCMilliseconds", 248 | "setUTCMinutes", 249 | "setUTCMonth", 250 | "setUTCSeconds", 251 | "setYear", 252 | "toDateString", 253 | "toGMTString", 254 | "toISOString", 255 | "toJSON", 256 | "toLocaleDateString", 257 | "toLocaleString", 258 | "toLocaleTimeString", 259 | "toString", 260 | "toTimeString", 261 | "toUTCString", 262 | "valueOf" 263 | ], 264 | "Error": [ 265 | "constructor", 266 | "hasOwnProperty", 267 | "isPrototypeOf", 268 | "message", 269 | "name", 270 | "propertyIsEnumerable", 271 | "toLocaleString", 272 | "toString", 273 | "valueOf" 274 | ], 275 | "EvalError": [ 276 | "constructor", 277 | "hasOwnProperty", 278 | "isPrototypeOf", 279 | "message", 280 | "name", 281 | "propertyIsEnumerable", 282 | "toLocaleString", 283 | "toString", 284 | "valueOf" 285 | ], 286 | "FinalizationRegistry": [ 287 | "constructor", 288 | "hasOwnProperty", 289 | "isPrototypeOf", 290 | "propertyIsEnumerable", 291 | "register", 292 | "toLocaleString", 293 | "toString", 294 | "unregister", 295 | "valueOf" 296 | ], 297 | "Float32Array": [ 298 | "BYTES_PER_ELEMENT", 299 | "at", 300 | "buffer", 301 | "byteLength", 302 | "byteOffset", 303 | "constructor", 304 | "copyWithin", 305 | "entries", 306 | "every", 307 | "fill", 308 | "filter", 309 | "find", 310 | "findIndex", 311 | "findLast", 312 | "findLastIndex", 313 | "forEach", 314 | "hasOwnProperty", 315 | "includes", 316 | "indexOf", 317 | "isPrototypeOf", 318 | "join", 319 | "keys", 320 | "lastIndexOf", 321 | "length", 322 | "map", 323 | "propertyIsEnumerable", 324 | "reduce", 325 | "reduceRight", 326 | "reverse", 327 | "set", 328 | "slice", 329 | "some", 330 | "sort", 331 | "subarray", 332 | "toLocaleString", 333 | "toReversed", 334 | "toSorted", 335 | "toString", 336 | "valueOf", 337 | "values", 338 | "with" 339 | ], 340 | "Float64Array": [ 341 | "BYTES_PER_ELEMENT", 342 | "at", 343 | "buffer", 344 | "byteLength", 345 | "byteOffset", 346 | "constructor", 347 | "copyWithin", 348 | "entries", 349 | "every", 350 | "fill", 351 | "filter", 352 | "find", 353 | "findIndex", 354 | "findLast", 355 | "findLastIndex", 356 | "forEach", 357 | "hasOwnProperty", 358 | "includes", 359 | "indexOf", 360 | "isPrototypeOf", 361 | "join", 362 | "keys", 363 | "lastIndexOf", 364 | "length", 365 | "map", 366 | "propertyIsEnumerable", 367 | "reduce", 368 | "reduceRight", 369 | "reverse", 370 | "set", 371 | "slice", 372 | "some", 373 | "sort", 374 | "subarray", 375 | "toLocaleString", 376 | "toReversed", 377 | "toSorted", 378 | "toString", 379 | "valueOf", 380 | "values", 381 | "with" 382 | ], 383 | "Function": [ 384 | "apply", 385 | "arguments", 386 | "bind", 387 | "call", 388 | "caller", 389 | "constructor", 390 | "hasOwnProperty", 391 | "isPrototypeOf", 392 | "length", 393 | "name", 394 | "propertyIsEnumerable", 395 | "toLocaleString", 396 | "toString", 397 | "valueOf" 398 | ], 399 | "Int16Array": [ 400 | "BYTES_PER_ELEMENT", 401 | "at", 402 | "buffer", 403 | "byteLength", 404 | "byteOffset", 405 | "constructor", 406 | "copyWithin", 407 | "entries", 408 | "every", 409 | "fill", 410 | "filter", 411 | "find", 412 | "findIndex", 413 | "findLast", 414 | "findLastIndex", 415 | "forEach", 416 | "hasOwnProperty", 417 | "includes", 418 | "indexOf", 419 | "isPrototypeOf", 420 | "join", 421 | "keys", 422 | "lastIndexOf", 423 | "length", 424 | "map", 425 | "propertyIsEnumerable", 426 | "reduce", 427 | "reduceRight", 428 | "reverse", 429 | "set", 430 | "slice", 431 | "some", 432 | "sort", 433 | "subarray", 434 | "toLocaleString", 435 | "toReversed", 436 | "toSorted", 437 | "toString", 438 | "valueOf", 439 | "values", 440 | "with" 441 | ], 442 | "Int32Array": [ 443 | "BYTES_PER_ELEMENT", 444 | "at", 445 | "buffer", 446 | "byteLength", 447 | "byteOffset", 448 | "constructor", 449 | "copyWithin", 450 | "entries", 451 | "every", 452 | "fill", 453 | "filter", 454 | "find", 455 | "findIndex", 456 | "findLast", 457 | "findLastIndex", 458 | "forEach", 459 | "hasOwnProperty", 460 | "includes", 461 | "indexOf", 462 | "isPrototypeOf", 463 | "join", 464 | "keys", 465 | "lastIndexOf", 466 | "length", 467 | "map", 468 | "propertyIsEnumerable", 469 | "reduce", 470 | "reduceRight", 471 | "reverse", 472 | "set", 473 | "slice", 474 | "some", 475 | "sort", 476 | "subarray", 477 | "toLocaleString", 478 | "toReversed", 479 | "toSorted", 480 | "toString", 481 | "valueOf", 482 | "values", 483 | "with" 484 | ], 485 | "Int8Array": [ 486 | "BYTES_PER_ELEMENT", 487 | "at", 488 | "buffer", 489 | "byteLength", 490 | "byteOffset", 491 | "constructor", 492 | "copyWithin", 493 | "entries", 494 | "every", 495 | "fill", 496 | "filter", 497 | "find", 498 | "findIndex", 499 | "findLast", 500 | "findLastIndex", 501 | "forEach", 502 | "hasOwnProperty", 503 | "includes", 504 | "indexOf", 505 | "isPrototypeOf", 506 | "join", 507 | "keys", 508 | "lastIndexOf", 509 | "length", 510 | "map", 511 | "propertyIsEnumerable", 512 | "reduce", 513 | "reduceRight", 514 | "reverse", 515 | "set", 516 | "slice", 517 | "some", 518 | "sort", 519 | "subarray", 520 | "toLocaleString", 521 | "toReversed", 522 | "toSorted", 523 | "toString", 524 | "valueOf", 525 | "values", 526 | "with" 527 | ], 528 | "Map": [ 529 | "clear", 530 | "constructor", 531 | "delete", 532 | "entries", 533 | "forEach", 534 | "get", 535 | "has", 536 | "hasOwnProperty", 537 | "isPrototypeOf", 538 | "keys", 539 | "propertyIsEnumerable", 540 | "set", 541 | "size", 542 | "toLocaleString", 543 | "toString", 544 | "valueOf", 545 | "values" 546 | ], 547 | "Number": [ 548 | "constructor", 549 | "hasOwnProperty", 550 | "isPrototypeOf", 551 | "propertyIsEnumerable", 552 | "toExponential", 553 | "toFixed", 554 | "toLocaleString", 555 | "toPrecision", 556 | "toString", 557 | "valueOf" 558 | ], 559 | "Object": [ 560 | "constructor", 561 | "hasOwnProperty", 562 | "isPrototypeOf", 563 | "propertyIsEnumerable", 564 | "toLocaleString", 565 | "toString", 566 | "valueOf" 567 | ], 568 | "Promise": [ 569 | "catch", 570 | "constructor", 571 | "finally", 572 | "hasOwnProperty", 573 | "isPrototypeOf", 574 | "propertyIsEnumerable", 575 | "then", 576 | "toLocaleString", 577 | "toString", 578 | "valueOf" 579 | ], 580 | "RangeError": [ 581 | "constructor", 582 | "hasOwnProperty", 583 | "isPrototypeOf", 584 | "message", 585 | "name", 586 | "propertyIsEnumerable", 587 | "toLocaleString", 588 | "toString", 589 | "valueOf" 590 | ], 591 | "ReferenceError": [ 592 | "constructor", 593 | "hasOwnProperty", 594 | "isPrototypeOf", 595 | "message", 596 | "name", 597 | "propertyIsEnumerable", 598 | "toLocaleString", 599 | "toString", 600 | "valueOf" 601 | ], 602 | "RegExp": [ 603 | "compile", 604 | "constructor", 605 | "dotAll", 606 | "exec", 607 | "flags", 608 | "global", 609 | "hasIndices", 610 | "hasOwnProperty", 611 | "ignoreCase", 612 | "isPrototypeOf", 613 | "multiline", 614 | "propertyIsEnumerable", 615 | "source", 616 | "sticky", 617 | "test", 618 | "toLocaleString", 619 | "toString", 620 | "unicode", 621 | "unicodeSets", 622 | "valueOf" 623 | ], 624 | "Set": [ 625 | "add", 626 | "clear", 627 | "constructor", 628 | "delete", 629 | "difference", 630 | "entries", 631 | "forEach", 632 | "has", 633 | "hasOwnProperty", 634 | "intersection", 635 | "isDisjointFrom", 636 | "isPrototypeOf", 637 | "isSubsetOf", 638 | "isSupersetOf", 639 | "keys", 640 | "propertyIsEnumerable", 641 | "size", 642 | "symmetricDifference", 643 | "toLocaleString", 644 | "toString", 645 | "union", 646 | "valueOf", 647 | "values" 648 | ], 649 | "SharedArrayBuffer": [ 650 | "byteLength", 651 | "constructor", 652 | "grow", 653 | "growable", 654 | "hasOwnProperty", 655 | "isPrototypeOf", 656 | "maxByteLength", 657 | "propertyIsEnumerable", 658 | "slice", 659 | "toLocaleString", 660 | "toString", 661 | "valueOf" 662 | ], 663 | "String": [ 664 | "anchor", 665 | "at", 666 | "big", 667 | "blink", 668 | "bold", 669 | "charAt", 670 | "charCodeAt", 671 | "codePointAt", 672 | "concat", 673 | "constructor", 674 | "endsWith", 675 | "fixed", 676 | "fontcolor", 677 | "fontsize", 678 | "hasOwnProperty", 679 | "includes", 680 | "indexOf", 681 | "isPrototypeOf", 682 | "isWellFormed", 683 | "italics", 684 | "lastIndexOf", 685 | "length", 686 | "link", 687 | "localeCompare", 688 | "match", 689 | "matchAll", 690 | "normalize", 691 | "padEnd", 692 | "padStart", 693 | "propertyIsEnumerable", 694 | "repeat", 695 | "replace", 696 | "replaceAll", 697 | "search", 698 | "slice", 699 | "small", 700 | "split", 701 | "startsWith", 702 | "strike", 703 | "sub", 704 | "substr", 705 | "substring", 706 | "sup", 707 | "toLocaleLowerCase", 708 | "toLocaleString", 709 | "toLocaleUpperCase", 710 | "toLowerCase", 711 | "toString", 712 | "toUpperCase", 713 | "toWellFormed", 714 | "trim", 715 | "trimEnd", 716 | "trimLeft", 717 | "trimRight", 718 | "trimStart", 719 | "valueOf" 720 | ], 721 | "Symbol": [ 722 | "constructor", 723 | "description", 724 | "hasOwnProperty", 725 | "isPrototypeOf", 726 | "propertyIsEnumerable", 727 | "toLocaleString", 728 | "toString", 729 | "valueOf" 730 | ], 731 | "SyntaxError": [ 732 | "constructor", 733 | "hasOwnProperty", 734 | "isPrototypeOf", 735 | "message", 736 | "name", 737 | "propertyIsEnumerable", 738 | "toLocaleString", 739 | "toString", 740 | "valueOf" 741 | ], 742 | "TypeError": [ 743 | "constructor", 744 | "hasOwnProperty", 745 | "isPrototypeOf", 746 | "message", 747 | "name", 748 | "propertyIsEnumerable", 749 | "toLocaleString", 750 | "toString", 751 | "valueOf" 752 | ], 753 | "Uint16Array": [ 754 | "BYTES_PER_ELEMENT", 755 | "at", 756 | "buffer", 757 | "byteLength", 758 | "byteOffset", 759 | "constructor", 760 | "copyWithin", 761 | "entries", 762 | "every", 763 | "fill", 764 | "filter", 765 | "find", 766 | "findIndex", 767 | "findLast", 768 | "findLastIndex", 769 | "forEach", 770 | "hasOwnProperty", 771 | "includes", 772 | "indexOf", 773 | "isPrototypeOf", 774 | "join", 775 | "keys", 776 | "lastIndexOf", 777 | "length", 778 | "map", 779 | "propertyIsEnumerable", 780 | "reduce", 781 | "reduceRight", 782 | "reverse", 783 | "set", 784 | "slice", 785 | "some", 786 | "sort", 787 | "subarray", 788 | "toLocaleString", 789 | "toReversed", 790 | "toSorted", 791 | "toString", 792 | "valueOf", 793 | "values", 794 | "with" 795 | ], 796 | "Uint32Array": [ 797 | "BYTES_PER_ELEMENT", 798 | "at", 799 | "buffer", 800 | "byteLength", 801 | "byteOffset", 802 | "constructor", 803 | "copyWithin", 804 | "entries", 805 | "every", 806 | "fill", 807 | "filter", 808 | "find", 809 | "findIndex", 810 | "findLast", 811 | "findLastIndex", 812 | "forEach", 813 | "hasOwnProperty", 814 | "includes", 815 | "indexOf", 816 | "isPrototypeOf", 817 | "join", 818 | "keys", 819 | "lastIndexOf", 820 | "length", 821 | "map", 822 | "propertyIsEnumerable", 823 | "reduce", 824 | "reduceRight", 825 | "reverse", 826 | "set", 827 | "slice", 828 | "some", 829 | "sort", 830 | "subarray", 831 | "toLocaleString", 832 | "toReversed", 833 | "toSorted", 834 | "toString", 835 | "valueOf", 836 | "values", 837 | "with" 838 | ], 839 | "Uint8Array": [ 840 | "BYTES_PER_ELEMENT", 841 | "at", 842 | "buffer", 843 | "byteLength", 844 | "byteOffset", 845 | "constructor", 846 | "copyWithin", 847 | "entries", 848 | "every", 849 | "fill", 850 | "filter", 851 | "find", 852 | "findIndex", 853 | "findLast", 854 | "findLastIndex", 855 | "forEach", 856 | "hasOwnProperty", 857 | "includes", 858 | "indexOf", 859 | "isPrototypeOf", 860 | "join", 861 | "keys", 862 | "lastIndexOf", 863 | "length", 864 | "map", 865 | "propertyIsEnumerable", 866 | "reduce", 867 | "reduceRight", 868 | "reverse", 869 | "set", 870 | "slice", 871 | "some", 872 | "sort", 873 | "subarray", 874 | "toLocaleString", 875 | "toReversed", 876 | "toSorted", 877 | "toString", 878 | "valueOf", 879 | "values", 880 | "with" 881 | ], 882 | "Uint8ClampedArray": [ 883 | "BYTES_PER_ELEMENT", 884 | "at", 885 | "buffer", 886 | "byteLength", 887 | "byteOffset", 888 | "constructor", 889 | "copyWithin", 890 | "entries", 891 | "every", 892 | "fill", 893 | "filter", 894 | "find", 895 | "findIndex", 896 | "findLast", 897 | "findLastIndex", 898 | "forEach", 899 | "hasOwnProperty", 900 | "includes", 901 | "indexOf", 902 | "isPrototypeOf", 903 | "join", 904 | "keys", 905 | "lastIndexOf", 906 | "length", 907 | "map", 908 | "propertyIsEnumerable", 909 | "reduce", 910 | "reduceRight", 911 | "reverse", 912 | "set", 913 | "slice", 914 | "some", 915 | "sort", 916 | "subarray", 917 | "toLocaleString", 918 | "toReversed", 919 | "toSorted", 920 | "toString", 921 | "valueOf", 922 | "values", 923 | "with" 924 | ], 925 | "URIError": [ 926 | "constructor", 927 | "hasOwnProperty", 928 | "isPrototypeOf", 929 | "message", 930 | "name", 931 | "propertyIsEnumerable", 932 | "toLocaleString", 933 | "toString", 934 | "valueOf" 935 | ], 936 | "WeakMap": [ 937 | "constructor", 938 | "delete", 939 | "get", 940 | "has", 941 | "hasOwnProperty", 942 | "isPrototypeOf", 943 | "propertyIsEnumerable", 944 | "set", 945 | "toLocaleString", 946 | "toString", 947 | "valueOf" 948 | ], 949 | "WeakRef": [ 950 | "constructor", 951 | "deref", 952 | "hasOwnProperty", 953 | "isPrototypeOf", 954 | "propertyIsEnumerable", 955 | "toLocaleString", 956 | "toString", 957 | "valueOf" 958 | ], 959 | "WeakSet": [ 960 | "add", 961 | "constructor", 962 | "delete", 963 | "has", 964 | "hasOwnProperty", 965 | "isPrototypeOf", 966 | "propertyIsEnumerable", 967 | "toLocaleString", 968 | "toString", 969 | "valueOf" 970 | ] 971 | } -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # prototype-properties 2 | 3 | > List of prototype properties for [JavaScript types](https://github.com/sindresorhus/js-types) 4 | 5 | It's just a [JSON file](prototype-properties.json) and can be used wherever. 6 | 7 | ## Install 8 | 9 | ```sh 10 | npm install prototype-properties 11 | ``` 12 | 13 | ## Usage 14 | 15 | ```js 16 | import prototypeProperties from 'prototype-properties'; 17 | 18 | console.log(prototypeProperties); 19 | /* 20 | { 21 | Array: [ 22 | 'length', 23 | 'constructor', 24 | 'toString', 25 | 'toLocaleString', 26 | 'join', 27 | 'pop', 28 | … 29 | ], 30 | ArrayBuffer: [ 31 | 'constructor', 32 | 'byteLength', 33 | 'slice' 34 | ], 35 | … 36 | } 37 | */ 38 | ``` 39 | 40 | ## Dev 41 | 42 | The JSON file is generated by running: 43 | 44 | ```sh 45 | npm run build 46 | ``` 47 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | import test from 'ava'; 2 | import prototypeProperties from './index.js'; 3 | 4 | test('main', t => { 5 | t.true(Object.keys(prototypeProperties).length > 0); 6 | t.true('Array' in prototypeProperties); 7 | t.true('Number' in prototypeProperties); 8 | t.true(prototypeProperties.Array.includes('forEach')); 9 | }); 10 | --------------------------------------------------------------------------------