solidity-ast
Advanced tools
Comparing version 0.4.56 to 0.4.57
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ASTDereferencerError = exports.curry2 = exports.astDereferencer = void 0; | ||
exports.ASTDereferencerError = void 0; | ||
exports.astDereferencer = astDereferencer; | ||
exports.curry2 = curry2; | ||
const is_node_type_1 = require("../utils/is-node-type"); | ||
const find_all_1 = require("../utils/find-all"); | ||
const array_prototype_findlast_1 = __importDefault(require("array.prototype.findlast")); | ||
// An ASTDereferencer is a function that looks up an AST node given its id, in all of the source files involved in a | ||
@@ -42,3 +40,3 @@ // solc run. It will generally be used together with the AST property `referencedDeclaration` (found in Identifier, | ||
continue; | ||
const childId = Array.isArray(child) ? (0, array_prototype_findlast_1.default)(child, n => n)?.id : child?.id; | ||
const childId = Array.isArray(child) ? child.findLast(n => n)?.id : child?.id; | ||
if (childId === undefined) | ||
@@ -83,3 +81,2 @@ continue; | ||
} | ||
exports.astDereferencer = astDereferencer; | ||
function curry2(fn) { | ||
@@ -96,4 +93,2 @@ function curried(a, ...b) { | ||
} | ||
exports.curry2 = curry2; | ||
const isArray = Array.isArray; | ||
class ASTDereferencerError extends Error { | ||
@@ -100,0 +95,0 @@ id; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.srcDecoder = void 0; | ||
exports.srcDecoder = srcDecoder; | ||
const path_1 = __importDefault(require("path")); | ||
@@ -35,3 +35,2 @@ function srcDecoder(solcInput, solcOutput, basePath = '.') { | ||
} | ||
exports.srcDecoder = srcDecoder; | ||
function countInBuffer(buf, str) { | ||
@@ -38,0 +37,0 @@ let count = 0; |
{ | ||
"name": "solidity-ast", | ||
"version": "0.4.56", | ||
"version": "0.4.57", | ||
"description": "Solidity AST schema and type definitions", | ||
@@ -27,16 +27,13 @@ "author": "Francisco Giordano <frangio.1@gmail.com>", | ||
}, | ||
"dependencies": { | ||
"array.prototype.findlast": "^1.2.2" | ||
}, | ||
"devDependencies": { | ||
"@types/lodash": "^4.14.155", | ||
"@types/node": "^14.18.33", | ||
"ajv": "^8.5.0", | ||
"chalk": "^4.0.0", | ||
"fast-check": "^3.12.0", | ||
"json-schema-to-typescript": "^10.1.4", | ||
"lodash": "^4.17.15", | ||
"mocha": "^10.1.0", | ||
"@types/lodash": "^4.17.7", | ||
"@types/node": "^18.14.10", | ||
"ajv": "^8.17.1", | ||
"chalk": "^4.1.2", | ||
"fast-check": "^3.20.0", | ||
"json-schema-to-typescript": "^14.1.0", | ||
"lodash": "^4.17.21", | ||
"mocha": "^10.6.0", | ||
"promisified": "^0.5.0", | ||
"semver": "^7.3.2", | ||
"semver": "^7.6.2", | ||
"solc-0.6.10": "npm:solc@0.6.10", | ||
@@ -73,2 +70,3 @@ "solc-0.6.11": "npm:solc@0.6.11", | ||
"solc-0.8.25": "npm:solc@0.8.25", | ||
"solc-0.8.26": "npm:solc@0.8.26", | ||
"solc-0.8.3": "npm:solc@0.8.3", | ||
@@ -80,7 +78,7 @@ "solc-0.8.4": "npm:solc@0.8.4", | ||
"solc-0.8.9": "npm:solc@0.8.9", | ||
"typedoc": "^0.24.8", | ||
"typedoc-theme-hierarchy": "^4.1.0", | ||
"typescript": "^4.9.5" | ||
"typedoc": "^0.26.4", | ||
"typedoc-theme-hierarchy": "^5.0.3", | ||
"typescript": "^5.5.3" | ||
}, | ||
"license": "MIT" | ||
} |
import { isNodeType, ExtendedNodeType, ExtendedNodeTypeMap } from '../utils/is-node-type'; | ||
import { findAll } from '../utils/find-all'; | ||
import type { ASTDereferencer, NodeWithSourceUnit } from '../utils'; | ||
import type { Node, NodeType, NodeTypeMap } from '../node'; | ||
import type { Node, NodeType } from '../node'; | ||
import type { SolcOutput } from '../solc'; | ||
import { SourceUnit } from '../types'; | ||
import findLast from 'array.prototype.findlast'; | ||
// An ASTDereferencer is a function that looks up an AST node given its id, in all of the source files involved in a | ||
@@ -48,3 +45,3 @@ // solc run. It will generally be used together with the AST property `referencedDeclaration` (found in Identifier, | ||
if (typeof child !== "object") continue; | ||
const childId = Array.isArray(child) ? findLast(child, n => n)?.id : child?.id; | ||
const childId = Array.isArray(child) ? child.findLast(n => n)?.id : child?.id; | ||
if (childId === undefined) continue; | ||
@@ -117,4 +114,2 @@ if (id <= childId && (nextRootId === undefined || childId <= nextRootId)) { | ||
const isArray: (arg: any) => arg is any[] | readonly any[] = Array.isArray; | ||
export class ASTDereferencerError extends Error { | ||
@@ -121,0 +116,0 @@ constructor(readonly id: number, readonly nodeType: readonly ExtendedNodeType[]) { |
@@ -773,3 +773,3 @@ /* tslint:disable */ | ||
baseModifiers?: number[] | null; | ||
body: Block; | ||
body?: Block | null; | ||
documentation?: StructuredDocumentation | null; | ||
@@ -776,0 +776,0 @@ overrides?: OverrideSpecifier | null; |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
0
237078
51
24
10972
- Removedarray.prototype.findlast@^1.2.2
- Removedarray-buffer-byte-length@1.0.1(transitive)
- Removedarray.prototype.findlast@1.2.5(transitive)
- Removedarraybuffer.prototype.slice@1.0.3(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removeddata-view-buffer@1.0.1(transitive)
- Removeddata-view-byte-length@1.0.1(transitive)
- Removeddata-view-byte-offset@1.0.0(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddefine-properties@1.2.1(transitive)
- Removedes-abstract@1.23.3(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.0.0(transitive)
- Removedes-set-tostringtag@2.0.3(transitive)
- Removedes-shim-unscopables@1.0.2(transitive)
- Removedes-to-primitive@1.2.1(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedfunction.prototype.name@1.1.6(transitive)
- Removedfunctions-have-names@1.2.3(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedget-symbol-description@1.0.2(transitive)
- Removedglobalthis@1.0.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-bigints@1.0.2(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhas-tostringtag@1.0.2(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinternal-slot@1.0.7(transitive)
- Removedis-array-buffer@3.0.4(transitive)
- Removedis-bigint@1.0.4(transitive)
- Removedis-boolean-object@1.1.2(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-data-view@1.0.1(transitive)
- Removedis-date-object@1.0.5(transitive)
- Removedis-negative-zero@2.0.3(transitive)
- Removedis-number-object@1.0.7(transitive)
- Removedis-regex@1.1.4(transitive)
- Removedis-shared-array-buffer@1.0.3(transitive)
- Removedis-string@1.0.7(transitive)
- Removedis-symbol@1.0.4(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedis-weakref@1.0.2(transitive)
- Removedisarray@2.0.5(transitive)
- Removedobject-inspect@1.13.2(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedobject.assign@4.1.5(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedregexp.prototype.flags@1.5.3(transitive)
- Removedsafe-array-concat@1.1.2(transitive)
- Removedsafe-regex-test@1.0.3(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedset-function-name@2.0.2(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedstring.prototype.trim@1.2.9(transitive)
- Removedstring.prototype.trimend@1.0.8(transitive)
- Removedstring.prototype.trimstart@1.0.8(transitive)
- Removedtyped-array-buffer@1.0.2(transitive)
- Removedtyped-array-byte-length@1.0.1(transitive)
- Removedtyped-array-byte-offset@1.0.2(transitive)
- Removedtyped-array-length@1.0.6(transitive)
- Removedunbox-primitive@1.0.2(transitive)
- Removedwhich-boxed-primitive@1.0.2(transitive)
- Removedwhich-typed-array@1.1.15(transitive)