chore: update node_modules with new binary files and dependencies
- Add new binary files for nodemon, onnxruntime-web, and xenova/transformers - Update various JavaScript and TypeScript files in node_modules - Remove unused files and dependencies - Add new test fixtures and documentation files
This commit is contained in:
24
node_modules/onnxruntime-web/lib/onnxjs/attribute-with-cache-key.ts
generated
vendored
Normal file
24
node_modules/onnxruntime-web/lib/onnxjs/attribute-with-cache-key.ts
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
class AttributeWithCacheKeyImpl {
|
||||
constructor(attribute: Record<string, unknown>) {
|
||||
Object.assign(this, attribute);
|
||||
}
|
||||
|
||||
private _cacheKey: string;
|
||||
public get cacheKey(): string {
|
||||
if (!this._cacheKey) {
|
||||
this._cacheKey =
|
||||
Object.getOwnPropertyNames(this).sort().map(name => `${(this as Record<string, unknown>)[name]}`).join(';');
|
||||
}
|
||||
return this._cacheKey;
|
||||
}
|
||||
}
|
||||
|
||||
export interface AttributeWithCacheKey {
|
||||
readonly cacheKey: string;
|
||||
}
|
||||
|
||||
export const createAttributeWithCacheKey = <T extends Record<string, unknown>>(attribute: T): T&AttributeWithCacheKey =>
|
||||
new AttributeWithCacheKeyImpl(attribute) as unknown as T & AttributeWithCacheKey;
|
||||
Reference in New Issue
Block a user