bare-realm
Advanced tools
+12
-3
@@ -1,7 +0,16 @@ | ||
| declare class Realm { | ||
| evaluate(code: string, opts?: { filename: string; offset: number }): any | ||
| interface EvaluateOptions { | ||
| filename?: string | ||
| offset?: number | ||
| } | ||
| destroy(): void | ||
| interface Realm { | ||
| evaluate(code: string, options?: EvaluateOptions): any | ||
| } | ||
| declare class Realm {} | ||
| declare namespace Realm { | ||
| export type { EvaluateOptions } | ||
| } | ||
| export = Realm |
+0
-7
| const binding = require('./binding') | ||
| const errors = require('./lib/errors') | ||
@@ -9,9 +8,3 @@ module.exports = class Realm { | ||
| destroy() { | ||
| this._handle = null | ||
| } | ||
| evaluate(code, opts = {}) { | ||
| if (this._handle === null) throw errors.REALM_DESTROYED() | ||
| const { filename = '<anonymous>', offset = 0 } = opts | ||
@@ -18,0 +11,0 @@ |
+3
-5
| { | ||
| "name": "bare-realm", | ||
| "version": "1.0.8", | ||
| "version": "2.0.0", | ||
| "description": "Realm support for Bare", | ||
| "exports": { | ||
| "./package": "./package.json", | ||
| ".": { | ||
| "types": "./index.d.ts", | ||
| "default": "./index.js" | ||
| }, | ||
| "./package": "./package.json", | ||
| "./errors": "./lib/errors.js" | ||
| } | ||
| }, | ||
@@ -19,3 +18,2 @@ "files": [ | ||
| "CMakeLists.txt", | ||
| "lib", | ||
| "prebuilds" | ||
@@ -22,0 +20,0 @@ ], |
| module.exports = class RealmError extends Error { | ||
| constructor(msg, code, fn = RealmError) { | ||
| super(`${code}: ${msg}`) | ||
| this.code = code | ||
| if (Error.captureStackTrace) { | ||
| Error.captureStackTrace(this, fn) | ||
| } | ||
| } | ||
| get name() { | ||
| return 'RealmError' | ||
| } | ||
| static REALM_DESTROYED(msg = 'Realm has been destroyed') { | ||
| return new RealmError(msg, 'REALM_DESTROYED', RealmError.REALM_DESTROYED) | ||
| } | ||
| } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Obfuscated code
Supply chain riskObfuscated files are intentionally packed to hide their behavior. This could be a sign of malware.
Found 1 instance in 1 package
489122
0.23%0
-100%21
-4.55%23
-36.11%