Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@parcel/cache

Package Overview
Dependencies
Maintainers
1
Versions
896
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/cache - npm Package Compare versions

Comparing version 2.0.0-canary.1646 to 2.0.0-canary.1647

11

lib/LMDBCache.js

@@ -42,2 +42,9 @@ "use strict";

}
function _featureFlags() {
const data = require("@parcel/feature-flags");
_featureFlags = function () {
return data;
};
return data;
}
function _fs() {

@@ -160,5 +167,5 @@ const data = require("@parcel/fs");

}
const largeBlobKey = (0, _featureFlags().getFeatureFlag)('randomLargeBlobKeys') ?
// $FlowFixMe flow libs are outdated but we only support node>16 so randomUUID is present
const largeBlobKey = `${key}_${_crypto().default.randomUUID()}`;
`${key}_${_crypto().default.randomUUID()}` : key;
await this.fsCache.setLargeBlob(largeBlobKey, contents, options);

@@ -165,0 +172,0 @@ await this.set(key, {

12

package.json
{
"name": "@parcel/cache",
"description": "Interface for defining caches and file-system, IDB and LMDB implementations.",
"version": "2.0.0-canary.1646+9eff0bfeb",
"version": "2.0.0-canary.1647+2ce4efe40",
"license": "MIT",

@@ -28,9 +28,9 @@ "publishConfig": {

"dependencies": {
"@parcel/fs": "2.0.0-canary.1646+9eff0bfeb",
"@parcel/logger": "2.0.0-canary.1646+9eff0bfeb",
"@parcel/utils": "2.0.0-canary.1646+9eff0bfeb",
"@parcel/fs": "2.0.0-canary.1647+2ce4efe40",
"@parcel/logger": "2.0.0-canary.1647+2ce4efe40",
"@parcel/utils": "2.0.0-canary.1647+2ce4efe40",
"lmdb": "2.8.5"
},
"peerDependencies": {
"@parcel/core": "^2.0.0-canary.1644+9eff0bfeb"
"@parcel/core": "^2.0.0-canary.1645+2ce4efe40"
},

@@ -44,3 +44,3 @@ "devDependencies": {

},
"gitHead": "9eff0bfeb655845c8ffd86d8acdba9a21bbafc82"
"gitHead": "2ce4efe40b663d04706dcd21b1a38e78eb24be79"
}

@@ -11,2 +11,3 @@ // @flow strict-local

import {serialize, deserialize, registerSerializableClass} from '@parcel/core';
import {getFeatureFlag} from '@parcel/feature-flags';
import {NodeFS} from '@parcel/fs';

@@ -151,4 +152,6 @@ // flowlint-next-line untyped-import:off

// $FlowFixMe flow libs are outdated but we only support node>16 so randomUUID is present
const largeBlobKey = `${key}_${crypto.randomUUID()}`;
const largeBlobKey = getFeatureFlag('randomLargeBlobKeys')
? // $FlowFixMe flow libs are outdated but we only support node>16 so randomUUID is present
`${key}_${crypto.randomUUID()}`
: key;
await this.fsCache.setLargeBlob(largeBlobKey, contents, options);

@@ -155,0 +158,0 @@ const entry: LargeBlobEntry = {type: 'LARGE_BLOB', largeBlobKey};

// @flow
import {DEFAULT_FEATURE_FLAGS, setFeatureFlags} from '@parcel/feature-flags';
import * as mkdirp from 'mkdirp';

@@ -18,4 +19,15 @@ import * as tempy from 'tempy';

await lmdbCache.ensure();
setFeatureFlags({
...DEFAULT_FEATURE_FLAGS,
randomLargeBlobKeys: true,
});
});
afterEach(() => {
setFeatureFlags({
...DEFAULT_FEATURE_FLAGS,
});
});
it('LMDBCache::get / set will return key values', async () => {

@@ -22,0 +34,0 @@ assert(!(await lmdbCache.has('test-key')), 'LMDB did not start empty');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc