detective/000755 001751 000177 0000000000 14522265601014516 5ustar00runner000000 000000 1452226560114522265601detective/LICENSE000644 001751 000177 0000002165 14522265601015527 0ustar00runner000000 000000 1452226560114522265601 MIT License Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE detective/README.md000644 001751 000177 0000001004 14522265601015756 0ustar00runner000000 000000 1452231310214522265601# Installation > `npm install --save @types/detective` # Summary This package contains type definitions for detective (https://github.com/browserify/detective). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/detective. ### Additional Details * Last updated: Mon, 06 Nov 2023 22:41:05 GMT * Dependencies: [acorn](https://npmjs.com/package/acorn) # Credits These definitions were written by [TeamworkGuy2](https://github.com/TeamworkGuy2). detective/index.d.ts000644 001751 000177 0000007741 14522265601016430 0ustar00runner000000 000000 1452226560114522265601import * as acorn from "acorn"; /** * Find all calls to require() by walking the AST */ declare namespace detective { interface Detective { /** * Give some source body src, return an array of all the require() calls with string arguments. * The options parameter opts is passed along to detective.find(). */ (src: string, opts?: Options): string[]; /** * Give some source body 'src', return 'found' DetectiveResults */ find(src: string, opts?: Options): DetectiveResults; } interface Options { /** * specify a different function name instead of "require" */ word?: string | undefined; /** * when true, populate found.nodes */ nodes?: string | undefined; /** * a function returning whether an AST CallExpression node is a require call */ isRequire?: ((node: any) => boolean) | undefined; /** * supply options directly to acorn with some support for esprima-style options range and loc */ parse?: acorn.Options | undefined; /** * Indicates the ECMAScript version to parse. Must be either 3, 5, 6 (2015), * 7 (2016), 8 (2017), 9 (2018) or 10 (2019, partial support). This influences * support for strict mode, the set of reserved words, and support for new syntax features. * Default is 9. */ ecmaVersion?: string | number | undefined; /** * If false, using a reserved word will generate an error. Defaults to true for ecmaVersion 3, * false for higher versions. When given the value "never", reserved words and keywords can * also not be used as property names (as in Internet Explorer's old parser). */ allowReserved?: boolean | "never" | undefined; /** * By default, a return statement at the top level raises an error. Set this to true to accept such code. */ allowReturnOutsideFunction?: boolean | undefined; /** * By default, import and export declarations can only appear at a program's top level. * Setting this option to true allows them anywhere where a statement is allowed. */ allowImportExportEverywhere?: boolean | undefined; /** * When this is enabled (off by default), if the code starts with the * characters #! (as in a shellscript), the first line will be treated as a comment. */ allowHashBang?: boolean | undefined; /** * When true, each node has a loc object attached with start and end subobjects, each of which * contains the one-based line and zero-based column numbers in {line, column} form. Default is false. */ locations?: boolean | undefined; /** * Nodes have their start and end characters offsets recorded in start and end properties * (directly on the node, rather than the loc object, which holds line/column data. * To also add a semi-standardized range property holding a [start, end] array with * the same numbers, set the ranges option to true. */ ranges?: string | undefined; /** * Indicate the mode the code should be parsed in. Can be either "script" or "module". * This influences global strict mode and parsing of import and export declarations. */ sourceType?: ("script" | "module") | undefined; } interface DetectiveResults { /** * an array of each string found in a require() */ strings: string[]; /** * an array of each stringified expression found in a require() call */ expressions: string[]; /** * (when opts.nodes === true) - an array of AST nodes for each argument found in a require() call */ nodes?: any[] | undefined; } } declare var detective: detective.Detective; export = detective; detective/package.json000644 001751 000177 0000001501 14522265601016767 0ustar00runner000000 000000 1452231310214522265601{ "name": "@types/detective", "version": "5.1.5", "description": "TypeScript definitions for detective", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/detective", "license": "MIT", "contributors": [ { "name": "TeamworkGuy2", "githubUsername": "TeamworkGuy2", "url": "https://github.com/TeamworkGuy2" } ], "main": "", "types": "index.d.ts", "repository": { "type": "git", "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", "directory": "types/detective" }, "scripts": {}, "dependencies": { "acorn": "^7.0.0" }, "typesPublisherContentHash": "2824f07f95115516e1dc22eafd5f49b0d9ae2cc696d0753108c33374d5fcc757", "typeScriptVersion": "4.5" }