{"_id":"@jest/create-cache-key-function@30.5.1","bugs":{"url":"https://github.com/jestjs/jest/issues"},"dist":{"shasum":"dc7c728bb1b4a8b5cb774bdf363e4a26d89d2b0e","tarball":"http://registry-npm.ywwl.com/@jest/create-cache-key-function/download/@jest/create-cache-key-function-30.5.1.tgz","fileCount":6,"integrity":"sha512-5qkif//qhlbt54255O/M2JtUZNlnefOzE12bi7FlApOIYO4pqrZcAwhNCfP4jOGFubez8uoLgY9czWFjYY57ow==","signatures":[{"sig":"MEUCIQDkv2xPcivmwBpnp58ytw47Fs+KB69rKkgSYKjPezR8gwIgETg/JOFERYWu3UlJF1v10lEX45SEkfSp7sfrVldMZX4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD9eYiphOyQEiA/6sztBieS8aYYFHGCzOJdqStL+sUyrQIhAJUGzXXdd7teWpVgG2R7p+eaGDDpVXacGD+ZgCCWf11N"}],"unpackedSize":9037,"size":3440,"noattachment":false,"key":"/@jest/create-cache-key-function/-/@jest/create-cache-key-function-30.5.1.tgz"},"main":"./build/index.js","name":"@jest/create-cache-key-function","types":"./build/index.d.ts","engines":{"node":"^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0"},"exports":{".":{"types":"./build/index.d.ts","import":"./build/index.mjs","default":"./build/index.js","require":"./build/index.js"},"./package.json":"./package.json"},"gitHead":"9ab14feccd6c15fec1334dbcb03a53a079d153d3","license":"MIT","version":"30.5.1","_npmUser":{"name":"simenb","email":"sbekkhus91@gmail.com"},"homepage":"https://github.com/jestjs/jest#readme","repository":{"url":"git+https://github.com/jestjs/jest.git","type":"git","directory":"packages/jest-create-cache-key-function"},"_npmVersion":"lerna/4.11.5/node@v26.8.1+arm64 (darwin)","description":"This module creates a function which is used for generating cache keys used by code transformers in Jest.","directories":{},"maintainers":[{"name":"aaronabramov","email":"aaron@abramov.io"},{"name":"simenb","email":"sbekkhus91@gmail.com"},{"name":"rickhanlonii","email":"rickhanlonii@gmail.com"},{"name":"openjs-operations","email":"operations@openjsf.org"},{"name":"cpojer","email":"christoph.pojer@gmail.com"}],"_nodeVersion":"26.8.1","dependencies":{"@jest/types":"30.5.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest-util":"30.5.1","@types/node":"*"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/create-cache-key-function_30.5.1_1788249619721_0.5759677923966133"},"readme":"# jest-create-cache-key-function\n\nThis module creates a function which is used for generating cache keys used by code transformers in Jest.\n\n## Install\n\n```sh\n$ npm install --save-dev @jest/create-cache-key-function\n```\n\n## API\n\n### `createCacheKey(files?: Array<string>, values?: Array<String>, length?: number): GetCacheKeyFunction`\n\nReturns a function that can be used to generate cache keys based on source code of provided files and provided values.\n\n#### Parameters\n\n- `files`: [Optional] Array of absolute paths to files whose code should be accounted for when generating cache key\n- `values`: [Optional] Array of string values that should be accounted for when generating cache key\n- `length`: [Optional] Length of the resulting key. The default is `32`, or `16` on Windows.\n\n**Note:**\n\nThe source code for your test is already taken into account when generating the cache key. The `files` array should be used to provide files that are not directly related to your code such as external configuration files.\n\n## Usage\n\nHere is some sample usage code while creating a new transformer for Jest\n\n```javascript\nconst createCacheKeyFunction =\n  require('@jest/create-cache-key-function').default;\n\nconst filesToAccountFor = [\n  __filename,\n  require.resolve('some-package-name/package.json'),\n];\n\nconst valuesToAccountFor = [process.env.SOME_LOCAL_ENV, 'Some_Other_Value'];\n\nmodule.exports = {\n  process(src, filename, config, options) {},\n  getCacheKey: createCacheKeyFunction(filesToAccountFor, valuesToAccountFor),\n};\n```\n","publish_time":1788249619794,"_cnpm_publish_time":1788249619794,"dist-tags":{"latest":"30.5.1","next":"30.0.0-rc.1"}}