@types/is-expression
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

Installation

npm install --save @types/is-expression

Summary

This package contains type definitions for is-expression (https://github.com/pugjs/is-expression#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/is-expression.

index.d.ts

import acorn = require("acorn");

type Options = acorn.Options & {
    /**
     * Throw an error if the string is not an expression.
     * The error can be an Acorn error, with location information in `err.loc` and `err.pos`. Defaults to `false`.
     */
    throw: boolean;
    /**
     * Use strict mode when trying to parse the string. Defaults to `false`.
     * Even if this option is `false`, if you have provided `options.sourceType === 'module'`
     * which imples strict mode under ES2015, strict mode will be used.
     */
    strict: boolean;
    /**
     * When `true`, allows line comments in the expression. Defaults to `false` for safety.
     */
    lineComment: boolean;
};

/**
 * Validates a string as a JavaScript expression.
 */
declare function isExpression(src: string, options?: Partial<Options>): boolean;

export = isExpression;

Additional Details

  • Last updated: Fri, 01 Dec 2023 22:07:07 GMT
  • Dependencies: acorn

Credits

These definitions were written by Tristan F..

Readme

Keywords

none

Package Sidebar

Install

npm i @types/is-expression

Weekly Downloads

673

Version

4.0.0

License

MIT

Unpacked Size

4.35 kB

Total Files

5

Last publish

Collaborators

  • types