Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@jest/create-cache-key-function
Advanced tools
Changelog
29.7.0
[create-jest]
Add npm init
/ yarn create
initialiser for Jest projects (#14465)[jest-validate]
Allow deprecation warnings for unknown options (#14499)[jest-resolver]
Replace unmatched capture groups in moduleNameMapper
with empty string instead of undefined
(#14507)[jest-snapshot]
Allow for strings as well as template literals in inline snapshots (#14465)[@jest/test-sequencer]
Calculate test runtime if perStats.duration
is missing (#14473)[@jest/create-cache-key-function]
Cache access of NODE_ENV
and BABEL_ENV
(#14455)[jest-cli]
Move internal config initialisation logic to the create-jest
package (#14465)Readme
This module creates a function which is used for generating cache keys used by code transformers in Jest.
$ npm install --save-dev @jest/create-cache-key-function
createCacheKey(files?: Array<string>, values?: Array<String>, length?: number): GetCacheKeyFunction
Returns a function that can be used to generate cache keys based on source code of provided files and provided values.
files
: [Optional] Array of absolute paths to files whose code should be accounted for when generating cache keyvalues
: [Optional] Array of string values that should be accounted for when generating cache keylength
: [Optional] Length of the resulting key. The default is 32
, or 16
on Windows.Note:
The 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.
Here is some sample usage code while creating a new transformer for Jest
const createCacheKeyFunction =
require('@jest/create-cache-key-function').default;
const filesToAccountFor = [
__filename,
require.resolve('some-package-name/package.json'),
];
const valuesToAccountFor = [process.env.SOME_LOCAL_ENV, 'Some_Other_Value'];
module.exports = {
process(src, filename, config, options) {},
getCacheKey: createCacheKeyFunction(filesToAccountFor, valuesToAccountFor),
};
FAQs
This module creates a function which is used for generating cache keys used by code transformers in Jest.
The npm package @jest/create-cache-key-function receives a total of 2,793,047 weekly downloads. As such, @jest/create-cache-key-function popularity was classified as popular.
We found that @jest/create-cache-key-function demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.