Socket
Socket
Sign inDemoInstall

@voiceflow/common

Package Overview
Dependencies
Maintainers
20
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@voiceflow/common - npm Package Compare versions

Comparing version 7.20.1 to 7.20.2

2

build/common/utils/id.d.ts
import cuid from 'cuid';
import { EmptyObject } from '../types';
export { cuid };
export declare const objectID: () => string;
export declare const remapObjectIDs: <T extends Readonly<EmptyObject>>(object: T, lookupMap: Record<string, string> | Map<string, string>) => T;

@@ -6,8 +6,21 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.objectID = exports.cuid = void 0;
exports.remapObjectIDs = exports.objectID = exports.cuid = void 0;
const bson_objectid_1 = __importDefault(require("bson-objectid"));
const cuid_1 = __importDefault(require("cuid"));
exports.cuid = cuid_1.default;
const deep_map_1 = __importDefault(require("deep-map"));
const deep_map_keys_1 = __importDefault(require("deep-map-keys"));
const objectID = () => new bson_objectid_1.default().toHexString();
exports.objectID = objectID;
const remapObjectIDs = (object, lookupMap) => {
const map = lookupMap instanceof Map ? lookupMap : new Map(Object.entries(lookupMap));
const mapping = (value) => {
if (typeof value === 'string' && map.has(value)) {
return map.get(value);
}
return value;
};
return (0, deep_map_keys_1.default)((0, deep_map_1.default)(object, mapping), mapping);
};
exports.remapObjectIDs = remapObjectIDs;
//# sourceMappingURL=id.js.map
import cuid from 'cuid';
import { EmptyObject } from '../types';
export { cuid };
export declare const objectID: () => string;
export declare const remapObjectIDs: <T extends Readonly<EmptyObject>>(object: T, lookupMap: Record<string, string> | Map<string, string>) => T;
import ObjectId from 'bson-objectid';
import cuid from 'cuid';
import deepMap from 'deep-map';
import deepMapKeys from 'deep-map-keys';
export { cuid };
export const objectID = () => new ObjectId().toHexString();
export const remapObjectIDs = (object, lookupMap) => {
const map = lookupMap instanceof Map ? lookupMap : new Map(Object.entries(lookupMap));
const mapping = (value) => {
if (typeof value === 'string' && map.has(value)) {
return map.get(value);
}
return value;
};
return deepMapKeys(deepMap(object, mapping), mapping);
};
//# sourceMappingURL=id.js.map

7

package.json
{
"name": "@voiceflow/common",
"description": "Junk drawer of utility functions",
"version": "7.20.1",
"version": "7.20.2",
"author": "Voiceflow",

@@ -15,2 +15,5 @@ "bugs": {

"dayjs": "^1.10.7",
"deep-map": "2.0.0",
"deep-map-keys": "2.0.1",
"es6-weak-map": "2.0.3",
"lodash": "^4.17.21",

@@ -79,3 +82,3 @@ "murmurhash-wasm": "^1.3.0",

},
"gitHead": "434247de43ee27aeb92c2964309fb35c1dd69434"
"gitHead": "132bb4a23c41ee02103ac2f1e332cbf7793f2ba3"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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