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

@karmaniverous/entity-manager

Package Overview
Dependencies
Maintainers
0
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@karmaniverous/entity-manager - npm Package Compare versions

Comparing version 6.13.0 to 6.13.1

7

dist/cjs/EntityManager.js

@@ -114,7 +114,10 @@ 'use strict';

* @param rangeKeyToken - Index range key.
* @param suppressError - Suppress error if no match found.
*
* @returns Index token if found.
*
* @throws `Error` if no match found and `suppressError` is not `true`.
*/
findIndexToken(hashKeyToken, rangeKeyToken) {
return findIndexToken.findIndexToken(this, hashKeyToken, rangeKeyToken);
findIndexToken(hashKeyToken, rangeKeyToken, suppressError) {
return findIndexToken.findIndexToken(this, hashKeyToken, rangeKeyToken, suppressError);
}

@@ -121,0 +124,0 @@ /**

@@ -9,9 +9,15 @@ 'use strict';

* @param rangeKeyToken - Index range key.
* @param suppressError - Suppress error if no match found.
*
* @returns Index token if found.
*
* @throws `Error` if no match found and `suppressError` is not `true`.
*/
function findIndexToken(entityManager, hashKeyToken, rangeKeyToken) {
return Object.entries(entityManager.config.indexes).find(([, index]) => index.hashKey === hashKeyToken && index.rangeKey === rangeKeyToken)?.[0];
function findIndexToken(entityManager, hashKeyToken, rangeKeyToken, suppressError) {
const indexToken = Object.entries(entityManager.config.indexes).find(([, index]) => index.hashKey === hashKeyToken && index.rangeKey === rangeKeyToken)?.[0];
if (!indexToken && !suppressError)
throw new Error(`No index token found for hashKey '${hashKeyToken}' & rangeKey '${rangeKeyToken}'.`);
return indexToken;
}
exports.findIndexToken = findIndexToken;

@@ -595,6 +595,9 @@ import { EntityMap, TranscodeMap, ConditionalProperty, Exactify, PropertiesOfType, TranscodableProperties, FlattenEntityMap, Transcodes, SortOrder, MutuallyExclusive, NotNever, DefaultTranscodeMap } from '@karmaniverous/entity-tools';

* @param rangeKeyToken - Index range key.
* @param suppressError - Suppress error if no match found.
*
* @returns Index token if found.
*
* @throws `Error` if no match found and `suppressError` is not `true`.
*/
findIndexToken(hashKeyToken: string, rangeKeyToken: string): string | undefined;
findIndexToken(hashKeyToken: string, rangeKeyToken: string, suppressError?: boolean): string | undefined;
/**

@@ -601,0 +604,0 @@ * Query a database entity across shards in a provider-generic fashion.

@@ -112,7 +112,10 @@ import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';

* @param rangeKeyToken - Index range key.
* @param suppressError - Suppress error if no match found.
*
* @returns Index token if found.
*
* @throws `Error` if no match found and `suppressError` is not `true`.
*/
findIndexToken(hashKeyToken, rangeKeyToken) {
return findIndexToken(this, hashKeyToken, rangeKeyToken);
findIndexToken(hashKeyToken, rangeKeyToken, suppressError) {
return findIndexToken(this, hashKeyToken, rangeKeyToken, suppressError);
}

@@ -119,0 +122,0 @@ /**

@@ -7,9 +7,15 @@ /**

* @param rangeKeyToken - Index range key.
* @param suppressError - Suppress error if no match found.
*
* @returns Index token if found.
*
* @throws `Error` if no match found and `suppressError` is not `true`.
*/
function findIndexToken(entityManager, hashKeyToken, rangeKeyToken) {
return Object.entries(entityManager.config.indexes).find(([, index]) => index.hashKey === hashKeyToken && index.rangeKey === rangeKeyToken)?.[0];
function findIndexToken(entityManager, hashKeyToken, rangeKeyToken, suppressError) {
const indexToken = Object.entries(entityManager.config.indexes).find(([, index]) => index.hashKey === hashKeyToken && index.rangeKey === rangeKeyToken)?.[0];
if (!indexToken && !suppressError)
throw new Error(`No index token found for hashKey '${hashKeyToken}' & rangeKey '${rangeKeyToken}'.`);
return indexToken;
}
export { findIndexToken };

@@ -135,3 +135,3 @@ {

"types": "dist/index.d.ts",
"version": "6.13.0"
"version": "6.13.1"
}
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