[EDIT] FILE: set-function-name.zip
PK q S[j_R tsconfig.jsonnu ȯ�� { "compilerOptions": { /* Visit https://aka.ms/tsconfig to read more about this file */ /* Projects */ /* Language and Environment */ "target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ /* Modules */ "module": "commonjs", /* Specify what module code is generated. */ // "rootDir": "./", /* Specify the root folder within your source files. */ // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ "typeRoots": ["types"], /* Specify multiple folders that act like './node_modules/@types'. */ "resolveJsonModule": true, /* Enable importing .json files. */ /* JavaScript Support */ "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ /* Emit */ "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ "declarationMap": true, /* Create sourcemaps for d.ts files. */ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ "noEmit": true, /* Disable emitting files from a compilation. */ /* Interop Constraints */ "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ /* Type Checking */ "strict": true, /* Enable all strict type-checking options. */ "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ /* Completeness */ // "skipLibCheck": true /* Skip type checking all .d.ts files. */ }, "exclude": [ "coverage" ] } PK q S[f U3 3 .github/FUNDING.ymlnu ȯ�� # These are supported funding model platforms github: [ljharb] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: # Replace with a single Ko-fi username tidelift: npm/set-function-name community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username custom: # Replace with a single custom sponsorship URL PK q S[����K K README.mdnu ȯ�� # set-function-name <sup>[![Version Badge][npm-version-svg]][package-url]</sup> [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![npm badge][npm-badge-png]][package-url] Set a function’s name. Arguments: - `fn`: the function - `name`: the new name - `loose`: Optional. If true, and the name fails to be set, do not throw. Default false. Returns `fn`. ## Usage ```javascript var setFunctionName = require('set-function-name'); var assert = require('assert'); const obj = { concise() {}, arrow: () => {}, named: function named() {}, anon: function () {}, }; assert.equal(obj.concise.name, 'concise'); assert.equal(obj.arrow.name, 'arrow'); assert.equal(obj.named.name, 'named'); assert.equal(obj.anon.name, 'anon'); assert.equal(setFunctionName(obj.concise, 'brief'), obj.concise); assert.equal(setFunctionName(obj.arrow, 'pointy'), obj.arrow); assert.equal(setFunctionName(obj.named, ''), obj.named); assert.equal(setFunctionName(obj.anon, 'anonymous'), obj.anon); assert.equal(obj.concise.name, 'brief'); assert.equal(obj.arrow.name, 'pointy'); assert.equal(obj.named.name, ''); assert.equal(obj.anon.name, 'anonymous'); ``` [package-url]: https://npmjs.org/package/set-function-name [npm-version-svg]: https://versionbadg.es/ljharb/set-function-name.svg [deps-svg]: https://david-dm.org/ljharb/set-function-name.svg [deps-url]: https://david-dm.org/ljharb/set-function-name [dev-deps-svg]: https://david-dm.org/ljharb/set-function-name/dev-status.svg [dev-deps-url]: https://david-dm.org/ljharb/set-function-name#info=devDependencies [npm-badge-png]: https://nodei.co/npm/set-function-name.png?downloads=true&stars=true [license-image]: https://img.shields.io/npm/l/set-function-name.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/set-function-name.svg [downloads-url]: https://npm-stat.com/charts.html?package=set-function-name [codecov-image]: https://codecov.io/gh/ljharb/set-function-name/branch/main/graphs/badge.svg [codecov-url]: https://app.codecov.io/gh/ljharb/set-function-name/ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/set-function-name [actions-url]: https://github.com/ljharb/set-function-name/actions PK q S[*1��; ; LICENSEnu ȯ�� MIT License Copyright (c) Jordan Harband and contributors 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: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 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. PK q S[�� � index.d.tsnu ȯ�� type Func = (...args: unknown[]) => unknown; declare function setFunctionName<T extends Func = Func>(fn: T, name: string, loose?: boolean): T; export = setFunctionName;PK q S[�!ZV� � CHANGELOG.mdnu ȯ�� # Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [v2.0.2](https://github.com/jfsiii/set-function-name/compare/v2.0.1...v2.0.2) - 2024-02-19 ### Commits - [meta] add types [`ae747cd`](https://github.com/jfsiii/set-function-name/commit/ae747cdcf4a986e6974a375be8ec04dd7565f0bd) - [Dev Deps] update `aud`, `npmignore`, `object-inspect`, `tape` [`01aafcb`](https://github.com/jfsiii/set-function-name/commit/01aafcb82e4df653fcbd666ce4f256c06f70d94e) - [Deps] update `define-data-property`, `has-property-descriptors` [`0ef6338`](https://github.com/jfsiii/set-function-name/commit/0ef6338fac84f63c2445855778bfd9271ae048cb) - [Refactor] use `es-errors` [`0b23e87`](https://github.com/jfsiii/set-function-name/commit/0b23e878a16c959bd8b1aa7152d65818dd90578c) ## [v2.0.1](https://github.com/jfsiii/set-function-name/compare/v2.0.0...v2.0.1) - 2023-09-13 ### Commits - [Fix] move `functions-have-names` to runtime deps [`db2eda8`](https://github.com/jfsiii/set-function-name/commit/db2eda8da4c8aecfad01739000bbd63d04a8e8cf) ## [v2.0.0](https://github.com/jfsiii/set-function-name/compare/v1.0.0...v2.0.0) - 2023-09-12 ### Commits - [eslint] add `npm run lint` [`23e1fcd`](https://github.com/jfsiii/set-function-name/commit/23e1fcd85b64b864cb8f7e894da78d540e72923a) - [actions] add reused GHA [`525127e`](https://github.com/jfsiii/set-function-name/commit/525127e08bdb35b0d44f565492456c7d1d5923fc) - [meta] add `.gitignore` [`aa3abdf`](https://github.com/jfsiii/set-function-name/commit/aa3abdfa6af18adf70281352905dd69ef8b2c66f) - [Tests] switch tests to use tape; add posttest [`8ad6d30`](https://github.com/jfsiii/set-function-name/commit/8ad6d30c61f78d2f9beec156ba7f1c4c3741c593) - [readme] add readme [`732c46c`](https://github.com/jfsiii/set-function-name/commit/732c46c05e0fa6843dbc85b3af1e9c9bf22e7bf9) - [New] add optional `loose` argument [`f5e4771`](https://github.com/jfsiii/set-function-name/commit/f5e4771266c95567d87f6dc2cff94c986bc7e074) - [meta] relicense package to MIT; fix repo URLs [`13948f8`](https://github.com/jfsiii/set-function-name/commit/13948f8bb4ec8a25b67332d8de232ad0c0dc4e6d) - [meta] add `auto-changelog` [`7ab201c`](https://github.com/jfsiii/set-function-name/commit/7ab201c0d83d464664cc4588acad0d0f75926679) - [Breaking] throw if a non-function is provided [`cf6fc8f`](https://github.com/jfsiii/set-function-name/commit/cf6fc8f3396d58aa8c32a83375cbf57d933d7e79) - [Breaking] drop UMD, just use CJS [`47abfe8`](https://github.com/jfsiii/set-function-name/commit/47abfe89abfaa72f71e0a77a52a5ff2b7377e11a) - [Refactor] use `define-data-property` and `has-property-descriptors` [`9921c2b`](https://github.com/jfsiii/set-function-name/commit/9921c2b64c571255084aefaa02660314609e8ea0) - [meta] use `npmignore` to autogenerate an npmignore file [`c5dbe4f`](https://github.com/jfsiii/set-function-name/commit/c5dbe4f4c44298596338432e2ac9946a10c98edd) - Only apps should have lockfiles [`98bbfa1`](https://github.com/jfsiii/set-function-name/commit/98bbfa145387f318152a6b792bd69aca3c544813) - [meta] add `safe-publish-latest` [`8916cd8`](https://github.com/jfsiii/set-function-name/commit/8916cd8f5549dceee31f06d35a76e2f9d4933a8b) - [meta] add `engines` [`2427c8e`](https://github.com/jfsiii/set-function-name/commit/2427c8e2499f378c9ff3d92c7d544c771ca810df) ## v1.0.0 - 2017-09-14 ### Commits - Initial commit. Including tests. [`f26a1f2`](https://github.com/jfsiii/set-function-name/commit/f26a1f2c69a70dad5049b1daa08eae5f6acd9a1e) - add .npmignore to ignore test directory [`9cac96f`](https://github.com/jfsiii/set-function-name/commit/9cac96fd9e98f25883be6e727ac32356522a5d69) PK q S[��X � � package.jsonnu ȯ�� { "name": "set-function-name", "version": "2.0.2", "description": "Set a function's name property", "main": "index.js", "types": "./index.d.ts", "directories": { "test": "test" }, "scripts": { "prepack": "npmignore --auto --commentLines=autogenerated", "prepublish": "not-in-publish || npm run prepublishOnly", "prepublishOnly": "safe-publish-latest", "prelint": "evalmd README.md", "lint": "eslint --ext=js,mjs .", "postlint": "tsc -p .", "pretest": "npm run lint", "tests-only": "tape 'test/**/*.js'", "test": "npm run tests-only", "posttest": "aud --production", "version": "auto-changelog && git add CHANGELOG.md", "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" }, "repository": { "type": "git", "url": "git+https://github.com/ljharb/set-function-name.git" }, "keywords": [ "set", "assign", "function", "name", "function.name" ], "author": "Jordan Harband <ljharb@gmail.com>", "license": "MIT", "bugs": { "url": "https://github.com/ljharb/set-function-name/issues" }, "homepage": "https://github.com/ljharb/set-function-name#readme", "devDependencies": { "@ljharb/eslint-config": "^21.1.0", "@types/call-bind": "^1.0.5", "@types/define-properties": "^1.1.5", "@types/es-value-fixtures": "^1.4.4", "@types/for-each": "^0.3.3", "@types/function.prototype.name": "^1.1.3", "@types/functions-have-names": "^1.2.2", "@types/has-property-descriptors": "^1.0.3", "@types/make-arrow-function": "^1.2.2", "@types/make-async-function": "^1.0.2", "@types/make-async-generator-function": "^1.0.3", "@types/make-generator-function": "^2.0.3", "@types/object-inspect": "^1.8.4", "@types/tape": "^5.6.4", "aud": "^2.0.4", "auto-changelog": "^2.4.0", "es-value-fixtures": "^1.4.2", "eslint": "=8.8.0", "evalmd": "^0.0.19", "for-each": "^0.3.3", "function.prototype.name": "^1.1.6", "in-publish": "^2.0.1", "make-arrow-function": "^1.2.0", "make-async-function": "^1.0.0", "make-async-generator-function": "^1.0.0", "make-generator-function": "^2.0.0", "npmignore": "^0.3.1", "object-inspect": "^1.13.1", "safe-publish-latest": "^2.0.0", "tape": "^5.7.5", "typescript": "next" }, "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "functions-have-names": "^1.2.3", "has-property-descriptors": "^1.0.2" }, "engines": { "node": ">= 0.4" }, "auto-changelog": { "output": "CHANGELOG.md", "template": "keepachangelog", "unreleased": false, "commitLimit": false, "backfillLimit": false, "hideCredit": true }, "publishConfig": { "ignore": [ ".github/workflows", "test", "!*.d.ts", "!*.d.ts.map" ] } } PK r S[�� .eslintrcnu ȯ�� { "root": true, "extends": "@ljharb", "rules": { "id-length": "off", "no-extra-parens": "off", }, "overrides": [ { "files": ["test/**/*.js"], "rules": { "id-length": "off", "multiline-comment-style": "off", "no-empty-function": "off", }, }, ], } PK r S[AQN�� � index.jsnu ȯ�� 'use strict'; var define = require('define-data-property'); var hasDescriptors = require('has-property-descriptors')(); var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames(); var $TypeError = require('es-errors/type'); /** @type {import('.')} */ module.exports = function setFunctionName(fn, name) { if (typeof fn !== 'function') { throw new $TypeError('`fn` is not a function'); } var loose = arguments.length > 2 && !!arguments[2]; if (!loose || functionsHaveConfigurableNames) { if (hasDescriptors) { define(/** @type {Parameters<define>[0]} */ (fn), 'name', name, true, true); } else { define(/** @type {Parameters<define>[0]} */ (fn), 'name', name); } } return fn; }; PK q S[j_R tsconfig.jsonnu ȯ�� PK q S[f U3 3 T .github/FUNDING.ymlnu ȯ�� PK q S[����K K � README.mdnu ȯ�� PK q S[*1��; ; N LICENSEnu ȯ�� PK q S[�� � �# index.d.tsnu ȯ�� PK q S[�!ZV� � �$ CHANGELOG.mdnu ȯ�� PK q S[��X � � �3 package.jsonnu ȯ�� PK r S[�� �>