Repository: styled-components/polished Branch: main Commit: a567100687fe Files: 298 Total size: 6.4 MB Directory structure: gitextract_mb0rzq9c/ ├── .browserlistrc ├── .documentation.json ├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .flowconfig ├── .github/ │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ ├── feature_request.md │ │ └── question.md │ └── workflows/ │ ├── codeql-analysis.yml │ ├── main.yml │ └── report-coverage.yml ├── .gitignore ├── .husky/ │ ├── .gitignore │ ├── post-commit │ └── pre-commit ├── .npmignore ├── .prettierignore ├── .prettierrc ├── .yarn/ │ ├── build-state.yml │ └── releases/ │ └── yarn-1.22.5.cjs ├── .yarnrc ├── CNAME ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── babel.config.js ├── docs/ │ ├── CNAME │ ├── assets/ │ │ ├── anchor.js │ │ ├── bass-addons.css │ │ ├── bass.css │ │ ├── docs.js │ │ ├── fonts/ │ │ │ ├── LICENSE.txt │ │ │ ├── OTF/ │ │ │ │ ├── SourceCodePro-Bold.otf │ │ │ │ └── SourceCodePro-Regular.otf │ │ │ └── source-code-pro.css │ │ ├── github.css │ │ ├── highlight.pack.js │ │ ├── polished.js │ │ ├── script.js │ │ └── style.css │ ├── docs/ │ │ └── index.html │ └── index.html ├── docs-theme/ │ ├── assets/ │ │ ├── anchor.js │ │ ├── bass-addons.css │ │ ├── bass.css │ │ ├── docs.js │ │ ├── fonts/ │ │ │ ├── LICENSE.txt │ │ │ ├── OTF/ │ │ │ │ ├── SourceCodePro-Bold.otf │ │ │ │ └── SourceCodePro-Regular.otf │ │ │ └── source-code-pro.css │ │ ├── github.css │ │ ├── highlight.pack.js │ │ ├── script.js │ │ └── style.css │ ├── docs/ │ │ └── index._ │ ├── index._ │ ├── index.js │ └── partials/ │ ├── base._ │ ├── note._ │ ├── section._ │ └── section_list._ ├── flow-typed/ │ └── npm/ │ ├── @babel/ │ │ ├── cli_vx.x.x.js │ │ ├── core_vx.x.x.js │ │ ├── plugin-transform-runtime_vx.x.x.js │ │ ├── polyfill_v7.x.x.js │ │ ├── preset-env_vx.x.x.js │ │ ├── preset-flow_vx.x.x.js │ │ └── runtime_vx.x.x.js │ ├── babel-eslint_vx.x.x.js │ ├── babel-jest_vx.x.x.js │ ├── babel-loader_vx.x.x.js │ ├── babel-plugin-add-module-exports_vx.x.x.js │ ├── babel-plugin-annotate-pure-calls_vx.x.x.js │ ├── babel-plugin-preval_vx.x.x.js │ ├── concat-stream_vx.x.x.js │ ├── cross-env_vx.x.x.js │ ├── cz-conventional-changelog_vx.x.x.js │ ├── documentation_vx.x.x.js │ ├── eslint-config-airbnb-base_vx.x.x.js │ ├── eslint-plugin-import_vx.x.x.js │ ├── eslint_vx.x.x.js │ ├── flow-bin_v0.x.x.js │ ├── flow-copy-source_vx.x.x.js │ ├── flow-coverage-report_vx.x.x.js │ ├── husky_vx.x.x.js │ ├── jest_v24.x.x.js │ ├── lint-staged_vx.x.x.js │ ├── lodash_v4.x.x.js │ ├── npm-watch_vx.x.x.js │ ├── prettier_v1.x.x.js │ ├── pushstate-server_vx.x.x.js │ ├── ramda_v0.26.x.js │ ├── rollup-plugin-babel_vx.x.x.js │ ├── rollup-plugin-node-resolve_vx.x.x.js │ ├── rollup-plugin-replace_vx.x.x.js │ ├── rollup-plugin-uglify_vx.x.x.js │ ├── rollup_vx.x.x.js │ ├── semantic-release_vx.x.x.js │ ├── shx_vx.x.x.js │ ├── tsgen_vx.x.x.js │ ├── typescript_v3.3.x.js │ ├── validate-commit-msg_vx.x.x.js │ ├── vinyl-fs_vx.x.x.js │ └── vinyl_vx.x.x.js ├── package.json ├── rollup.config.js ├── src/ │ ├── color/ │ │ ├── adjustHue.js │ │ ├── complement.js │ │ ├── darken.js │ │ ├── desaturate.js │ │ ├── getContrast.js │ │ ├── getLuminance.js │ │ ├── grayscale.js │ │ ├── hsl.js │ │ ├── hslToColorString.js │ │ ├── hsla.js │ │ ├── invert.js │ │ ├── lighten.js │ │ ├── meetsContrastGuidelines.js │ │ ├── mix.js │ │ ├── opacify.js │ │ ├── parseToHsl.js │ │ ├── parseToRgb.js │ │ ├── readableColor.js │ │ ├── rgb.js │ │ ├── rgbToColorString.js │ │ ├── rgba.js │ │ ├── saturate.js │ │ ├── setHue.js │ │ ├── setLightness.js │ │ ├── setSaturation.js │ │ ├── shade.js │ │ ├── test/ │ │ │ ├── adjustHue.test.js │ │ │ ├── complement.test.js │ │ │ ├── darken.test.js │ │ │ ├── desaturate.test.js │ │ │ ├── getContrast.test.js │ │ │ ├── getLuminance.test.js │ │ │ ├── grayscale.test.js │ │ │ ├── hsl.test.js │ │ │ ├── hslToColorString.test.js │ │ │ ├── hsla.test.js │ │ │ ├── invert.test.js │ │ │ ├── lighten.test.js │ │ │ ├── meetsContrastGuidelines.test.js │ │ │ ├── mix.test.js │ │ │ ├── opacify.test.js │ │ │ ├── parseToHsl.test.js │ │ │ ├── parseToRgb.test.js │ │ │ ├── readableColor.test.js │ │ │ ├── rgb.test.js │ │ │ ├── rgbToColorString.test.js │ │ │ ├── rgba.test.js │ │ │ ├── saturate.test.js │ │ │ ├── setHue.test.js │ │ │ ├── setLightness.test.js │ │ │ ├── setSaturation.test.js │ │ │ ├── shade.test.js │ │ │ ├── tint.test.js │ │ │ ├── toColorString.test.js │ │ │ └── transparentize.test.js │ │ ├── tint.js │ │ ├── toColorString.js │ │ └── transparentize.js │ ├── easings/ │ │ ├── easeIn.js │ │ ├── easeInOut.js │ │ ├── easeOut.js │ │ └── test/ │ │ ├── easeIn.test.js │ │ ├── easeInOut.test.js │ │ └── easeOut.test.js │ ├── helpers/ │ │ ├── cssVar.js │ │ ├── directionalProperty.js │ │ ├── em.js │ │ ├── getValueAndUnit.js │ │ ├── important.js │ │ ├── modularScale.js │ │ ├── rem.js │ │ ├── remToPx.js │ │ ├── stripUnit.js │ │ └── test/ │ │ ├── cssVar.test.js │ │ ├── directionalProperty.test.js │ │ ├── em.test.js │ │ ├── getValueAndUnit.test.js │ │ ├── important.test.js │ │ ├── modularScale.test.js │ │ ├── rem.test.js │ │ ├── remToPx.test.js │ │ └── stripUnit.test.js │ ├── index.js │ ├── internalHelpers/ │ │ ├── _capitalizeString.js │ │ ├── _constructGradientValue.js │ │ ├── _curry.js │ │ ├── _endsWith.js │ │ ├── _errors.js │ │ ├── _guard.js │ │ ├── _hslToHex.js │ │ ├── _hslToRgb.js │ │ ├── _nameToHex.js │ │ ├── _numberToHex.js │ │ ├── _pxto.js │ │ ├── _reduceHexValue.js │ │ ├── _rgbToHsl.js │ │ ├── _statefulSelectors.js │ │ ├── errors.md │ │ └── test/ │ │ ├── _capitalizeString.test.js │ │ ├── _curry.test.js │ │ ├── _errors.test.js │ │ ├── _guard.test.js │ │ ├── _hslToHex.test.js │ │ ├── _hslToRgb.test.js │ │ ├── _nameToHex.test.js │ │ ├── _numberToHex.test.js │ │ ├── _pxto.test.js │ │ ├── _reduceHexValue.test.js │ │ ├── _rgbToHsl.test.js │ │ └── _statefulSelectors.test.js │ ├── math/ │ │ ├── math.js │ │ ├── presets/ │ │ │ ├── defaultSymbols.js │ │ │ └── exponentialSymbols.js │ │ └── test/ │ │ └── math.test.js │ ├── mixins/ │ │ ├── between.js │ │ ├── clearFix.js │ │ ├── cover.js │ │ ├── ellipsis.js │ │ ├── fluidRange.js │ │ ├── fontFace.js │ │ ├── hiDPI.js │ │ ├── hideText.js │ │ ├── hideVisually.js │ │ ├── linearGradient.js │ │ ├── normalize.js │ │ ├── radialGradient.js │ │ ├── retinaImage.js │ │ ├── test/ │ │ │ ├── between.test.js │ │ │ ├── clearFix.test.js │ │ │ ├── cover.test.js │ │ │ ├── ellipsis.test.js │ │ │ ├── fluidRange.test.js │ │ │ ├── fontFace.test.js │ │ │ ├── hiDPI.test.js │ │ │ ├── hideText.test.js │ │ │ ├── hideVisually.test.js │ │ │ ├── linearGradient.test.js │ │ │ ├── normalize.test.js │ │ │ ├── radialGradient.test.js │ │ │ ├── retinaImage.test.js │ │ │ ├── timingFunctions.test.js │ │ │ ├── triangle.test.js │ │ │ └── wordWrap.test.js │ │ ├── timingFunctions.js │ │ ├── triangle.js │ │ └── wordWrap.js │ ├── shorthands/ │ │ ├── animation.js │ │ ├── backgroundImages.js │ │ ├── backgrounds.js │ │ ├── border.js │ │ ├── borderColor.js │ │ ├── borderRadius.js │ │ ├── borderStyle.js │ │ ├── borderWidth.js │ │ ├── buttons.js │ │ ├── margin.js │ │ ├── padding.js │ │ ├── position.js │ │ ├── size.js │ │ ├── test/ │ │ │ ├── animation.test.js │ │ │ ├── backgroundImages.test.js │ │ │ ├── backgrounds.test.js │ │ │ ├── border.test.js │ │ │ ├── borderColor.test.js │ │ │ ├── borderRadius.test.js │ │ │ ├── borderStyle.test.js │ │ │ ├── borderWidth.test.js │ │ │ ├── buttons.test.js │ │ │ ├── margin.test.js │ │ │ ├── padding.test.js │ │ │ ├── position.test.js │ │ │ ├── size.test.js │ │ │ ├── textInputs.test.js │ │ │ └── transitions.test.js │ │ ├── textInputs.js │ │ └── transitions.js │ └── types/ │ ├── color.js │ ├── fluidRangeConfiguration.js │ ├── fontFaceConfiguration.js │ ├── interactionState.js │ ├── linearGradientConfiguration.js │ ├── modularScaleRatio.js │ ├── radialGradientConfiguration.js │ ├── sideKeyword.js │ ├── style.js │ ├── timingFunction.js │ └── triangleConfiguration.js └── typescript-test.ts ================================================ FILE CONTENTS ================================================ ================================================ FILE: .browserlistrc ================================================ ie >= 11 last 1 Edge version last 1 Firefox version last 1 Chrome version last 1 Safari version last 1 iOS version last 1 Android version last 1 ChromeAndroid version ================================================ FILE: .documentation.json ================================================ { "hljs": { "highlightAuto": true }, "inferPrivate": "^_", "toc": [ { "name": "Installation", "description": "
npm install --save polished
", "markdown": false }, { "name": "Usage", "description": "
import { lighten, modularScale } from 'polished'
", "markdown": false }, { "name": "Mixins" }, "between", "clearFix", "cover", "ellipsis", "fluidRange", "fontFace", "hideText", "hideVisually", "hiDPI", "linearGradient", "normalize", "radialGradient", "retinaImage", "timingFunctions", "triangle", "wordWrap", { "name": "Color" }, "adjustHue", "complement", "darken", "desaturate", "getContrast", "getLuminance", "grayscale", "hsl", "hsla", "hslToColorString", "invert", "lighten", "meetsContrastGuidelines", "mix", "opacify", "parseToHsl", "parseToRgb", "readableColor", "rgb", "rgba", "rgbToColorString", "saturate", "setHue", "setLightness", "setSaturation", "shade", "tint", "toColorString", "transparentize", { "name": "Math" }, "math", { "name": "Shorthands" }, "animation", "backgroundImages", "backgrounds", "border", "borderColor", "borderRadius", "borderStyle", "borderWidth", "buttons", "margin", "padding", "position", "size", "textInputs", "transitions", { "name": "Helpers" }, "cssVar", "directionalProperty", "em", "getValueAndUnit", "important", "modularScale", "rem", "remToPx", "stripUnit", { "name": "Easings" }, "easeIn", "easeInOut", "easeOut", { "name": "Types" }, "FluidRangeConfiguration", "FontFaceConfiguration", "HslColor", "HslaColor", "InteractionState", "ModularScaleRatio", "RadialGradientConfiguration", "RgbaColor", "RgbColor", "SideKeyword", "Styles", "TriangleConfiguration" ] } ================================================ FILE: .editorconfig ================================================ root = true [*] end_of_line = lf indent_style = space indent_size = 2 insert_final_newline = true trim_trailing_whitespace = true ================================================ FILE: .eslintignore ================================================ ================================================ FILE: .eslintrc ================================================ { "extends": "airbnb-base", "parser": "@babel/eslint-parser", "parserOptions": { "ecmaVersion": 7, "sourceType": "module", "ecmaFeatures": { "impliedStrict": true, "experimentalObjectRestSpread": true } }, "env": { "jest": true, }, "rules": { "arrow-parens": 0, "class-methods-use-this": 0, "default-param-last": 0, "import/no-extraneous-dependencies": 0, "linebreak-style": 0, "no-confusing-arrow": 0, "no-dupe-keys": 0, "no-duplicate-imports": 0, "no-else-return": 0, "no-mixed-operators": 0, "no-prototype-builtins": 0, "no-restricted-globals": 0, "no-restricted-syntax": ["error", "LabeledStatement", "WithStatement"], "no-unused-vars": [2, { "varsIgnorePattern": "^_+$" }], "quote-props": 0, "semi": [2, "never"], "space-before-function-paren": 0, "symbol-description": 0, "valid-jsdoc": 0, "max-len": 0 } } ================================================ FILE: .flowconfig ================================================ [ignore] .*/node_modules/.* .*/lib/.* [include] [libs] [options] ================================================ FILE: .github/FUNDING.yml ================================================ # These are supported funding model platforms github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: # Replace with a single Patreon username open_collective: polished ko_fi: # Replace with a single Ko-fi username tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: Bug Report 🐞 about: Something isn't working as expected? Submit a bug report here. labels: "type: unconfirmed bug" --- - `polished` version: - `JSS-in_CSS` library and version: - Any relevant JS library and version: ## Mixin/Helper/Shorthand Usage ```javascript ``` ## What You Are Seeing ## What You Expected To See ## Reproduction ================================================ FILE: .github/ISSUE_TEMPLATE/feature_request.md ================================================ --- name: Feature Request 💡 about: Suggest a new idea for the library. labels: "type: enhancement" --- ## Summary ## Basic Example ```javascript ``` ## Reasoning ================================================ FILE: .github/ISSUE_TEMPLATE/question.md ================================================ --- name: Question ❓ about: Question about usage of the library. labels: "type: question" --- ## Question ## Relevant Information ================================================ FILE: .github/workflows/codeql-analysis.yml ================================================ name: "CodeQL" on: push: branches: [main] pull_request: # The branches below must be a subset of the branches above branches: [main] schedule: - cron: '0 3 * * 2' jobs: analyze: name: Analyze runs-on: ubuntu-latest strategy: fail-fast: false matrix: # Override automatic language detection by changing the below list # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] language: ['javascript'] # Learn more... # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection steps: - name: Checkout repository uses: actions/checkout@v2 with: # We must fetch at least the immediate parents so that if this is # a pull request then we can checkout the head. fetch-depth: 2 # If this run was triggered by a pull request event, then checkout # the head of the pull request instead of the merge commit. - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: languages: ${{ matrix.language }} # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild uses: github/codeql-action/autobuild@v1 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines # and modify them (or add more) to build your code if your project # uses a compiled language #- run: | # make bootstrap # make release - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 ================================================ FILE: .github/workflows/main.yml ================================================ name: Node CI Test on: push: branches: - "main" pull_request: types: [opened, synchronize, reopened] jobs: build-test: strategy: matrix: node-version: [14.x, 16.x, 17.x] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - name: Install Yarn run: npm install -g yarn - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - uses: actions/cache@v2 id: yarn-cache with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - name: Install Dependencies run: yarn install --ignore-scripts --frozen-lockfile - name: Run Jest Tests run: yarn test - name: Lint Files run: yarn lint - name: Build and Check Types run: | yarn flow yarn build:flow ================================================ FILE: .github/workflows/report-coverage.yml ================================================ name: Node CI Coverage on: push: branches: - "main" pull_request: types: [opened, synchronize, reopened] jobs: report-coverage: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Use Node.js 14.x uses: actions/setup-node@v1 with: node-version: 14.x - name: Install Yarn run: npm install -g yarn - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - uses: actions/cache@v2 id: yarn-cache with: path: ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - name: Install Dependencies run: yarn install --ignore-scripts --frozen-lockfile - name: Run Jest Tests run: yarn test - name: Report Code Coverage uses: codecov/codecov-action@v1 with: flags: unittests fail_ci_if_error: true ================================================ FILE: .gitignore ================================================ node_modules lib coverage npm-debug.log dist .vscode .DS_Store yarn-error.log ================================================ FILE: .husky/.gitignore ================================================ _ ================================================ FILE: .husky/post-commit ================================================ #!/bin/sh . "$(dirname "$0")/_/husky.sh" validate-commit-msg ================================================ FILE: .husky/pre-commit ================================================ #!/bin/sh . "$(dirname "$0")/_/husky.sh" lint-staged --debug ================================================ FILE: .npmignore ================================================ # config files .babelrc .babelrc.js .documentation.json .editorconfig .eslintignore .eslintrc .flowconfig .github .gitignore .npmignore .travis.yml .browserlistrc .prettierignore .prettierrc .vscode babel.config.js CODEOWNERS # folders coverage docs-theme src test flow-typed # markdown files CONTRIBUTING.md CODE_OF_CONDUCT.md # misc. CNAME rollup.config.js travis_after_all.py yarn.lock .yarn typescript-test.ts ================================================ FILE: .prettierignore ================================================ # Ignore artifacts: *.yml dist flow-typed ================================================ FILE: .prettierrc ================================================ { "arrowParens": "avoid", "printWidth": 100, "jsxBracketSameLine": false, "semi": false, "singleQuote": true, "tabWidth": 2, "trailingComma": "all" } ================================================ FILE: .yarn/build-state.yml ================================================ # Warning: This file is automatically generated. Removing it is fine, but will # cause all your builds to become invalidated. # core-js@npm:2.6.11 "15178ded27ab674ae2054269453d809bdb1d00b98392a34947b5d43ea7a5811e5674c2fda7d48bb653b24a3506b0a8aa126bbac861bdeba93438ec6c7efb2d9d": db736dc4074e342691ef9817883333341256536f991f66d9509013388d3fc65bdbc8bfd6cf60ba237fe0f94d7915b02a2e398309a3f8fa1fcf3f1ef25cfe2b1b # fsevents@patch:fsevents@npm%3A1.2.13#builtin::version=1.2.13&hash=87eb42 "2564bef5e1d1616dab22376e4afe7b73b2ac5539ceaea41ddb8f35c766bb8b831bf4861d53d6d930a3a5108b4d6919b585eabfd7dbce49eef2eb0f74602be02e": 07711048af01204c0b06c7c9eaf38dcd195bfa25c74729a86ef99a133353c43a8d339271fb206001595bc6a6301eccff01f3448d27afd2e4a3c646eb231b15ba # husky@npm:4.3.0 "b6c2d49d0eb0ccd03cd8d5c01a23823972e91724d5313135fb55c2090a54e63449ce42dc64f102e84407ec8464d7ed38e2521f28cf82d313cbe7425fc5f1bffc": d513fcedb6f5fcb0f4eb96b6e9548affedacadccb2a93924b6fee22394d1fad39ea544b1c9e11cfbfb0e56d283877d29419f5cc2ca45ee0aea36b6c8ef175257 # nodemon@npm:2.0.4 "6cfc557b1b3ed98544cad13ffd74462797496fe01d0dd9649602e1c1359d7df7fba294f2ac2939dc40ca1a1f18a3b7641601422c7b242c5785fec1a2e013a42b": f4851e4132f5b7e52f8d2b20f1fcfff59132390d4ea58c2187c135e4ac5422f9e0452e68d5e2183d0a57a9f4e4f4aa5a769506ba205102a7ed394c089e0d045f ================================================ FILE: .yarn/releases/yarn-1.22.5.cjs ================================================ #!/usr/bin/env node module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // identity function for calling harmony imports with the correct context /******/ __webpack_require__.i = function(value) { return value; }; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 549); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { module.exports = require("path"); /***/ }), /* 1 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = __extends; /* unused harmony export __assign */ /* unused harmony export __rest */ /* unused harmony export __decorate */ /* unused harmony export __param */ /* unused harmony export __metadata */ /* unused harmony export __awaiter */ /* unused harmony export __generator */ /* unused harmony export __exportStar */ /* unused harmony export __values */ /* unused harmony export __read */ /* unused harmony export __spread */ /* unused harmony export __await */ /* unused harmony export __asyncGenerator */ /* unused harmony export __asyncDelegator */ /* unused harmony export __asyncValues */ /* unused harmony export __makeTemplateObject */ /* unused harmony export __importStar */ /* unused harmony export __importDefault */ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]]; return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } function __exportStar(m, exports) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } function __values(o) { var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; if (m) return m.call(o); return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; result.default = mod; return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _promise = __webpack_require__(227); var _promise2 = _interopRequireDefault(_promise); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = function (fn) { return function () { var gen = fn.apply(this, arguments); return new _promise2.default(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return _promise2.default.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }; /***/ }), /* 3 */ /***/ (function(module, exports) { module.exports = require("util"); /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getFirstSuitableFolder = exports.readFirstAvailableStream = exports.makeTempDir = exports.hardlinksWork = exports.writeFilePreservingEol = exports.getFileSizeOnDisk = exports.walk = exports.symlink = exports.find = exports.readJsonAndFile = exports.readJson = exports.readFileAny = exports.hardlinkBulk = exports.copyBulk = exports.unlink = exports.glob = exports.link = exports.chmod = exports.lstat = exports.exists = exports.mkdirp = exports.stat = exports.access = exports.rename = exports.readdir = exports.realpath = exports.readlink = exports.writeFile = exports.open = exports.readFileBuffer = exports.lockQueue = exports.constants = undefined; var _asyncToGenerator2; function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } let buildActionsForCopy = (() => { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { // let build = (() => { var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { const src = data.src, dest = data.dest, type = data.type; const onFresh = data.onFresh || noop; const onDone = data.onDone || noop; // TODO https://github.com/yarnpkg/yarn/issues/3751 // related to bundled dependencies handling if (files.has(dest.toLowerCase())) { reporter.verbose(`The case-insensitive file ${dest} shouldn't be copied twice in one bulk copy`); } else { files.add(dest.toLowerCase()); } if (type === 'symlink') { yield mkdirp((_path || _load_path()).default.dirname(dest)); onFresh(); actions.symlink.push({ dest, linkname: src }); onDone(); return; } if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) { // ignored file return; } const srcStat = yield lstat(src); let srcFiles; if (srcStat.isDirectory()) { srcFiles = yield readdir(src); } let destStat; try { // try accessing the destination destStat = yield lstat(dest); } catch (e) { // proceed if destination doesn't exist, otherwise error if (e.code !== 'ENOENT') { throw e; } } // if destination exists if (destStat) { const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); const bothFolders = srcStat.isDirectory() && destStat.isDirectory(); const bothFiles = srcStat.isFile() && destStat.isFile(); // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving // us modes that aren't valid. investigate this, it's generally safe to proceed. /* if (srcStat.mode !== destStat.mode) { try { await access(dest, srcStat.mode); } catch (err) {} } */ if (bothFiles && artifactFiles.has(dest)) { // this file gets changed during build, likely by a custom install script. Don't bother checking it. onDone(); reporter.verbose(reporter.lang('verboseFileSkipArtifact', src)); return; } if (bothFiles && srcStat.size === destStat.size && (0, (_fsNormalized || _load_fsNormalized()).fileDatesEqual)(srcStat.mtime, destStat.mtime)) { // we can safely assume this is the same file onDone(); reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.size, +srcStat.mtime)); return; } if (bothSymlinks) { const srcReallink = yield readlink(src); if (srcReallink === (yield readlink(dest))) { // if both symlinks are the same then we can continue on onDone(); reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink)); return; } } if (bothFolders) { // mark files that aren't in this folder as possibly extraneous const destFiles = yield readdir(dest); invariant(srcFiles, 'src files not initialised'); for (var _iterator4 = destFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { var _ref6; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref6 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref6 = _i4.value; } const file = _ref6; if (srcFiles.indexOf(file) < 0) { const loc = (_path || _load_path()).default.join(dest, file); possibleExtraneous.add(loc); if ((yield lstat(loc)).isDirectory()) { for (var _iterator5 = yield readdir(loc), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { var _ref7; if (_isArray5) { if (_i5 >= _iterator5.length) break; _ref7 = _iterator5[_i5++]; } else { _i5 = _iterator5.next(); if (_i5.done) break; _ref7 = _i5.value; } const file = _ref7; possibleExtraneous.add((_path || _load_path()).default.join(loc, file)); } } } } } } if (destStat && destStat.isSymbolicLink()) { yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); destStat = null; } if (srcStat.isSymbolicLink()) { onFresh(); const linkname = yield readlink(src); actions.symlink.push({ dest, linkname }); onDone(); } else if (srcStat.isDirectory()) { if (!destStat) { reporter.verbose(reporter.lang('verboseFileFolder', dest)); yield mkdirp(dest); } const destParts = dest.split((_path || _load_path()).default.sep); while (destParts.length) { files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); destParts.pop(); } // push all files to queue invariant(srcFiles, 'src files not initialised'); let remaining = srcFiles.length; if (!remaining) { onDone(); } for (var _iterator6 = srcFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { var _ref8; if (_isArray6) { if (_i6 >= _iterator6.length) break; _ref8 = _iterator6[_i6++]; } else { _i6 = _iterator6.next(); if (_i6.done) break; _ref8 = _i6.value; } const file = _ref8; queue.push({ dest: (_path || _load_path()).default.join(dest, file), onFresh, onDone: function (_onDone) { function onDone() { return _onDone.apply(this, arguments); } onDone.toString = function () { return _onDone.toString(); }; return onDone; }(function () { if (--remaining === 0) { onDone(); } }), src: (_path || _load_path()).default.join(src, file) }); } } else if (srcStat.isFile()) { onFresh(); actions.file.push({ src, dest, atime: srcStat.atime, mtime: srcStat.mtime, mode: srcStat.mode }); onDone(); } else { throw new Error(`unsure how to copy this: ${src}`); } }); return function build(_x5) { return _ref5.apply(this, arguments); }; })(); const artifactFiles = new Set(events.artifactFiles || []); const files = new Set(); // initialise events for (var _iterator = queue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref2; if (_isArray) { if (_i >= _iterator.length) break; _ref2 = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref2 = _i.value; } const item = _ref2; const onDone = item.onDone; item.onDone = function () { events.onProgress(item.dest); if (onDone) { onDone(); } }; } events.onStart(queue.length); // start building actions const actions = { file: [], symlink: [], link: [] }; // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items // at a time due to the requirement to push items onto the queue while (queue.length) { const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); yield Promise.all(items.map(build)); } // simulate the existence of some files to prevent considering them extraneous for (var _iterator2 = artifactFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { var _ref3; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref3 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref3 = _i2.value; } const file = _ref3; if (possibleExtraneous.has(file)) { reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file)); possibleExtraneous.delete(file); } } for (var _iterator3 = possibleExtraneous, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { var _ref4; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref4 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref4 = _i3.value; } const loc = _ref4; if (files.has(loc.toLowerCase())) { possibleExtraneous.delete(loc); } } return actions; }); return function buildActionsForCopy(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); }; })(); let buildActionsForHardlink = (() => { var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) { // let build = (() => { var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { const src = data.src, dest = data.dest; const onFresh = data.onFresh || noop; const onDone = data.onDone || noop; if (files.has(dest.toLowerCase())) { // Fixes issue https://github.com/yarnpkg/yarn/issues/2734 // When bulk hardlinking we have A -> B structure that we want to hardlink to A1 -> B1, // package-linker passes that modules A1 and B1 need to be hardlinked, // the recursive linking algorithm of A1 ends up scheduling files in B1 to be linked twice which will case // an exception. onDone(); return; } files.add(dest.toLowerCase()); if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) { // ignored file return; } const srcStat = yield lstat(src); let srcFiles; if (srcStat.isDirectory()) { srcFiles = yield readdir(src); } const destExists = yield exists(dest); if (destExists) { const destStat = yield lstat(dest); const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink(); const bothFolders = srcStat.isDirectory() && destStat.isDirectory(); const bothFiles = srcStat.isFile() && destStat.isFile(); if (srcStat.mode !== destStat.mode) { try { yield access(dest, srcStat.mode); } catch (err) { // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving // us modes that aren't valid. investigate this, it's generally safe to proceed. reporter.verbose(err); } } if (bothFiles && artifactFiles.has(dest)) { // this file gets changed during build, likely by a custom install script. Don't bother checking it. onDone(); reporter.verbose(reporter.lang('verboseFileSkipArtifact', src)); return; } // correct hardlink if (bothFiles && srcStat.ino !== null && srcStat.ino === destStat.ino) { onDone(); reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.ino)); return; } if (bothSymlinks) { const srcReallink = yield readlink(src); if (srcReallink === (yield readlink(dest))) { // if both symlinks are the same then we can continue on onDone(); reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink)); return; } } if (bothFolders) { // mark files that aren't in this folder as possibly extraneous const destFiles = yield readdir(dest); invariant(srcFiles, 'src files not initialised'); for (var _iterator10 = destFiles, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { var _ref14; if (_isArray10) { if (_i10 >= _iterator10.length) break; _ref14 = _iterator10[_i10++]; } else { _i10 = _iterator10.next(); if (_i10.done) break; _ref14 = _i10.value; } const file = _ref14; if (srcFiles.indexOf(file) < 0) { const loc = (_path || _load_path()).default.join(dest, file); possibleExtraneous.add(loc); if ((yield lstat(loc)).isDirectory()) { for (var _iterator11 = yield readdir(loc), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) { var _ref15; if (_isArray11) { if (_i11 >= _iterator11.length) break; _ref15 = _iterator11[_i11++]; } else { _i11 = _iterator11.next(); if (_i11.done) break; _ref15 = _i11.value; } const file = _ref15; possibleExtraneous.add((_path || _load_path()).default.join(loc, file)); } } } } } } if (srcStat.isSymbolicLink()) { onFresh(); const linkname = yield readlink(src); actions.symlink.push({ dest, linkname }); onDone(); } else if (srcStat.isDirectory()) { reporter.verbose(reporter.lang('verboseFileFolder', dest)); yield mkdirp(dest); const destParts = dest.split((_path || _load_path()).default.sep); while (destParts.length) { files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase()); destParts.pop(); } // push all files to queue invariant(srcFiles, 'src files not initialised'); let remaining = srcFiles.length; if (!remaining) { onDone(); } for (var _iterator12 = srcFiles, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) { var _ref16; if (_isArray12) { if (_i12 >= _iterator12.length) break; _ref16 = _iterator12[_i12++]; } else { _i12 = _iterator12.next(); if (_i12.done) break; _ref16 = _i12.value; } const file = _ref16; queue.push({ onFresh, src: (_path || _load_path()).default.join(src, file), dest: (_path || _load_path()).default.join(dest, file), onDone: function (_onDone2) { function onDone() { return _onDone2.apply(this, arguments); } onDone.toString = function () { return _onDone2.toString(); }; return onDone; }(function () { if (--remaining === 0) { onDone(); } }) }); } } else if (srcStat.isFile()) { onFresh(); actions.link.push({ src, dest, removeDest: destExists }); onDone(); } else { throw new Error(`unsure how to copy this: ${src}`); } }); return function build(_x10) { return _ref13.apply(this, arguments); }; })(); const artifactFiles = new Set(events.artifactFiles || []); const files = new Set(); // initialise events for (var _iterator7 = queue, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { var _ref10; if (_isArray7) { if (_i7 >= _iterator7.length) break; _ref10 = _iterator7[_i7++]; } else { _i7 = _iterator7.next(); if (_i7.done) break; _ref10 = _i7.value; } const item = _ref10; const onDone = item.onDone || noop; item.onDone = function () { events.onProgress(item.dest); onDone(); }; } events.onStart(queue.length); // start building actions const actions = { file: [], symlink: [], link: [] }; // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items // at a time due to the requirement to push items onto the queue while (queue.length) { const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS); yield Promise.all(items.map(build)); } // simulate the existence of some files to prevent considering them extraneous for (var _iterator8 = artifactFiles, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { var _ref11; if (_isArray8) { if (_i8 >= _iterator8.length) break; _ref11 = _iterator8[_i8++]; } else { _i8 = _iterator8.next(); if (_i8.done) break; _ref11 = _i8.value; } const file = _ref11; if (possibleExtraneous.has(file)) { reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file)); possibleExtraneous.delete(file); } } for (var _iterator9 = possibleExtraneous, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { var _ref12; if (_isArray9) { if (_i9 >= _iterator9.length) break; _ref12 = _iterator9[_i9++]; } else { _i9 = _iterator9.next(); if (_i9.done) break; _ref12 = _i9.value; } const loc = _ref12; if (files.has(loc.toLowerCase())) { possibleExtraneous.delete(loc); } } return actions; }); return function buildActionsForHardlink(_x6, _x7, _x8, _x9) { return _ref9.apply(this, arguments); }; })(); let copyBulk = exports.copyBulk = (() => { var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { const events = { onStart: _events && _events.onStart || noop, onProgress: _events && _events.onProgress || noop, possibleExtraneous: _events ? _events.possibleExtraneous : new Set(), ignoreBasenames: _events && _events.ignoreBasenames || [], artifactFiles: _events && _events.artifactFiles || [] }; const actions = yield buildActionsForCopy(queue, events, events.possibleExtraneous, reporter); events.onStart(actions.file.length + actions.symlink.length + actions.link.length); const fileActions = actions.file; const currentlyWriting = new Map(); yield (_promise || _load_promise()).queue(fileActions, (() => { var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { let writePromise; while (writePromise = currentlyWriting.get(data.dest)) { yield writePromise; } reporter.verbose(reporter.lang('verboseFileCopy', data.src, data.dest)); const copier = (0, (_fsNormalized || _load_fsNormalized()).copyFile)(data, function () { return currentlyWriting.delete(data.dest); }); currentlyWriting.set(data.dest, copier); events.onProgress(data.dest); return copier; }); return function (_x14) { return _ref18.apply(this, arguments); }; })(), CONCURRENT_QUEUE_ITEMS); // we need to copy symlinks last as they could reference files we were copying const symlinkActions = actions.symlink; yield (_promise || _load_promise()).queue(symlinkActions, function (data) { const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname)); return symlink(linkname, data.dest); }); }); return function copyBulk(_x11, _x12, _x13) { return _ref17.apply(this, arguments); }; })(); let hardlinkBulk = exports.hardlinkBulk = (() => { var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) { const events = { onStart: _events && _events.onStart || noop, onProgress: _events && _events.onProgress || noop, possibleExtraneous: _events ? _events.possibleExtraneous : new Set(), artifactFiles: _events && _events.artifactFiles || [], ignoreBasenames: [] }; const actions = yield buildActionsForHardlink(queue, events, events.possibleExtraneous, reporter); events.onStart(actions.file.length + actions.symlink.length + actions.link.length); const fileActions = actions.link; yield (_promise || _load_promise()).queue(fileActions, (() => { var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) { reporter.verbose(reporter.lang('verboseFileLink', data.src, data.dest)); if (data.removeDest) { yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(data.dest); } yield link(data.src, data.dest); }); return function (_x18) { return _ref20.apply(this, arguments); }; })(), CONCURRENT_QUEUE_ITEMS); // we need to copy symlinks last as they could reference files we were copying const symlinkActions = actions.symlink; yield (_promise || _load_promise()).queue(symlinkActions, function (data) { const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname); reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname)); return symlink(linkname, data.dest); }); }); return function hardlinkBulk(_x15, _x16, _x17) { return _ref19.apply(this, arguments); }; })(); let readFileAny = exports.readFileAny = (() => { var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (files) { for (var _iterator13 = files, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) { var _ref22; if (_isArray13) { if (_i13 >= _iterator13.length) break; _ref22 = _iterator13[_i13++]; } else { _i13 = _iterator13.next(); if (_i13.done) break; _ref22 = _i13.value; } const file = _ref22; if (yield exists(file)) { return readFile(file); } } return null; }); return function readFileAny(_x19) { return _ref21.apply(this, arguments); }; })(); let readJson = exports.readJson = (() => { var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { return (yield readJsonAndFile(loc)).object; }); return function readJson(_x20) { return _ref23.apply(this, arguments); }; })(); let readJsonAndFile = exports.readJsonAndFile = (() => { var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { const file = yield readFile(loc); try { return { object: (0, (_map || _load_map()).default)(JSON.parse(stripBOM(file))), content: file }; } catch (err) { err.message = `${loc}: ${err.message}`; throw err; } }); return function readJsonAndFile(_x21) { return _ref24.apply(this, arguments); }; })(); let find = exports.find = (() => { var _ref25 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, dir) { const parts = dir.split((_path || _load_path()).default.sep); while (parts.length) { const loc = parts.concat(filename).join((_path || _load_path()).default.sep); if (yield exists(loc)) { return loc; } else { parts.pop(); } } return false; }); return function find(_x22, _x23) { return _ref25.apply(this, arguments); }; })(); let symlink = exports.symlink = (() => { var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) { if (process.platform !== 'win32') { // use relative paths otherwise which will be retained if the directory is moved src = (_path || _load_path()).default.relative((_path || _load_path()).default.dirname(dest), src); // When path.relative returns an empty string for the current directory, we should instead use // '.', which is a valid fs.symlink target. src = src || '.'; } try { const stats = yield lstat(dest); if (stats.isSymbolicLink()) { const resolved = dest; if (resolved === src) { return; } } } catch (err) { if (err.code !== 'ENOENT') { throw err; } } // We use rimraf for unlink which never throws an ENOENT on missing target yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest); if (process.platform === 'win32') { // use directory junctions if possible on win32, this requires absolute paths yield fsSymlink(src, dest, 'junction'); } else { yield fsSymlink(src, dest); } }); return function symlink(_x24, _x25) { return _ref26.apply(this, arguments); }; })(); let walk = exports.walk = (() => { var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir, ignoreBasenames = new Set()) { let files = []; let filenames = yield readdir(dir); if (ignoreBasenames.size) { filenames = filenames.filter(function (name) { return !ignoreBasenames.has(name); }); } for (var _iterator14 = filenames, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) { var _ref28; if (_isArray14) { if (_i14 >= _iterator14.length) break; _ref28 = _iterator14[_i14++]; } else { _i14 = _iterator14.next(); if (_i14.done) break; _ref28 = _i14.value; } const name = _ref28; const relative = relativeDir ? (_path || _load_path()).default.join(relativeDir, name) : name; const loc = (_path || _load_path()).default.join(dir, name); const stat = yield lstat(loc); files.push({ relative, basename: name, absolute: loc, mtime: +stat.mtime }); if (stat.isDirectory()) { files = files.concat((yield walk(loc, relative, ignoreBasenames))); } } return files; }); return function walk(_x26, _x27) { return _ref27.apply(this, arguments); }; })(); let getFileSizeOnDisk = exports.getFileSizeOnDisk = (() => { var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) { const stat = yield lstat(loc); const size = stat.size, blockSize = stat.blksize; return Math.ceil(size / blockSize) * blockSize; }); return function getFileSizeOnDisk(_x28) { return _ref29.apply(this, arguments); }; })(); let getEolFromFile = (() => { var _ref30 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path) { if (!(yield exists(path))) { return undefined; } const buffer = yield readFileBuffer(path); for (let i = 0; i < buffer.length; ++i) { if (buffer[i] === cr) { return '\r\n'; } if (buffer[i] === lf) { return '\n'; } } return undefined; }); return function getEolFromFile(_x29) { return _ref30.apply(this, arguments); }; })(); let writeFilePreservingEol = exports.writeFilePreservingEol = (() => { var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path, data) { const eol = (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL; if (eol !== '\n') { data = data.replace(/\n/g, eol); } yield writeFile(path, data); }); return function writeFilePreservingEol(_x30, _x31) { return _ref31.apply(this, arguments); }; })(); let hardlinksWork = exports.hardlinksWork = (() => { var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) { const filename = 'test-file' + Math.random(); const file = (_path || _load_path()).default.join(dir, filename); const fileLink = (_path || _load_path()).default.join(dir, filename + '-link'); try { yield writeFile(file, 'test'); yield link(file, fileLink); } catch (err) { return false; } finally { yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(file); yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(fileLink); } return true; }); return function hardlinksWork(_x32) { return _ref32.apply(this, arguments); }; })(); // not a strict polyfill for Node's fs.mkdtemp let makeTempDir = exports.makeTempDir = (() => { var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (prefix) { const dir = (_path || _load_path()).default.join((_os || _load_os()).default.tmpdir(), `yarn-${prefix || ''}-${Date.now()}-${Math.random()}`); yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dir); yield mkdirp(dir); return dir; }); return function makeTempDir(_x33) { return _ref33.apply(this, arguments); }; })(); let readFirstAvailableStream = exports.readFirstAvailableStream = (() => { var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) { for (var _iterator15 = paths, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) { var _ref35; if (_isArray15) { if (_i15 >= _iterator15.length) break; _ref35 = _iterator15[_i15++]; } else { _i15 = _iterator15.next(); if (_i15.done) break; _ref35 = _i15.value; } const path = _ref35; try { const fd = yield open(path, 'r'); return (_fs || _load_fs()).default.createReadStream(path, { fd }); } catch (err) { // Try the next one } } return null; }); return function readFirstAvailableStream(_x34) { return _ref34.apply(this, arguments); }; })(); let getFirstSuitableFolder = exports.getFirstSuitableFolder = (() => { var _ref36 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths, mode = constants.W_OK | constants.X_OK) { const result = { skipped: [], folder: null }; for (var _iterator16 = paths, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator]();;) { var _ref37; if (_isArray16) { if (_i16 >= _iterator16.length) break; _ref37 = _iterator16[_i16++]; } else { _i16 = _iterator16.next(); if (_i16.done) break; _ref37 = _i16.value; } const folder = _ref37; try { yield mkdirp(folder); yield access(folder, mode); result.folder = folder; return result; } catch (error) { result.skipped.push({ error, folder }); } } return result; }); return function getFirstSuitableFolder(_x35) { return _ref36.apply(this, arguments); }; })(); exports.copy = copy; exports.readFile = readFile; exports.readFileRaw = readFileRaw; exports.normalizeOS = normalizeOS; var _fs; function _load_fs() { return _fs = _interopRequireDefault(__webpack_require__(5)); } var _glob; function _load_glob() { return _glob = _interopRequireDefault(__webpack_require__(99)); } var _os; function _load_os() { return _os = _interopRequireDefault(__webpack_require__(46)); } var _path; function _load_path() { return _path = _interopRequireDefault(__webpack_require__(0)); } var _blockingQueue; function _load_blockingQueue() { return _blockingQueue = _interopRequireDefault(__webpack_require__(110)); } var _promise; function _load_promise() { return _promise = _interopRequireWildcard(__webpack_require__(50)); } var _promise2; function _load_promise2() { return _promise2 = __webpack_require__(50); } var _map; function _load_map() { return _map = _interopRequireDefault(__webpack_require__(29)); } var _fsNormalized; function _load_fsNormalized() { return _fsNormalized = __webpack_require__(218); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const constants = exports.constants = typeof (_fs || _load_fs()).default.constants !== 'undefined' ? (_fs || _load_fs()).default.constants : { R_OK: (_fs || _load_fs()).default.R_OK, W_OK: (_fs || _load_fs()).default.W_OK, X_OK: (_fs || _load_fs()).default.X_OK }; const lockQueue = exports.lockQueue = new (_blockingQueue || _load_blockingQueue()).default('fs lock'); const readFileBuffer = exports.readFileBuffer = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readFile); const open = exports.open = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.open); const writeFile = exports.writeFile = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.writeFile); const readlink = exports.readlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readlink); const realpath = exports.realpath = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.realpath); const readdir = exports.readdir = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readdir); const rename = exports.rename = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.rename); const access = exports.access = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.access); const stat = exports.stat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.stat); const mkdirp = exports.mkdirp = (0, (_promise2 || _load_promise2()).promisify)(__webpack_require__(145)); const exists = exports.exists = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.exists, true); const lstat = exports.lstat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.lstat); const chmod = exports.chmod = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.chmod); const link = exports.link = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.link); const glob = exports.glob = (0, (_promise2 || _load_promise2()).promisify)((_glob || _load_glob()).default); exports.unlink = (_fsNormalized || _load_fsNormalized()).unlink; // fs.copyFile uses the native file copying instructions on the system, performing much better // than any JS-based solution and consumes fewer resources. Repeated testing to fine tune the // concurrency level revealed 128 as the sweet spot on a quad-core, 16 CPU Intel system with SSD. const CONCURRENT_QUEUE_ITEMS = (_fs || _load_fs()).default.copyFile ? 128 : 4; const fsSymlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.symlink); const invariant = __webpack_require__(9); const stripBOM = __webpack_require__(160); const noop = () => {}; function copy(src, dest, reporter) { return copyBulk([{ src, dest }], reporter); } function _readFile(loc, encoding) { return new Promise((resolve, reject) => { (_fs || _load_fs()).default.readFile(loc, encoding, function (err, content) { if (err) { reject(err); } else { resolve(content); } }); }); } function readFile(loc) { return _readFile(loc, 'utf8').then(normalizeOS); } function readFileRaw(loc) { return _readFile(loc, 'binary'); } function normalizeOS(body) { return body.replace(/\r\n/g, '\n'); } const cr = '\r'.charCodeAt(0); const lf = '\n'.charCodeAt(0); /***/ }), /* 5 */ /***/ (function(module, exports) { module.exports = require("fs"); /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class MessageError extends Error { constructor(msg, code) { super(msg); this.code = code; } } exports.MessageError = MessageError; class ProcessSpawnError extends MessageError { constructor(msg, code, process) { super(msg, code); this.process = process; } } exports.ProcessSpawnError = ProcessSpawnError; class SecurityError extends MessageError {} exports.SecurityError = SecurityError; class ProcessTermError extends MessageError {} exports.ProcessTermError = ProcessTermError; class ResponseError extends Error { constructor(msg, responseCode) { super(msg); this.responseCode = responseCode; } } exports.ResponseError = ResponseError; class OneTimePasswordError extends Error {} exports.OneTimePasswordError = OneTimePasswordError; /***/ }), /* 7 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscriber; }); /* unused harmony export SafeSubscriber */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isFunction__ = __webpack_require__(154); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observer__ = __webpack_require__(420); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__ = __webpack_require__(321); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__config__ = __webpack_require__(185); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_hostReportError__ = __webpack_require__(323); /** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */ var Subscriber = /*@__PURE__*/ (function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](Subscriber, _super); function Subscriber(destinationOrNext, error, complete) { var _this = _super.call(this) || this; _this.syncErrorValue = null; _this.syncErrorThrown = false; _this.syncErrorThrowable = false; _this.isStopped = false; _this._parentSubscription = null; switch (arguments.length) { case 0: _this.destination = __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]; break; case 1: if (!destinationOrNext) { _this.destination = __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]; break; } if (typeof destinationOrNext === 'object') { if (destinationOrNext instanceof Subscriber) { _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable; _this.destination = destinationOrNext; destinationOrNext.add(_this); } else { _this.syncErrorThrowable = true; _this.destination = new SafeSubscriber(_this, destinationOrNext); } break; } default: _this.syncErrorThrowable = true; _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete); break; } return _this; } Subscriber.prototype[__WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__["a" /* rxSubscriber */]] = function () { return this; }; Subscriber.create = function (next, error, complete) { var subscriber = new Subscriber(next, error, complete); subscriber.syncErrorThrowable = false; return subscriber; }; Subscriber.prototype.next = function (value) { if (!this.isStopped) { this._next(value); } }; Subscriber.prototype.error = function (err) { if (!this.isStopped) { this.isStopped = true; this._error(err); } }; Subscriber.prototype.complete = function () { if (!this.isStopped) { this.isStopped = true; this._complete(); } }; Subscriber.prototype.unsubscribe = function () { if (this.closed) { return; } this.isStopped = true; _super.prototype.unsubscribe.call(this); }; Subscriber.prototype._next = function (value) { this.destination.next(value); }; Subscriber.prototype._error = function (err) { this.destination.error(err); this.unsubscribe(); }; Subscriber.prototype._complete = function () { this.destination.complete(); this.unsubscribe(); }; Subscriber.prototype._unsubscribeAndRecycle = function () { var _a = this, _parent = _a._parent, _parents = _a._parents; this._parent = null; this._parents = null; this.unsubscribe(); this.closed = false; this.isStopped = false; this._parent = _parent; this._parents = _parents; this._parentSubscription = null; return this; }; return Subscriber; }(__WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */])); var SafeSubscriber = /*@__PURE__*/ (function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SafeSubscriber, _super); function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) { var _this = _super.call(this) || this; _this._parentSubscriber = _parentSubscriber; var next; var context = _this; if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isFunction__["a" /* isFunction */])(observerOrNext)) { next = observerOrNext; } else if (observerOrNext) { next = observerOrNext.next; error = observerOrNext.error; complete = observerOrNext.complete; if (observerOrNext !== __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]) { context = Object.create(observerOrNext); if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isFunction__["a" /* isFunction */])(context.unsubscribe)) { _this.add(context.unsubscribe.bind(context)); } context.unsubscribe = _this.unsubscribe.bind(_this); } } _this._context = context; _this._next = next; _this._error = error; _this._complete = complete; return _this; } SafeSubscriber.prototype.next = function (value) { if (!this.isStopped && this._next) { var _parentSubscriber = this._parentSubscriber; if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { this.__tryOrUnsub(this._next, value); } else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) { this.unsubscribe(); } } }; SafeSubscriber.prototype.error = function (err) { if (!this.isStopped) { var _parentSubscriber = this._parentSubscriber; var useDeprecatedSynchronousErrorHandling = __WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling; if (this._error) { if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { this.__tryOrUnsub(this._error, err); this.unsubscribe(); } else { this.__tryOrSetError(_parentSubscriber, this._error, err); this.unsubscribe(); } } else if (!_parentSubscriber.syncErrorThrowable) { this.unsubscribe(); if (useDeprecatedSynchronousErrorHandling) { throw err; } __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err); } else { if (useDeprecatedSynchronousErrorHandling) { _parentSubscriber.syncErrorValue = err; _parentSubscriber.syncErrorThrown = true; } else { __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err); } this.unsubscribe(); } } }; SafeSubscriber.prototype.complete = function () { var _this = this; if (!this.isStopped) { var _parentSubscriber = this._parentSubscriber; if (this._complete) { var wrappedComplete = function () { return _this._complete.call(_this._context); }; if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) { this.__tryOrUnsub(wrappedComplete); this.unsubscribe(); } else { this.__tryOrSetError(_parentSubscriber, wrappedComplete); this.unsubscribe(); } } else { this.unsubscribe(); } } }; SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) { try { fn.call(this._context, value); } catch (err) { this.unsubscribe(); if (__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { throw err; } else { __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err); } } }; SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) { if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { throw new Error('bad call'); } try { fn.call(this._context, value); } catch (err) { if (__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { parent.syncErrorValue = err; parent.syncErrorThrown = true; return true; } else { __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err); return true; } } return false; }; SafeSubscriber.prototype._unsubscribe = function () { var _parentSubscriber = this._parentSubscriber; this._context = null; this._parentSubscriber = null; _parentSubscriber.unsubscribe(); }; return SafeSubscriber; }(Subscriber)); //# sourceMappingURL=Subscriber.js.map /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getPathKey = getPathKey; const os = __webpack_require__(46); const path = __webpack_require__(0); const userHome = __webpack_require__(67).default; var _require = __webpack_require__(225); const getCacheDir = _require.getCacheDir, getConfigDir = _require.getConfigDir, getDataDir = _require.getDataDir; const isWebpackBundle = __webpack_require__(278); const DEPENDENCY_TYPES = exports.DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies', 'peerDependencies']; const OWNED_DEPENDENCY_TYPES = exports.OWNED_DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies']; const RESOLUTIONS = exports.RESOLUTIONS = 'resolutions'; const MANIFEST_FIELDS = exports.MANIFEST_FIELDS = [RESOLUTIONS, ...DEPENDENCY_TYPES]; const SUPPORTED_NODE_VERSIONS = exports.SUPPORTED_NODE_VERSIONS = '^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0'; const YARN_REGISTRY = exports.YARN_REGISTRY = 'https://registry.yarnpkg.com'; const NPM_REGISTRY_RE = exports.NPM_REGISTRY_RE = /https?:\/\/registry\.npmjs\.org/g; const YARN_DOCS = exports.YARN_DOCS = 'https://yarnpkg.com/en/docs/cli/'; const YARN_INSTALLER_SH = exports.YARN_INSTALLER_SH = 'https://yarnpkg.com/install.sh'; const YARN_INSTALLER_MSI = exports.YARN_INSTALLER_MSI = 'https://yarnpkg.com/latest.msi'; const SELF_UPDATE_VERSION_URL = exports.SELF_UPDATE_VERSION_URL = 'https://yarnpkg.com/latest-version'; // cache version, bump whenever we make backwards incompatible changes const CACHE_VERSION = exports.CACHE_VERSION = 6; // lockfile version, bump whenever we make backwards incompatible changes const LOCKFILE_VERSION = exports.LOCKFILE_VERSION = 1; // max amount of network requests to perform concurrently const NETWORK_CONCURRENCY = exports.NETWORK_CONCURRENCY = 8; // HTTP timeout used when downloading packages const NETWORK_TIMEOUT = exports.NETWORK_TIMEOUT = 30 * 1000; // in milliseconds // max amount of child processes to execute concurrently const CHILD_CONCURRENCY = exports.CHILD_CONCURRENCY = 5; const REQUIRED_PACKAGE_KEYS = exports.REQUIRED_PACKAGE_KEYS = ['name', 'version', '_uid']; function getPreferredCacheDirectories() { const preferredCacheDirectories = [getCacheDir()]; if (process.getuid) { // $FlowFixMe: process.getuid exists, dammit preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache-${process.getuid()}`)); } preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache`)); return preferredCacheDirectories; } const PREFERRED_MODULE_CACHE_DIRECTORIES = exports.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories(); const CONFIG_DIRECTORY = exports.CONFIG_DIRECTORY = getConfigDir(); const DATA_DIRECTORY = exports.DATA_DIRECTORY = getDataDir(); const LINK_REGISTRY_DIRECTORY = exports.LINK_REGISTRY_DIRECTORY = path.join(DATA_DIRECTORY, 'link'); const GLOBAL_MODULE_DIRECTORY = exports.GLOBAL_MODULE_DIRECTORY = path.join(DATA_DIRECTORY, 'global'); const NODE_BIN_PATH = exports.NODE_BIN_PATH = process.execPath; const YARN_BIN_PATH = exports.YARN_BIN_PATH = getYarnBinPath(); // Webpack needs to be configured with node.__dirname/__filename = false function getYarnBinPath() { if (isWebpackBundle) { return __filename; } else { return path.join(__dirname, '..', 'bin', 'yarn.js'); } } const NODE_MODULES_FOLDER = exports.NODE_MODULES_FOLDER = 'node_modules'; const NODE_PACKAGE_JSON = exports.NODE_PACKAGE_JSON = 'package.json'; const PNP_FILENAME = exports.PNP_FILENAME = '.pnp.js'; const POSIX_GLOBAL_PREFIX = exports.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ''}/usr/local`; const FALLBACK_GLOBAL_PREFIX = exports.FALLBACK_GLOBAL_PREFIX = path.join(userHome, '.yarn'); const META_FOLDER = exports.META_FOLDER = '.yarn-meta'; const INTEGRITY_FILENAME = exports.INTEGRITY_FILENAME = '.yarn-integrity'; const LOCKFILE_FILENAME = exports.LOCKFILE_FILENAME = 'yarn.lock'; const METADATA_FILENAME = exports.METADATA_FILENAME = '.yarn-metadata.json'; const TARBALL_FILENAME = exports.TARBALL_FILENAME = '.yarn-tarball.tgz'; const CLEAN_FILENAME = exports.CLEAN_FILENAME = '.yarnclean'; const NPM_LOCK_FILENAME = exports.NPM_LOCK_FILENAME = 'package-lock.json'; const NPM_SHRINKWRAP_FILENAME = exports.NPM_SHRINKWRAP_FILENAME = 'npm-shrinkwrap.json'; const DEFAULT_INDENT = exports.DEFAULT_INDENT = ' '; const SINGLE_INSTANCE_PORT = exports.SINGLE_INSTANCE_PORT = 31997; const SINGLE_INSTANCE_FILENAME = exports.SINGLE_INSTANCE_FILENAME = '.yarn-single-instance'; const ENV_PATH_KEY = exports.ENV_PATH_KEY = getPathKey(process.platform, process.env); function getPathKey(platform, env) { let pathKey = 'PATH'; // windows calls its path "Path" usually, but this is not guaranteed. if (platform === 'win32') { pathKey = 'Path'; for (const key in env) { if (key.toLowerCase() === 'path') { pathKey = key; } } } return pathKey; } const VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = { major: 'red', premajor: 'red', minor: 'yellow', preminor: 'yellow', patch: 'green', prepatch: 'green', prerelease: 'red', unchanged: 'white', unknown: 'red' }; /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /** * Use invariant() to assert state which your program assumes to be true. * * Provide sprintf-style format (only %s is supported) and arguments * to provide information about what broke and what you were * expecting. * * The invariant message will be stripped in production, but the invariant * will remain to ensure logic does not differ in production. */ var NODE_ENV = process.env.NODE_ENV; var invariant = function(condition, format, a, b, c, d, e, f) { if (NODE_ENV !== 'production') { if (format === undefined) { throw new Error('invariant requires an error message argument'); } } if (!condition) { var error; if (format === undefined) { error = new Error( 'Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.' ); } else { var args = [a, b, c, d, e, f]; var argIndex = 0; error = new Error( format.replace(/%s/g, function() { return args[argIndex++]; }) ); error.name = 'Invariant Violation'; } error.framesToPop = 1; // we don't care about invariant's own frame throw error; } }; module.exports = invariant; /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var YAMLException = __webpack_require__(54); var TYPE_CONSTRUCTOR_OPTIONS = [ 'kind', 'resolve', 'construct', 'instanceOf', 'predicate', 'represent', 'defaultStyle', 'styleAliases' ]; var YAML_NODE_KINDS = [ 'scalar', 'sequence', 'mapping' ]; function compileStyleAliases(map) { var result = {}; if (map !== null) { Object.keys(map).forEach(function (style) { map[style].forEach(function (alias) { result[String(alias)] = style; }); }); } return result; } function Type(tag, options) { options = options || {}; Object.keys(options).forEach(function (name) { if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); } }); // TODO: Add tag format check. this.tag = tag; this.kind = options['kind'] || null; this.resolve = options['resolve'] || function () { return true; }; this.construct = options['construct'] || function (data) { return data; }; this.instanceOf = options['instanceOf'] || null; this.predicate = options['predicate'] || null; this.represent = options['represent'] || null; this.defaultStyle = options['defaultStyle'] || null; this.styleAliases = compileStyleAliases(options['styleAliases'] || null); if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); } } module.exports = Type; /***/ }), /* 11 */ /***/ (function(module, exports) { module.exports = require("crypto"); /***/ }), /* 12 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Observable; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_canReportError__ = __webpack_require__(322); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__ = __webpack_require__(932); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__ = __webpack_require__(117); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_pipe__ = __webpack_require__(324); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config__ = __webpack_require__(185); /** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_internal_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */ var Observable = /*@__PURE__*/ (function () { function Observable(subscribe) { this._isScalar = false; if (subscribe) { this._subscribe = subscribe; } } Observable.prototype.lift = function (operator) { var observable = new Observable(); observable.source = this; observable.operator = operator; return observable; }; Observable.prototype.subscribe = function (observerOrNext, error, complete) { var operator = this.operator; var sink = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__["a" /* toSubscriber */])(observerOrNext, error, complete); if (operator) { operator.call(sink, this.source); } else { sink.add(this.source || (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ? this._subscribe(sink) : this._trySubscribe(sink)); } if (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { if (sink.syncErrorThrowable) { sink.syncErrorThrowable = false; if (sink.syncErrorThrown) { throw sink.syncErrorValue; } } } return sink; }; Observable.prototype._trySubscribe = function (sink) { try { return this._subscribe(sink); } catch (err) { if (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) { sink.syncErrorThrown = true; sink.syncErrorValue = err; } if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_canReportError__["a" /* canReportError */])(sink)) { sink.error(err); } else { console.warn(err); } } }; Observable.prototype.forEach = function (next, promiseCtor) { var _this = this; promiseCtor = getPromiseCtor(promiseCtor); return new promiseCtor(function (resolve, reject) { var subscription; subscription = _this.subscribe(function (value) { try { next(value); } catch (err) { reject(err); if (subscription) { subscription.unsubscribe(); } } }, reject, resolve); }); }; Observable.prototype._subscribe = function (subscriber) { var source = this.source; return source && source.subscribe(subscriber); }; Observable.prototype[__WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__["a" /* observable */]] = function () { return this; }; Observable.prototype.pipe = function () { var operations = []; for (var _i = 0; _i < arguments.length; _i++) { operations[_i] = arguments[_i]; } if (operations.length === 0) { return this; } return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_pipe__["b" /* pipeFromArray */])(operations)(this); }; Observable.prototype.toPromise = function (promiseCtor) { var _this = this; promiseCtor = getPromiseCtor(promiseCtor); return new promiseCtor(function (resolve, reject) { var value; _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); }); }); }; Observable.create = function (subscribe) { return new Observable(subscribe); }; return Observable; }()); function getPromiseCtor(promiseCtor) { if (!promiseCtor) { promiseCtor = __WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].Promise || Promise; } if (!promiseCtor) { throw new Error('no Promise impl found'); } return promiseCtor; } //# sourceMappingURL=Observable.js.map /***/ }), /* 13 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return OuterSubscriber; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */ var OuterSubscriber = /*@__PURE__*/ (function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](OuterSubscriber, _super); function OuterSubscriber() { return _super !== null && _super.apply(this, arguments) || this; } OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { this.destination.next(innerValue); }; OuterSubscriber.prototype.notifyError = function (error, innerSub) { this.destination.error(error); }; OuterSubscriber.prototype.notifyComplete = function (innerSub) { this.destination.complete(); }; return OuterSubscriber; }(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */])); //# sourceMappingURL=OuterSubscriber.js.map /***/ }), /* 14 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = subscribeToResult; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__ = __webpack_require__(84); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__subscribeTo__ = __webpack_require__(446); /** PURE_IMPORTS_START _InnerSubscriber,_subscribeTo PURE_IMPORTS_END */ function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, destination) { if (destination === void 0) { destination = new __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__["a" /* InnerSubscriber */](outerSubscriber, outerValue, outerIndex); } if (destination.closed) { return; } return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__subscribeTo__["a" /* subscribeTo */])(result)(destination); } //# sourceMappingURL=subscribeToResult.js.map /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable node/no-deprecated-api */ var buffer = __webpack_require__(64) var Buffer = buffer.Buffer var safer = {} var key for (key in buffer) { if (!buffer.hasOwnProperty(key)) continue if (key === 'SlowBuffer' || key === 'Buffer') continue safer[key] = buffer[key] } var Safer = safer.Buffer = {} for (key in Buffer) { if (!Buffer.hasOwnProperty(key)) continue if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue Safer[key] = Buffer[key] } safer.Buffer.prototype = Buffer.prototype if (!Safer.from || Safer.from === Uint8Array.from) { Safer.from = function (value, encodingOrOffset, length) { if (typeof value === 'number') { throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value) } if (value && typeof value.length === 'undefined') { throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value) } return Buffer(value, encodingOrOffset, length) } } if (!Safer.alloc) { Safer.alloc = function (size, fill, encoding) { if (typeof size !== 'number') { throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size) } if (size < 0 || size >= 2 * (1 << 30)) { throw new RangeError('The value "' + size + '" is invalid for option "size"') } var buf = Buffer(size) if (!fill || fill.length === 0) { buf.fill(0) } else if (typeof encoding === 'string') { buf.fill(fill, encoding) } else { buf.fill(fill) } return buf } } if (!safer.kStringMaxLength) { try { safer.kStringMaxLength = process.binding('buffer').kStringMaxLength } catch (e) { // we can't determine kStringMaxLength in environments where process.binding // is unsupported, so let's not set it } } if (!safer.constants) { safer.constants = { MAX_LENGTH: safer.kMaxLength } if (safer.kStringMaxLength) { safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength } } module.exports = safer /***/ }), /* 16 */ /***/ (function(module, exports, __webpack_require__) { // Copyright (c) 2012, Mark Cavage. All rights reserved. // Copyright 2015 Joyent, Inc. var assert = __webpack_require__(28); var Stream = __webpack_require__(23).Stream; var util = __webpack_require__(3); ///--- Globals /* JSSTYLED */ var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; ///--- Internal function _capitalize(str) { return (str.charAt(0).toUpperCase() + str.slice(1)); } function _toss(name, expected, oper, arg, actual) { throw new assert.AssertionError({ message: util.format('%s (%s) is required', name, expected), actual: (actual === undefined) ? typeof (arg) : actual(arg), expected: expected, operator: oper || '===', stackStartFunction: _toss.caller }); } function _getClass(arg) { return (Object.prototype.toString.call(arg).slice(8, -1)); } function noop() { // Why even bother with asserts? } ///--- Exports var types = { bool: { check: function (arg) { return typeof (arg) === 'boolean'; } }, func: { check: function (arg) { return typeof (arg) === 'function'; } }, string: { check: function (arg) { return typeof (arg) === 'string'; } }, object: { check: function (arg) { return typeof (arg) === 'object' && arg !== null; } }, number: { check: function (arg) { return typeof (arg) === 'number' && !isNaN(arg); } }, finite: { check: function (arg) { return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg); } }, buffer: { check: function (arg) { return Buffer.isBuffer(arg); }, operator: 'Buffer.isBuffer' }, array: { check: function (arg) { return Array.isArray(arg); }, operator: 'Array.isArray' }, stream: { check: function (arg) { return arg instanceof Stream; }, operator: 'instanceof', actual: _getClass }, date: { check: function (arg) { return arg instanceof Date; }, operator: 'instanceof', actual: _getClass }, regexp: { check: function (arg) { return arg instanceof RegExp; }, operator: 'instanceof', actual: _getClass }, uuid: { check: function (arg) { return typeof (arg) === 'string' && UUID_REGEXP.test(arg); }, operator: 'isUUID' } }; function _setExports(ndebug) { var keys = Object.keys(types); var out; /* re-export standard assert */ if (process.env.NODE_NDEBUG) { out = noop; } else { out = function (arg, msg) { if (!arg) { _toss(msg, 'true', arg); } }; } /* standard checks */ keys.forEach(function (k) { if (ndebug) { out[k] = noop; return; } var type = types[k]; out[k] = function (arg, msg) { if (!type.check(arg)) { _toss(msg, k, type.operator, arg, type.actual); } }; }); /* optional checks */ keys.forEach(function (k) { var name = 'optional' + _capitalize(k); if (ndebug) { out[name] = noop; return; } var type = types[k]; out[name] = function (arg, msg) { if (arg === undefined || arg === null) { return; } if (!type.check(arg)) { _toss(msg, k, type.operator, arg, type.actual); } }; }); /* arrayOf checks */ keys.forEach(function (k) { var name = 'arrayOf' + _capitalize(k); if (ndebug) { out[name] = noop; return; } var type = types[k]; var expected = '[' + k + ']'; out[name] = function (arg, msg) { if (!Array.isArray(arg)) { _toss(msg, expected, type.operator, arg, type.actual); } var i; for (i = 0; i < arg.length; i++) { if (!type.check(arg[i])) { _toss(msg, expected, type.operator, arg, type.actual); } } }; }); /* optionalArrayOf checks */ keys.forEach(function (k) { var name = 'optionalArrayOf' + _capitalize(k); if (ndebug) { out[name] = noop; return; } var type = types[k]; var expected = '[' + k + ']'; out[name] = function (arg, msg) { if (arg === undefined || arg === null) { return; } if (!Array.isArray(arg)) { _toss(msg, expected, type.operator, arg, type.actual); } var i; for (i = 0; i < arg.length; i++) { if (!type.check(arg[i])) { _toss(msg, expected, type.operator, arg, type.actual); } } }; }); /* re-export built-in assertions */ Object.keys(assert).forEach(function (k) { if (k === 'AssertionError') { out[k] = assert[k]; return; } if (ndebug) { out[k] = noop; return; } out[k] = assert[k]; }); /* export ourselves (for unit tests _only_) */ out._setExports = _setExports; return out; } module.exports = _setExports(process.env.NODE_NDEBUG); /***/ }), /* 17 */ /***/ (function(module, exports) { // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self // eslint-disable-next-line no-new-func : Function('return this')(); if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef /***/ }), /* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.sortAlpha = sortAlpha; exports.sortOptionsByFlags = sortOptionsByFlags; exports.entries = entries; exports.removePrefix = removePrefix; exports.removeSuffix = removeSuffix; exports.addSuffix = addSuffix; exports.hyphenate = hyphenate; exports.camelCase = camelCase; exports.compareSortedArrays = compareSortedArrays; exports.sleep = sleep; const _camelCase = __webpack_require__(230); function sortAlpha(a, b) { // sort alphabetically in a deterministic way const shortLen = Math.min(a.length, b.length); for (let i = 0; i < shortLen; i++) { const aChar = a.charCodeAt(i); const bChar = b.charCodeAt(i); if (aChar !== bChar) { return aChar - bChar; } } return a.length - b.length; } function sortOptionsByFlags(a, b) { const aOpt = a.flags.replace(/-/g, ''); const bOpt = b.flags.replace(/-/g, ''); return sortAlpha(aOpt, bOpt); } function entries(obj) { const entries = []; if (obj) { for (const key in obj) { entries.push([key, obj[key]]); } } return entries; } function removePrefix(pattern, prefix) { if (pattern.startsWith(prefix)) { pattern = pattern.slice(prefix.length); } return pattern; } function removeSuffix(pattern, suffix) { if (pattern.endsWith(suffix)) { return pattern.slice(0, -suffix.length); } return pattern; } function addSuffix(pattern, suffix) { if (!pattern.endsWith(suffix)) { return pattern + suffix; } return pattern; } function hyphenate(str) { return str.replace(/[A-Z]/g, match => { return '-' + match.charAt(0).toLowerCase(); }); } function camelCase(str) { if (/[A-Z]/.test(str)) { return null; } else { return _camelCase(str); } } function compareSortedArrays(array1, array2) { if (array1.length !== array2.length) { return false; } for (let i = 0, len = array1.length; i < len; i++) { if (array1[i] !== array2[i]) { return false; } } return true; } function sleep(ms) { return new Promise(resolve => { setTimeout(resolve, ms); }); } /***/ }), /* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.stringify = exports.parse = undefined; var _asyncToGenerator2; function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } var _parse; function _load_parse() { return _parse = __webpack_require__(105); } Object.defineProperty(exports, 'parse', { enumerable: true, get: function get() { return _interopRequireDefault(_parse || _load_parse()).default; } }); var _stringify; function _load_stringify() { return _stringify = __webpack_require__(199); } Object.defineProperty(exports, 'stringify', { enumerable: true, get: function get() { return _interopRequireDefault(_stringify || _load_stringify()).default; } }); exports.implodeEntry = implodeEntry; exports.explodeEntry = explodeEntry; var _misc; function _load_misc() { return _misc = __webpack_require__(18); } var _normalizePattern; function _load_normalizePattern() { return _normalizePattern = __webpack_require__(37); } var _parse2; function _load_parse2() { return _parse2 = _interopRequireDefault(__webpack_require__(105)); } var _constants; function _load_constants() { return _constants = __webpack_require__(8); } var _fs; function _load_fs() { return _fs = _interopRequireWildcard(__webpack_require__(4)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const invariant = __webpack_require__(9); const path = __webpack_require__(0); const ssri = __webpack_require__(65); function getName(pattern) { return (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern).name; } function blankObjectUndefined(obj) { return obj && Object.keys(obj).length ? obj : undefined; } function keyForRemote(remote) { return remote.resolved || (remote.reference && remote.hash ? `${remote.reference}#${remote.hash}` : null); } function serializeIntegrity(integrity) { // We need this because `Integrity.toString()` does not use sorting to ensure a stable string output // See https://git.io/vx2Hy return integrity.toString().split(' ').sort().join(' '); } function implodeEntry(pattern, obj) { const inferredName = getName(pattern); const integrity = obj.integrity ? serializeIntegrity(obj.integrity) : ''; const imploded = { name: inferredName === obj.name ? undefined : obj.name, version: obj.version, uid: obj.uid === obj.version ? undefined : obj.uid, resolved: obj.resolved, registry: obj.registry === 'npm' ? undefined : obj.registry, dependencies: blankObjectUndefined(obj.dependencies), optionalDependencies: blankObjectUndefined(obj.optionalDependencies), permissions: blankObjectUndefined(obj.permissions), prebuiltVariants: blankObjectUndefined(obj.prebuiltVariants) }; if (integrity) { imploded.integrity = integrity; } return imploded; } function explodeEntry(pattern, obj) { obj.optionalDependencies = obj.optionalDependencies || {}; obj.dependencies = obj.dependencies || {}; obj.uid = obj.uid || obj.version; obj.permissions = obj.permissions || {}; obj.registry = obj.registry || 'npm'; obj.name = obj.name || getName(pattern); const integrity = obj.integrity; if (integrity && integrity.isIntegrity) { obj.integrity = ssri.parse(integrity); } return obj; } class Lockfile { constructor({ cache, source, parseResultType } = {}) { this.source = source || ''; this.cache = cache; this.parseResultType = parseResultType; } // source string if the `cache` was parsed // if true, we're parsing an old yarn file and need to update integrity fields hasEntriesExistWithoutIntegrity() { if (!this.cache) { return false; } for (const key in this.cache) { // $FlowFixMe - `this.cache` is clearly defined at this point if (!/^.*@(file:|http)/.test(key) && this.cache[key] && !this.cache[key].integrity) { return true; } } return false; } static fromDirectory(dir, reporter) { return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { // read the manifest in this directory const lockfileLoc = path.join(dir, (_constants || _load_constants()).LOCKFILE_FILENAME); let lockfile; let rawLockfile = ''; let parseResult; if (yield (_fs || _load_fs()).exists(lockfileLoc)) { rawLockfile = yield (_fs || _load_fs()).readFile(lockfileLoc); parseResult = (0, (_parse2 || _load_parse2()).default)(rawLockfile, lockfileLoc); if (reporter) { if (parseResult.type === 'merge') { reporter.info(reporter.lang('lockfileMerged')); } else if (parseResult.type === 'conflict') { reporter.warn(reporter.lang('lockfileConflict')); } } lockfile = parseResult.object; } else if (reporter) { reporter.info(reporter.lang('noLockfileFound')); } if (lockfile && lockfile.__metadata) { const lockfilev2 = lockfile; lockfile = {}; } return new Lockfile({ cache: lockfile, source: rawLockfile, parseResultType: parseResult && parseResult.type }); })(); } getLocked(pattern) { const cache = this.cache; if (!cache) { return undefined; } const shrunk = pattern in cache && cache[pattern]; if (typeof shrunk === 'string') { return this.getLocked(shrunk); } else if (shrunk) { explodeEntry(pattern, shrunk); return shrunk; } return undefined; } removePattern(pattern) { const cache = this.cache; if (!cache) { return; } delete cache[pattern]; } getLockfile(patterns) { const lockfile = {}; const seen = new Map(); // order by name so that lockfile manifest is assigned to the first dependency with this manifest // the others that have the same remoteKey will just refer to the first // ordering allows for consistency in lockfile when it is serialized const sortedPatternsKeys = Object.keys(patterns).sort((_misc || _load_misc()).sortAlpha); for (var _iterator = sortedPatternsKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } const pattern = _ref; const pkg = patterns[pattern]; const remote = pkg._remote, ref = pkg._reference; invariant(ref, 'Package is missing a reference'); invariant(remote, 'Package is missing a remote'); const remoteKey = keyForRemote(remote); const seenPattern = remoteKey && seen.get(remoteKey); if (seenPattern) { // no point in duplicating it lockfile[pattern] = seenPattern; // if we're relying on our name being inferred and two of the patterns have // different inferred names then we need to set it if (!seenPattern.name && getName(pattern) !== pkg.name) { seenPattern.name = pkg.name; } continue; } const obj = implodeEntry(pattern, { name: pkg.name, version: pkg.version, uid: pkg._uid, resolved: remote.resolved, integrity: remote.integrity, registry: remote.registry, dependencies: pkg.dependencies, peerDependencies: pkg.peerDependencies, optionalDependencies: pkg.optionalDependencies, permissions: ref.permissions, prebuiltVariants: pkg.prebuiltVariants }); lockfile[pattern] = obj; if (remoteKey) { seen.set(remoteKey, obj); } } return lockfile; } } exports.default = Lockfile; /***/ }), /* 20 */ /***/ (function(module, exports, __webpack_require__) { var store = __webpack_require__(133)('wks'); var uid = __webpack_require__(137); var Symbol = __webpack_require__(17).Symbol; var USE_SYMBOL = typeof Symbol == 'function'; var $exports = module.exports = function (name) { return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); }; $exports.store = store; /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; exports.__esModule = true; var _assign = __webpack_require__(591); var _assign2 = _interopRequireDefault(_assign); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = _assign2.default || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /***/ }), /* 22 */ /***/ (function(module, exports) { exports = module.exports = SemVer; // The debug function is excluded entirely from the minified version. /* nomin */ var debug; /* nomin */ if (typeof process === 'object' && /* nomin */ process.env && /* nomin */ process.env.NODE_DEBUG && /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) /* nomin */ debug = function() { /* nomin */ var args = Array.prototype.slice.call(arguments, 0); /* nomin */ args.unshift('SEMVER'); /* nomin */ console.log.apply(console, args); /* nomin */ }; /* nomin */ else /* nomin */ debug = function() {}; // Note: this is the semver.org version of the spec that it implements // Not necessarily the package version of this code. exports.SEMVER_SPEC_VERSION = '2.0.0'; var MAX_LENGTH = 256; var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; // Max safe segment length for coercion. var MAX_SAFE_COMPONENT_LENGTH = 16; // The actual regexps go on exports.re var re = exports.re = []; var src = exports.src = []; var R = 0; // The following Regular Expressions can be used for tokenizing, // validating, and parsing SemVer version strings. // ## Numeric Identifier // A single `0`, or a non-zero digit followed by zero or more digits. var NUMERICIDENTIFIER = R++; src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; var NUMERICIDENTIFIERLOOSE = R++; src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; // ## Non-numeric Identifier // Zero or more digits, followed by a letter or hyphen, and then zero or // more letters, digits, or hyphens. var NONNUMERICIDENTIFIER = R++; src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; // ## Main Version // Three dot-separated numeric identifiers. var MAINVERSION = R++; src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + '(' + src[NUMERICIDENTIFIER] + ')\\.' + '(' + src[NUMERICIDENTIFIER] + ')'; var MAINVERSIONLOOSE = R++; src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; // ## Pre-release Version Identifier // A numeric identifier, or a non-numeric identifier. var PRERELEASEIDENTIFIER = R++; src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + '|' + src[NONNUMERICIDENTIFIER] + ')'; var PRERELEASEIDENTIFIERLOOSE = R++; src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + '|' + src[NONNUMERICIDENTIFIER] + ')'; // ## Pre-release Version // Hyphen, followed by one or more dot-separated pre-release version // identifiers. var PRERELEASE = R++; src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; var PRERELEASELOOSE = R++; src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; // ## Build Metadata Identifier // Any combination of digits, letters, or hyphens. var BUILDIDENTIFIER = R++; src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; // ## Build Metadata // Plus sign, followed by one or more period-separated build metadata // identifiers. var BUILD = R++; src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; // ## Full Version String // A main version, followed optionally by a pre-release version and // build metadata. // Note that the only major, minor, patch, and pre-release sections of // the version string are capturing groups. The build metadata is not a // capturing group, because it should not ever be used in version // comparison. var FULL = R++; var FULLPLAIN = 'v?' + src[MAINVERSION] + src[PRERELEASE] + '?' + src[BUILD] + '?'; src[FULL] = '^' + FULLPLAIN + '$'; // like full, but allows v1.2.3 and =1.2.3, which people do sometimes. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty // common in the npm registry. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + src[PRERELEASELOOSE] + '?' + src[BUILD] + '?'; var LOOSE = R++; src[LOOSE] = '^' + LOOSEPLAIN + '$'; var GTLT = R++; src[GTLT] = '((?:<|>)?=?)'; // Something like "2.*" or "1.2.x". // Note that "x.x" is a valid xRange identifer, meaning "any version" // Only the first item is strictly required. var XRANGEIDENTIFIERLOOSE = R++; src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; var XRANGEIDENTIFIER = R++; src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; var XRANGEPLAIN = R++; src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:' + src[PRERELEASE] + ')?' + src[BUILD] + '?' + ')?)?'; var XRANGEPLAINLOOSE = R++; src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:' + src[PRERELEASELOOSE] + ')?' + src[BUILD] + '?' + ')?)?'; var XRANGE = R++; src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; var XRANGELOOSE = R++; src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; // Coercion. // Extract anything that could conceivably be a part of a valid semver var COERCE = R++; src[COERCE] = '(?:^|[^\\d])' + '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' + '(?:$|[^\\d])'; // Tilde ranges. // Meaning is "reasonably at or greater than" var LONETILDE = R++; src[LONETILDE] = '(?:~>?)'; var TILDETRIM = R++; src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); var tildeTrimReplace = '$1~'; var TILDE = R++; src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; var TILDELOOSE = R++; src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; // Caret ranges. // Meaning is "at least and backwards compatible with" var LONECARET = R++; src[LONECARET] = '(?:\\^)'; var CARETTRIM = R++; src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); var caretTrimReplace = '$1^'; var CARET = R++; src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; var CARETLOOSE = R++; src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; // A simple gt/lt/eq thing, or just "" to indicate "any version" var COMPARATORLOOSE = R++; src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; var COMPARATOR = R++; src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; // An expression to strip any whitespace between the gtlt and the thing // it modifies, so that `> 1.2.3` ==> `>1.2.3` var COMPARATORTRIM = R++; src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; // this one has to use the /g flag re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); var comparatorTrimReplace = '$1$2$3'; // Something like `1.2.3 - 1.2.4` // Note that these all use the loose form, because they'll be // checked against either the strict or loose comparator form // later. var HYPHENRANGE = R++; src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAIN] + ')' + '\\s*$'; var HYPHENRANGELOOSE = R++; src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + '\\s+-\\s+' + '(' + src[XRANGEPLAINLOOSE] + ')' + '\\s*$'; // Star ranges basically just allow anything at all. var STAR = R++; src[STAR] = '(<|>)?=?\\s*\\*'; // Compile to actual regexp objects. // All are flag-free, unless they were created above with a flag. for (var i = 0; i < R; i++) { debug(i, src[i]); if (!re[i]) re[i] = new RegExp(src[i]); } exports.parse = parse; function parse(version, loose) { if (version instanceof SemVer) return version; if (typeof version !== 'string') return null; if (version.length > MAX_LENGTH) return null; var r = loose ? re[LOOSE] : re[FULL]; if (!r.test(version)) return null; try { return new SemVer(version, loose); } catch (er) { return null; } } exports.valid = valid; function valid(version, loose) { var v = parse(version, loose); return v ? v.version : null; } exports.clean = clean; function clean(version, loose) { var s = parse(version.trim().replace(/^[=v]+/, ''), loose); return s ? s.version : null; } exports.SemVer = SemVer; function SemVer(version, loose) { if (version instanceof SemVer) { if (version.loose === loose) return version; else version = version.version; } else if (typeof version !== 'string') { throw new TypeError('Invalid Version: ' + version); } if (version.length > MAX_LENGTH) throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') if (!(this instanceof SemVer)) return new SemVer(version, loose); debug('SemVer', version, loose); this.loose = loose; var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); if (!m) throw new TypeError('Invalid Version: ' + version); this.raw = version; // these are actually numbers this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError('Invalid major version') if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError('Invalid minor version') if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError('Invalid patch version') // numberify any prerelease numeric ids if (!m[4]) this.prerelease = []; else this.prerelease = m[4].split('.').map(function(id) { if (/^[0-9]+$/.test(id)) { var num = +id; if (num >= 0 && num < MAX_SAFE_INTEGER) return num; } return id; }); this.build = m[5] ? m[5].split('.') : []; this.format(); } SemVer.prototype.format = function() { this.version = this.major + '.' + this.minor + '.' + this.patch; if (this.prerelease.length) this.version += '-' + this.prerelease.join('.'); return this.version; }; SemVer.prototype.toString = function() { return this.version; }; SemVer.prototype.compare = function(other) { debug('SemVer.compare', this.version, this.loose, other); if (!(other instanceof SemVer)) other = new SemVer(other, this.loose); return this.compareMain(other) || this.comparePre(other); }; SemVer.prototype.compareMain = function(other) { if (!(other instanceof SemVer)) other = new SemVer(other, this.loose); return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); }; SemVer.prototype.comparePre = function(other) { if (!(other instanceof SemVer)) other = new SemVer(other, this.loose); // NOT having a prerelease is > having one if (this.prerelease.length && !other.prerelease.length) return -1; else if (!this.prerelease.length && other.prerelease.length) return 1; else if (!this.prerelease.length && !other.prerelease.length) return 0; var i = 0; do { var a = this.prerelease[i]; var b = other.prerelease[i]; debug('prerelease compare', i, a, b); if (a === undefined && b === undefined) return 0; else if (b === undefined) return 1; else if (a === undefined) return -1; else if (a === b) continue; else return compareIdentifiers(a, b); } while (++i); }; // preminor will bump the version up to the next minor release, and immediately // down to pre-release. premajor and prepatch work the same way. SemVer.prototype.inc = function(release, identifier) { switch (release) { case 'premajor': this.prerelease.length = 0; this.patch = 0; this.minor = 0; this.major++; this.inc('pre', identifier); break; case 'preminor': this.prerelease.length = 0; this.patch = 0; this.minor++; this.inc('pre', identifier); break; case 'prepatch': // If this is already a prerelease, it will bump to the next version // drop any prereleases that might already exist, since they are not // relevant at this point. this.prerelease.length = 0; this.inc('patch', identifier); this.inc('pre', identifier); break; // If the input is a non-prerelease version, this acts the same as // prepatch. case 'prerelease': if (this.prerelease.length === 0) this.inc('patch', identifier); this.inc('pre', identifier); break; case 'major': // If this is a pre-major version, bump up to the same major version. // Otherwise increment major. // 1.0.0-5 bumps to 1.0.0 // 1.1.0 bumps to 2.0.0 if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++; this.minor = 0; this.patch = 0; this.prerelease = []; break; case 'minor': // If this is a pre-minor version, bump up to the same minor version. // Otherwise increment minor. // 1.2.0-5 bumps to 1.2.0 // 1.2.1 bumps to 1.3.0 if (this.patch !== 0 || this.prerelease.length === 0) this.minor++; this.patch = 0; this.prerelease = []; break; case 'patch': // If this is not a pre-release version, it will increment the patch. // If it is a pre-release it will bump up to the same patch version. // 1.2.0-5 patches to 1.2.0 // 1.2.0 patches to 1.2.1 if (this.prerelease.length === 0) this.patch++; this.prerelease = []; break; // This probably shouldn't be used publicly. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) this.prerelease = [0]; else { var i = this.prerelease.length; while (--i >= 0) { if (typeof this.prerelease[i] === 'number') { this.prerelease[i]++; i = -2; } } if (i === -1) // didn't increment anything this.prerelease.push(0); } if (identifier) { // 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 if (this.prerelease[0] === identifier) { if (isNaN(this.prerelease[1])) this.prerelease = [identifier, 0]; } else this.prerelease = [identifier, 0]; } break; default: throw new Error('invalid increment argument: ' + release); } this.format(); this.raw = this.version; return this; }; exports.inc = inc; function inc(version, release, loose, identifier) { if (typeof(loose) === 'string') { identifier = loose; loose = undefined; } try { return new SemVer(version, loose).inc(release, identifier).version; } catch (er) { return null; } } exports.diff = diff; function diff(version1, version2) { if (eq(version1, version2)) { return null; } else { var v1 = parse(version1); var v2 = parse(version2); if (v1.prerelease.length || v2.prerelease.length) { for (var key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return 'pre'+key; } } } return 'prerelease'; } for (var key in v1) { if (key === 'major' || key === 'minor' || key === 'patch') { if (v1[key] !== v2[key]) { return key; } } } } } exports.compareIdentifiers = compareIdentifiers; var numeric = /^[0-9]+$/; function compareIdentifiers(a, b) { var anum = numeric.test(a); var bnum = numeric.test(b); if (anum && bnum) { a = +a; b = +b; } return (anum && !bnum) ? -1 : (bnum && !anum) ? 1 : a < b ? -1 : a > b ? 1 : 0; } exports.rcompareIdentifiers = rcompareIdentifiers; function rcompareIdentifiers(a, b) { return compareIdentifiers(b, a); } exports.major = major; function major(a, loose) { return new SemVer(a, loose).major; } exports.minor = minor; function minor(a, loose) { return new SemVer(a, loose).minor; } exports.patch = patch; function patch(a, loose) { return new SemVer(a, loose).patch; } exports.compare = compare; function compare(a, b, loose) { return new SemVer(a, loose).compare(new SemVer(b, loose)); } exports.compareLoose = compareLoose; function compareLoose(a, b) { return compare(a, b, true); } exports.rcompare = rcompare; function rcompare(a, b, loose) { return compare(b, a, loose); } exports.sort = sort; function sort(list, loose) { return list.sort(function(a, b) { return exports.compare(a, b, loose); }); } exports.rsort = rsort; function rsort(list, loose) { return list.sort(function(a, b) { return exports.rcompare(a, b, loose); }); } exports.gt = gt; function gt(a, b, loose) { return compare(a, b, loose) > 0; } exports.lt = lt; function lt(a, b, loose) { return compare(a, b, loose) < 0; } exports.eq = eq; function eq(a, b, loose) { return compare(a, b, loose) === 0; } exports.neq = neq; function neq(a, b, loose) { return compare(a, b, loose) !== 0; } exports.gte = gte; function gte(a, b, loose) { return compare(a, b, loose) >= 0; } exports.lte = lte; function lte(a, b, loose) { return compare(a, b, loose) <= 0; } exports.cmp = cmp; function cmp(a, op, b, loose) { var ret; switch (op) { case '===': if (typeof a === 'object') a = a.version; if (typeof b === 'object') b = b.version; ret = a === b; break; case '!==': if (typeof a === 'object') a = a.version; if (typeof b === 'object') b = b.version; ret = a !== b; break; case '': case '=': case '==': ret = eq(a, b, loose); break; case '!=': ret = neq(a, b, loose); break; case '>': ret = gt(a, b, loose); break; case '>=': ret = gte(a, b, loose); break; case '<': ret = lt(a, b, loose); break; case '<=': ret = lte(a, b, loose); break; default: throw new TypeError('Invalid operator: ' + op); } return ret; } exports.Comparator = Comparator; function Comparator(comp, loose) { if (comp instanceof Comparator) { if (comp.loose === loose) return comp; else comp = comp.value; } if (!(this instanceof Comparator)) return new Comparator(comp, loose); debug('comparator', comp, loose); this.loose = loose; this.parse(comp); if (this.semver === ANY) this.value = ''; else this.value = this.operator + this.semver.version; debug('comp', this); } var ANY = {}; Comparator.prototype.parse = function(comp) { var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; var m = comp.match(r); if (!m) throw new TypeError('Invalid comparator: ' + comp); this.operator = m[1]; if (this.operator === '=') this.operator = ''; // if it literally is just '>' or '' then allow anything. if (!m[2]) this.semver = ANY; else this.semver = new SemVer(m[2], this.loose); }; Comparator.prototype.toString = function() { return this.value; }; Comparator.prototype.test = function(version) { debug('Comparator.test', version, this.loose); if (this.semver === ANY) return true; if (typeof version === 'string') version = new SemVer(version, this.loose); return cmp(version, this.operator, this.semver, this.loose); }; Comparator.prototype.intersects = function(comp, loose) { if (!(comp instanceof Comparator)) { throw new TypeError('a Comparator is required'); } var rangeTmp; if (this.operator === '') { rangeTmp = new Range(comp.value, loose); return satisfies(this.value, rangeTmp, loose); } else if (comp.operator === '') { rangeTmp = new Range(this.value, loose); return satisfies(comp.semver, rangeTmp, loose); } var sameDirectionIncreasing = (this.operator === '>=' || this.operator === '>') && (comp.operator === '>=' || comp.operator === '>'); var sameDirectionDecreasing = (this.operator === '<=' || this.operator === '<') && (comp.operator === '<=' || comp.operator === '<'); var sameSemVer = this.semver.version === comp.semver.version; var differentDirectionsInclusive = (this.operator === '>=' || this.operator === '<=') && (comp.operator === '>=' || comp.operator === '<='); var oppositeDirectionsLessThan = cmp(this.semver, '<', comp.semver, loose) && ((this.operator === '>=' || this.operator === '>') && (comp.operator === '<=' || comp.operator === '<')); var oppositeDirectionsGreaterThan = cmp(this.semver, '>', comp.semver, loose) && ((this.operator === '<=' || this.operator === '<') && (comp.operator === '>=' || comp.operator === '>')); return sameDirectionIncreasing || sameDirectionDecreasing || (sameSemVer && differentDirectionsInclusive) || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan; }; exports.Range = Range; function Range(range, loose) { if (range instanceof Range) { if (range.loose === loose) { return range; } else { return new Range(range.raw, loose); } } if (range instanceof Comparator) { return new Range(range.value, loose); } if (!(this instanceof Range)) return new Range(range, loose); this.loose = loose; // First, split based on boolean or || this.raw = range; this.set = range.split(/\s*\|\|\s*/).map(function(range) { return this.parseRange(range.trim()); }, this).filter(function(c) { // throw out any that are not relevant for whatever reason return c.length; }); if (!this.set.length) { throw new TypeError('Invalid SemVer Range: ' + range); } this.format(); } Range.prototype.format = function() { this.range = this.set.map(function(comps) { return comps.join(' ').trim(); }).join('||').trim(); return this.range; }; Range.prototype.toString = function() { return this.range; }; Range.prototype.parseRange = function(range) { var loose = this.loose; range = range.trim(); debug('range', range, loose); // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; range = range.replace(hr, hyphenReplace); debug('hyphen replace', range); // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); debug('comparator trim', range, re[COMPARATORTRIM]); // `~ 1.2.3` => `~1.2.3` range = range.replace(re[TILDETRIM], tildeTrimReplace); // `^ 1.2.3` => `^1.2.3` range = range.replace(re[CARETTRIM], caretTrimReplace); // normalize spaces range = range.split(/\s+/).join(' '); // At this point, the range is completely trimmed and // ready to be split into comparators. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; var set = range.split(' ').map(function(comp) { return parseComparator(comp, loose); }).join(' ').split(/\s+/); if (this.loose) { // in loose mode, throw out any that are not valid comparators set = set.filter(function(comp) { return !!comp.match(compRe); }); } set = set.map(function(comp) { return new Comparator(comp, loose); }); return set; }; Range.prototype.intersects = function(range, loose) { if (!(range instanceof Range)) { throw new TypeError('a Range is required'); } return this.set.some(function(thisComparators) { return thisComparators.every(function(thisComparator) { return range.set.some(function(rangeComparators) { return rangeComparators.every(function(rangeComparator) { return thisComparator.intersects(rangeComparator, loose); }); }); }); }); }; // Mostly just for testing and legacy API reasons exports.toComparators = toComparators; function toComparators(range, loose) { return new Range(range, loose).set.map(function(comp) { return comp.map(function(c) { return c.value; }).join(' ').trim().split(' '); }); } // comprised of xranges, tildes, stars, and gtlt's at this point. // already replaced the hyphen ranges // turn into a set of JUST comparators. function parseComparator(comp, loose) { debug('comp', comp); comp = replaceCarets(comp, loose); debug('caret', comp); comp = replaceTildes(comp, loose); debug('tildes', comp); comp = replaceXRanges(comp, loose); debug('xrange', comp); comp = replaceStars(comp, loose); debug('stars', comp); return comp; } function isX(id) { return !id || id.toLowerCase() === 'x' || id === '*'; } // ~, ~> --> * (any, kinda silly) // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 function replaceTildes(comp, loose) { return comp.trim().split(/\s+/).map(function(comp) { return replaceTilde(comp, loose); }).join(' '); } function replaceTilde(comp, loose) { var r = loose ? re[TILDELOOSE] : re[TILDE]; return comp.replace(r, function(_, M, m, p, pr) { debug('tilde', comp, _, M, m, p, pr); var ret; if (isX(M)) ret = ''; else if (isX(m)) ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) // ~1.2 == >=1.2.0 <1.3.0 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else if (pr) { debug('replaceTilde pr', pr); if (pr.charAt(0) !== '-') pr = '-' + pr; ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + M + '.' + (+m + 1) + '.0'; } else // ~1.2.3 == >=1.2.3 <1.3.0 ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0'; debug('tilde return', ret); return ret; }); } // ^ --> * (any, kinda silly) // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 // ^1.2.3 --> >=1.2.3 <2.0.0 // ^1.2.0 --> >=1.2.0 <2.0.0 function replaceCarets(comp, loose) { return comp.trim().split(/\s+/).map(function(comp) { return replaceCaret(comp, loose); }).join(' '); } function replaceCaret(comp, loose) { debug('caret', comp, loose); var r = loose ? re[CARETLOOSE] : re[CARET]; return comp.replace(r, function(_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr); var ret; if (isX(M)) ret = ''; else if (isX(m)) ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) { if (M === '0') ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; } else if (pr) { debug('replaceCaret pr', pr); if (pr.charAt(0) !== '-') pr = '-' + pr; if (M === '0') { if (m === '0') ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + M + '.' + m + '.' + (+p + 1); else ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + M + '.' + (+m + 1) + '.0'; } else ret = '>=' + M + '.' + m + '.' + p + pr + ' <' + (+M + 1) + '.0.0'; } else { debug('no pr'); if (M === '0') { if (m === '0') ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + m + '.' + (+p + 1); else ret = '>=' + M + '.' + m + '.' + p + ' <' + M + '.' + (+m + 1) + '.0'; } else ret = '>=' + M + '.' + m + '.' + p + ' <' + (+M + 1) + '.0.0'; } debug('caret return', ret); return ret; }); } function replaceXRanges(comp, loose) { debug('replaceXRanges', comp, loose); return comp.split(/\s+/).map(function(comp) { return replaceXRange(comp, loose); }).join(' '); } function replaceXRange(comp, loose) { comp = comp.trim(); var r = loose ? re[XRANGELOOSE] : re[XRANGE]; return comp.replace(r, function(ret, gtlt, M, m, p, pr) { debug('xRange', comp, ret, gtlt, M, m, p, pr); var xM = isX(M); var xm = xM || isX(m); var xp = xm || isX(p); var anyX = xp; if (gtlt === '=' && anyX) gtlt = ''; if (xM) { if (gtlt === '>' || gtlt === '<') { // nothing is allowed ret = '<0.0.0'; } else { // nothing is forbidden ret = '*'; } } else if (gtlt && anyX) { // replace X with 0 if (xm) m = 0; if (xp) p = 0; if (gtlt === '>') { // >1 => >=2.0.0 // >1.2 => >=1.3.0 // >1.2.3 => >= 1.2.4 gtlt = '>='; if (xm) { M = +M + 1; m = 0; p = 0; } else if (xp) { m = +m + 1; p = 0; } } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. gtlt = '<'; if (xm) M = +M + 1; else m = +m + 1; } ret = gtlt + M + '.' + m + '.' + p; } else if (xm) { ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; } else if (xp) { ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; } debug('xRange return', ret); return ret; }); } // Because * is AND-ed with everything else in the comparator, // and '' means "any version", just remove the *s entirely. function replaceStars(comp, loose) { debug('replaceStars', comp, loose); // Looseness is ignored here. star is always as loose as it gets! return comp.trim().replace(re[STAR], ''); } // This function is passed to string.replace(re[HYPHENRANGE]) // M, m, patch, prerelease, build // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do // 1.2 - 3.4 => >=1.2.0 <3.5.0 function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { if (isX(fM)) from = ''; else if (isX(fm)) from = '>=' + fM + '.0.0'; else if (isX(fp)) from = '>=' + fM + '.' + fm + '.0'; else from = '>=' + from; if (isX(tM)) to = ''; else if (isX(tm)) to = '<' + (+tM + 1) + '.0.0'; else if (isX(tp)) to = '<' + tM + '.' + (+tm + 1) + '.0'; else if (tpr) to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; else to = '<=' + to; return (from + ' ' + to).trim(); } // if ANY of the sets match ALL of its comparators, then pass Range.prototype.test = function(version) { if (!version) return false; if (typeof version === 'string') version = new SemVer(version, this.loose); for (var i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version)) return true; } return false; }; function testSet(set, version) { for (var i = 0; i < set.length; i++) { if (!set[i].test(version)) return false; } if (version.prerelease.length) { // Find the set of versions that are allowed to have prereleases // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 // That should allow `1.2.3-pr.2` to pass. // However, `1.2.4-alpha.notready` should NOT be allowed, // even though it's within the range set by the comparators. for (var i = 0; i < set.length; i++) { debug(set[i].semver); if (set[i].semver === ANY) continue; if (set[i].semver.prerelease.length > 0) { var allowed = set[i].semver; if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true; } } // Version has a -pre, but it's not one of the ones we like. return false; } return true; } exports.satisfies = satisfies; function satisfies(version, range, loose) { try { range = new Range(range, loose); } catch (er) { return false; } return range.test(version); } exports.maxSatisfying = maxSatisfying; function maxSatisfying(versions, range, loose) { var max = null; var maxSV = null; try { var rangeObj = new Range(range, loose); } catch (er) { return null; } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, loose) if (!max || maxSV.compare(v) === -1) { // compare(max, v, true) max = v; maxSV = new SemVer(max, loose); } } }) return max; } exports.minSatisfying = minSatisfying; function minSatisfying(versions, range, loose) { var min = null; var minSV = null; try { var rangeObj = new Range(range, loose); } catch (er) { return null; } versions.forEach(function (v) { if (rangeObj.test(v)) { // satisfies(v, range, loose) if (!min || minSV.compare(v) === 1) { // compare(min, v, true) min = v; minSV = new SemVer(min, loose); } } }) return min; } exports.validRange = validRange; function validRange(range, loose) { try { // Return '*' instead of '' so that truthiness works. // This will throw if it's invalid anyway return new Range(range, loose).range || '*'; } catch (er) { return null; } } // Determine if version is less than all the versions possible in the range exports.ltr = ltr; function ltr(version, range, loose) { return outside(version, range, '<', loose); } // Determine if version is greater than all the versions possible in the range. exports.gtr = gtr; function gtr(version, range, loose) { return outside(version, range, '>', loose); } exports.outside = outside; function outside(version, range, hilo, loose) { version = new SemVer(version, loose); range = new Range(range, loose); var gtfn, ltefn, ltfn, comp, ecomp; switch (hilo) { case '>': gtfn = gt; ltefn = lte; ltfn = lt; comp = '>'; ecomp = '>='; break; case '<': gtfn = lt; ltefn = gte; ltfn = gt; comp = '<'; ecomp = '<='; break; default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } // If it satisifes the range it is not outside if (satisfies(version, range, loose)) { return false; } // From now on, variable terms are as if we're in "gtr" mode. // but note that everything is flipped for the "ltr" function. for (var i = 0; i < range.set.length; ++i) { var comparators = range.set[i]; var high = null; var low = null; comparators.forEach(function(comparator) { if (comparator.semver === ANY) { comparator = new Comparator('>=0.0.0') } high = high || comparator; low = low || comparator; if (gtfn(comparator.semver, high.semver, loose)) { high = comparator; } else if (ltfn(comparator.semver, low.semver, loose)) { low = comparator; } }); // If the edge version comparator has a operator then our version // isn't outside it if (high.operator === comp || high.operator === ecomp) { return false; } // If the lowest version comparator has an operator and our version // is less than it then it isn't higher than the range if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { return false; } else if (low.operator === ecomp && ltfn(version, low.semver)) { return false; } } return true; } exports.prerelease = prerelease; function prerelease(version, loose) { var parsed = parse(version, loose); return (parsed && parsed.prerelease.length) ? parsed.prerelease : null; } exports.intersects = intersects; function intersects(r1, r2, loose) { r1 = new Range(r1, loose) r2 = new Range(r2, loose) return r1.intersects(r2) } exports.coerce = coerce; function coerce(version) { if (version instanceof SemVer) return version; if (typeof version !== 'string') return null; var match = version.match(re[COERCE]); if (match == null) return null; return parse((match[1] || '0') + '.' + (match[2] || '0') + '.' + (match[3] || '0')); } /***/ }), /* 23 */ /***/ (function(module, exports) { module.exports = require("stream"); /***/ }), /* 24 */ /***/ (function(module, exports) { module.exports = require("url"); /***/ }), /* 25 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscription; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isArray__ = __webpack_require__(41); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isObject__ = __webpack_require__(444); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isFunction__ = __webpack_require__(154); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_tryCatch__ = __webpack_require__(56); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_errorObject__ = __webpack_require__(48); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__ = __webpack_require__(441); /** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_tryCatch,_util_errorObject,_util_UnsubscriptionError PURE_IMPORTS_END */ var Subscription = /*@__PURE__*/ (function () { function Subscription(unsubscribe) { this.closed = false; this._parent = null; this._parents = null; this._subscriptions = null; if (unsubscribe) { this._unsubscribe = unsubscribe; } } Subscription.prototype.unsubscribe = function () { var hasErrors = false; var errors; if (this.closed) { return; } var _a = this, _parent = _a._parent, _parents = _a._parents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions; this.closed = true; this._parent = null; this._parents = null; this._subscriptions = null; var index = -1; var len = _parents ? _parents.length : 0; while (_parent) { _parent.remove(this); _parent = ++index < len && _parents[index] || null; } if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isFunction__["a" /* isFunction */])(_unsubscribe)) { var trial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(_unsubscribe).call(this); if (trial === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) { hasErrors = true; errors = errors || (__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */] ? flattenUnsubscriptionErrors(__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e.errors) : [__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e]); } } if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isArray__["a" /* isArray */])(_subscriptions)) { index = -1; len = _subscriptions.length; while (++index < len) { var sub = _subscriptions[index]; if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isObject__["a" /* isObject */])(sub)) { var trial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(sub.unsubscribe).call(sub); if (trial === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) { hasErrors = true; errors = errors || []; var err = __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e; if (err instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */]) { errors = errors.concat(flattenUnsubscriptionErrors(err.errors)); } else { errors.push(err); } } } } } if (hasErrors) { throw new __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */](errors); } }; Subscription.prototype.add = function (teardown) { if (!teardown || (teardown === Subscription.EMPTY)) { return Subscription.EMPTY; } if (teardown === this) { return this; } var subscription = teardown; switch (typeof teardown) { case 'function': subscription = new Subscription(teardown); case 'object': if (subscription.closed || typeof subscription.unsubscribe !== 'function') { return subscription; } else if (this.closed) { subscription.unsubscribe(); return subscription; } else if (typeof subscription._addParent !== 'function') { var tmp = subscription; subscription = new Subscription(); subscription._subscriptions = [tmp]; } break; default: throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.'); } var subscriptions = this._subscriptions || (this._subscriptions = []); subscriptions.push(subscription); subscription._addParent(this); return subscription; }; Subscription.prototype.remove = function (subscription) { var subscriptions = this._subscriptions; if (subscriptions) { var subscriptionIndex = subscriptions.indexOf(subscription); if (subscriptionIndex !== -1) { subscriptions.splice(subscriptionIndex, 1); } } }; Subscription.prototype._addParent = function (parent) { var _a = this, _parent = _a._parent, _parents = _a._parents; if (!_parent || _parent === parent) { this._parent = parent; } else if (!_parents) { this._parents = [parent]; } else if (_parents.indexOf(parent) === -1) { _parents.push(parent); } }; Subscription.EMPTY = (function (empty) { empty.closed = true; return empty; }(new Subscription())); return Subscription; }()); function flattenUnsubscriptionErrors(errors) { return errors.reduce(function (errs, err) { return errs.concat((err instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */]) ? err.errors : err); }, []); } //# sourceMappingURL=Subscription.js.map /***/ }), /* 26 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. module.exports = { bufferSplit: bufferSplit, addRSAMissing: addRSAMissing, calculateDSAPublic: calculateDSAPublic, calculateED25519Public: calculateED25519Public, calculateX25519Public: calculateX25519Public, mpNormalize: mpNormalize, mpDenormalize: mpDenormalize, ecNormalize: ecNormalize, countZeros: countZeros, assertCompatible: assertCompatible, isCompatible: isCompatible, opensslKeyDeriv: opensslKeyDeriv, opensshCipherInfo: opensshCipherInfo, publicFromPrivateECDSA: publicFromPrivateECDSA, zeroPadToLength: zeroPadToLength, writeBitString: writeBitString, readBitString: readBitString }; var assert = __webpack_require__(16); var Buffer = __webpack_require__(15).Buffer; var PrivateKey = __webpack_require__(33); var Key = __webpack_require__(27); var crypto = __webpack_require__(11); var algs = __webpack_require__(32); var asn1 = __webpack_require__(66); var ec, jsbn; var nacl; var MAX_CLASS_DEPTH = 3; function isCompatible(obj, klass, needVer) { if (obj === null || typeof (obj) !== 'object') return (false); if (needVer === undefined) needVer = klass.prototype._sshpkApiVersion; if (obj instanceof klass && klass.prototype._sshpkApiVersion[0] == needVer[0]) return (true); var proto = Object.getPrototypeOf(obj); var depth = 0; while (proto.constructor.name !== klass.name) { proto = Object.getPrototypeOf(proto); if (!proto || ++depth > MAX_CLASS_DEPTH) return (false); } if (proto.constructor.name !== klass.name) return (false); var ver = proto._sshpkApiVersion; if (ver === undefined) ver = klass._oldVersionDetect(obj); if (ver[0] != needVer[0] || ver[1] < needVer[1]) return (false); return (true); } function assertCompatible(obj, klass, needVer, name) { if (name === undefined) name = 'object'; assert.ok(obj, name + ' must not be null'); assert.object(obj, name + ' must be an object'); if (needVer === undefined) needVer = klass.prototype._sshpkApiVersion; if (obj instanceof klass && klass.prototype._sshpkApiVersion[0] == needVer[0]) return; var proto = Object.getPrototypeOf(obj); var depth = 0; while (proto.constructor.name !== klass.name) { proto = Object.getPrototypeOf(proto); assert.ok(proto && ++depth <= MAX_CLASS_DEPTH, name + ' must be a ' + klass.name + ' instance'); } assert.strictEqual(proto.constructor.name, klass.name, name + ' must be a ' + klass.name + ' instance'); var ver = proto._sshpkApiVersion; if (ver === undefined) ver = klass._oldVersionDetect(obj); assert.ok(ver[0] == needVer[0] && ver[1] >= needVer[1], name + ' must be compatible with ' + klass.name + ' klass ' + 'version ' + needVer[0] + '.' + needVer[1]); } var CIPHER_LEN = { 'des-ede3-cbc': { key: 7, iv: 8 }, 'aes-128-cbc': { key: 16, iv: 16 } }; var PKCS5_SALT_LEN = 8; function opensslKeyDeriv(cipher, salt, passphrase, count) { assert.buffer(salt, 'salt'); assert.buffer(passphrase, 'passphrase'); assert.number(count, 'iteration count'); var clen = CIPHER_LEN[cipher]; assert.object(clen, 'supported cipher'); salt = salt.slice(0, PKCS5_SALT_LEN); var D, D_prev, bufs; var material = Buffer.alloc(0); while (material.length < clen.key + clen.iv) { bufs = []; if (D_prev) bufs.push(D_prev); bufs.push(passphrase); bufs.push(salt); D = Buffer.concat(bufs); for (var j = 0; j < count; ++j) D = crypto.createHash('md5').update(D).digest(); material = Buffer.concat([material, D]); D_prev = D; } return ({ key: material.slice(0, clen.key), iv: material.slice(clen.key, clen.key + clen.iv) }); } /* Count leading zero bits on a buffer */ function countZeros(buf) { var o = 0, obit = 8; while (o < buf.length) { var mask = (1 << obit); if ((buf[o] & mask) === mask) break; obit--; if (obit < 0) { o++; obit = 8; } } return (o*8 + (8 - obit) - 1); } function bufferSplit(buf, chr) { assert.buffer(buf); assert.string(chr); var parts = []; var lastPart = 0; var matches = 0; for (var i = 0; i < buf.length; ++i) { if (buf[i] === chr.charCodeAt(matches)) ++matches; else if (buf[i] === chr.charCodeAt(0)) matches = 1; else matches = 0; if (matches >= chr.length) { var newPart = i + 1; parts.push(buf.slice(lastPart, newPart - matches)); lastPart = newPart; matches = 0; } } if (lastPart <= buf.length) parts.push(buf.slice(lastPart, buf.length)); return (parts); } function ecNormalize(buf, addZero) { assert.buffer(buf); if (buf[0] === 0x00 && buf[1] === 0x04) { if (addZero) return (buf); return (buf.slice(1)); } else if (buf[0] === 0x04) { if (!addZero) return (buf); } else { while (buf[0] === 0x00) buf = buf.slice(1); if (buf[0] === 0x02 || buf[0] === 0x03) throw (new Error('Compressed elliptic curve points ' + 'are not supported')); if (buf[0] !== 0x04) throw (new Error('Not a valid elliptic curve point')); if (!addZero) return (buf); } var b = Buffer.alloc(buf.length + 1); b[0] = 0x0; buf.copy(b, 1); return (b); } function readBitString(der, tag) { if (tag === undefined) tag = asn1.Ber.BitString; var buf = der.readString(tag, true); assert.strictEqual(buf[0], 0x00, 'bit strings with unused bits are ' + 'not supported (0x' + buf[0].toString(16) + ')'); return (buf.slice(1)); } function writeBitString(der, buf, tag) { if (tag === undefined) tag = asn1.Ber.BitString; var b = Buffer.alloc(buf.length + 1); b[0] = 0x00; buf.copy(b, 1); der.writeBuffer(b, tag); } function mpNormalize(buf) { assert.buffer(buf); while (buf.length > 1 && buf[0] === 0x00 && (buf[1] & 0x80) === 0x00) buf = buf.slice(1); if ((buf[0] & 0x80) === 0x80) { var b = Buffer.alloc(buf.length + 1); b[0] = 0x00; buf.copy(b, 1); buf = b; } return (buf); } function mpDenormalize(buf) { assert.buffer(buf); while (buf.length > 1 && buf[0] === 0x00) buf = buf.slice(1); return (buf); } function zeroPadToLength(buf, len) { assert.buffer(buf); assert.number(len); while (buf.length > len) { assert.equal(buf[0], 0x00); buf = buf.slice(1); } while (buf.length < len) { var b = Buffer.alloc(buf.length + 1); b[0] = 0x00; buf.copy(b, 1); buf = b; } return (buf); } function bigintToMpBuf(bigint) { var buf = Buffer.from(bigint.toByteArray()); buf = mpNormalize(buf); return (buf); } function calculateDSAPublic(g, p, x) { assert.buffer(g); assert.buffer(p); assert.buffer(x); try { var bigInt = __webpack_require__(81).BigInteger; } catch (e) { throw (new Error('To load a PKCS#8 format DSA private key, ' + 'the node jsbn library is required.')); } g = new bigInt(g); p = new bigInt(p); x = new bigInt(x); var y = g.modPow(x, p); var ybuf = bigintToMpBuf(y); return (ybuf); } function calculateED25519Public(k) { assert.buffer(k); if (nacl === undefined) nacl = __webpack_require__(76); var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k)); return (Buffer.from(kp.publicKey)); } function calculateX25519Public(k) { assert.buffer(k); if (nacl === undefined) nacl = __webpack_require__(76); var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k)); return (Buffer.from(kp.publicKey)); } function addRSAMissing(key) { assert.object(key); assertCompatible(key, PrivateKey, [1, 1]); try { var bigInt = __webpack_require__(81).BigInteger; } catch (e) { throw (new Error('To write a PEM private key from ' + 'this source, the node jsbn lib is required.')); } var d = new bigInt(key.part.d.data); var buf; if (!key.part.dmodp) { var p = new bigInt(key.part.p.data); var dmodp = d.mod(p.subtract(1)); buf = bigintToMpBuf(dmodp); key.part.dmodp = {name: 'dmodp', data: buf}; key.parts.push(key.part.dmodp); } if (!key.part.dmodq) { var q = new bigInt(key.part.q.data); var dmodq = d.mod(q.subtract(1)); buf = bigintToMpBuf(dmodq); key.part.dmodq = {name: 'dmodq', data: buf}; key.parts.push(key.part.dmodq); } } function publicFromPrivateECDSA(curveName, priv) { assert.string(curveName, 'curveName'); assert.buffer(priv); if (ec === undefined) ec = __webpack_require__(139); if (jsbn === undefined) jsbn = __webpack_require__(81).BigInteger; var params = algs.curves[curveName]; var p = new jsbn(params.p); var a = new jsbn(params.a); var b = new jsbn(params.b); var curve = new ec.ECCurveFp(p, a, b); var G = curve.decodePointHex(params.G.toString('hex')); var d = new jsbn(mpNormalize(priv)); var pub = G.multiply(d); pub = Buffer.from(curve.encodePointHex(pub), 'hex'); var parts = []; parts.push({name: 'curve', data: Buffer.from(curveName)}); parts.push({name: 'Q', data: pub}); var key = new Key({type: 'ecdsa', curve: curve, parts: parts}); return (key); } function opensshCipherInfo(cipher) { var inf = {}; switch (cipher) { case '3des-cbc': inf.keySize = 24; inf.blockSize = 8; inf.opensslName = 'des-ede3-cbc'; break; case 'blowfish-cbc': inf.keySize = 16; inf.blockSize = 8; inf.opensslName = 'bf-cbc'; break; case 'aes128-cbc': case 'aes128-ctr': case 'aes128-gcm@openssh.com': inf.keySize = 16; inf.blockSize = 16; inf.opensslName = 'aes-128-' + cipher.slice(7, 10); break; case 'aes192-cbc': case 'aes192-ctr': case 'aes192-gcm@openssh.com': inf.keySize = 24; inf.blockSize = 16; inf.opensslName = 'aes-192-' + cipher.slice(7, 10); break; case 'aes256-cbc': case 'aes256-ctr': case 'aes256-gcm@openssh.com': inf.keySize = 32; inf.blockSize = 16; inf.opensslName = 'aes-256-' + cipher.slice(7, 10); break; default: throw (new Error( 'Unsupported openssl cipher "' + cipher + '"')); } return (inf); } /***/ }), /* 27 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Joyent, Inc. module.exports = Key; var assert = __webpack_require__(16); var algs = __webpack_require__(32); var crypto = __webpack_require__(11); var Fingerprint = __webpack_require__(156); var Signature = __webpack_require__(75); var DiffieHellman = __webpack_require__(325).DiffieHellman; var errs = __webpack_require__(74); var utils = __webpack_require__(26); var PrivateKey = __webpack_require__(33); var edCompat; try { edCompat = __webpack_require__(454); } catch (e) { /* Just continue through, and bail out if we try to use it. */ } var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; var formats = {}; formats['auto'] = __webpack_require__(455); formats['pem'] = __webpack_require__(86); formats['pkcs1'] = __webpack_require__(327); formats['pkcs8'] = __webpack_require__(157); formats['rfc4253'] = __webpack_require__(103); formats['ssh'] = __webpack_require__(456); formats['ssh-private'] = __webpack_require__(192); formats['openssh'] = formats['ssh-private']; formats['dnssec'] = __webpack_require__(326); function Key(opts) { assert.object(opts, 'options'); assert.arrayOfObject(opts.parts, 'options.parts'); assert.string(opts.type, 'options.type'); assert.optionalString(opts.comment, 'options.comment'); var algInfo = algs.info[opts.type]; if (typeof (algInfo) !== 'object') throw (new InvalidAlgorithmError(opts.type)); var partLookup = {}; for (var i = 0; i < opts.parts.length; ++i) { var part = opts.parts[i]; partLookup[part.name] = part; } this.type = opts.type; this.parts = opts.parts; this.part = partLookup; this.comment = undefined; this.source = opts.source; /* for speeding up hashing/fingerprint operations */ this._rfc4253Cache = opts._rfc4253Cache; this._hashCache = {}; var sz; this.curve = undefined; if (this.type === 'ecdsa') { var curve = this.part.curve.data.toString(); this.curve = curve; sz = algs.curves[curve].size; } else if (this.type === 'ed25519' || this.type === 'curve25519') { sz = 256; this.curve = 'curve25519'; } else { var szPart = this.part[algInfo.sizePart]; sz = szPart.data.length; sz = sz * 8 - utils.countZeros(szPart.data); } this.size = sz; } Key.formats = formats; Key.prototype.toBuffer = function (format, options) { if (format === undefined) format = 'ssh'; assert.string(format, 'format'); assert.object(formats[format], 'formats[format]'); assert.optionalObject(options, 'options'); if (format === 'rfc4253') { if (this._rfc4253Cache === undefined) this._rfc4253Cache = formats['rfc4253'].write(this); return (this._rfc4253Cache); } return (formats[format].write(this, options)); }; Key.prototype.toString = function (format, options) { return (this.toBuffer(format, options).toString()); }; Key.prototype.hash = function (algo) { assert.string(algo, 'algorithm'); algo = algo.toLowerCase(); if (algs.hashAlgs[algo] === undefined) throw (new InvalidAlgorithmError(algo)); if (this._hashCache[algo]) return (this._hashCache[algo]); var hash = crypto.createHash(algo). update(this.toBuffer('rfc4253')).digest(); this._hashCache[algo] = hash; return (hash); }; Key.prototype.fingerprint = function (algo) { if (algo === undefined) algo = 'sha256'; assert.string(algo, 'algorithm'); var opts = { type: 'key', hash: this.hash(algo), algorithm: algo }; return (new Fingerprint(opts)); }; Key.prototype.defaultHashAlgorithm = function () { var hashAlgo = 'sha1'; if (this.type === 'rsa') hashAlgo = 'sha256'; if (this.type === 'dsa' && this.size > 1024) hashAlgo = 'sha256'; if (this.type === 'ed25519') hashAlgo = 'sha512'; if (this.type === 'ecdsa') { if (this.size <= 256) hashAlgo = 'sha256'; else if (this.size <= 384) hashAlgo = 'sha384'; else hashAlgo = 'sha512'; } return (hashAlgo); }; Key.prototype.createVerify = function (hashAlgo) { if (hashAlgo === undefined) hashAlgo = this.defaultHashAlgorithm(); assert.string(hashAlgo, 'hash algorithm'); /* ED25519 is not supported by OpenSSL, use a javascript impl. */ if (this.type === 'ed25519' && edCompat !== undefined) return (new edCompat.Verifier(this, hashAlgo)); if (this.type === 'curve25519') throw (new Error('Curve25519 keys are not suitable for ' + 'signing or verification')); var v, nm, err; try { nm = hashAlgo.toUpperCase(); v = crypto.createVerify(nm); } catch (e) { err = e; } if (v === undefined || (err instanceof Error && err.message.match(/Unknown message digest/))) { nm = 'RSA-'; nm += hashAlgo.toUpperCase(); v = crypto.createVerify(nm); } assert.ok(v, 'failed to create verifier'); var oldVerify = v.verify.bind(v); var key = this.toBuffer('pkcs8'); var curve = this.curve; var self = this; v.verify = function (signature, fmt) { if (Signature.isSignature(signature, [2, 0])) { if (signature.type !== self.type) return (false); if (signature.hashAlgorithm && signature.hashAlgorithm !== hashAlgo) return (false); if (signature.curve && self.type === 'ecdsa' && signature.curve !== curve) return (false); return (oldVerify(key, signature.toBuffer('asn1'))); } else if (typeof (signature) === 'string' || Buffer.isBuffer(signature)) { return (oldVerify(key, signature, fmt)); /* * Avoid doing this on valid arguments, walking the prototype * chain can be quite slow. */ } else if (Signature.isSignature(signature, [1, 0])) { throw (new Error('signature was created by too old ' + 'a version of sshpk and cannot be verified')); } else { throw (new TypeError('signature must be a string, ' + 'Buffer, or Signature object')); } }; return (v); }; Key.prototype.createDiffieHellman = function () { if (this.type === 'rsa') throw (new Error('RSA keys do not support Diffie-Hellman')); return (new DiffieHellman(this)); }; Key.prototype.createDH = Key.prototype.createDiffieHellman; Key.parse = function (data, format, options) { if (typeof (data) !== 'string') assert.buffer(data, 'data'); if (format === undefined) format = 'auto'; assert.string(format, 'format'); if (typeof (options) === 'string') options = { filename: options }; assert.optionalObject(options, 'options'); if (options === undefined) options = {}; assert.optionalString(options.filename, 'options.filename'); if (options.filename === undefined) options.filename = '(unnamed)'; assert.object(formats[format], 'formats[format]'); try { var k = formats[format].read(data, options); if (k instanceof PrivateKey) k = k.toPublic(); if (!k.comment) k.comment = options.filename; return (k); } catch (e) { if (e.name === 'KeyEncryptedError') throw (e); throw (new KeyParseError(options.filename, format, e)); } }; Key.isKey = function (obj, ver) { return (utils.isCompatible(obj, Key, ver)); }; /* * API versions for Key: * [1,0] -- initial ver, may take Signature for createVerify or may not * [1,1] -- added pkcs1, pkcs8 formats * [1,2] -- added auto, ssh-private, openssh formats * [1,3] -- added defaultHashAlgorithm * [1,4] -- added ed support, createDH * [1,5] -- first explicitly tagged version * [1,6] -- changed ed25519 part names */ Key.prototype._sshpkApiVersion = [1, 6]; Key._oldVersionDetect = function (obj) { assert.func(obj.toBuffer); assert.func(obj.fingerprint); if (obj.createDH) return ([1, 4]); if (obj.defaultHashAlgorithm) return ([1, 3]); if (obj.formats['auto']) return ([1, 2]); if (obj.formats['pkcs1']) return ([1, 1]); return ([1, 0]); }; /***/ }), /* 28 */ /***/ (function(module, exports) { module.exports = require("assert"); /***/ }), /* 29 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = nullify; function nullify(obj = {}) { if (Array.isArray(obj)) { for (var _iterator = obj, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } const item = _ref; nullify(item); } } else if (obj !== null && typeof obj === 'object' || typeof obj === 'function') { Object.setPrototypeOf(obj, null); // for..in can only be applied to 'object', not 'function' if (typeof obj === 'object') { for (const key in obj) { nullify(obj[key]); } } } return obj; } /***/ }), /* 30 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const escapeStringRegexp = __webpack_require__(388); const ansiStyles = __webpack_require__(506); const stdoutColor = __webpack_require__(598).stdout; const template = __webpack_require__(599); const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); // `supportsColor.level` → `ansiStyles.color[name]` mapping const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; // `color-convert` models to exclude from the Chalk API due to conflicts and such const skipModels = new Set(['gray']); const styles = Object.create(null); function applyOptions(obj, options) { options = options || {}; // Detect level if not set manually const scLevel = stdoutColor ? stdoutColor.level : 0; obj.level = options.level === undefined ? scLevel : options.level; obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; } function Chalk(options) { // We check for this.template here since calling `chalk.constructor()` // by itself will have a `this` of a previously constructed chalk object if (!this || !(this instanceof Chalk) || this.template) { const chalk = {}; applyOptions(chalk, options); chalk.template = function () { const args = [].slice.call(arguments); return chalkTag.apply(null, [chalk.template].concat(args)); }; Object.setPrototypeOf(chalk, Chalk.prototype); Object.setPrototypeOf(chalk.template, chalk); chalk.template.constructor = Chalk; return chalk.template; } applyOptions(this, options); } // Use bright blue on Windows as the normal blue color is illegible if (isSimpleWindowsTerm) { ansiStyles.blue.open = '\u001B[94m'; } for (const key of Object.keys(ansiStyles)) { ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); styles[key] = { get() { const codes = ansiStyles[key]; return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); } }; } styles.visible = { get() { return build.call(this, this._styles || [], true, 'visible'); } }; ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); for (const model of Object.keys(ansiStyles.color.ansi)) { if (skipModels.has(model)) { continue; } styles[model] = { get() { const level = this.level; return function () { const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); const codes = { open, close: ansiStyles.color.close, closeRe: ansiStyles.color.closeRe }; return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); }; } }; } ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); for (const model of Object.keys(ansiStyles.bgColor.ansi)) { if (skipModels.has(model)) { continue; } const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); styles[bgModel] = { get() { const level = this.level; return function () { const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); const codes = { open, close: ansiStyles.bgColor.close, closeRe: ansiStyles.bgColor.closeRe }; return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); }; } }; } const proto = Object.defineProperties(() => {}, styles); function build(_styles, _empty, key) { const builder = function () { return applyStyle.apply(builder, arguments); }; builder._styles = _styles; builder._empty = _empty; const self = this; Object.defineProperty(builder, 'level', { enumerable: true, get() { return self.level; }, set(level) { self.level = level; } }); Object.defineProperty(builder, 'enabled', { enumerable: true, get() { return self.enabled; }, set(enabled) { self.enabled = enabled; } }); // See below for fix regarding invisible grey/dim combination on Windows builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; // `__proto__` is used because we must return a function, but there is // no way to create a function with a different prototype builder.__proto__ = proto; // eslint-disable-line no-proto return builder; } function applyStyle() { // Support varags, but simply cast to string in case there's only one arg const args = arguments; const argsLen = args.length; let str = String(arguments[0]); if (argsLen === 0) { return ''; } if (argsLen > 1) { // Don't slice `arguments`, it prevents V8 optimizations for (let a = 1; a < argsLen; a++) { str += ' ' + args[a]; } } if (!this.enabled || this.level <= 0 || !str) { return this._empty ? '' : str; } // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, // see https://github.com/chalk/chalk/issues/58 // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. const originalDim = ansiStyles.dim.open; if (isSimpleWindowsTerm && this.hasGrey) { ansiStyles.dim.open = ''; } for (const code of this._styles.slice().reverse()) { // Replace any instances already present with a re-opening code // otherwise only the part of the string until said closing code // will be colored, and the rest will simply be 'plain'. str = code.open + str.replace(code.closeRe, code.open) + code.close; // Close the styling before a linebreak and reopen // after next line to fix a bleed issue on macOS // https://github.com/chalk/chalk/pull/92 str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); } // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue ansiStyles.dim.open = originalDim; return str; } function chalkTag(chalk, strings) { if (!Array.isArray(strings)) { // If chalk() was called by itself or with a string, // return the string itself as a string. return [].slice.call(arguments, 1).join(' '); } const args = [].slice.call(arguments, 2); const parts = [strings.raw[0]]; for (let i = 1; i < strings.length; i++) { parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); parts.push(String(strings.raw[i])); } return template(chalk, parts.join('')); } Object.defineProperties(Chalk.prototype, styles); module.exports = Chalk(); // eslint-disable-line new-cap module.exports.supportsColor = stdoutColor; module.exports.default = module.exports; // For TypeScript /***/ }), /* 31 */ /***/ (function(module, exports) { var core = module.exports = { version: '2.5.7' }; if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. var Buffer = __webpack_require__(15).Buffer; var algInfo = { 'dsa': { parts: ['p', 'q', 'g', 'y'], sizePart: 'p' }, 'rsa': { parts: ['e', 'n'], sizePart: 'n' }, 'ecdsa': { parts: ['curve', 'Q'], sizePart: 'Q' }, 'ed25519': { parts: ['A'], sizePart: 'A' } }; algInfo['curve25519'] = algInfo['ed25519']; var algPrivInfo = { 'dsa': { parts: ['p', 'q', 'g', 'y', 'x'] }, 'rsa': { parts: ['n', 'e', 'd', 'iqmp', 'p', 'q'] }, 'ecdsa': { parts: ['curve', 'Q', 'd'] }, 'ed25519': { parts: ['A', 'k'] } }; algPrivInfo['curve25519'] = algPrivInfo['ed25519']; var hashAlgs = { 'md5': true, 'sha1': true, 'sha256': true, 'sha384': true, 'sha512': true }; /* * Taken from * http://csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf */ var curves = { 'nistp256': { size: 256, pkcs8oid: '1.2.840.10045.3.1.7', p: Buffer.from(('00' + 'ffffffff 00000001 00000000 00000000' + '00000000 ffffffff ffffffff ffffffff'). replace(/ /g, ''), 'hex'), a: Buffer.from(('00' + 'FFFFFFFF 00000001 00000000 00000000' + '00000000 FFFFFFFF FFFFFFFF FFFFFFFC'). replace(/ /g, ''), 'hex'), b: Buffer.from(( '5ac635d8 aa3a93e7 b3ebbd55 769886bc' + '651d06b0 cc53b0f6 3bce3c3e 27d2604b'). replace(/ /g, ''), 'hex'), s: Buffer.from(('00' + 'c49d3608 86e70493 6a6678e1 139d26b7' + '819f7e90'). replace(/ /g, ''), 'hex'), n: Buffer.from(('00' + 'ffffffff 00000000 ffffffff ffffffff' + 'bce6faad a7179e84 f3b9cac2 fc632551'). replace(/ /g, ''), 'hex'), G: Buffer.from(('04' + '6b17d1f2 e12c4247 f8bce6e5 63a440f2' + '77037d81 2deb33a0 f4a13945 d898c296' + '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16' + '2bce3357 6b315ece cbb64068 37bf51f5'). replace(/ /g, ''), 'hex') }, 'nistp384': { size: 384, pkcs8oid: '1.3.132.0.34', p: Buffer.from(('00' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff fffffffe' + 'ffffffff 00000000 00000000 ffffffff'). replace(/ /g, ''), 'hex'), a: Buffer.from(('00' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE' + 'FFFFFFFF 00000000 00000000 FFFFFFFC'). replace(/ /g, ''), 'hex'), b: Buffer.from(( 'b3312fa7 e23ee7e4 988e056b e3f82d19' + '181d9c6e fe814112 0314088f 5013875a' + 'c656398d 8a2ed19d 2a85c8ed d3ec2aef'). replace(/ /g, ''), 'hex'), s: Buffer.from(('00' + 'a335926a a319a27a 1d00896a 6773a482' + '7acdac73'). replace(/ /g, ''), 'hex'), n: Buffer.from(('00' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff c7634d81 f4372ddf' + '581a0db2 48b0a77a ecec196a ccc52973'). replace(/ /g, ''), 'hex'), G: Buffer.from(('04' + 'aa87ca22 be8b0537 8eb1c71e f320ad74' + '6e1d3b62 8ba79b98 59f741e0 82542a38' + '5502f25d bf55296c 3a545e38 72760ab7' + '3617de4a 96262c6f 5d9e98bf 9292dc29' + 'f8f41dbd 289a147c e9da3113 b5f0b8c0' + '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'). replace(/ /g, ''), 'hex') }, 'nistp521': { size: 521, pkcs8oid: '1.3.132.0.35', p: Buffer.from(( '01ffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffff').replace(/ /g, ''), 'hex'), a: Buffer.from(('01FF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' + 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC'). replace(/ /g, ''), 'hex'), b: Buffer.from(('51' + '953eb961 8e1c9a1f 929a21a0 b68540ee' + 'a2da725b 99b315f3 b8b48991 8ef109e1' + '56193951 ec7e937b 1652c0bd 3bb1bf07' + '3573df88 3d2c34f1 ef451fd4 6b503f00'). replace(/ /g, ''), 'hex'), s: Buffer.from(('00' + 'd09e8800 291cb853 96cc6717 393284aa' + 'a0da64ba').replace(/ /g, ''), 'hex'), n: Buffer.from(('01ff' + 'ffffffff ffffffff ffffffff ffffffff' + 'ffffffff ffffffff ffffffff fffffffa' + '51868783 bf2f966b 7fcc0148 f709a5d0' + '3bb5c9b8 899c47ae bb6fb71e 91386409'). replace(/ /g, ''), 'hex'), G: Buffer.from(('04' + '00c6 858e06b7 0404e9cd 9e3ecb66 2395b442' + '9c648139 053fb521 f828af60 6b4d3dba' + 'a14b5e77 efe75928 fe1dc127 a2ffa8de' + '3348b3c1 856a429b f97e7e31 c2e5bd66' + '0118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9' + '98f54449 579b4468 17afbd17 273e662c' + '97ee7299 5ef42640 c550b901 3fad0761' + '353c7086 a272c240 88be9476 9fd16650'). replace(/ /g, ''), 'hex') } }; module.exports = { info: algInfo, privInfo: algPrivInfo, hashAlgs: hashAlgs, curves: curves }; /***/ }), /* 33 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2017 Joyent, Inc. module.exports = PrivateKey; var assert = __webpack_require__(16); var Buffer = __webpack_require__(15).Buffer; var algs = __webpack_require__(32); var crypto = __webpack_require__(11); var Fingerprint = __webpack_require__(156); var Signature = __webpack_require__(75); var errs = __webpack_require__(74); var util = __webpack_require__(3); var utils = __webpack_require__(26); var dhe = __webpack_require__(325); var generateECDSA = dhe.generateECDSA; var generateED25519 = dhe.generateED25519; var edCompat; var nacl; try { edCompat = __webpack_require__(454); } catch (e) { /* Just continue through, and bail out if we try to use it. */ } var Key = __webpack_require__(27); var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; var KeyEncryptedError = errs.KeyEncryptedError; var formats = {}; formats['auto'] = __webpack_require__(455); formats['pem'] = __webpack_require__(86); formats['pkcs1'] = __webpack_require__(327); formats['pkcs8'] = __webpack_require__(157); formats['rfc4253'] = __webpack_require__(103); formats['ssh-private'] = __webpack_require__(192); formats['openssh'] = formats['ssh-private']; formats['ssh'] = formats['ssh-private']; formats['dnssec'] = __webpack_require__(326); function PrivateKey(opts) { assert.object(opts, 'options'); Key.call(this, opts); this._pubCache = undefined; } util.inherits(PrivateKey, Key); PrivateKey.formats = formats; PrivateKey.prototype.toBuffer = function (format, options) { if (format === undefined) format = 'pkcs1'; assert.string(format, 'format'); assert.object(formats[format], 'formats[format]'); assert.optionalObject(options, 'options'); return (formats[format].write(this, options)); }; PrivateKey.prototype.hash = function (algo) { return (this.toPublic().hash(algo)); }; PrivateKey.prototype.toPublic = function () { if (this._pubCache) return (this._pubCache); var algInfo = algs.info[this.type]; var pubParts = []; for (var i = 0; i < algInfo.parts.length; ++i) { var p = algInfo.parts[i]; pubParts.push(this.part[p]); } this._pubCache = new Key({ type: this.type, source: this, parts: pubParts }); if (this.comment) this._pubCache.comment = this.comment; return (this._pubCache); }; PrivateKey.prototype.derive = function (newType) { assert.string(newType, 'type'); var priv, pub, pair; if (this.type === 'ed25519' && newType === 'curve25519') { if (nacl === undefined) nacl = __webpack_require__(76); priv = this.part.k.data; if (priv[0] === 0x00) priv = priv.slice(1); pair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv)); pub = Buffer.from(pair.publicKey); return (new PrivateKey({ type: 'curve25519', parts: [ { name: 'A', data: utils.mpNormalize(pub) }, { name: 'k', data: utils.mpNormalize(priv) } ] })); } else if (this.type === 'curve25519' && newType === 'ed25519') { if (nacl === undefined) nacl = __webpack_require__(76); priv = this.part.k.data; if (priv[0] === 0x00) priv = priv.slice(1); pair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv)); pub = Buffer.from(pair.publicKey); return (new PrivateKey({ type: 'ed25519', parts: [ { name: 'A', data: utils.mpNormalize(pub) }, { name: 'k', data: utils.mpNormalize(priv) } ] })); } throw (new Error('Key derivation not supported from ' + this.type + ' to ' + newType)); }; PrivateKey.prototype.createVerify = function (hashAlgo) { return (this.toPublic().createVerify(hashAlgo)); }; PrivateKey.prototype.createSign = function (hashAlgo) { if (hashAlgo === undefined) hashAlgo = this.defaultHashAlgorithm(); assert.string(hashAlgo, 'hash algorithm'); /* ED25519 is not supported by OpenSSL, use a javascript impl. */ if (this.type === 'ed25519' && edCompat !== undefined) return (new edCompat.Signer(this, hashAlgo)); if (this.type === 'curve25519') throw (new Error('Curve25519 keys are not suitable for ' + 'signing or verification')); var v, nm, err; try { nm = hashAlgo.toUpperCase(); v = crypto.createSign(nm); } catch (e) { err = e; } if (v === undefined || (err instanceof Error && err.message.match(/Unknown message digest/))) { nm = 'RSA-'; nm += hashAlgo.toUpperCase(); v = crypto.createSign(nm); } assert.ok(v, 'failed to create verifier'); var oldSign = v.sign.bind(v); var key = this.toBuffer('pkcs1'); var type = this.type; var curve = this.curve; v.sign = function () { var sig = oldSign(key); if (typeof (sig) === 'string') sig = Buffer.from(sig, 'binary'); sig = Signature.parse(sig, type, 'asn1'); sig.hashAlgorithm = hashAlgo; sig.curve = curve; return (sig); }; return (v); }; PrivateKey.parse = function (data, format, options) { if (typeof (data) !== 'string') assert.buffer(data, 'data'); if (format === undefined) format = 'auto'; assert.string(format, 'format'); if (typeof (options) === 'string') options = { filename: options }; assert.optionalObject(options, 'options'); if (options === undefined) options = {}; assert.optionalString(options.filename, 'options.filename'); if (options.filename === undefined) options.filename = '(unnamed)'; assert.object(formats[format], 'formats[format]'); try { var k = formats[format].read(data, options); assert.ok(k instanceof PrivateKey, 'key is not a private key'); if (!k.comment) k.comment = options.filename; return (k); } catch (e) { if (e.name === 'KeyEncryptedError') throw (e); throw (new KeyParseError(options.filename, format, e)); } }; PrivateKey.isPrivateKey = function (obj, ver) { return (utils.isCompatible(obj, PrivateKey, ver)); }; PrivateKey.generate = function (type, options) { if (options === undefined) options = {}; assert.object(options, 'options'); switch (type) { case 'ecdsa': if (options.curve === undefined) options.curve = 'nistp256'; assert.string(options.curve, 'options.curve'); return (generateECDSA(options.curve)); case 'ed25519': return (generateED25519()); default: throw (new Error('Key generation not supported with key ' + 'type "' + type + '"')); } }; /* * API versions for PrivateKey: * [1,0] -- initial ver * [1,1] -- added auto, pkcs[18], openssh/ssh-private formats * [1,2] -- added defaultHashAlgorithm * [1,3] -- added derive, ed, createDH * [1,4] -- first tagged version * [1,5] -- changed ed25519 part names and format */ PrivateKey.prototype._sshpkApiVersion = [1, 5]; PrivateKey._oldVersionDetect = function (obj) { assert.func(obj.toPublic); assert.func(obj.createSign); if (obj.derive) return ([1, 3]); if (obj.defaultHashAlgorithm) return ([1, 2]); if (obj.formats['auto']) return ([1, 1]); return ([1, 0]); }; /***/ }), /* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.wrapLifecycle = exports.run = exports.install = exports.Install = undefined; var _extends2; function _load_extends() { return _extends2 = _interopRequireDefault(__webpack_require__(21)); } var _asyncToGenerator2; function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } let install = exports.install = (() => { var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile) { yield wrapLifecycle(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { const install = new Install(flags, config, reporter, lockfile); yield install.init(); })); }); return function install(_x7, _x8, _x9, _x10) { return _ref29.apply(this, arguments); }; })(); let run = exports.run = (() => { var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { let lockfile; let error = 'installCommandRenamed'; if (flags.lockfile === false) { lockfile = new (_lockfile || _load_lockfile()).default(); } else { lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); } if (args.length) { const exampleArgs = args.slice(); if (flags.saveDev) { exampleArgs.push('--dev'); } if (flags.savePeer) { exampleArgs.push('--peer'); } if (flags.saveOptional) { exampleArgs.push('--optional'); } if (flags.saveExact) { exampleArgs.push('--exact'); } if (flags.saveTilde) { exampleArgs.push('--tilde'); } let command = 'add'; if (flags.global) { error = 'globalFlagRemoved'; command = 'global add'; } throw new (_errors || _load_errors()).MessageError(reporter.lang(error, `yarn ${command} ${exampleArgs.join(' ')}`)); } yield install(config, reporter, flags, lockfile); }); return function run(_x11, _x12, _x13, _x14) { return _ref31.apply(this, arguments); }; })(); let wrapLifecycle = exports.wrapLifecycle = (() => { var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags, factory) { yield config.executeLifecycleScript('preinstall'); yield factory(); // npm behaviour, seems kinda funky but yay compatibility yield config.executeLifecycleScript('install'); yield config.executeLifecycleScript('postinstall'); if (!config.production) { if (!config.disablePrepublish) { yield config.executeLifecycleScript('prepublish'); } yield config.executeLifecycleScript('prepare'); } }); return function wrapLifecycle(_x15, _x16, _x17) { return _ref32.apply(this, arguments); }; })(); exports.hasWrapper = hasWrapper; exports.setFlags = setFlags; var _objectPath; function _load_objectPath() { return _objectPath = _interopRequireDefault(__webpack_require__(304)); } var _hooks; function _load_hooks() { return _hooks = __webpack_require__(374); } var _index; function _load_index() { return _index = _interopRequireDefault(__webpack_require__(220)); } var _errors; function _load_errors() { return _errors = __webpack_require__(6); } var _integrityChecker; function _load_integrityChecker() { return _integrityChecker = _interopRequireDefault(__webpack_require__(208)); } var _lockfile; function _load_lockfile() { return _lockfile = _interopRequireDefault(__webpack_require__(19)); } var _lockfile2; function _load_lockfile2() { return _lockfile2 = __webpack_require__(19); } var _packageFetcher; function _load_packageFetcher() { return _packageFetcher = _interopRequireWildcard(__webpack_require__(210)); } var _packageInstallScripts; function _load_packageInstallScripts() { return _packageInstallScripts = _interopRequireDefault(__webpack_require__(557)); } var _packageCompatibility; function _load_packageCompatibility() { return _packageCompatibility = _interopRequireWildcard(__webpack_require__(209)); } var _packageResolver; function _load_packageResolver() { return _packageResolver = _interopRequireDefault(__webpack_require__(366)); } var _packageLinker; function _load_packageLinker() { return _packageLinker = _interopRequireDefault(__webpack_require__(211)); } var _index2; function _load_index2() { return _index2 = __webpack_require__(57); } var _index3; function _load_index3() { return _index3 = __webpack_require__(78); } var _autoclean; function _load_autoclean() { return _autoclean = __webpack_require__(354); } var _constants; function _load_constants() { return _constants = _interopRequireWildcard(__webpack_require__(8)); } var _normalizePattern; function _load_normalizePattern() { return _normalizePattern = __webpack_require__(37); } var _fs; function _load_fs() { return _fs = _interopRequireWildcard(__webpack_require__(4)); } var _map; function _load_map() { return _map = _interopRequireDefault(__webpack_require__(29)); } var _yarnVersion; function _load_yarnVersion() { return _yarnVersion = __webpack_require__(120); } var _generatePnpMap; function _load_generatePnpMap() { return _generatePnpMap = __webpack_require__(579); } var _workspaceLayout; function _load_workspaceLayout() { return _workspaceLayout = _interopRequireDefault(__webpack_require__(90)); } var _resolutionMap; function _load_resolutionMap() { return _resolutionMap = _interopRequireDefault(__webpack_require__(214)); } var _guessName; function _load_guessName() { return _guessName = _interopRequireDefault(__webpack_require__(169)); } var _audit; function _load_audit() { return _audit = _interopRequireDefault(__webpack_require__(353)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const deepEqual = __webpack_require__(631); const emoji = __webpack_require__(302); const invariant = __webpack_require__(9); const path = __webpack_require__(0); const semver = __webpack_require__(22); const uuid = __webpack_require__(119); const ssri = __webpack_require__(65); const ONE_DAY = 1000 * 60 * 60 * 24; /** * Try and detect the installation method for Yarn and provide a command to update it with. */ function getUpdateCommand(installationMethod) { if (installationMethod === 'tar') { return `curl --compressed -o- -L ${(_constants || _load_constants()).YARN_INSTALLER_SH} | bash`; } if (installationMethod === 'homebrew') { return 'brew upgrade yarn'; } if (installationMethod === 'deb') { return 'sudo apt-get update && sudo apt-get install yarn'; } if (installationMethod === 'rpm') { return 'sudo yum install yarn'; } if (installationMethod === 'npm') { return 'npm install --global yarn'; } if (installationMethod === 'chocolatey') { return 'choco upgrade yarn'; } if (installationMethod === 'apk') { return 'apk update && apk add -u yarn'; } if (installationMethod === 'portage') { return 'sudo emerge --sync && sudo emerge -au sys-apps/yarn'; } return null; } function getUpdateInstaller(installationMethod) { // Windows if (installationMethod === 'msi') { return (_constants || _load_constants()).YARN_INSTALLER_MSI; } return null; } function normalizeFlags(config, rawFlags) { const flags = { // install har: !!rawFlags.har, ignorePlatform: !!rawFlags.ignorePlatform, ignoreEngines: !!rawFlags.ignoreEngines, ignoreScripts: !!rawFlags.ignoreScripts, ignoreOptional: !!rawFlags.ignoreOptional, force: !!rawFlags.force, flat: !!rawFlags.flat, lockfile: rawFlags.lockfile !== false, pureLockfile: !!rawFlags.pureLockfile, updateChecksums: !!rawFlags.updateChecksums, skipIntegrityCheck: !!rawFlags.skipIntegrityCheck, frozenLockfile: !!rawFlags.frozenLockfile, linkDuplicates: !!rawFlags.linkDuplicates, checkFiles: !!rawFlags.checkFiles, audit: !!rawFlags.audit, // add peer: !!rawFlags.peer, dev: !!rawFlags.dev, optional: !!rawFlags.optional, exact: !!rawFlags.exact, tilde: !!rawFlags.tilde, ignoreWorkspaceRootCheck: !!rawFlags.ignoreWorkspaceRootCheck, // outdated, update-interactive includeWorkspaceDeps: !!rawFlags.includeWorkspaceDeps, // add, remove, update workspaceRootIsCwd: rawFlags.workspaceRootIsCwd !== false }; if (config.getOption('ignore-scripts')) { flags.ignoreScripts = true; } if (config.getOption('ignore-platform')) { flags.ignorePlatform = true; } if (config.getOption('ignore-engines')) { flags.ignoreEngines = true; } if (config.getOption('ignore-optional')) { flags.ignoreOptional = true; } if (config.getOption('force')) { flags.force = true; } return flags; } class Install { constructor(flags, config, reporter, lockfile) { this.rootManifestRegistries = []; this.rootPatternsToOrigin = (0, (_map || _load_map()).default)(); this.lockfile = lockfile; this.reporter = reporter; this.config = config; this.flags = normalizeFlags(config, flags); this.resolutions = (0, (_map || _load_map()).default)(); // Legacy resolutions field used for flat install mode this.resolutionMap = new (_resolutionMap || _load_resolutionMap()).default(config); // Selective resolutions for nested dependencies this.resolver = new (_packageResolver || _load_packageResolver()).default(config, lockfile, this.resolutionMap); this.integrityChecker = new (_integrityChecker || _load_integrityChecker()).default(config); this.linker = new (_packageLinker || _load_packageLinker()).default(config, this.resolver); this.scripts = new (_packageInstallScripts || _load_packageInstallScripts()).default(config, this.resolver, this.flags.force); } /** * Create a list of dependency requests from the current directories manifests. */ fetchRequestFromCwd(excludePatterns = [], ignoreUnusedPatterns = false) { var _this = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { const patterns = []; const deps = []; let resolutionDeps = []; const manifest = {}; const ignorePatterns = []; const usedPatterns = []; let workspaceLayout; // some commands should always run in the context of the entire workspace const cwd = _this.flags.includeWorkspaceDeps || _this.flags.workspaceRootIsCwd ? _this.config.lockfileFolder : _this.config.cwd; // non-workspaces are always root, otherwise check for workspace root const cwdIsRoot = !_this.config.workspaceRootFolder || _this.config.lockfileFolder === cwd; // exclude package names that are in install args const excludeNames = []; for (var _iterator = excludePatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } const pattern = _ref; if ((0, (_index3 || _load_index3()).getExoticResolver)(pattern)) { excludeNames.push((0, (_guessName || _load_guessName()).default)(pattern)); } else { // extract the name const parts = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern); excludeNames.push(parts.name); } } const stripExcluded = function stripExcluded(manifest) { for (var _iterator2 = excludeNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } const exclude = _ref2; if (manifest.dependencies && manifest.dependencies[exclude]) { delete manifest.dependencies[exclude]; } if (manifest.devDependencies && manifest.devDependencies[exclude]) { delete manifest.devDependencies[exclude]; } if (manifest.optionalDependencies && manifest.optionalDependencies[exclude]) { delete manifest.optionalDependencies[exclude]; } } }; for (var _iterator3 = Object.keys((_index2 || _load_index2()).registries), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } const registry = _ref3; const filename = (_index2 || _load_index2()).registries[registry].filename; const loc = path.join(cwd, filename); if (!(yield (_fs || _load_fs()).exists(loc))) { continue; } _this.rootManifestRegistries.push(registry); const projectManifestJson = yield _this.config.readJson(loc); yield (0, (_index || _load_index()).default)(projectManifestJson, cwd, _this.config, cwdIsRoot); Object.assign(_this.resolutions, projectManifestJson.resolutions); Object.assign(manifest, projectManifestJson); _this.resolutionMap.init(_this.resolutions); for (var _iterator4 = Object.keys(_this.resolutionMap.resolutionsByPackage), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { var _ref4; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref4 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref4 = _i4.value; } const packageName = _ref4; const optional = (_objectPath || _load_objectPath()).default.has(manifest.optionalDependencies, packageName) && _this.flags.ignoreOptional; for (var _iterator8 = _this.resolutionMap.resolutionsByPackage[packageName], _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) { var _ref9; if (_isArray8) { if (_i8 >= _iterator8.length) break; _ref9 = _iterator8[_i8++]; } else { _i8 = _iterator8.next(); if (_i8.done) break; _ref9 = _i8.value; } const _ref8 = _ref9; const pattern = _ref8.pattern; resolutionDeps = [...resolutionDeps, { registry, pattern, optional, hint: 'resolution' }]; } } const pushDeps = function pushDeps(depType, manifest, { hint, optional }, isUsed) { if (ignoreUnusedPatterns && !isUsed) { return; } // We only take unused dependencies into consideration to get deterministic hoisting. // Since flat mode doesn't care about hoisting and everything is top level and specified then we can safely // leave these out. if (_this.flags.flat && !isUsed) { return; } const depMap = manifest[depType]; for (const name in depMap) { if (excludeNames.indexOf(name) >= 0) { continue; } let pattern = name; if (!_this.lockfile.getLocked(pattern)) { // when we use --save we save the dependency to the lockfile with just the name rather than the // version combo pattern += '@' + depMap[name]; } // normalization made sure packages are mentioned only once if (isUsed) { usedPatterns.push(pattern); } else { ignorePatterns.push(pattern); } _this.rootPatternsToOrigin[pattern] = depType; patterns.push(pattern); deps.push({ pattern, registry, hint, optional, workspaceName: manifest.name, workspaceLoc: manifest._loc }); } }; if (cwdIsRoot) { pushDeps('dependencies', projectManifestJson, { hint: null, optional: false }, true); pushDeps('devDependencies', projectManifestJson, { hint: 'dev', optional: false }, !_this.config.production); pushDeps('optionalDependencies', projectManifestJson, { hint: 'optional', optional: true }, true); } if (_this.config.workspaceRootFolder) { const workspaceLoc = cwdIsRoot ? loc : path.join(_this.config.lockfileFolder, filename); const workspacesRoot = path.dirname(workspaceLoc); let workspaceManifestJson = projectManifestJson; if (!cwdIsRoot) { // the manifest we read before was a child workspace, so get the root workspaceManifestJson = yield _this.config.readJson(workspaceLoc); yield (0, (_index || _load_index()).default)(workspaceManifestJson, workspacesRoot, _this.config, true); } const workspaces = yield _this.config.resolveWorkspaces(workspacesRoot, workspaceManifestJson); workspaceLayout = new (_workspaceLayout || _load_workspaceLayout()).default(workspaces, _this.config); // add virtual manifest that depends on all workspaces, this way package hoisters and resolvers will work fine const workspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.dependencies); for (var _iterator5 = Object.keys(workspaces), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { var _ref5; if (_isArray5) { if (_i5 >= _iterator5.length) break; _ref5 = _iterator5[_i5++]; } else { _i5 = _iterator5.next(); if (_i5.done) break; _ref5 = _i5.value; } const workspaceName = _ref5; const workspaceManifest = workspaces[workspaceName].manifest; workspaceDependencies[workspaceName] = workspaceManifest.version; // include dependencies from all workspaces if (_this.flags.includeWorkspaceDeps) { pushDeps('dependencies', workspaceManifest, { hint: null, optional: false }, true); pushDeps('devDependencies', workspaceManifest, { hint: 'dev', optional: false }, !_this.config.production); pushDeps('optionalDependencies', workspaceManifest, { hint: 'optional', optional: true }, true); } } const virtualDependencyManifest = { _uid: '', name: `workspace-aggregator-${uuid.v4()}`, version: '1.0.0', _registry: 'npm', _loc: workspacesRoot, dependencies: workspaceDependencies, devDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.devDependencies), optionalDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.optionalDependencies), private: workspaceManifestJson.private, workspaces: workspaceManifestJson.workspaces }; workspaceLayout.virtualManifestName = virtualDependencyManifest.name; const virtualDep = {}; virtualDep[virtualDependencyManifest.name] = virtualDependencyManifest.version; workspaces[virtualDependencyManifest.name] = { loc: workspacesRoot, manifest: virtualDependencyManifest }; // ensure dependencies that should be excluded are stripped from the correct manifest stripExcluded(cwdIsRoot ? virtualDependencyManifest : workspaces[projectManifestJson.name].manifest); pushDeps('workspaces', { workspaces: virtualDep }, { hint: 'workspaces', optional: false }, true); const implicitWorkspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceDependencies); for (var _iterator6 = (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { var _ref6; if (_isArray6) { if (_i6 >= _iterator6.length) break; _ref6 = _iterator6[_i6++]; } else { _i6 = _iterator6.next(); if (_i6.done) break; _ref6 = _i6.value; } const type = _ref6; for (var _iterator7 = Object.keys(projectManifestJson[type] || {}), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) { var _ref7; if (_isArray7) { if (_i7 >= _iterator7.length) break; _ref7 = _iterator7[_i7++]; } else { _i7 = _iterator7.next(); if (_i7.done) break; _ref7 = _i7.value; } const dependencyName = _ref7; delete implicitWorkspaceDependencies[dependencyName]; } } pushDeps('dependencies', { dependencies: implicitWorkspaceDependencies }, { hint: 'workspaces', optional: false }, true); } break; } // inherit root flat flag if (manifest.flat) { _this.flags.flat = true; } return { requests: [...resolutionDeps, ...deps], patterns, manifest, usedPatterns, ignorePatterns, workspaceLayout }; })(); } /** * TODO description */ prepareRequests(requests) { return requests; } preparePatterns(patterns) { return patterns; } preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) { return patterns; } prepareManifests() { var _this2 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { const manifests = yield _this2.config.getRootManifests(); return manifests; })(); } bailout(patterns, workspaceLayout) { var _this3 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { // We don't want to skip the audit - it could yield important errors if (_this3.flags.audit) { return false; } // PNP is so fast that the integrity check isn't pertinent if (_this3.config.plugnplayEnabled) { return false; } if (_this3.flags.skipIntegrityCheck || _this3.flags.force) { return false; } const lockfileCache = _this3.lockfile.cache; if (!lockfileCache) { return false; } const lockfileClean = _this3.lockfile.parseResultType === 'success'; const match = yield _this3.integrityChecker.check(patterns, lockfileCache, _this3.flags, workspaceLayout); if (_this3.flags.frozenLockfile && (!lockfileClean || match.missingPatterns.length > 0)) { throw new (_errors || _load_errors()).MessageError(_this3.reporter.lang('frozenLockfileError')); } const haveLockfile = yield (_fs || _load_fs()).exists(path.join(_this3.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME)); const lockfileIntegrityPresent = !_this3.lockfile.hasEntriesExistWithoutIntegrity(); const integrityBailout = lockfileIntegrityPresent || !_this3.config.autoAddIntegrity; if (match.integrityMatches && haveLockfile && lockfileClean && integrityBailout) { _this3.reporter.success(_this3.reporter.lang('upToDate')); return true; } if (match.integrityFileMissing && haveLockfile) { // Integrity file missing, force script installations _this3.scripts.setForce(true); return false; } if (match.hardRefreshRequired) { // e.g. node version doesn't match, force script installations _this3.scripts.setForce(true); return false; } if (!patterns.length && !match.integrityFileMissing) { _this3.reporter.success(_this3.reporter.lang('nothingToInstall')); yield _this3.createEmptyManifestFolders(); yield _this3.saveLockfileAndIntegrity(patterns, workspaceLayout); return true; } return false; })(); } /** * Produce empty folders for all used root manifests. */ createEmptyManifestFolders() { var _this4 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { if (_this4.config.modulesFolder) { // already created return; } for (var _iterator9 = _this4.rootManifestRegistries, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { var _ref10; if (_isArray9) { if (_i9 >= _iterator9.length) break; _ref10 = _iterator9[_i9++]; } else { _i9 = _iterator9.next(); if (_i9.done) break; _ref10 = _i9.value; } const registryName = _ref10; const folder = _this4.config.registries[registryName].folder; yield (_fs || _load_fs()).mkdirp(path.join(_this4.config.lockfileFolder, folder)); } })(); } /** * TODO description */ markIgnored(patterns) { for (var _iterator10 = patterns, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { var _ref11; if (_isArray10) { if (_i10 >= _iterator10.length) break; _ref11 = _iterator10[_i10++]; } else { _i10 = _iterator10.next(); if (_i10.done) break; _ref11 = _i10.value; } const pattern = _ref11; const manifest = this.resolver.getStrictResolvedPattern(pattern); const ref = manifest._reference; invariant(ref, 'expected package reference'); // just mark the package as ignored. if the package is used by a required package, the hoister // will take care of that. ref.ignore = true; } } /** * helper method that gets only recent manifests * used by global.ls command */ getFlattenedDeps() { var _this5 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { var _ref12 = yield _this5.fetchRequestFromCwd(); const depRequests = _ref12.requests, rawPatterns = _ref12.patterns; yield _this5.resolver.init(depRequests, {}); const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this5.resolver.getManifests(), _this5.config); _this5.resolver.updateManifests(manifests); return _this5.flatten(rawPatterns); })(); } /** * TODO description */ init() { var _this6 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { _this6.checkUpdate(); // warn if we have a shrinkwrap if (yield (_fs || _load_fs()).exists(path.join(_this6.config.lockfileFolder, (_constants || _load_constants()).NPM_SHRINKWRAP_FILENAME))) { _this6.reporter.warn(_this6.reporter.lang('shrinkwrapWarning')); } // warn if we have an npm lockfile if (yield (_fs || _load_fs()).exists(path.join(_this6.config.lockfileFolder, (_constants || _load_constants()).NPM_LOCK_FILENAME))) { _this6.reporter.warn(_this6.reporter.lang('npmLockfileWarning')); } if (_this6.config.plugnplayEnabled) { _this6.reporter.info(_this6.reporter.lang('plugnplaySuggestV2L1')); _this6.reporter.info(_this6.reporter.lang('plugnplaySuggestV2L2')); } let flattenedTopLevelPatterns = []; const steps = []; var _ref13 = yield _this6.fetchRequestFromCwd(); const depRequests = _ref13.requests, rawPatterns = _ref13.patterns, ignorePatterns = _ref13.ignorePatterns, workspaceLayout = _ref13.workspaceLayout, manifest = _ref13.manifest; let topLevelPatterns = []; const artifacts = yield _this6.integrityChecker.getArtifacts(); if (artifacts) { _this6.linker.setArtifacts(artifacts); _this6.scripts.setArtifacts(artifacts); } if ((_packageCompatibility || _load_packageCompatibility()).shouldCheck(manifest, _this6.flags)) { steps.push((() => { var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { _this6.reporter.step(curr, total, _this6.reporter.lang('checkingManifest'), emoji.get('mag')); yield _this6.checkCompatibility(); }); return function (_x, _x2) { return _ref14.apply(this, arguments); }; })()); } const audit = new (_audit || _load_audit()).default(_this6.config, _this6.reporter, { groups: (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES }); let auditFoundProblems = false; steps.push(function (curr, total) { return (0, (_hooks || _load_hooks()).callThroughHook)('resolveStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { _this6.reporter.step(curr, total, _this6.reporter.lang('resolvingPackages'), emoji.get('mag')); yield _this6.resolver.init(_this6.prepareRequests(depRequests), { isFlat: _this6.flags.flat, isFrozen: _this6.flags.frozenLockfile, workspaceLayout }); topLevelPatterns = _this6.preparePatterns(rawPatterns); flattenedTopLevelPatterns = yield _this6.flatten(topLevelPatterns); return { bailout: !_this6.flags.audit && (yield _this6.bailout(topLevelPatterns, workspaceLayout)) }; })); }); if (_this6.flags.audit) { steps.push(function (curr, total) { return (0, (_hooks || _load_hooks()).callThroughHook)('auditStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { _this6.reporter.step(curr, total, _this6.reporter.lang('auditRunning'), emoji.get('mag')); if (_this6.flags.offline) { _this6.reporter.warn(_this6.reporter.lang('auditOffline')); return { bailout: false }; } const preparedManifests = yield _this6.prepareManifests(); // $FlowFixMe - Flow considers `m` in the map operation to be "mixed", so does not recognize `m.object` const mergedManifest = Object.assign({}, ...Object.values(preparedManifests).map(function (m) { return m.object; })); const auditVulnerabilityCounts = yield audit.performAudit(mergedManifest, _this6.lockfile, _this6.resolver, _this6.linker, topLevelPatterns); auditFoundProblems = auditVulnerabilityCounts.info || auditVulnerabilityCounts.low || auditVulnerabilityCounts.moderate || auditVulnerabilityCounts.high || auditVulnerabilityCounts.critical; return { bailout: yield _this6.bailout(topLevelPatterns, workspaceLayout) }; })); }); } steps.push(function (curr, total) { return (0, (_hooks || _load_hooks()).callThroughHook)('fetchStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { _this6.markIgnored(ignorePatterns); _this6.reporter.step(curr, total, _this6.reporter.lang('fetchingPackages'), emoji.get('truck')); const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this6.resolver.getManifests(), _this6.config); _this6.resolver.updateManifests(manifests); yield (_packageCompatibility || _load_packageCompatibility()).check(_this6.resolver.getManifests(), _this6.config, _this6.flags.ignoreEngines); })); }); steps.push(function (curr, total) { return (0, (_hooks || _load_hooks()).callThroughHook)('linkStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { // remove integrity hash to make this operation atomic yield _this6.integrityChecker.removeIntegrityFile(); _this6.reporter.step(curr, total, _this6.reporter.lang('linkingDependencies'), emoji.get('link')); flattenedTopLevelPatterns = _this6.preparePatternsForLinking(flattenedTopLevelPatterns, manifest, _this6.config.lockfileFolder === _this6.config.cwd); yield _this6.linker.init(flattenedTopLevelPatterns, workspaceLayout, { linkDuplicates: _this6.flags.linkDuplicates, ignoreOptional: _this6.flags.ignoreOptional }); })); }); if (_this6.config.plugnplayEnabled) { steps.push(function (curr, total) { return (0, (_hooks || _load_hooks()).callThroughHook)('pnpStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { const pnpPath = `${_this6.config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`; const code = yield (0, (_generatePnpMap || _load_generatePnpMap()).generatePnpMap)(_this6.config, flattenedTopLevelPatterns, { resolver: _this6.resolver, reporter: _this6.reporter, targetPath: pnpPath, workspaceLayout }); try { const file = yield (_fs || _load_fs()).readFile(pnpPath); if (file === code) { return; } } catch (error) {} yield (_fs || _load_fs()).writeFile(pnpPath, code); yield (_fs || _load_fs()).chmod(pnpPath, 0o755); })); }); } steps.push(function (curr, total) { return (0, (_hooks || _load_hooks()).callThroughHook)('buildStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { _this6.reporter.step(curr, total, _this6.flags.force ? _this6.reporter.lang('rebuildingPackages') : _this6.reporter.lang('buildingFreshPackages'), emoji.get('hammer')); if (_this6.config.ignoreScripts) { _this6.reporter.warn(_this6.reporter.lang('ignoredScripts')); } else { yield _this6.scripts.init(flattenedTopLevelPatterns); } })); }); if (_this6.flags.har) { steps.push((() => { var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { const formattedDate = new Date().toISOString().replace(/:/g, '-'); const filename = `yarn-install_${formattedDate}.har`; _this6.reporter.step(curr, total, _this6.reporter.lang('savingHar', filename), emoji.get('black_circle_for_record')); yield _this6.config.requestManager.saveHar(filename); }); return function (_x3, _x4) { return _ref21.apply(this, arguments); }; })()); } if (yield _this6.shouldClean()) { steps.push((() => { var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) { _this6.reporter.step(curr, total, _this6.reporter.lang('cleaningModules'), emoji.get('recycle')); yield (0, (_autoclean || _load_autoclean()).clean)(_this6.config, _this6.reporter); }); return function (_x5, _x6) { return _ref22.apply(this, arguments); }; })()); } let currentStep = 0; for (var _iterator11 = steps, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) { var _ref23; if (_isArray11) { if (_i11 >= _iterator11.length) break; _ref23 = _iterator11[_i11++]; } else { _i11 = _iterator11.next(); if (_i11.done) break; _ref23 = _i11.value; } const step = _ref23; const stepResult = yield step(++currentStep, steps.length); if (stepResult && stepResult.bailout) { if (_this6.flags.audit) { audit.summary(); } if (auditFoundProblems) { _this6.reporter.warn(_this6.reporter.lang('auditRunAuditForDetails')); } _this6.maybeOutputUpdate(); return flattenedTopLevelPatterns; } } // fin! if (_this6.flags.audit) { audit.summary(); } if (auditFoundProblems) { _this6.reporter.warn(_this6.reporter.lang('auditRunAuditForDetails')); } yield _this6.saveLockfileAndIntegrity(topLevelPatterns, workspaceLayout); yield _this6.persistChanges(); _this6.maybeOutputUpdate(); _this6.config.requestManager.clearCache(); return flattenedTopLevelPatterns; })(); } checkCompatibility() { var _this7 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { var _ref24 = yield _this7.fetchRequestFromCwd(); const manifest = _ref24.manifest; yield (_packageCompatibility || _load_packageCompatibility()).checkOne(manifest, _this7.config, _this7.flags.ignoreEngines); })(); } persistChanges() { var _this8 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { // get all the different registry manifests in this folder const manifests = yield _this8.config.getRootManifests(); if (yield _this8.applyChanges(manifests)) { yield _this8.config.saveRootManifests(manifests); } })(); } applyChanges(manifests) { let hasChanged = false; if (this.config.plugnplayPersist) { const object = manifests.npm.object; if (typeof object.installConfig !== 'object') { object.installConfig = {}; } if (this.config.plugnplayEnabled && object.installConfig.pnp !== true) { object.installConfig.pnp = true; hasChanged = true; } else if (!this.config.plugnplayEnabled && typeof object.installConfig.pnp !== 'undefined') { delete object.installConfig.pnp; hasChanged = true; } if (Object.keys(object.installConfig).length === 0) { delete object.installConfig; } } return Promise.resolve(hasChanged); } /** * Check if we should run the cleaning step. */ shouldClean() { return (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).CLEAN_FILENAME)); } /** * TODO */ flatten(patterns) { var _this9 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { if (!_this9.flags.flat) { return patterns; } const flattenedPatterns = []; for (var _iterator12 = _this9.resolver.getAllDependencyNamesByLevelOrder(patterns), _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) { var _ref25; if (_isArray12) { if (_i12 >= _iterator12.length) break; _ref25 = _iterator12[_i12++]; } else { _i12 = _iterator12.next(); if (_i12.done) break; _ref25 = _i12.value; } const name = _ref25; const infos = _this9.resolver.getAllInfoForPackageName(name).filter(function (manifest) { const ref = manifest._reference; invariant(ref, 'expected package reference'); return !ref.ignore; }); if (infos.length === 0) { continue; } if (infos.length === 1) { // single version of this package // take out a single pattern as multiple patterns may have resolved to this package flattenedPatterns.push(_this9.resolver.patternsByPackage[name][0]); continue; } const options = infos.map(function (info) { const ref = info._reference; invariant(ref, 'expected reference'); return { // TODO `and is required by {PARENT}`, name: _this9.reporter.lang('manualVersionResolutionOption', ref.patterns.join(', '), info.version), value: info.version }; }); const versions = infos.map(function (info) { return info.version; }); let version; const resolutionVersion = _this9.resolutions[name]; if (resolutionVersion && versions.indexOf(resolutionVersion) >= 0) { // use json `resolution` version version = resolutionVersion; } else { version = yield _this9.reporter.select(_this9.reporter.lang('manualVersionResolution', name), _this9.reporter.lang('answer'), options); _this9.resolutions[name] = version; } flattenedPatterns.push(_this9.resolver.collapseAllVersionsOfPackage(name, version)); } // save resolutions to their appropriate root manifest if (Object.keys(_this9.resolutions).length) { const manifests = yield _this9.config.getRootManifests(); for (const name in _this9.resolutions) { const version = _this9.resolutions[name]; const patterns = _this9.resolver.patternsByPackage[name]; if (!patterns) { continue; } let manifest; for (var _iterator13 = patterns, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) { var _ref26; if (_isArray13) { if (_i13 >= _iterator13.length) break; _ref26 = _iterator13[_i13++]; } else { _i13 = _iterator13.next(); if (_i13.done) break; _ref26 = _i13.value; } const pattern = _ref26; manifest = _this9.resolver.getResolvedPattern(pattern); if (manifest) { break; } } invariant(manifest, 'expected manifest'); const ref = manifest._reference; invariant(ref, 'expected reference'); const object = manifests[ref.registry].object; object.resolutions = object.resolutions || {}; object.resolutions[name] = version; } yield _this9.config.saveRootManifests(manifests); } return flattenedPatterns; })(); } /** * Remove offline tarballs that are no longer required */ pruneOfflineMirror(lockfile) { var _this10 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { const mirror = _this10.config.getOfflineMirrorPath(); if (!mirror) { return; } const requiredTarballs = new Set(); for (const dependency in lockfile) { const resolved = lockfile[dependency].resolved; if (resolved) { const basename = path.basename(resolved.split('#')[0]); if (dependency[0] === '@' && basename[0] !== '@') { requiredTarballs.add(`${dependency.split('/')[0]}-${basename}`); } requiredTarballs.add(basename); } } const mirrorFiles = yield (_fs || _load_fs()).walk(mirror); for (var _iterator14 = mirrorFiles, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) { var _ref27; if (_isArray14) { if (_i14 >= _iterator14.length) break; _ref27 = _iterator14[_i14++]; } else { _i14 = _iterator14.next(); if (_i14.done) break; _ref27 = _i14.value; } const file = _ref27; const isTarball = path.extname(file.basename) === '.tgz'; // if using experimental-pack-script-packages-in-mirror flag, don't unlink prebuilt packages const hasPrebuiltPackage = file.relative.startsWith('prebuilt/'); if (isTarball && !hasPrebuiltPackage && !requiredTarballs.has(file.basename)) { yield (_fs || _load_fs()).unlink(file.absolute); } } })(); } /** * Save updated integrity and lockfiles. */ saveLockfileAndIntegrity(patterns, workspaceLayout) { var _this11 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { const resolvedPatterns = {}; Object.keys(_this11.resolver.patterns).forEach(function (pattern) { if (!workspaceLayout || !workspaceLayout.getManifestByPattern(pattern)) { resolvedPatterns[pattern] = _this11.resolver.patterns[pattern]; } }); // TODO this code is duplicated in a few places, need a common way to filter out workspace patterns from lockfile patterns = patterns.filter(function (p) { return !workspaceLayout || !workspaceLayout.getManifestByPattern(p); }); const lockfileBasedOnResolver = _this11.lockfile.getLockfile(resolvedPatterns); if (_this11.config.pruneOfflineMirror) { yield _this11.pruneOfflineMirror(lockfileBasedOnResolver); } // write integrity hash if (!_this11.config.plugnplayEnabled) { yield _this11.integrityChecker.save(patterns, lockfileBasedOnResolver, _this11.flags, workspaceLayout, _this11.scripts.getArtifacts()); } // --no-lockfile or --pure-lockfile or --frozen-lockfile if (_this11.flags.lockfile === false || _this11.flags.pureLockfile || _this11.flags.frozenLockfile) { return; } const lockFileHasAllPatterns = patterns.every(function (p) { return _this11.lockfile.getLocked(p); }); const lockfilePatternsMatch = Object.keys(_this11.lockfile.cache || {}).every(function (p) { return lockfileBasedOnResolver[p]; }); const resolverPatternsAreSameAsInLockfile = Object.keys(lockfileBasedOnResolver).every(function (pattern) { const manifest = _this11.lockfile.getLocked(pattern); return manifest && manifest.resolved === lockfileBasedOnResolver[pattern].resolved && deepEqual(manifest.prebuiltVariants, lockfileBasedOnResolver[pattern].prebuiltVariants); }); const integrityPatternsAreSameAsInLockfile = Object.keys(lockfileBasedOnResolver).every(function (pattern) { const existingIntegrityInfo = lockfileBasedOnResolver[pattern].integrity; if (!existingIntegrityInfo) { // if this entry does not have an integrity, no need to re-write the lockfile because of it return true; } const manifest = _this11.lockfile.getLocked(pattern); if (manifest && manifest.integrity) { const manifestIntegrity = ssri.stringify(manifest.integrity); return manifestIntegrity === existingIntegrityInfo; } return false; }); // remove command is followed by install with force, lockfile will be rewritten in any case then if (!_this11.flags.force && _this11.lockfile.parseResultType === 'success' && lockFileHasAllPatterns && lockfilePatternsMatch && resolverPatternsAreSameAsInLockfile && integrityPatternsAreSameAsInLockfile && patterns.length) { return; } // build lockfile location const loc = path.join(_this11.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME); // write lockfile const lockSource = (0, (_lockfile2 || _load_lockfile2()).stringify)(lockfileBasedOnResolver, false, _this11.config.enableLockfileVersions); yield (_fs || _load_fs()).writeFilePreservingEol(loc, lockSource); _this11._logSuccessSaveLockfile(); })(); } _logSuccessSaveLockfile() { this.reporter.success(this.reporter.lang('savedLockfile')); } /** * Load the dependency graph of the current install. Only does package resolving and wont write to the cwd. */ hydrate(ignoreUnusedPatterns) { var _this12 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { const request = yield _this12.fetchRequestFromCwd([], ignoreUnusedPatterns); const depRequests = request.requests, rawPatterns = request.patterns, ignorePatterns = request.ignorePatterns, workspaceLayout = request.workspaceLayout; yield _this12.resolver.init(depRequests, { isFlat: _this12.flags.flat, isFrozen: _this12.flags.frozenLockfile, workspaceLayout }); yield _this12.flatten(rawPatterns); _this12.markIgnored(ignorePatterns); // fetch packages, should hit cache most of the time const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this12.resolver.getManifests(), _this12.config); _this12.resolver.updateManifests(manifests); yield (_packageCompatibility || _load_packageCompatibility()).check(_this12.resolver.getManifests(), _this12.config, _this12.flags.ignoreEngines); // expand minimal manifests for (var _iterator15 = _this12.resolver.getManifests(), _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) { var _ref28; if (_isArray15) { if (_i15 >= _iterator15.length) break; _ref28 = _iterator15[_i15++]; } else { _i15 = _iterator15.next(); if (_i15.done) break; _ref28 = _i15.value; } const manifest = _ref28; const ref = manifest._reference; invariant(ref, 'expected reference'); const type = ref.remote.type; // link specifier won't ever hit cache let loc = ''; if (type === 'link') { continue; } else if (type === 'workspace') { if (!ref.remote.reference) { continue; } loc = ref.remote.reference; } else { loc = _this12.config.generateModuleCachePath(ref); } const newPkg = yield _this12.config.readManifest(loc); yield _this12.resolver.updateManifest(ref, newPkg); } return request; })(); } /** * Check for updates every day and output a nag message if there's a newer version. */ checkUpdate() { if (this.config.nonInteractive) { // don't show upgrade dialog on CI or non-TTY terminals return; } // don't check if disabled if (this.config.getOption('disable-self-update-check')) { return; } // only check for updates once a day const lastUpdateCheck = Number(this.config.getOption('lastUpdateCheck')) || 0; if (lastUpdateCheck && Date.now() - lastUpdateCheck < ONE_DAY) { return; } // don't bug for updates on tagged releases if ((_yarnVersion || _load_yarnVersion()).version.indexOf('-') >= 0) { return; } this._checkUpdate().catch(() => { // swallow errors }); } _checkUpdate() { var _this13 = this; return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { let latestVersion = yield _this13.config.requestManager.request({ url: (_constants || _load_constants()).SELF_UPDATE_VERSION_URL }); invariant(typeof latestVersion === 'string', 'expected string'); latestVersion = latestVersion.trim(); if (!semver.valid(latestVersion)) { return; } // ensure we only check for updates periodically _this13.config.registries.yarn.saveHomeConfig({ lastUpdateCheck: Date.now() }); if (semver.gt(latestVersion, (_yarnVersion || _load_yarnVersion()).version)) { const installationMethod = yield (0, (_yarnVersion || _load_yarnVersion()).getInstallationMethod)(); _this13.maybeOutputUpdate = function () { _this13.reporter.warn(_this13.reporter.lang('yarnOutdated', latestVersion, (_yarnVersion || _load_yarnVersion()).version)); const command = getUpdateCommand(installationMethod); if (command) { _this13.reporter.info(_this13.reporter.lang('yarnOutdatedCommand')); _this13.reporter.command(command); } else { const installer = getUpdateInstaller(installationMethod); if (installer) { _this13.reporter.info(_this13.reporter.lang('yarnOutdatedInstaller', installer)); } } }; } })(); } /** * Method to override with a possible upgrade message. */ maybeOutputUpdate() {} } exports.Install = Install; function hasWrapper(commander, args) { return true; } function setFlags(commander) { commander.description('Yarn install is used to install all dependencies for a project.'); commander.usage('install [flags]'); commander.option('-A, --audit', 'Run vulnerability audit on installed packages'); commander.option('-g, --global', 'DEPRECATED'); commander.option('-S, --save', 'DEPRECATED - save package to your `dependencies`'); commander.option('-D, --save-dev', 'DEPRECATED - save package to your `devDependencies`'); commander.option('-P, --save-peer', 'DEPRECATED - save package to your `peerDependencies`'); commander.option('-O, --save-optional', 'DEPRECATED - save package to your `optionalDependencies`'); commander.option('-E, --save-exact', 'DEPRECATED'); commander.option('-T, --save-tilde', 'DEPRECATED'); } /***/ }), /* 35 */ /***/ (function(module, exports, __webpack_require__) { var isObject = __webpack_require__(52); module.exports = function (it) { if (!isObject(it)) throw TypeError(it + ' is not an object!'); return it; }; /***/ }), /* 36 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SubjectSubscriber; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subject; }); /* unused harmony export AnonymousSubject */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscriber__ = __webpack_require__(7); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__ = __webpack_require__(189); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__ = __webpack_require__(422); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__ = __webpack_require__(321); /** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */ var SubjectSubscriber = /*@__PURE__*/ (function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubjectSubscriber, _super); function SubjectSubscriber(destination) { var _this = _super.call(this, destination) || this; _this.destination = destination; return _this; } return SubjectSubscriber; }(__WEBPACK_IMPORTED_MODULE_2__Subscriber__["a" /* Subscriber */])); var Subject = /*@__PURE__*/ (function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](Subject, _super); function Subject() { var _this = _super.call(this) || this; _this.observers = []; _this.closed = false; _this.isStopped = false; _this.hasError = false; _this.thrownError = null; return _this; } Subject.prototype[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__["a" /* rxSubscriber */]] = function () { return new SubjectSubscriber(this); }; Subject.prototype.lift = function (operator) { var subject = new AnonymousSubject(this, this); subject.operator = operator; return subject; }; Subject.prototype.next = function (value) { if (this.closed) { throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); } if (!this.isStopped) { var observers = this.observers; var len = observers.length; var copy = observers.slice(); for (var i = 0; i < len; i++) { copy[i].next(value); } } }; Subject.prototype.error = function (err) { if (this.closed) { throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); } this.hasError = true; this.thrownError = err; this.isStopped = true; var observers = this.observers; var len = observers.length; var copy = observers.slice(); for (var i = 0; i < len; i++) { copy[i].error(err); } this.observers.length = 0; }; Subject.prototype.complete = function () { if (this.closed) { throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); } this.isStopped = true; var observers = this.observers; var len = observers.length; var copy = observers.slice(); for (var i = 0; i < len; i++) { copy[i].complete(); } this.observers.length = 0; }; Subject.prototype.unsubscribe = function () { this.isStopped = true; this.closed = true; this.observers = null; }; Subject.prototype._trySubscribe = function (subscriber) { if (this.closed) { throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); } else { return _super.prototype._trySubscribe.call(this, subscriber); } }; Subject.prototype._subscribe = function (subscriber) { if (this.closed) { throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */](); } else if (this.hasError) { subscriber.error(this.thrownError); return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY; } else if (this.isStopped) { subscriber.complete(); return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY; } else { this.observers.push(subscriber); return new __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__["a" /* SubjectSubscription */](this, subscriber); } }; Subject.prototype.asObservable = function () { var observable = new __WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */](); observable.source = this; return observable; }; Subject.create = function (destination, source) { return new AnonymousSubject(destination, source); }; return Subject; }(__WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */])); var AnonymousSubject = /*@__PURE__*/ (function (_super) { __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AnonymousSubject, _super); function AnonymousSubject(destination, source) { var _this = _super.call(this) || this; _this.destination = destination; _this.source = source; return _this; } AnonymousSubject.prototype.next = function (value) { var destination = this.destination; if (destination && destination.next) { destination.next(value); } }; AnonymousSubject.prototype.error = function (err) { var destination = this.destination; if (destination && destination.error) { this.destination.error(err); } }; AnonymousSubject.prototype.complete = function () { var destination = this.destination; if (destination && destination.complete) { this.destination.complete(); } }; AnonymousSubject.prototype._subscribe = function (subscriber) { var source = this.source; if (source) { return this.source.subscribe(subscriber); } else { return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY; } }; return AnonymousSubject; }(Subject)); //# sourceMappingURL=Subject.js.map /***/ }), /* 37 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.normalizePattern = normalizePattern; /** * Explode and normalize a pattern into its name and range. */ function normalizePattern(pattern) { let hasVersion = false; let range = 'latest'; let name = pattern; // if we're a scope then remove the @ and add it back later let isScoped = false; if (name[0] === '@') { isScoped = true; name = name.slice(1); } // take first part as the name const parts = name.split('@'); if (parts.length > 1) { name = parts.shift(); range = parts.join('@'); if (range) { hasVersion = true; } else { range = '*'; } } // add back @ scope suffix if (isScoped) { name = `@${name}`; } return { name, range, hasVersion }; } /***/ }), /* 38 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** * @license * Lodash * Copyright JS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ ;(function() { /** Used as a safe reference for `undefined` in pre-ES5 environments. */ var undefined; /** Used as the semantic version number. */ var VERSION = '4.17.10'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** Error message constants. */ var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', FUNC_ERROR_TEXT = 'Expected a function'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500; /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; /** Used as default options for `_.truncate`. */ var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = '...'; /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16; /** Used to indicate the type of lazy iteratees. */ var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 1.7976931348623157e+308, NAN = 0 / 0; /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; /** Used to associate wrap methods with their bit flags. */ var wrapFlags = [ ['ary', WRAP_ARY_FLAG], ['bind', WRAP_BIND_FLAG], ['bindKey', WRAP_BIND_KEY_FLAG], ['curry', WRAP_CURRY_FLAG], ['curryRight', WRAP_CURRY_RIGHT_FLAG], ['flip', WRAP_FLIP_FLAG], ['partial', WRAP_PARTIAL_FLAG], ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], ['rearg', WRAP_REARG_FLAG] ]; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', asyncTag = '[object AsyncFunction]', boolTag = '[object Boolean]', dateTag = '[object Date]', domExcTag = '[object DOMException]', errorTag = '[object Error]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', mapTag = '[object Map]', numberTag = '[object Number]', nullTag = '[object Null]', objectTag = '[object Object]', promiseTag = '[object Promise]', proxyTag = '[object Proxy]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]', undefinedTag = '[object Undefined]', weakMapTag = '[object WeakMap]', weakSetTag = '[object WeakSet]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to match empty string literals in compiled template source. */ var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; /** Used to match HTML entities and HTML characters. */ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); /** Used to match template delimiters. */ var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g, reTrimStart = /^\s+/, reTrimEnd = /\s+$/; /** Used to match wrap detail comments. */ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; /** Used to match words composed of alphanumeric characters. */ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Used to match * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). */ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** Used to match Latin Unicode letters (excluding mathematical operators). */ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; /** Used to ensure capturing order of template delimiters. */ var reNoMatch = /($^)/; /** Used to match unescaped characters in compiled string literals. */ var reUnescapedString = /['\n\r\u2028\u2029\\]/g; /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f', reComboHalfMarksRange = '\\ufe20-\\ufe2f', rsComboSymbolsRange = '\\u20d0-\\u20ff', rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = '\\u2700-\\u27bf', rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', rsPunctuationRange = '\\u2000-\\u206f', rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', rsVarRange = '\\ufe0e\\ufe0f', rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; /** Used to compose unicode capture groups. */ var rsApos = "['\u2019]", rsAstral = '[' + rsAstralRange + ']', rsBreak = '[' + rsBreakRange + ']', rsCombo = '[' + rsComboRange + ']', rsDigits = '\\d+', rsDingbat = '[' + rsDingbatRange + ']', rsLower = '[' + rsLowerRange + ']', rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', rsFitz = '\\ud83c[\\udffb-\\udfff]', rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', rsUpper = '[' + rsUpperRange + ']', rsZWJ = '\\u200d'; /** Used to compose unicode regexes. */ var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange + ']?', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; /** Used to match apostrophes. */ var reApos = RegExp(rsApos, 'g'); /** * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). */ var reComboMark = RegExp(rsCombo, 'g'); /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** Used to match complex or compound words. */ var reUnicodeWord = RegExp([ rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, rsUpper + '+' + rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji ].join('|'), 'g'); /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); /** Used to detect strings that need a more robust regexp to match words. */ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; /** Used to assign default `context` object properties. */ var contextProps = [ 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' ]; /** Used to make template sourceURLs easier to identify. */ var templateCounter = -1; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** Used to identify `toStringTag` values supported by `_.clone`. */ var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; /** Used to map Latin Unicode letters to basic Latin letters. */ var deburredLetters = { // Latin-1 Supplement block. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', '\xc7': 'C', '\xe7': 'c', '\xd0': 'D', '\xf0': 'd', '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', '\xd1': 'N', '\xf1': 'n', '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', '\xc6': 'Ae', '\xe6': 'ae', '\xde': 'Th', '\xfe': 'th', '\xdf': 'ss', // Latin Extended-A block. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', '\u0134': 'J', '\u0135': 'j', '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', '\u0163': 't', '\u0165': 't', '\u0167': 't', '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', '\u0174': 'W', '\u0175': 'w', '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', '\u0132': 'IJ', '\u0133': 'ij', '\u0152': 'Oe', '\u0153': 'oe', '\u0149': "'n", '\u017f': 's' }; /** Used to map characters to HTML entities. */ var htmlEscapes = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; /** Used to map HTML entities to characters. */ var htmlUnescapes = { '&': '&', '<': '<', '>': '>', '"': '"', ''': "'" }; /** Used to escape characters for inclusion in compiled string literals. */ var stringEscapes = { '\\': '\\', "'": "'", '\n': 'n', '\r': 'r', '\u2028': 'u2028', '\u2029': 'u2029' }; /** Built-in method references without a dependency on `root`. */ var freeParseFloat = parseFloat, freeParseInt = parseInt; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); /** Detect free variable `exports`. */ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { // Use `util.types` for Node.js 10+. var types = freeModule && freeModule.require && freeModule.require('util').types; if (types) { return types; } // Legacy `process.binding('util')` for Node.js < 10. return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); /* Node.js helper references. */ var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /*--------------------------------------------------------------------------*/ /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } /** * A specialized version of `baseAggregator` for arrays. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function arrayAggregator(array, setter, iteratee, accumulator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { var value = array[index]; setter(accumulator, value, iteratee(value), array); } return accumulator; } /** * A specialized version of `_.forEach` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } /** * A specialized version of `_.forEachRight` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEachRight(array, iteratee) { var length = array == null ? 0 : array.length; while (length--) { if (iteratee(array[length], length, array) === false) { break; } } return array; } /** * A specialized version of `_.every` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. */ function arrayEvery(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (!predicate(array[index], index, array)) { return false; } } return true; } /** * A specialized version of `_.filter` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result[resIndex++] = value; } } return result; } /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } /** * This function is like `arrayIncludes` except that it accepts a comparator. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludesWith(array, value, comparator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; } /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } /** * Appends the elements of `values` to `array`. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to append. * @returns {Array} Returns `array`. */ function arrayPush(array, values) { var index = -1, length = values.length, offset = array.length; while (++index < length) { array[offset + index] = values[index]; } return array; } /** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } /** * A specialized version of `_.reduceRight` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the last element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduceRight(array, iteratee, accumulator, initAccum) { var length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[--length]; } while (length--) { accumulator = iteratee(accumulator, array[length], length, array); } return accumulator; } /** * A specialized version of `_.some` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } /** * Gets the size of an ASCII `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ var asciiSize = baseProperty('length'); /** * Converts an ASCII `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function asciiToArray(string) { return string.split(''); } /** * Splits an ASCII `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function asciiWords(string) { return string.match(reAsciiWord) || []; } /** * The base implementation of methods like `_.findKey` and `_.findLastKey`, * without support for iteratee shorthands, which iterates over `collection` * using `eachFunc`. * * @private * @param {Array|Object} collection The collection to inspect. * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the found element or its key, else `undefined`. */ function baseFindKey(collection, predicate, eachFunc) { var result; eachFunc(collection, function(value, key, collection) { if (predicate(value, key, collection)) { result = key; return false; } }); return result; } /** * The base implementation of `_.findIndex` and `_.findLastIndex` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { return index; } } return -1; } /** * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } /** * This function is like `baseIndexOf` except that it accepts a comparator. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @param {Function} comparator The comparator invoked per element. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOfWith(array, value, fromIndex, comparator) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (comparator(array[index], value)) { return index; } } return -1; } /** * The base implementation of `_.isNaN` without support for number objects. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ function baseIsNaN(value) { return value !== value; } /** * The base implementation of `_.mean` and `_.meanBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the mean. */ function baseMean(array, iteratee) { var length = array == null ? 0 : array.length; return length ? (baseSum(array, iteratee) / length) : NAN; } /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } /** * The base implementation of `_.propertyOf` without support for deep paths. * * @private * @param {Object} object The object to query. * @returns {Function} Returns the new accessor function. */ function basePropertyOf(object) { return function(key) { return object == null ? undefined : object[key]; }; } /** * The base implementation of `_.reduce` and `_.reduceRight`, without support * for iteratee shorthands, which iterates over `collection` using `eachFunc`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. * @param {boolean} initAccum Specify using the first or last element of * `collection` as the initial value. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the accumulated value. */ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, function(value, index, collection) { accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection); }); return accumulator; } /** * The base implementation of `_.sortBy` which uses `comparer` to define the * sort order of `array` and replaces criteria objects with their corresponding * values. * * @private * @param {Array} array The array to sort. * @param {Function} comparer The function to define sort order. * @returns {Array} Returns `array`. */ function baseSortBy(array, comparer) { var length = array.length; array.sort(comparer); while (length--) { array[length] = array[length].value; } return array; } /** * The base implementation of `_.sum` and `_.sumBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the sum. */ function baseSum(array, iteratee) { var result, index = -1, length = array.length; while (++index < length) { var current = iteratee(array[index]); if (current !== undefined) { result = result === undefined ? current : (result + current); } } return result; } /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } /** * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array * of key-value pairs for `object` corresponding to the property names of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the key-value pairs. */ function baseToPairs(object, props) { return arrayMap(props, function(key) { return [key, object[key]]; }); } /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } /** * The base implementation of `_.values` and `_.valuesIn` which creates an * array of `object` property values corresponding to the property names * of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the array of property values. */ function baseValues(object, props) { return arrayMap(props, function(key) { return object[key]; }); } /** * Checks if a `cache` value for `key` exists. * * @private * @param {Object} cache The cache to query. * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function cacheHas(cache, key) { return cache.has(key); } /** * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the first unmatched string symbol. */ function charsStartIndex(strSymbols, chrSymbols) { var index = -1, length = strSymbols.length; while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } /** * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the last unmatched string symbol. */ function charsEndIndex(strSymbols, chrSymbols) { var index = strSymbols.length; while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } /** * Gets the number of `placeholder` occurrences in `array`. * * @private * @param {Array} array The array to inspect. * @param {*} placeholder The placeholder to search for. * @returns {number} Returns the placeholder count. */ function countHolders(array, placeholder) { var length = array.length, result = 0; while (length--) { if (array[length] === placeholder) { ++result; } } return result; } /** * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A * letters to basic Latin letters. * * @private * @param {string} letter The matched letter to deburr. * @returns {string} Returns the deburred letter. */ var deburrLetter = basePropertyOf(deburredLetters); /** * Used by `_.escape` to convert characters to HTML entities. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ var escapeHtmlChar = basePropertyOf(htmlEscapes); /** * Used by `_.template` to escape characters for inclusion in compiled string literals. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ function escapeStringChar(chr) { return '\\' + stringEscapes[chr]; } /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } /** * Checks if `string` contains Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a symbol is found, else `false`. */ function hasUnicode(string) { return reHasUnicode.test(string); } /** * Checks if `string` contains a word composed of Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a word is found, else `false`. */ function hasUnicodeWord(string) { return reHasUnicodeWord.test(string); } /** * Converts `iterator` to an array. * * @private * @param {Object} iterator The iterator to convert. * @returns {Array} Returns the converted array. */ function iteratorToArray(iterator) { var data, result = []; while (!(data = iterator.next()).done) { result.push(data.value); } return result; } /** * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. * @returns {Array} Returns the key-value pairs. */ function mapToArray(map) { var index = -1, result = Array(map.size); map.forEach(function(value, key) { result[++index] = [key, value]; }); return result; } /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } /** * Replaces all `placeholder` elements in `array` with an internal placeholder * and returns an array of their indexes. * * @private * @param {Array} array The array to modify. * @param {*} placeholder The placeholder to replace. * @returns {Array} Returns the new array of placeholder indexes. */ function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value === placeholder || value === PLACEHOLDER) { array[index] = PLACEHOLDER; result[resIndex++] = index; } } return result; } /** * Gets the value at `key`, unless `key` is "__proto__". * * @private * @param {Object} object The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function safeGet(object, key) { return key == '__proto__' ? undefined : object[key]; } /** * Converts `set` to an array of its values. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the values. */ function setToArray(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = value; }); return result; } /** * Converts `set` to its value-value pairs. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the value-value pairs. */ function setToPairs(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = [value, value]; }); return result; } /** * A specialized version of `_.indexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } /** * A specialized version of `_.lastIndexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictLastIndexOf(array, value, fromIndex) { var index = fromIndex + 1; while (index--) { if (array[index] === value) { return index; } } return index; } /** * Gets the number of symbols in `string`. * * @private * @param {string} string The string to inspect. * @returns {number} Returns the string size. */ function stringSize(string) { return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); } /** * Converts `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function stringToArray(string) { return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); } /** * Used by `_.unescape` to convert HTML entities to characters. * * @private * @param {string} chr The matched character to unescape. * @returns {string} Returns the unescaped character. */ var unescapeHtmlChar = basePropertyOf(htmlUnescapes); /** * Gets the size of a Unicode `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ function unicodeSize(string) { var result = reUnicode.lastIndex = 0; while (reUnicode.test(string)) { ++result; } return result; } /** * Converts a Unicode `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function unicodeToArray(string) { return string.match(reUnicode) || []; } /** * Splits a Unicode `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function unicodeWords(string) { return string.match(reUnicodeWord) || []; } /*--------------------------------------------------------------------------*/ /** * Create a new pristine `lodash` function using the `context` object. * * @static * @memberOf _ * @since 1.1.0 * @category Util * @param {Object} [context=root] The context object. * @returns {Function} Returns a new `lodash` function. * @example * * _.mixin({ 'foo': _.constant('foo') }); * * var lodash = _.runInContext(); * lodash.mixin({ 'bar': lodash.constant('bar') }); * * _.isFunction(_.foo); * // => true * _.isFunction(_.bar); * // => false * * lodash.isFunction(lodash.foo); * // => false * lodash.isFunction(lodash.bar); * // => true * * // Create a suped-up `defer` in Node.js. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; */ var runInContext = (function runInContext(context) { context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); /** Built-in constructor references. */ var Array = context.Array, Date = context.Date, Error = context.Error, Function = context.Function, Math = context.Math, Object = context.Object, RegExp = context.RegExp, String = context.String, TypeError = context.TypeError; /** Used for built-in method references. */ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ var coreJsData = context['__core-js_shared__']; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to generate unique IDs. */ var idCounter = 0; /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** Used to restore the original `_` reference in `_.noConflict`. */ var oldDash = root._; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** Built-in value references. */ var Buffer = moduleExports ? context.Buffer : undefined, Symbol = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, symIterator = Symbol ? Symbol.iterator : undefined, symToStringTag = Symbol ? Symbol.toStringTag : undefined; var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); /** Mocked built-ins. */ var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, nativeFloor = Math.floor, nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max, nativeMin = Math.min, nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math.random, nativeReverse = arrayProto.reverse; /* Built-in method references that are verified to be native. */ var DataView = getNative(context, 'DataView'), Map = getNative(context, 'Map'), Promise = getNative(context, 'Promise'), Set = getNative(context, 'Set'), WeakMap = getNative(context, 'WeakMap'), nativeCreate = getNative(Object, 'create'); /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; /** Used to lookup unminified function names. */ var realNames = {}; /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap); /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined; /*------------------------------------------------------------------------*/ /** * Creates a `lodash` object which wraps `value` to enable implicit method * chain sequences. Methods that operate on and return arrays, collections, * and functions can be chained together. Methods that retrieve a single value * or may return a primitive value will automatically end the chain sequence * and return the unwrapped value. Otherwise, the value must be unwrapped * with `_#value`. * * Explicit chain sequences, which must be unwrapped with `_#value`, may be * enabled using `_.chain`. * * The execution of chained methods is lazy, that is, it's deferred until * `_#value` is implicitly or explicitly called. * * Lazy evaluation allows several methods to support shortcut fusion. * Shortcut fusion is an optimization to merge iteratee calls; this avoids * the creation of intermediate arrays and can greatly reduce the number of * iteratee executions. Sections of a chain sequence qualify for shortcut * fusion if the section is applied to an array and iteratees accept only * one argument. The heuristic for whether a section qualifies for shortcut * fusion is subject to change. * * Chaining is supported in custom builds as long as the `_#value` method is * directly or indirectly included in the build. * * In addition to lodash methods, wrappers have `Array` and `String` methods. * * The wrapper `Array` methods are: * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` * * The wrapper `String` methods are: * `replace` and `split` * * The wrapper methods that support shortcut fusion are: * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` * * The chainable wrapper methods are: * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, * `zipObject`, `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, * `upperFirst`, `value`, and `words` * * @name _ * @constructor * @category Seq * @param {*} value The value to wrap in a `lodash` instance. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2, 3]); * * // Returns an unwrapped value. * wrapped.reduce(_.add); * // => 6 * * // Returns a wrapped value. * var squares = wrapped.map(square); * * _.isArray(squares); * // => false * * _.isArray(squares.value()); * // => true */ function lodash(value) { if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { if (value instanceof LodashWrapper) { return value; } if (hasOwnProperty.call(value, '__wrapped__')) { return wrapperClone(value); } } return new LodashWrapper(value); } /** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ var baseCreate = (function() { function object() {} return function(proto) { if (!isObject(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object; object.prototype = undefined; return result; }; }()); /** * The function whose prototype chain sequence wrappers inherit from. * * @private */ function baseLodash() { // No operation performed. } /** * The base constructor for creating `lodash` wrapper objects. * * @private * @param {*} value The value to wrap. * @param {boolean} [chainAll] Enable explicit method chain sequences. */ function LodashWrapper(value, chainAll) { this.__wrapped__ = value; this.__actions__ = []; this.__chain__ = !!chainAll; this.__index__ = 0; this.__values__ = undefined; } /** * By default, the template delimiters used by lodash are like those in * embedded Ruby (ERB) as well as ES2015 template strings. Change the * following template settings to use alternative delimiters. * * @static * @memberOf _ * @type {Object} */ lodash.templateSettings = { /** * Used to detect `data` property values to be HTML-escaped. * * @memberOf _.templateSettings * @type {RegExp} */ 'escape': reEscape, /** * Used to detect code to be evaluated. * * @memberOf _.templateSettings * @type {RegExp} */ 'evaluate': reEvaluate, /** * Used to detect `data` property values to inject. * * @memberOf _.templateSettings * @type {RegExp} */ 'interpolate': reInterpolate, /** * Used to reference the data object in the template text. * * @memberOf _.templateSettings * @type {string} */ 'variable': '', /** * Used to import variables into the compiled template. * * @memberOf _.templateSettings * @type {Object} */ 'imports': { /** * A reference to the `lodash` function. * * @memberOf _.templateSettings.imports * @type {Function} */ '_': lodash } }; // Ensure wrappers are instances of `baseLodash`. lodash.prototype = baseLodash.prototype; lodash.prototype.constructor = lodash; LodashWrapper.prototype = baseCreate(baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; /*------------------------------------------------------------------------*/ /** * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. * * @private * @constructor * @param {*} value The value to wrap. */ function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH; this.__views__ = []; } /** * Creates a clone of the lazy wrapper object. * * @private * @name clone * @memberOf LazyWrapper * @returns {Object} Returns the cloned `LazyWrapper` object. */ function lazyClone() { var result = new LazyWrapper(this.__wrapped__); result.__actions__ = copyArray(this.__actions__); result.__dir__ = this.__dir__; result.__filtered__ = this.__filtered__; result.__iteratees__ = copyArray(this.__iteratees__); result.__takeCount__ = this.__takeCount__; result.__views__ = copyArray(this.__views__); return result; } /** * Reverses the direction of lazy iteration. * * @private * @name reverse * @memberOf LazyWrapper * @returns {Object} Returns the new reversed `LazyWrapper` object. */ function lazyReverse() { if (this.__filtered__) { var result = new LazyWrapper(this); result.__dir__ = -1; result.__filtered__ = true; } else { result = this.clone(); result.__dir__ *= -1; } return result; } /** * Extracts the unwrapped value from its lazy wrapper. * * @private * @name value * @memberOf LazyWrapper * @returns {*} Returns the unwrapped value. */ function lazyValue() { var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : (start - 1), iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__); if (!isArr || (!isRight && arrLength == length && takeCount == length)) { return baseWrapperValue(array, this.__actions__); } var result = []; outer: while (length-- && resIndex < takeCount) { index += dir; var iterIndex = -1, value = array[index]; while (++iterIndex < iterLength) { var data = iteratees[iterIndex], iteratee = data.iteratee, type = data.type, computed = iteratee(value); if (type == LAZY_MAP_FLAG) { value = computed; } else if (!computed) { if (type == LAZY_FILTER_FLAG) { continue outer; } else { break outer; } } } result[resIndex++] = value; } return result; } // Ensure `LazyWrapper` is an instance of `baseLodash`. LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; /*------------------------------------------------------------------------*/ /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; /*------------------------------------------------------------------------*/ /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; /*------------------------------------------------------------------------*/ /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { var result = getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { var data = getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; /*------------------------------------------------------------------------*/ /** * * Creates an array cache object to store unique values. * * @private * @constructor * @param {Array} [values] The values to cache. */ function SetCache(values) { var index = -1, length = values == null ? 0 : values.length; this.__data__ = new MapCache; while (++index < length) { this.add(values[index]); } } /** * Adds `value` to the array cache. * * @private * @name add * @memberOf SetCache * @alias push * @param {*} value The value to cache. * @returns {Object} Returns the cache instance. */ function setCacheAdd(value) { this.__data__.set(value, HASH_UNDEFINED); return this; } /** * Checks if `value` is in the array cache. * * @private * @name has * @memberOf SetCache * @param {*} value The value to search for. * @returns {number} Returns `true` if `value` is found, else `false`. */ function setCacheHas(value) { return this.__data__.has(value); } // Add methods to `SetCache`. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; SetCache.prototype.has = setCacheHas; /*------------------------------------------------------------------------*/ /** * Creates a stack cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } /** * Removes all key-value entries from the stack. * * @private * @name clear * @memberOf Stack */ function stackClear() { this.__data__ = new ListCache; this.size = 0; } /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { var data = this.__data__, result = data['delete'](key); this.size = data.size; return result; } /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function stackGet(key) { return this.__data__.get(key); } /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { return this.__data__.has(key); } /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); this.size = ++data.size; return this; } data = this.__data__ = new MapCache(pairs); } data.set(key, value); this.size = data.size; return this; } // Add methods to `Stack`. Stack.prototype.clear = stackClear; Stack.prototype['delete'] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; /*------------------------------------------------------------------------*/ /** * Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode. key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers. (isBuff && (key == 'offset' || key == 'parent')) || // PhantomJS 2 has enumerable non-index properties on typed arrays. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || // Skip index properties. isIndex(key, length) ))) { result.push(key); } } return result; } /** * A specialized version of `_.sample` for arrays. * * @private * @param {Array} array The array to sample. * @returns {*} Returns the random element. */ function arraySample(array) { var length = array.length; return length ? array[baseRandom(0, length - 1)] : undefined; } /** * A specialized version of `_.sampleSize` for arrays. * * @private * @param {Array} array The array to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. */ function arraySampleSize(array, n) { return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); } /** * A specialized version of `_.shuffle` for arrays. * * @private * @param {Array} array The array to shuffle. * @returns {Array} Returns the new shuffled array. */ function arrayShuffle(array) { return shuffleSelf(copyArray(array)); } /** * This function is like `assignValue` except that it doesn't assign * `undefined` values. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } /** * Aggregates elements of `collection` on `accumulator` with keys transformed * by `iteratee` and values set by `setter`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function baseAggregator(collection, setter, iteratee, accumulator) { baseEach(collection, function(value, key, collection) { setter(accumulator, value, iteratee(value), collection); }); return accumulator; } /** * The base implementation of `_.assign` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssign(object, source) { return object && copyObject(source, keys(source), object); } /** * The base implementation of `_.assignIn` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssignIn(object, source) { return object && copyObject(source, keysIn(source), object); } /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } /** * The base implementation of `_.at` without support for individual paths. * * @private * @param {Object} object The object to iterate over. * @param {string[]} paths The property paths to pick. * @returns {Array} Returns the picked elements. */ function baseAt(object, paths) { var index = -1, length = paths.length, result = Array(length), skip = object == null; while (++index < length) { result[index] = skip ? undefined : get(object, paths[index]); } return result; } /** * The base implementation of `_.clamp` which doesn't coerce arguments. * * @private * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. */ function baseClamp(number, lower, upper) { if (number === number) { if (upper !== undefined) { number = number <= upper ? number : upper; } if (lower !== undefined) { number = number >= lower ? number : lower; } } return number; } /** * The base implementation of `_.clone` and `_.cloneDeep` which tracks * traversed objects. * * @private * @param {*} value The value to clone. * @param {boolean} bitmask The bitmask flags. * 1 - Deep clone * 2 - Flatten inherited properties * 4 - Clone symbols * @param {Function} [customizer] The function to customize cloning. * @param {string} [key] The key of `value`. * @param {Object} [object] The parent object of `value`. * @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @returns {*} Returns the cloned value. */ function baseClone(value, bitmask, customizer, key, object, stack) { var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; if (customizer) { result = object ? customizer(value, key, object, stack) : customizer(value); } if (result !== undefined) { return result; } if (!isObject(value)) { return value; } var isArr = isArray(value); if (isArr) { result = initCloneArray(value); if (!isDeep) { return copyArray(value, result); } } else { var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; if (isBuffer(value)) { return cloneBuffer(value, isDeep); } if (tag == objectTag || tag == argsTag || (isFunc && !object)) { result = (isFlat || isFunc) ? {} : initCloneObject(value); if (!isDeep) { return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); } } else { if (!cloneableTags[tag]) { return object ? value : {}; } result = initCloneByTag(value, tag, isDeep); } } // Check for circular references and return its corresponding clone. stack || (stack = new Stack); var stacked = stack.get(value); if (stacked) { return stacked; } stack.set(value, result); if (isSet(value)) { value.forEach(function(subValue) { result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); return result; } if (isMap(value)) { value.forEach(function(subValue, key) { result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); return result; } var keysFunc = isFull ? (isFlat ? getAllKeysIn : getAllKeys) : (isFlat ? keysIn : keys); var props = isArr ? undefined : keysFunc(value); arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; subValue = value[key]; } // Recursively populate clone (susceptible to call stack limits). assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); return result; } /** * The base implementation of `_.conforms` which doesn't clone `source`. * * @private * @param {Object} source The object of property predicates to conform to. * @returns {Function} Returns the new spec function. */ function baseConforms(source) { var props = keys(source); return function(object) { return baseConformsTo(object, source, props); }; } /** * The base implementation of `_.conformsTo` which accepts `props` to check. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property predicates to conform to. * @returns {boolean} Returns `true` if `object` conforms, else `false`. */ function baseConformsTo(object, source, props) { var length = props.length; if (object == null) { return !length; } object = Object(object); while (length--) { var key = props[length], predicate = source[key], value = object[key]; if ((value === undefined && !(key in object)) || !predicate(value)) { return false; } } return true; } /** * The base implementation of `_.delay` and `_.defer` which accepts `args` * to provide to `func`. * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @param {Array} args The arguments to provide to `func`. * @returns {number|Object} Returns the timer id or timeout object. */ function baseDelay(func, wait, args) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return setTimeout(function() { func.apply(undefined, args); }, wait); } /** * The base implementation of methods like `_.difference` without support * for excluding multiple arrays or iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Array} values The values to exclude. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. */ function baseDifference(array, values, iteratee, comparator) { var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length; if (!length) { return result; } if (iteratee) { values = arrayMap(values, baseUnary(iteratee)); } if (comparator) { includes = arrayIncludesWith; isCommon = false; } else if (values.length >= LARGE_ARRAY_SIZE) { includes = cacheHas; isCommon = false; values = new SetCache(values); } outer: while (++index < length) { var value = array[index], computed = iteratee == null ? value : iteratee(value); value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var valuesIndex = valuesLength; while (valuesIndex--) { if (values[valuesIndex] === computed) { continue outer; } } result.push(value); } else if (!includes(values, computed, comparator)) { result.push(value); } } return result; } /** * The base implementation of `_.forEach` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEach = createBaseEach(baseForOwn); /** * The base implementation of `_.forEachRight` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEachRight = createBaseEach(baseForOwnRight, true); /** * The base implementation of `_.every` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false` */ function baseEvery(collection, predicate) { var result = true; baseEach(collection, function(value, index, collection) { result = !!predicate(value, index, collection); return result; }); return result; } /** * The base implementation of methods like `_.max` and `_.min` which accepts a * `comparator` to determine the extremum value. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The iteratee invoked per iteration. * @param {Function} comparator The comparator used to compare values. * @returns {*} Returns the extremum value. */ function baseExtremum(array, iteratee, comparator) { var index = -1, length = array.length; while (++index < length) { var value = array[index], current = iteratee(value); if (current != null && (computed === undefined ? (current === current && !isSymbol(current)) : comparator(current, computed) )) { var computed = current, result = value; } } return result; } /** * The base implementation of `_.fill` without an iteratee call guard. * * @private * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns `array`. */ function baseFill(array, value, start, end) { var length = array.length; start = toInteger(start); if (start < 0) { start = -start > length ? 0 : (length + start); } end = (end === undefined || end > length) ? length : toInteger(end); if (end < 0) { end += length; } end = start > end ? 0 : toLength(end); while (start < end) { array[start++] = value; } return array; } /** * The base implementation of `_.filter` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function baseFilter(collection, predicate) { var result = []; baseEach(collection, function(value, index, collection) { if (predicate(value, index, collection)) { result.push(value); } }); return result; } /** * The base implementation of `_.flatten` with support for restricting flattening. * * @private * @param {Array} array The array to flatten. * @param {number} depth The maximum recursion depth. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; predicate || (predicate = isFlattenable); result || (result = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } } else if (!isStrict) { result[result.length] = value; } } return result; } /** * The base implementation of `baseForOwn` which iterates over `object` * properties returned by `keysFunc` and invokes `iteratee` for each property. * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = createBaseFor(); /** * This function is like `baseFor` except that it iterates over properties * in the opposite order. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseForRight = createBaseFor(true); /** * The base implementation of `_.forOwn` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { return object && baseFor(object, iteratee, keys); } /** * The base implementation of `_.forOwnRight` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwnRight(object, iteratee) { return object && baseForRight(object, iteratee, keys); } /** * The base implementation of `_.functions` which creates an array of * `object` function property names filtered from `props`. * * @private * @param {Object} object The object to inspect. * @param {Array} props The property names to filter. * @returns {Array} Returns the function names. */ function baseFunctions(object, props) { return arrayFilter(props, function(key) { return isFunction(object[key]); }); } /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return (index && index == length) ? object : undefined; } /** * The base implementation of `getAllKeys` and `getAllKeysIn` which uses * `keysFunc` and `symbolsFunc` to get the enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @param {Function} keysFunc The function to get the keys of `object`. * @param {Function} symbolsFunc The function to get the symbols of `object`. * @returns {Array} Returns the array of property names and symbols. */ function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); } /** * The base implementation of `_.gt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. */ function baseGt(value, other) { return value > other; } /** * The base implementation of `_.has` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHas(object, key) { return object != null && hasOwnProperty.call(object, key); } /** * The base implementation of `_.hasIn` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHasIn(object, key) { return object != null && key in Object(object); } /** * The base implementation of `_.inRange` which doesn't coerce arguments. * * @private * @param {number} number The number to check. * @param {number} start The start of the range. * @param {number} end The end of the range. * @returns {boolean} Returns `true` if `number` is in the range, else `false`. */ function baseInRange(number, start, end) { return number >= nativeMin(start, end) && number < nativeMax(start, end); } /** * The base implementation of methods like `_.intersection`, without support * for iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of shared values. */ function baseIntersection(arrays, iteratee, comparator) { var includes = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = []; while (othIndex--) { var array = arrays[othIndex]; if (othIndex && iteratee) { array = arrayMap(array, baseUnary(iteratee)); } maxLength = nativeMin(array.length, maxLength); caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) ? new SetCache(othIndex && array) : undefined; } array = arrays[0]; var index = -1, seen = caches[0]; outer: while (++index < length && result.length < maxLength) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator) )) { othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator)) ) { continue outer; } } if (seen) { seen.push(computed); } result.push(value); } } return result; } /** * The base implementation of `_.invert` and `_.invertBy` which inverts * `object` with values transformed by `iteratee` and set by `setter`. * * @private * @param {Object} object The object to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform values. * @param {Object} accumulator The initial inverted object. * @returns {Function} Returns `accumulator`. */ function baseInverter(object, setter, iteratee, accumulator) { baseForOwn(object, function(value, key, object) { setter(accumulator, iteratee(value), key, object); }); return accumulator; } /** * The base implementation of `_.invoke` without support for individual * method arguments. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {Array} args The arguments to invoke the method with. * @returns {*} Returns the result of the invoked method. */ function baseInvoke(object, path, args) { path = castPath(path, object); object = parent(object, path); var func = object == null ? object : object[toKey(last(path))]; return func == null ? undefined : apply(func, object, args); } /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } /** * The base implementation of `_.isArrayBuffer` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. */ function baseIsArrayBuffer(value) { return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; } /** * The base implementation of `_.isDate` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a date object, else `false`. */ function baseIsDate(value) { return isObjectLike(value) && baseGetTag(value) == dateTag; } /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {boolean} bitmask The bitmask flags. * 1 - Unordered comparison * 2 - Partial comparison * @param {Function} [customizer] The function to customize comparisons. * @param {Object} [stack] Tracks traversed `value` and `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } /** * A specialized version of `baseIsEqual` for arrays and objects which performs * deep comparisons and tracks traversed objects enabling objects with circular * references to be compared. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new Stack); return (objIsArr || isTypedArray(object)) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack); return equalObjects(object, other, bitmask, customizer, equalFunc, stack); } /** * The base implementation of `_.isMap` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. */ function baseIsMap(value) { return isObjectLike(value) && getTag(value) == mapTag; } /** * The base implementation of `_.isMatch` without support for iteratee shorthands. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Array} matchData The property names, values, and compare flags to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. */ function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = Object(object); while (index--) { var data = matchData[index]; if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object) ) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined && !(key in object)) { return false; } } else { var stack = new Stack; if (customizer) { var result = customizer(objValue, srcValue, key, object, source, stack); } if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result )) { return false; } } } return true; } /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } /** * The base implementation of `_.isRegExp` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. */ function baseIsRegExp(value) { return isObjectLike(value) && baseGetTag(value) == regexpTag; } /** * The base implementation of `_.isSet` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. */ function baseIsSet(value) { return isObjectLike(value) && getTag(value) == setTag; } /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } /** * The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. if (typeof value == 'function') { return value; } if (value == null) { return identity; } if (typeof value == 'object') { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } /** * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result = []; for (var key in Object(object)) { if (hasOwnProperty.call(object, key) && key != 'constructor') { result.push(key); } } return result; } /** * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { if (!isObject(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; for (var key in object) { if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } return result; } /** * The base implementation of `_.lt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. */ function baseLt(value, other) { return value < other; } /** * The base implementation of `_.map` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function baseMap(collection, iteratee) { var index = -1, result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value, key, collection) { result[++index] = iteratee(value, key, collection); }); return result; } /** * The base implementation of `_.matches` which doesn't clone `source`. * * @private * @param {Object} source The object of property values to match. * @returns {Function} Returns the new spec function. */ function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || baseIsMatch(object, source, matchData); }; } /** * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private * @param {string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function baseMatchesProperty(path, srcValue) { if (isKey(path) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path), srcValue); } return function(object) { var objValue = get(object, path); return (objValue === undefined && objValue === srcValue) ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } /** * The base implementation of `_.merge` without support for multiple sources. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor(source, function(srcValue, key) { if (isObject(srcValue)) { stack || (stack = new Stack); baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { newValue = srcValue; } assignMergeValue(object, key, newValue); } }, keysIn); } /** * A specialized version of `baseMerge` for arrays and objects which performs * deep merges and tracks traversed objects enabling objects with circular * references to be merged. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined; var isCommon = newValue === undefined; if (isCommon) { var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack['delete'](srcValue); } assignMergeValue(object, key, newValue); } /** * The base implementation of `_.nth` which doesn't coerce arguments. * * @private * @param {Array} array The array to query. * @param {number} n The index of the element to return. * @returns {*} Returns the nth element of `array`. */ function baseNth(array, n) { var length = array.length; if (!length) { return; } n += n < 0 ? length : 0; return isIndex(n, length) ? array[n] : undefined; } /** * The base implementation of `_.orderBy` without param guards. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. * @param {string[]} orders The sort orders of `iteratees`. * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { var index = -1; iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee())); var result = baseMap(collection, function(value, key, collection) { var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); return { 'criteria': criteria, 'index': ++index, 'value': value }; }); return baseSortBy(result, function(object, other) { return compareMultiple(object, other, orders); }); } /** * The base implementation of `_.pick` without support for individual * property identifiers. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @returns {Object} Returns the new object. */ function basePick(object, paths) { return basePickBy(object, paths, function(value, path) { return hasIn(object, path); }); } /** * The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @param {Function} predicate The function invoked per property. * @returns {Object} Returns the new object. */ function basePickBy(object, paths, predicate) { var index = -1, length = paths.length, result = {}; while (++index < length) { var path = paths[index], value = baseGet(object, path); if (predicate(value, path)) { baseSet(result, castPath(path, object), value); } } return result; } /** * A specialized version of `baseProperty` which supports deep paths. * * @private * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { return function(object) { return baseGet(object, path); }; } /** * The base implementation of `_.pullAllBy` without support for iteratee * shorthands. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. */ function basePullAll(array, values, iteratee, comparator) { var indexOf = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values.length, seen = array; if (array === values) { values = copyArray(values); } if (iteratee) { seen = arrayMap(array, baseUnary(iteratee)); } while (++index < length) { var fromIndex = 0, value = values[index], computed = iteratee ? iteratee(value) : value; while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { if (seen !== array) { splice.call(seen, fromIndex, 1); } splice.call(array, fromIndex, 1); } } return array; } /** * The base implementation of `_.pullAt` without support for individual * indexes or capturing the removed elements. * * @private * @param {Array} array The array to modify. * @param {number[]} indexes The indexes of elements to remove. * @returns {Array} Returns `array`. */ function basePullAt(array, indexes) { var length = array ? indexes.length : 0, lastIndex = length - 1; while (length--) { var index = indexes[length]; if (length == lastIndex || index !== previous) { var previous = index; if (isIndex(index)) { splice.call(array, index, 1); } else { baseUnset(array, index); } } } return array; } /** * The base implementation of `_.random` without support for returning * floating-point numbers. * * @private * @param {number} lower The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the random number. */ function baseRandom(lower, upper) { return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); } /** * The base implementation of `_.range` and `_.rangeRight` which doesn't * coerce arguments. * * @private * @param {number} start The start of the range. * @param {number} end The end of the range. * @param {number} step The value to increment or decrement by. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the range of numbers. */ function baseRange(start, end, step, fromRight) { var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length); while (length--) { result[fromRight ? length : ++index] = start; start += step; } return result; } /** * The base implementation of `_.repeat` which doesn't coerce arguments. * * @private * @param {string} string The string to repeat. * @param {number} n The number of times to repeat the string. * @returns {string} Returns the repeated string. */ function baseRepeat(string, n) { var result = ''; if (!string || n < 1 || n > MAX_SAFE_INTEGER) { return result; } // Leverage the exponentiation by squaring algorithm for a faster repeat. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. do { if (n % 2) { result += string; } n = nativeFloor(n / 2); if (n) { string += string; } } while (n); return result; } /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. */ function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ''); } /** * The base implementation of `_.sample`. * * @private * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. */ function baseSample(collection) { return arraySample(values(collection)); } /** * The base implementation of `_.sampleSize` without param guards. * * @private * @param {Array|Object} collection The collection to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. */ function baseSampleSize(collection, n) { var array = values(collection); return shuffleSelf(array, baseClamp(n, 0, array.length)); } /** * The base implementation of `_.set`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { if (!isObject(object)) { return object; } path = castPath(path, object); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = toKey(path[index]), newValue = value; if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; if (newValue === undefined) { newValue = isObject(objValue) ? objValue : (isIndex(path[index + 1]) ? [] : {}); } } assignValue(nested, key, newValue); nested = nested[key]; } return object; } /** * The base implementation of `setData` without support for hot loop shorting. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var baseSetData = !metaMap ? identity : function(func, data) { metaMap.set(func, data); return func; }; /** * The base implementation of `setToString` without support for hot loop shorting. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant(string), 'writable': true }); }; /** * The base implementation of `_.shuffle`. * * @private * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. */ function baseShuffle(collection) { return shuffleSelf(values(collection)); } /** * The base implementation of `_.slice` without an iteratee call guard. * * @private * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function baseSlice(array, start, end) { var index = -1, length = array.length; if (start < 0) { start = -start > length ? 0 : (length + start); } end = end > length ? length : end; if (end < 0) { end += length; } length = start > end ? 0 : ((end - start) >>> 0); start >>>= 0; var result = Array(length); while (++index < length) { result[index] = array[index + start]; } return result; } /** * The base implementation of `_.some` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function baseSome(collection, predicate) { var result; baseEach(collection, function(value, index, collection) { result = predicate(value, index, collection); return !result; }); return !!result; } /** * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which * performs a binary search of `array` to determine the index at which `value` * should be inserted into `array` in order to maintain its sort order. * * @private * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {boolean} [retHighest] Specify returning the highest qualified index. * @returns {number} Returns the index at which `value` should be inserted * into `array`. */ function baseSortedIndex(array, value, retHighest) { var low = 0, high = array == null ? low : array.length; if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { while (low < high) { var mid = (low + high) >>> 1, computed = array[mid]; if (computed !== null && !isSymbol(computed) && (retHighest ? (computed <= value) : (computed < value))) { low = mid + 1; } else { high = mid; } } return high; } return baseSortedIndexBy(array, value, identity, retHighest); } /** * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` * which invokes `iteratee` for `value` and each element of `array` to compute * their sort ranking. The iteratee is invoked with one argument; (value). * * @private * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} iteratee The iteratee invoked per element. * @param {boolean} [retHighest] Specify returning the highest qualified index. * @returns {number} Returns the index at which `value` should be inserted * into `array`. */ function baseSortedIndexBy(array, value, iteratee, retHighest) { value = iteratee(value); var low = 0, high = array == null ? 0 : array.length, valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined; while (low < high) { var mid = nativeFloor((low + high) / 2), computed = iteratee(array[mid]), othIsDefined = computed !== undefined, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed); if (valIsNaN) { var setLow = retHighest || othIsReflexive; } else if (valIsUndefined) { setLow = othIsReflexive && (retHighest || othIsDefined); } else if (valIsNull) { setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); } else if (valIsSymbol) { setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); } else if (othIsNull || othIsSymbol) { setLow = false; } else { setLow = retHighest ? (computed <= value) : (computed < value); } if (setLow) { low = mid + 1; } else { high = mid; } } return nativeMin(high, MAX_ARRAY_INDEX); } /** * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseSortedUniq(array, iteratee) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; if (!index || !eq(computed, seen)) { var seen = computed; result[resIndex++] = value === 0 ? 0 : value; } } return result; } /** * The base implementation of `_.toNumber` which doesn't ensure correct * conversions of binary, hexadecimal, or octal string values. * * @private * @param {*} value The value to process. * @returns {number} Returns the number. */ function baseToNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } return +value; } /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isArray(value)) { // Recursively convert values (susceptible to call stack limits). return arrayMap(value, baseToString) + ''; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * The base implementation of `_.uniqBy` without support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseUniq(array, iteratee, comparator) { var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result; if (comparator) { isCommon = false; includes = arrayIncludesWith; } else if (length >= LARGE_ARRAY_SIZE) { var set = iteratee ? null : createSet(array); if (set) { return setToArray(set); } isCommon = false; includes = cacheHas; seen = new SetCache; } else { seen = iteratee ? [] : result; } outer: while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var seenIndex = seen.length; while (seenIndex--) { if (seen[seenIndex] === computed) { continue outer; } } if (iteratee) { seen.push(computed); } result.push(value); } else if (!includes(seen, computed, comparator)) { if (seen !== result) { seen.push(computed); } result.push(value); } } return result; } /** * The base implementation of `_.unset`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The property path to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. */ function baseUnset(object, path) { path = castPath(path, object); object = parent(object, path); return object == null || delete object[toKey(last(path))]; } /** * The base implementation of `_.update`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to update. * @param {Function} updater The function to produce the updated value. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseUpdate(object, path, updater, customizer) { return baseSet(object, path, updater(baseGet(object, path)), customizer); } /** * The base implementation of methods like `_.dropWhile` and `_.takeWhile` * without support for iteratee shorthands. * * @private * @param {Array} array The array to query. * @param {Function} predicate The function invoked per iteration. * @param {boolean} [isDrop] Specify dropping elements instead of taking them. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the slice of `array`. */ function baseWhile(array, predicate, isDrop, fromRight) { var length = array.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {} return isDrop ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); } /** * The base implementation of `wrapperValue` which returns the result of * performing a sequence of actions on the unwrapped `value`, where each * successive action is supplied the return value of the previous. * * @private * @param {*} value The unwrapped value. * @param {Array} actions Actions to perform to resolve the unwrapped value. * @returns {*} Returns the resolved value. */ function baseWrapperValue(value, actions) { var result = value; if (result instanceof LazyWrapper) { result = result.value(); } return arrayReduce(actions, function(result, action) { return action.func.apply(action.thisArg, arrayPush([result], action.args)); }, result); } /** * The base implementation of methods like `_.xor`, without support for * iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of values. */ function baseXor(arrays, iteratee, comparator) { var length = arrays.length; if (length < 2) { return length ? baseUniq(arrays[0]) : []; } var index = -1, result = Array(length); while (++index < length) { var array = arrays[index], othIndex = -1; while (++othIndex < length) { if (othIndex != index) { result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); } } } return baseUniq(baseFlatten(result, 1), iteratee, comparator); } /** * This base implementation of `_.zipObject` which assigns values using `assignFunc`. * * @private * @param {Array} props The property identifiers. * @param {Array} values The property values. * @param {Function} assignFunc The function to assign values. * @returns {Object} Returns the new object. */ function baseZipObject(props, values, assignFunc) { var index = -1, length = props.length, valsLength = values.length, result = {}; while (++index < length) { var value = index < valsLength ? values[index] : undefined; assignFunc(result, props[index], value); } return result; } /** * Casts `value` to an empty array if it's not an array like object. * * @private * @param {*} value The value to inspect. * @returns {Array|Object} Returns the cast array-like object. */ function castArrayLikeObject(value) { return isArrayLikeObject(value) ? value : []; } /** * Casts `value` to `identity` if it's not a function. * * @private * @param {*} value The value to inspect. * @returns {Function} Returns cast function. */ function castFunction(value) { return typeof value == 'function' ? value : identity; } /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @param {Object} [object] The object to query keys on. * @returns {Array} Returns the cast property path array. */ function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } /** * A `baseRest` alias which can be replaced with `identity` by module * replacement plugins. * * @private * @type {Function} * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ var castRest = baseRest; /** * Casts `array` to a slice if it's needed. * * @private * @param {Array} array The array to inspect. * @param {number} start The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the cast slice. */ function castSlice(array, start, end) { var length = array.length; end = end === undefined ? length : end; return (!start && end >= length) ? array : baseSlice(array, start, end); } /** * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). * * @private * @param {number|Object} id The timer id or timeout object of the timer to clear. */ var clearTimeout = ctxClearTimeout || function(id) { return root.clearTimeout(id); }; /** * Creates a clone of `buffer`. * * @private * @param {Buffer} buffer The buffer to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result); return result; } /** * Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array(result).set(new Uint8Array(arrayBuffer)); return result; } /** * Creates a clone of `dataView`. * * @private * @param {Object} dataView The data view to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned data view. */ function cloneDataView(dataView, isDeep) { var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } /** * Creates a clone of `regexp`. * * @private * @param {Object} regexp The regexp to clone. * @returns {Object} Returns the cloned regexp. */ function cloneRegExp(regexp) { var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result.lastIndex = regexp.lastIndex; return result; } /** * Creates a clone of the `symbol` object. * * @private * @param {Object} symbol The symbol object to clone. * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } /** * Creates a clone of `typedArray`. * * @private * @param {Object} typedArray The typed array to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } /** * Compares values to sort them in ascending order. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {number} Returns the sort order indicator for `value`. */ function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || (valIsNull && othIsDefined && othIsReflexive) || (!valIsDefined && othIsReflexive) || !valIsReflexive) { return 1; } if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || (othIsNull && valIsDefined && valIsReflexive) || (!othIsDefined && valIsReflexive) || !othIsReflexive) { return -1; } } return 0; } /** * Used by `_.orderBy` to compare multiple properties of a value to another * and stable sort them. * * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, * specify an order of "desc" for descending or "asc" for ascending sort order * of corresponding values. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {boolean[]|string[]} orders The order to sort by for each property. * @returns {number} Returns the sort order indicator for `object`. */ function compareMultiple(object, other, orders) { var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; while (++index < length) { var result = compareAscending(objCriteria[index], othCriteria[index]); if (result) { if (index >= ordersLength) { return result; } var order = orders[index]; return result * (order == 'desc' ? -1 : 1); } } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications // that causes it, under certain circumstances, to provide the same value for // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 // for more details. // // This also ensures a stable sort in V8 and other engines. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. return object.index - other.index; } /** * Creates an array that is the composition of partially applied arguments, * placeholders, and provided arguments into a single array of arguments. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to prepend to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgs(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried; while (++leftIndex < leftLength) { result[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[holders[argsIndex]] = args[argsIndex]; } } while (rangeLength--) { result[leftIndex++] = args[argsIndex++]; } return result; } /** * This function is like `composeArgs` except that the arguments composition * is tailored for `_.partialRight`. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to append to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgsRight(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried; while (++argsIndex < rangeLength) { result[argsIndex] = args[argsIndex]; } var offset = argsIndex; while (++rightIndex < rightLength) { result[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[offset + holders[holdersIndex]] = args[argsIndex++]; } } return result; } /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; if (newValue === undefined) { newValue = source[key]; } if (isNew) { baseAssignValue(object, key, newValue); } else { assignValue(object, key, newValue); } } return object; } /** * Copies own symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbols(source, object) { return copyObject(source, getSymbols(source), object); } /** * Copies own and inherited symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbolsIn(source, object) { return copyObject(source, getSymbolsIn(source), object); } /** * Creates a function like `_.groupBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} [initializer] The accumulator object initializer. * @returns {Function} Returns the new aggregator function. */ function createAggregator(setter, initializer) { return function(collection, iteratee) { var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; return func(collection, setter, getIteratee(iteratee, 2), accumulator); }; } /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } /** * Creates a `baseEach` or `baseEachRight` function. * * @private * @param {Function} eachFunc The function to iterate over a collection. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { if (collection == null) { return collection; } if (!isArrayLike(collection)) { return eachFunc(collection, iteratee); } var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); while ((fromRight ? index-- : ++index < length)) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } /** * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } /** * Creates a function that wraps `func` to invoke it with the optional `this` * binding of `thisArg`. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new wrapped function. */ function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return fn.apply(isBind ? thisArg : this, arguments); } return wrapper; } /** * Creates a function like `_.lowerFirst`. * * @private * @param {string} methodName The name of the `String` case method to use. * @returns {Function} Returns the new case function. */ function createCaseFirst(methodName) { return function(string) { string = toString(string); var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined; var chr = strSymbols ? strSymbols[0] : string.charAt(0); var trailing = strSymbols ? castSlice(strSymbols, 1).join('') : string.slice(1); return chr[methodName]() + trailing; }; } /** * Creates a function like `_.camelCase`. * * @private * @param {Function} callback The function to combine each word. * @returns {Function} Returns the new compounder function. */ function createCompounder(callback) { return function(string) { return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); }; } /** * Creates a function that produces an instance of `Ctor` regardless of * whether it was invoked as part of a `new` expression or by `call` or `apply`. * * @private * @param {Function} Ctor The constructor to wrap. * @returns {Function} Returns the new wrapped function. */ function createCtor(Ctor) { return function() { // Use a `switch` statement to work with class constructors. See // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; switch (args.length) { case 0: return new Ctor; case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args); // Mimic the constructor's `return` behavior. // See https://es5.github.io/#x13.2.2 for more details. return isObject(result) ? result : thisBinding; }; } /** * Creates a function that wraps `func` to enable currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {number} arity The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createCurry(func, bitmask, arity) { var Ctor = createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length, placeholder = getHolder(wrapper); while (index--) { args[index] = arguments[index]; } var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) ? [] : replaceHolders(args, placeholder); length -= holders.length; if (length < arity) { return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length); } var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return apply(fn, this, args); } return wrapper; } /** * Creates a `_.find` or `_.findLast` function. * * @private * @param {Function} findIndexFunc The function to find the collection index. * @returns {Function} Returns the new find function. */ function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object(collection); if (!isArrayLike(collection)) { var iteratee = getIteratee(predicate, 3); collection = keys(collection); predicate = function(key) { return iteratee(iterable[key], key, iterable); }; } var index = findIndexFunc(collection, predicate, fromIndex); return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; }; } /** * Creates a `_.flow` or `_.flowRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new flow function. */ function createFlow(fromRight) { return flatRest(function(funcs) { var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru; if (fromRight) { funcs.reverse(); } while (index--) { var func = funcs[index]; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (prereq && !wrapper && getFuncName(func) == 'wrapper') { var wrapper = new LodashWrapper([], true); } } index = wrapper ? index : length; while (++index < length) { func = funcs[index]; var funcName = getFuncName(func), data = funcName == 'wrapper' ? getData(func) : undefined; if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1 ) { wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); } else { wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func); } } return function() { var args = arguments, value = args[0]; if (wrapper && args.length == 1 && isArray(value)) { return wrapper.plant(value).value(); } var index = 0, result = length ? funcs[index].apply(this, args) : value; while (++index < length) { result = funcs[index].call(this, result); } return result; }; }); } /** * Creates a function that wraps `func` to invoke it with optional `this` * binding of `thisArg`, partial application, and currying. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [partialsRight] The arguments to append to those provided * to the new function. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined : createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length; while (index--) { args[index] = arguments[index]; } if (isCurried) { var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); } if (partials) { args = composeArgs(args, partials, holders, isCurried); } if (partialsRight) { args = composeArgsRight(args, partialsRight, holdersRight, isCurried); } length -= holdersCount; if (isCurried && length < arity) { var newHolders = replaceHolders(args, placeholder); return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length ); } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; length = args.length; if (argPos) { args = reorder(args, argPos); } else if (isFlip && length > 1) { args.reverse(); } if (isAry && ary < length) { args.length = ary; } if (this && this !== root && this instanceof wrapper) { fn = Ctor || createCtor(fn); } return fn.apply(thisBinding, args); } return wrapper; } /** * Creates a function like `_.invertBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} toIteratee The function to resolve iteratees. * @returns {Function} Returns the new inverter function. */ function createInverter(setter, toIteratee) { return function(object, iteratee) { return baseInverter(object, setter, toIteratee(iteratee), {}); }; } /** * Creates a function that performs a mathematical operation on two values. * * @private * @param {Function} operator The function to perform the operation. * @param {number} [defaultValue] The value used for `undefined` arguments. * @returns {Function} Returns the new mathematical operation function. */ function createMathOperation(operator, defaultValue) { return function(value, other) { var result; if (value === undefined && other === undefined) { return defaultValue; } if (value !== undefined) { result = value; } if (other !== undefined) { if (result === undefined) { return other; } if (typeof value == 'string' || typeof other == 'string') { value = baseToString(value); other = baseToString(other); } else { value = baseToNumber(value); other = baseToNumber(other); } result = operator(value, other); } return result; }; } /** * Creates a function like `_.over`. * * @private * @param {Function} arrayFunc The function to iterate over iteratees. * @returns {Function} Returns the new over function. */ function createOver(arrayFunc) { return flatRest(function(iteratees) { iteratees = arrayMap(iteratees, baseUnary(getIteratee())); return baseRest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee) { return apply(iteratee, thisArg, args); }); }); }); } /** * Creates the padding for `string` based on `length`. The `chars` string * is truncated if the number of characters exceeds `length`. * * @private * @param {number} length The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padding for `string`. */ function createPadding(length, chars) { chars = chars === undefined ? ' ' : baseToString(chars); var charsLength = chars.length; if (charsLength < 2) { return charsLength ? baseRepeat(chars, length) : chars; } var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); return hasUnicode(chars) ? castSlice(stringToArray(result), 0, length).join('') : result.slice(0, length); } /** * Creates a function that wraps `func` to invoke it with the `this` binding * of `thisArg` and `partials` prepended to the arguments it receives. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to * the new function. * @returns {Function} Returns the new wrapped function. */ function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } return apply(fn, isBind ? thisArg : this, args); } return wrapper; } /** * Creates a `_.range` or `_.rangeRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new range function. */ function createRange(fromRight) { return function(start, end, step) { if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { end = step = undefined; } // Ensure the sign of `-0` is preserved. start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); return baseRange(start, end, step, fromRight); }; } /** * Creates a function that performs a relational operation on two values. * * @private * @param {Function} operator The function to perform the operation. * @returns {Function} Returns the new relational operation function. */ function createRelationalOperation(operator) { return function(value, other) { if (!(typeof value == 'string' && typeof other == 'string')) { value = toNumber(value); other = toNumber(other); } return operator(value, other); }; } /** * Creates a function that wraps `func` to continue currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {Function} wrapFunc The function to create the `func` wrapper. * @param {*} placeholder The placeholder value. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials; bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); } var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity ]; var result = wrapFunc.apply(undefined, newData); if (isLaziable(func)) { setData(result, newData); } result.placeholder = placeholder; return setWrapToString(result, func, bitmask); } /** * Creates a function like `_.round`. * * @private * @param {string} methodName The name of the `Math` method to use when rounding. * @returns {Function} Returns the new round function. */ function createRound(methodName) { var func = Math[methodName]; return function(number, precision) { number = toNumber(number); precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); if (precision) { // Shift with exponential notation to avoid floating-point issues. // See [MDN](https://mdn.io/round#Examples) for more details. var pair = (toString(number) + 'e').split('e'), value = func(pair[0] + 'e' + (+pair[1] + precision)); pair = (toString(value) + 'e').split('e'); return +(pair[0] + 'e' + (+pair[1] - precision)); } return func(number); }; } /** * Creates a set object of `values`. * * @private * @param {Array} values The values to add to the set. * @returns {Object} Returns the new set. */ var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { return new Set(values); }; /** * Creates a `_.toPairs` or `_.toPairsIn` function. * * @private * @param {Function} keysFunc The function to get the keys of a given object. * @returns {Function} Returns the new pairs function. */ function createToPairs(keysFunc) { return function(object) { var tag = getTag(object); if (tag == mapTag) { return mapToArray(object); } if (tag == setTag) { return setToPairs(object); } return baseToPairs(object, keysFunc(object)); }; } /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. * 1 - `_.bind` * 2 - `_.bindKey` * 4 - `_.curry` or `_.curryRight` of a bound function * 8 - `_.curry` * 16 - `_.curryRight` * 32 - `_.partial` * 64 - `_.partialRight` * 128 - `_.rearg` * 256 - `_.ary` * 512 - `_.flip` * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to be partially applied. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); partials = holders = undefined; } ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); arity = arity === undefined ? arity : toInteger(arity); length -= holders ? holders.length : 0; if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined; } var data = isBindKey ? undefined : getData(func); var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity ]; if (data) { mergeData(newData, data); } func = newData[0]; bitmask = newData[1]; thisArg = newData[2]; partials = newData[3]; holders = newData[4]; arity = newData[9] = newData[9] === undefined ? (isBindKey ? 0 : func.length) : nativeMax(newData[9] - length, 0); if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); } if (!bitmask || bitmask == WRAP_BIND_FLAG) { var result = createBind(func, bitmask, thisArg); } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { result = createCurry(func, bitmask, arity); } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { result = createPartial(func, bitmask, thisArg, partials); } else { result = createHybrid.apply(undefined, newData); } var setter = data ? baseSetData : setData; return setWrapToString(setter(result, newData), func, bitmask); } /** * Used by `_.defaults` to customize its `_.assignIn` use to assign properties * of source objects to the destination object for all destination properties * that resolve to `undefined`. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to assign. * @param {Object} object The parent object of `objValue`. * @returns {*} Returns the value to assign. */ function customDefaultsAssignIn(objValue, srcValue, key, object) { if (objValue === undefined || (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { return srcValue; } return objValue; } /** * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source * objects into destination objects that are passed thru. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to merge. * @param {Object} object The parent object of `objValue`. * @param {Object} source The parent object of `srcValue`. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. * @returns {*} Returns the value to assign. */ function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, objValue); baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); stack['delete'](srcValue); } return objValue; } /** * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain * objects. * * @private * @param {*} value The value to inspect. * @param {string} key The key of the property to inspect. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. */ function customOmitClone(value) { return isPlainObject(value) ? undefined : value; } /** * A specialized version of `baseIsEqualDeep` for arrays with support for * partial deep comparisons. * * @private * @param {Array} array The array to compare. * @param {Array} other The other array to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `array` and `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } // Assume cyclic values are equal. var stacked = stack.get(array); if (stacked && stack.get(other)) { return stacked == other; } var index = -1, result = true, seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; stack.set(array, other); stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { var arrValue = array[index], othValue = other[index]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); } if (compared !== undefined) { if (compared) { continue; } result = false; break; } // Recursively compare arrays (susceptible to call stack limits). if (seen) { if (!arraySome(other, function(othValue, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result = false; break; } } else if (!( arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack) )) { result = false; break; } } stack['delete'](array); stack['delete'](other); return result; } /** * A specialized version of `baseIsEqualDeep` for comparing objects of * the same `toStringTag`. * * **Note:** This function only supports comparing values with tags of * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if ((object.byteLength != other.byteLength) || (object.byteOffset != other.byteOffset)) { return false; } object = object.buffer; other = other.buffer; case arrayBufferTag: if ((object.byteLength != other.byteLength) || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { return false; } return true; case boolTag: case dateTag: case numberTag: // Coerce booleans to `1` or `0` and dates to milliseconds. // Invalid dates are coerced to `NaN`. return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring // for more details. return object == (other + ''); case mapTag: var convert = mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG; convert || (convert = setToArray); if (object.size != other.size && !isPartial) { return false; } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG; // Recursively compare objects (susceptible to call stack limits). stack.set(object, other); var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); stack['delete'](object); return result; case symbolTag: if (symbolValueOf) { return symbolValueOf.call(object) == symbolValueOf.call(other); } } return false; } /** * A specialized version of `baseIsEqualDeep` for objects with support for * partial deep comparisons. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index = objLength; while (index--) { var key = objProps[index]; if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked && stack.get(other)) { return stacked == other; } var result = true; stack.set(object, other); stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); } // Recursively compare objects (susceptible to call stack limits). if (!(compared === undefined ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) : compared )) { result = false; break; } skipCtor || (skipCtor = key == 'constructor'); } if (result && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal. if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { result = false; } } stack['delete'](object); stack['delete'](other); return result; } /** * A specialized version of `baseRest` which flattens the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ function flatRest(func) { return setToString(overRest(func, undefined, flatten), func + ''); } /** * Creates an array of own enumerable property names and symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols); } /** * Creates an array of own and inherited enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeysIn(object) { return baseGetAllKeys(object, keysIn, getSymbolsIn); } /** * Gets metadata for `func`. * * @private * @param {Function} func The function to query. * @returns {*} Returns the metadata for `func`. */ var getData = !metaMap ? noop : function(func) { return metaMap.get(func); }; /** * Gets the name of `func`. * * @private * @param {Function} func The function to query. * @returns {string} Returns the function name. */ function getFuncName(func) { var result = (func.name + ''), array = realNames[result], length = hasOwnProperty.call(realNames, result) ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result; } /** * Gets the argument placeholder value for `func`. * * @private * @param {Function} func The function to inspect. * @returns {*} Returns the placeholder value. */ function getHolder(func) { var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; return object.placeholder; } /** * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, * this function returns the custom method, otherwise it returns `baseIteratee`. * If arguments are provided, the chosen function is invoked with them and * its result is returned. * * @private * @param {*} [value] The value to convert to an iteratee. * @param {number} [arity] The arity of the created iteratee. * @returns {Function} Returns the chosen function or its result. */ function getIteratee() { var result = lodash.iteratee || iteratee; result = result === iteratee ? baseIteratee : result; return arguments.length ? result(arguments[0], arguments[1]) : result; } /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } /** * Gets the property names, values, and compare flags of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the match data of `object`. */ function getMatchData(object) { var result = keys(object), length = result.length; while (length--) { var key = result[length], value = object[key]; result[length] = [key, value, isStrictComparable(value)]; } return result; } /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } /** * Creates an array of the own enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbols = !nativeGetSymbols ? stubArray : function(object) { if (object == null) { return []; } object = Object(object); return arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); }); }; /** * Creates an array of the own and inherited enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { var result = []; while (object) { arrayPush(result, getSymbols(object)); object = getPrototype(object); } return result; }; /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (Map && getTag(new Map) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || (Set && getTag(new Set) != setTag) || (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : ''; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } } return result; }; } /** * Gets the view, applying any `transforms` to the `start` and `end` positions. * * @private * @param {number} start The start of the view. * @param {number} end The end of the view. * @param {Array} transforms The transformations to apply to the view. * @returns {Object} Returns an object containing the `start` and `end` * positions of the view. */ function getView(start, end, transforms) { var index = -1, length = transforms.length; while (++index < length) { var data = transforms[index], size = data.size; switch (data.type) { case 'drop': start += size; break; case 'dropRight': end -= size; break; case 'take': end = nativeMin(end, start + size); break; case 'takeRight': start = nativeMax(start, end - size); break; } } return { 'start': start, 'end': end }; } /** * Extracts wrapper details from the `source` body comment. * * @private * @param {string} source The source to inspect. * @returns {Array} Returns the wrapper details. */ function getWrapDetails(source) { var match = source.match(reWrapDetails); return match ? match[1].split(reSplitDetails) : []; } /** * Checks if `path` exists on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @param {Function} hasFunc The function to check properties. * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { path = castPath(path, object); var index = -1, length = path.length, result = false; while (++index < length) { var key = toKey(path[index]); if (!(result = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result || ++index != length) { return result; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } /** * Initializes an array clone. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the initialized clone. */ function initCloneArray(array) { var length = array.length, result = new array.constructor(length); // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { result.index = array.index; result.input = array.input; } return result; } /** * Initializes an object clone. * * @private * @param {Object} object The object to clone. * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { return (typeof object.constructor == 'function' && !isPrototype(object)) ? baseCreate(getPrototype(object)) : {}; } /** * Initializes an object clone based on its `toStringTag`. * * **Note:** This function only supports cloning values with tags of * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. * * @private * @param {Object} object The object to clone. * @param {string} tag The `toStringTag` of the object to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the initialized clone. */ function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: return cloneArrayBuffer(object); case boolTag: case dateTag: return new Ctor(+object); case dataViewTag: return cloneDataView(object, isDeep); case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: return cloneTypedArray(object, isDeep); case mapTag: return new Ctor; case numberTag: case stringTag: return new Ctor(object); case regexpTag: return cloneRegExp(object); case setTag: return new Ctor; case symbolTag: return cloneSymbol(object); } } /** * Inserts wrapper `details` in a comment at the top of the `source` body. * * @private * @param {string} source The source to modify. * @returns {Array} details The details to insert. * @returns {string} Returns the modified source. */ function insertWrapDetails(source, details) { var length = details.length; if (!length) { return source; } var lastIndex = length - 1; details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; details = details.join(length > 2 ? ', ' : ' '); return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); } /** * Checks if `value` is a flattenable `arguments` object or array. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); } /** * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, * else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object) ) { return eq(object[index], value); } return false; } /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); } /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } /** * Checks if `func` has a lazy counterpart. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` has a lazy counterpart, * else `false`. */ function isLaziable(func) { var funcName = getFuncName(func), other = lodash[funcName]; if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { return false; } if (func === other) { return true; } var data = getData(other); return !!data && func === data[0]; } /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } /** * Checks if `func` is capable of being masked. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `func` is maskable, else `false`. */ var isMaskable = coreJsData ? isFunction : stubFalse; /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` if suitable for strict * equality comparisons, else `false`. */ function isStrictComparable(value) { return value === value && !isObject(value); } /** * A specialized version of `matchesProperty` for source values suitable * for strict equality comparisons, i.e. `===`. * * @private * @param {string} key The key of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { return function(object) { if (object == null) { return false; } return object[key] === srcValue && (srcValue !== undefined || (key in Object(object))); }; } /** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { var result = memoize(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; } /** * Merges the function metadata of `source` into `data`. * * Merging metadata reduces the number of wrappers used to invoke a function. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` * may be applied regardless of execution order. Methods like `_.ary` and * `_.rearg` modify function arguments, making the order in which they are * executed important, preventing the merging of metadata. However, we make * an exception for a safe combined case where curried functions have `_.ary` * and or `_.rearg` applied. * * @private * @param {Array} data The destination metadata. * @param {Array} source The source metadata. * @returns {Array} Returns `data`. */ function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); var isCombo = ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); // Exit early if metadata can't be merged. if (!(isCommon || isCombo)) { return data; } // Use source `thisArg` if available. if (srcBitmask & WRAP_BIND_FLAG) { data[2] = source[2]; // Set when currying a bound function. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; } // Compose partial arguments. var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? composeArgs(partials, value, source[4]) : value; data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; } // Compose partial right arguments. value = source[5]; if (value) { partials = data[5]; data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; } // Use source `argPos` if available. value = source[7]; if (value) { data[7] = value; } // Use source `ary` if it's smaller. if (srcBitmask & WRAP_ARY_FLAG) { data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); } // Use source `arity` if one is not provided. if (data[9] == null) { data[9] = source[9]; } // Use source `func` and merge bitmasks. data[0] = source[0]; data[1] = newBitmask; return data; } /** * This function is like * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * except that it includes inherited enumerable properties. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } /** * Gets the parent value at `path` of `object`. * * @private * @param {Object} object The object to query. * @param {Array} path The path to get the parent value of. * @returns {*} Returns the parent value. */ function parent(object, path) { return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); } /** * Reorder `array` according to the specified indexes where the element at * the first index is assigned as the first element, the element at * the second index is assigned as the second element, and so on. * * @private * @param {Array} array The array to reorder. * @param {Array} indexes The arranged array indexes. * @returns {Array} Returns `array`. */ function reorder(array, indexes) { var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array); while (length--) { var index = indexes[length]; array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; } return array; } /** * Sets metadata for `func`. * * **Note:** If this function becomes hot, i.e. is invoked a lot in a short * period of time, it will trip its breaker and transition to an identity * function to avoid garbage collection pauses in V8. See * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) * for more details. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var setData = shortOut(baseSetData); /** * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @returns {number|Object} Returns the timer id or timeout object. */ var setTimeout = ctxSetTimeout || function(func, wait) { return root.setTimeout(func, wait); }; /** * Sets the `toString` method of `func` to return `string`. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var setToString = shortOut(baseSetToString); /** * Sets the `toString` method of `wrapper` to mimic the source of `reference` * with wrapper details in a comment at the top of the source body. * * @private * @param {Function} wrapper The function to modify. * @param {Function} reference The reference function. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Function} Returns `wrapper`. */ function setWrapToString(wrapper, reference, bitmask) { var source = (reference + ''); return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); } /** * Creates a function that'll short out and invoke `identity` instead * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` * milliseconds. * * @private * @param {Function} func The function to restrict. * @returns {Function} Returns the new shortable function. */ function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined, arguments); }; } /** * A specialized version of `_.shuffle` which mutates and sets the size of `array`. * * @private * @param {Array} array The array to shuffle. * @param {number} [size=array.length] The size of `array`. * @returns {Array} Returns `array`. */ function shuffleSelf(array, size) { var index = -1, length = array.length, lastIndex = length - 1; size = size === undefined ? length : size; while (++index < size) { var rand = baseRandom(index, lastIndex), value = array[rand]; array[rand] = array[index]; array[index] = value; } array.length = size; return array; } /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoizeCapped(function(string) { var result = []; if (string.charCodeAt(0) === 46 /* . */) { result.push(''); } string.replace(rePropName, function(match, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } /** * Updates wrapper `details` based on `bitmask` flags. * * @private * @returns {Array} details The details to modify. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Array} Returns `details`. */ function updateWrapDetails(details, bitmask) { arrayEach(wrapFlags, function(pair) { var value = '_.' + pair[0]; if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { details.push(value); } }); return details.sort(); } /** * Creates a clone of `wrapper`. * * @private * @param {Object} wrapper The wrapper to clone. * @returns {Object} Returns the cloned wrapper. */ function wrapperClone(wrapper) { if (wrapper instanceof LazyWrapper) { return wrapper.clone(); } var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); result.__actions__ = copyArray(wrapper.__actions__); result.__index__ = wrapper.__index__; result.__values__ = wrapper.__values__; return result; } /*------------------------------------------------------------------------*/ /** * Creates an array of elements split into groups the length of `size`. * If `array` can't be split evenly, the final chunk will be the remaining * elements. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to process. * @param {number} [size=1] The length of each chunk * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the new array of chunks. * @example * * _.chunk(['a', 'b', 'c', 'd'], 2); * // => [['a', 'b'], ['c', 'd']] * * _.chunk(['a', 'b', 'c', 'd'], 3); * // => [['a', 'b', 'c'], ['d']] */ function chunk(array, size, guard) { if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { size = 1; } else { size = nativeMax(toInteger(size), 0); } var length = array == null ? 0 : array.length; if (!length || size < 1) { return []; } var index = 0, resIndex = 0, result = Array(nativeCeil(length / size)); while (index < length) { result[resIndex++] = baseSlice(array, index, (index += size)); } return result; } /** * Creates an array with all falsey values removed. The values `false`, `null`, * `0`, `""`, `undefined`, and `NaN` are falsey. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to compact. * @returns {Array} Returns the new array of filtered values. * @example * * _.compact([0, 1, false, 2, '', 3]); * // => [1, 2, 3] */ function compact(array) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value) { result[resIndex++] = value; } } return result; } /** * Creates a new array concatenating `array` with any additional arrays * and/or values. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to concatenate. * @param {...*} [values] The values to concatenate. * @returns {Array} Returns the new concatenated array. * @example * * var array = [1]; * var other = _.concat(array, 2, [3], [[4]]); * * console.log(other); * // => [1, 2, 3, [4]] * * console.log(array); * // => [1] */ function concat() { var length = arguments.length; if (!length) { return []; } var args = Array(length - 1), array = arguments[0], index = length; while (index--) { args[index - 1] = arguments[index]; } return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); } /** * Creates an array of `array` values not included in the other given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * **Note:** Unlike `_.pullAll`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.without, _.xor * @example * * _.difference([2, 1], [2, 3]); * // => [1] */ var difference = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; }); /** * This method is like `_.difference` except that it accepts `iteratee` which * is invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The order and references of result values are * determined by the first array. The iteratee is invoked with one argument: * (value). * * **Note:** Unlike `_.pullAllBy`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [1.2] * * // The `_.property` iteratee shorthand. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ var differenceBy = baseRest(function(array, values) { var iteratee = last(values); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) : []; }); /** * This method is like `_.difference` except that it accepts `comparator` * which is invoked to compare elements of `array` to `values`. The order and * references of result values are determined by the first array. The comparator * is invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.pullAllWith`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); * // => [{ 'x': 2, 'y': 1 }] */ var differenceWith = baseRest(function(array, values) { var comparator = last(values); if (isArrayLikeObject(comparator)) { comparator = undefined; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : []; }); /** * Creates a slice of `array` with `n` elements dropped from the beginning. * * @static * @memberOf _ * @since 0.5.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.drop([1, 2, 3]); * // => [2, 3] * * _.drop([1, 2, 3], 2); * // => [3] * * _.drop([1, 2, 3], 5); * // => [] * * _.drop([1, 2, 3], 0); * // => [1, 2, 3] */ function drop(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); return baseSlice(array, n < 0 ? 0 : n, length); } /** * Creates a slice of `array` with `n` elements dropped from the end. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.dropRight([1, 2, 3]); * // => [1, 2] * * _.dropRight([1, 2, 3], 2); * // => [1] * * _.dropRight([1, 2, 3], 5); * // => [] * * _.dropRight([1, 2, 3], 0); * // => [1, 2, 3] */ function dropRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); n = length - n; return baseSlice(array, 0, n < 0 ? 0 : n); } /** * Creates a slice of `array` excluding elements dropped from the end. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.dropRightWhile(users, function(o) { return !o.active; }); * // => objects for ['barney'] * * // The `_.matches` iteratee shorthand. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); * // => objects for ['barney', 'fred'] * * // The `_.matchesProperty` iteratee shorthand. * _.dropRightWhile(users, ['active', false]); * // => objects for ['barney'] * * // The `_.property` iteratee shorthand. * _.dropRightWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] */ function dropRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; } /** * Creates a slice of `array` excluding elements dropped from the beginning. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.dropWhile(users, function(o) { return !o.active; }); * // => objects for ['pebbles'] * * // The `_.matches` iteratee shorthand. * _.dropWhile(users, { 'user': 'barney', 'active': false }); * // => objects for ['fred', 'pebbles'] * * // The `_.matchesProperty` iteratee shorthand. * _.dropWhile(users, ['active', false]); * // => objects for ['pebbles'] * * // The `_.property` iteratee shorthand. * _.dropWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] */ function dropWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true) : []; } /** * Fills elements of `array` with `value` from `start` up to, but not * including, `end`. * * **Note:** This method mutates `array`. * * @static * @memberOf _ * @since 3.2.0 * @category Array * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns `array`. * @example * * var array = [1, 2, 3]; * * _.fill(array, 'a'); * console.log(array); * // => ['a', 'a', 'a'] * * _.fill(Array(3), 2); * // => [2, 2, 2] * * _.fill([4, 6, 8, 10], '*', 1, 3); * // => [4, '*', '*', 10] */ function fill(array, value, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { start = 0; end = length; } return baseFill(array, value, start, end); } /** * This method is like `_.find` except that it returns the index of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.findIndex(users, function(o) { return o.user == 'barney'; }); * // => 0 * * // The `_.matches` iteratee shorthand. * _.findIndex(users, { 'user': 'fred', 'active': false }); * // => 1 * * // The `_.matchesProperty` iteratee shorthand. * _.findIndex(users, ['active', false]); * // => 0 * * // The `_.property` iteratee shorthand. * _.findIndex(users, 'active'); * // => 2 */ function findIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseFindIndex(array, getIteratee(predicate, 3), index); } /** * This method is like `_.findIndex` except that it iterates over elements * of `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); * // => 2 * * // The `_.matches` iteratee shorthand. * _.findLastIndex(users, { 'user': 'barney', 'active': true }); * // => 0 * * // The `_.matchesProperty` iteratee shorthand. * _.findLastIndex(users, ['active', false]); * // => 2 * * // The `_.property` iteratee shorthand. * _.findLastIndex(users, 'active'); * // => 0 */ function findLastIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length - 1; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return baseFindIndex(array, getIteratee(predicate, 3), index, true); } /** * Flattens `array` a single level deep. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flatten([1, [2, [3, [4]], 5]]); * // => [1, 2, [3, [4]], 5] */ function flatten(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, 1) : []; } /** * Recursively flattens `array`. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flattenDeep([1, [2, [3, [4]], 5]]); * // => [1, 2, 3, 4, 5] */ function flattenDeep(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, INFINITY) : []; } /** * Recursively flatten `array` up to `depth` times. * * @static * @memberOf _ * @since 4.4.0 * @category Array * @param {Array} array The array to flatten. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. * @example * * var array = [1, [2, [3, [4]], 5]]; * * _.flattenDepth(array, 1); * // => [1, 2, [3, [4]], 5] * * _.flattenDepth(array, 2); * // => [1, 2, 3, [4], 5] */ function flattenDepth(array, depth) { var length = array == null ? 0 : array.length; if (!length) { return []; } depth = depth === undefined ? 1 : toInteger(depth); return baseFlatten(array, depth); } /** * The inverse of `_.toPairs`; this method returns an object composed * from key-value `pairs`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} pairs The key-value pairs. * @returns {Object} Returns the new object. * @example * * _.fromPairs([['a', 1], ['b', 2]]); * // => { 'a': 1, 'b': 2 } */ function fromPairs(pairs) { var index = -1, length = pairs == null ? 0 : pairs.length, result = {}; while (++index < length) { var pair = pairs[index]; result[pair[0]] = pair[1]; } return result; } /** * Gets the first element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @alias first * @category Array * @param {Array} array The array to query. * @returns {*} Returns the first element of `array`. * @example * * _.head([1, 2, 3]); * // => 1 * * _.head([]); * // => undefined */ function head(array) { return (array && array.length) ? array[0] : undefined; } /** * Gets the index at which the first occurrence of `value` is found in `array` * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. If `fromIndex` is negative, it's used as the * offset from the end of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.indexOf([1, 2, 1, 2], 2); * // => 1 * * // Search from the `fromIndex`. * _.indexOf([1, 2, 1, 2], 2, 2); * // => 3 */ function indexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseIndexOf(array, value, index); } /** * Gets all but the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. * @example * * _.initial([1, 2, 3]); * // => [1, 2] */ function initial(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 0, -1) : []; } /** * Creates an array of unique values that are included in all given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersection([2, 1], [2, 3]); * // => [2] */ var intersection = baseRest(function(arrays) { var mapped = arrayMap(arrays, castArrayLikeObject); return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped) : []; }); /** * This method is like `_.intersection` except that it accepts `iteratee` * which is invoked for each element of each `arrays` to generate the criterion * by which they're compared. The order and references of result values are * determined by the first array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [2.1] * * // The `_.property` iteratee shorthand. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }] */ var intersectionBy = baseRest(function(arrays) { var iteratee = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); if (iteratee === last(mapped)) { iteratee = undefined; } else { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, getIteratee(iteratee, 2)) : []; }); /** * This method is like `_.intersection` except that it accepts `comparator` * which is invoked to compare elements of `arrays`. The order and references * of result values are determined by the first array. The comparator is * invoked with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.intersectionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }] */ var intersectionWith = baseRest(function(arrays) { var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); comparator = typeof comparator == 'function' ? comparator : undefined; if (comparator) { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, undefined, comparator) : []; }); /** * Converts all elements in `array` into a string separated by `separator`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to convert. * @param {string} [separator=','] The element separator. * @returns {string} Returns the joined string. * @example * * _.join(['a', 'b', 'c'], '~'); * // => 'a~b~c' */ function join(array, separator) { return array == null ? '' : nativeJoin.call(array, separator); } /** * Gets the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {*} Returns the last element of `array`. * @example * * _.last([1, 2, 3]); * // => 3 */ function last(array) { var length = array == null ? 0 : array.length; return length ? array[length - 1] : undefined; } /** * This method is like `_.indexOf` except that it iterates over elements of * `array` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.lastIndexOf([1, 2, 1, 2], 2); * // => 3 * * // Search from the `fromIndex`. * _.lastIndexOf([1, 2, 1, 2], 2, 2); * // => 1 */ function lastIndexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true); } /** * Gets the element at index `n` of `array`. If `n` is negative, the nth * element from the end is returned. * * @static * @memberOf _ * @since 4.11.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=0] The index of the element to return. * @returns {*} Returns the nth element of `array`. * @example * * var array = ['a', 'b', 'c', 'd']; * * _.nth(array, 1); * // => 'b' * * _.nth(array, -2); * // => 'c'; */ function nth(array, n) { return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; } /** * Removes all given values from `array` using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` * to remove elements from an array by predicate. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {...*} [values] The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pull(array, 'a', 'c'); * console.log(array); * // => ['b', 'b'] */ var pull = baseRest(pullAll); /** * This method is like `_.pull` except that it accepts an array of values to remove. * * **Note:** Unlike `_.difference`, this method mutates `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pullAll(array, ['a', 'c']); * console.log(array); * // => ['b', 'b'] */ function pullAll(array, values) { return (array && array.length && values && values.length) ? basePullAll(array, values) : array; } /** * This method is like `_.pullAll` except that it accepts `iteratee` which is * invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The iteratee is invoked with one argument: (value). * * **Note:** Unlike `_.differenceBy`, this method mutates `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns `array`. * @example * * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; * * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); * console.log(array); * // => [{ 'x': 2 }] */ function pullAllBy(array, values, iteratee) { return (array && array.length && values && values.length) ? basePullAll(array, values, getIteratee(iteratee, 2)) : array; } /** * This method is like `_.pullAll` except that it accepts `comparator` which * is invoked to compare elements of `array` to `values`. The comparator is * invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.differenceWith`, this method mutates `array`. * * @static * @memberOf _ * @since 4.6.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. * @example * * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; * * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); * console.log(array); * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] */ function pullAllWith(array, values, comparator) { return (array && array.length && values && values.length) ? basePullAll(array, values, undefined, comparator) : array; } /** * Removes elements from `array` corresponding to `indexes` and returns an * array of removed elements. * * **Note:** Unlike `_.at`, this method mutates `array`. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to modify. * @param {...(number|number[])} [indexes] The indexes of elements to remove. * @returns {Array} Returns the new array of removed elements. * @example * * var array = ['a', 'b', 'c', 'd']; * var pulled = _.pullAt(array, [1, 3]); * * console.log(array); * // => ['a', 'c'] * * console.log(pulled); * // => ['b', 'd'] */ var pullAt = flatRest(function(array, indexes) { var length = array == null ? 0 : array.length, result = baseAt(array, indexes); basePullAt(array, arrayMap(indexes, function(index) { return isIndex(index, length) ? +index : index; }).sort(compareAscending)); return result; }); /** * Removes all elements from `array` that `predicate` returns truthy for * and returns an array of the removed elements. The predicate is invoked * with three arguments: (value, index, array). * * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` * to pull elements from an array by value. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new array of removed elements. * @example * * var array = [1, 2, 3, 4]; * var evens = _.remove(array, function(n) { * return n % 2 == 0; * }); * * console.log(array); * // => [1, 3] * * console.log(evens); * // => [2, 4] */ function remove(array, predicate) { var result = []; if (!(array && array.length)) { return result; } var index = -1, indexes = [], length = array.length; predicate = getIteratee(predicate, 3); while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result.push(value); indexes.push(index); } } basePullAt(array, indexes); return result; } /** * Reverses `array` so that the first element becomes the last, the second * element becomes the second to last, and so on. * * **Note:** This method mutates `array` and is based on * [`Array#reverse`](https://mdn.io/Array/reverse). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @returns {Array} Returns `array`. * @example * * var array = [1, 2, 3]; * * _.reverse(array); * // => [3, 2, 1] * * console.log(array); * // => [3, 2, 1] */ function reverse(array) { return array == null ? array : nativeReverse.call(array); } /** * Creates a slice of `array` from `start` up to, but not including, `end`. * * **Note:** This method is used instead of * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are * returned. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function slice(array, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { start = 0; end = length; } else { start = start == null ? 0 : toInteger(start); end = end === undefined ? length : toInteger(end); } return baseSlice(array, start, end); } /** * Uses a binary search to determine the lowest index at which `value` * should be inserted into `array` in order to maintain its sort order. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * _.sortedIndex([30, 50], 40); * // => 1 */ function sortedIndex(array, value) { return baseSortedIndex(array, value); } /** * This method is like `_.sortedIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * var objects = [{ 'x': 4 }, { 'x': 5 }]; * * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); * // => 0 * * // The `_.property` iteratee shorthand. * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); * // => 0 */ function sortedIndexBy(array, value, iteratee) { return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); } /** * This method is like `_.indexOf` except that it performs a binary * search on a sorted `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.sortedIndexOf([4, 5, 5, 5, 6], 5); * // => 1 */ function sortedIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value); if (index < length && eq(array[index], value)) { return index; } } return -1; } /** * This method is like `_.sortedIndex` except that it returns the highest * index at which `value` should be inserted into `array` in order to * maintain its sort order. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * _.sortedLastIndex([4, 5, 5, 5, 6], 5); * // => 4 */ function sortedLastIndex(array, value) { return baseSortedIndex(array, value, true); } /** * This method is like `_.sortedLastIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * var objects = [{ 'x': 4 }, { 'x': 5 }]; * * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); * // => 1 * * // The `_.property` iteratee shorthand. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); * // => 1 */ function sortedLastIndexBy(array, value, iteratee) { return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); } /** * This method is like `_.lastIndexOf` except that it performs a binary * search on a sorted `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); * // => 3 */ function sortedLastIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value, true) - 1; if (eq(array[index], value)) { return index; } } return -1; } /** * This method is like `_.uniq` except that it's designed and optimized * for sorted arrays. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.sortedUniq([1, 1, 2]); * // => [1, 2] */ function sortedUniq(array) { return (array && array.length) ? baseSortedUniq(array) : []; } /** * This method is like `_.uniqBy` except that it's designed and optimized * for sorted arrays. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); * // => [1.1, 2.3] */ function sortedUniqBy(array, iteratee) { return (array && array.length) ? baseSortedUniq(array, getIteratee(iteratee, 2)) : []; } /** * Gets all but the first element of `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. * @example * * _.tail([1, 2, 3]); * // => [2, 3] */ function tail(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 1, length) : []; } /** * Creates a slice of `array` with `n` elements taken from the beginning. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.take([1, 2, 3]); * // => [1] * * _.take([1, 2, 3], 2); * // => [1, 2] * * _.take([1, 2, 3], 5); * // => [1, 2, 3] * * _.take([1, 2, 3], 0); * // => [] */ function take(array, n, guard) { if (!(array && array.length)) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); return baseSlice(array, 0, n < 0 ? 0 : n); } /** * Creates a slice of `array` with `n` elements taken from the end. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.takeRight([1, 2, 3]); * // => [3] * * _.takeRight([1, 2, 3], 2); * // => [2, 3] * * _.takeRight([1, 2, 3], 5); * // => [1, 2, 3] * * _.takeRight([1, 2, 3], 0); * // => [] */ function takeRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); n = length - n; return baseSlice(array, n < 0 ? 0 : n, length); } /** * Creates a slice of `array` with elements taken from the end. Elements are * taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.takeRightWhile(users, function(o) { return !o.active; }); * // => objects for ['fred', 'pebbles'] * * // The `_.matches` iteratee shorthand. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); * // => objects for ['pebbles'] * * // The `_.matchesProperty` iteratee shorthand. * _.takeRightWhile(users, ['active', false]); * // => objects for ['fred', 'pebbles'] * * // The `_.property` iteratee shorthand. * _.takeRightWhile(users, 'active'); * // => [] */ function takeRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), false, true) : []; } /** * Creates a slice of `array` with elements taken from the beginning. Elements * are taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.takeWhile(users, function(o) { return !o.active; }); * // => objects for ['barney', 'fred'] * * // The `_.matches` iteratee shorthand. * _.takeWhile(users, { 'user': 'barney', 'active': false }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.takeWhile(users, ['active', false]); * // => objects for ['barney', 'fred'] * * // The `_.property` iteratee shorthand. * _.takeWhile(users, 'active'); * // => [] */ function takeWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3)) : []; } /** * Creates an array of unique values, in order, from all given arrays using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of combined values. * @example * * _.union([2], [1, 2]); * // => [2, 1] */ var union = baseRest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); /** * This method is like `_.union` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which uniqueness is computed. Result values are chosen from the first * array in which the value occurs. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of combined values. * @example * * _.unionBy([2.1], [1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ var unionBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); }); /** * This method is like `_.union` except that it accepts `comparator` which * is invoked to compare elements of `arrays`. Result values are chosen from * the first array in which the value occurs. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of combined values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.unionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ var unionWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == 'function' ? comparator : undefined; return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); }); /** * Creates a duplicate-free version of an array, using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons, in which only the first occurrence of each element * is kept. The order of result values is determined by the order they occur * in the array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniq([2, 1, 2]); * // => [2, 1] */ function uniq(array) { return (array && array.length) ? baseUniq(array) : []; } /** * This method is like `_.uniq` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * uniqueness is computed. The order of result values is determined by the * order they occur in the array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniqBy([2.1, 1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ function uniqBy(array, iteratee) { return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; } /** * This method is like `_.uniq` except that it accepts `comparator` which * is invoked to compare elements of `array`. The order of result values is * determined by the order they occur in the array.The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.uniqWith(objects, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] */ function uniqWith(array, comparator) { comparator = typeof comparator == 'function' ? comparator : undefined; return (array && array.length) ? baseUniq(array, undefined, comparator) : []; } /** * This method is like `_.zip` except that it accepts an array of grouped * elements and creates an array regrouping the elements to their pre-zip * configuration. * * @static * @memberOf _ * @since 1.2.0 * @category Array * @param {Array} array The array of grouped elements to process. * @returns {Array} Returns the new array of regrouped elements. * @example * * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] * * _.unzip(zipped); * // => [['a', 'b'], [1, 2], [true, false]] */ function unzip(array) { if (!(array && array.length)) { return []; } var length = 0; array = arrayFilter(array, function(group) { if (isArrayLikeObject(group)) { length = nativeMax(group.length, length); return true; } }); return baseTimes(length, function(index) { return arrayMap(array, baseProperty(index)); }); } /** * This method is like `_.unzip` except that it accepts `iteratee` to specify * how regrouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). * * @static * @memberOf _ * @since 3.8.0 * @category Array * @param {Array} array The array of grouped elements to process. * @param {Function} [iteratee=_.identity] The function to combine * regrouped values. * @returns {Array} Returns the new array of regrouped elements. * @example * * var zipped = _.zip([1, 2], [10, 20], [100, 200]); * // => [[1, 10, 100], [2, 20, 200]] * * _.unzipWith(zipped, _.add); * // => [3, 30, 300] */ function unzipWith(array, iteratee) { if (!(array && array.length)) { return []; } var result = unzip(array); if (iteratee == null) { return result; } return arrayMap(result, function(group) { return apply(iteratee, undefined, group); }); } /** * Creates an array excluding all given values using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.pull`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...*} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.xor * @example * * _.without([2, 1, 2, 3], 1, 2); * // => [3] */ var without = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, values) : []; }); /** * Creates an array of unique values that is the * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) * of the given arrays. The order of result values is determined by the order * they occur in the arrays. * * @static * @memberOf _ * @since 2.4.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.without * @example * * _.xor([2, 1], [2, 3]); * // => [1, 3] */ var xor = baseRest(function(arrays) { return baseXor(arrayFilter(arrays, isArrayLikeObject)); }); /** * This method is like `_.xor` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which by which they're compared. The order of result values is determined * by the order they occur in the arrays. The iteratee is invoked with one * argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [1.2, 3.4] * * // The `_.property` iteratee shorthand. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ var xorBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); }); /** * This method is like `_.xor` except that it accepts `comparator` which is * invoked to compare elements of `arrays`. The order of result values is * determined by the order they occur in the arrays. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.xorWith(objects, others, _.isEqual); * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ var xorWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == 'function' ? comparator : undefined; return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); }); /** * Creates an array of grouped elements, the first of which contains the * first elements of the given arrays, the second of which contains the * second elements of the given arrays, and so on. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @returns {Array} Returns the new array of grouped elements. * @example * * _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] */ var zip = baseRest(unzip); /** * This method is like `_.fromPairs` except that it accepts two arrays, * one of property identifiers and one of corresponding values. * * @static * @memberOf _ * @since 0.4.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example * * _.zipObject(['a', 'b'], [1, 2]); * // => { 'a': 1, 'b': 2 } */ function zipObject(props, values) { return baseZipObject(props || [], values || [], assignValue); } /** * This method is like `_.zipObject` except that it supports property paths. * * @static * @memberOf _ * @since 4.1.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example * * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } */ function zipObjectDeep(props, values) { return baseZipObject(props || [], values || [], baseSet); } /** * This method is like `_.zip` except that it accepts `iteratee` to specify * how grouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). * * @static * @memberOf _ * @since 3.8.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @param {Function} [iteratee=_.identity] The function to combine * grouped values. * @returns {Array} Returns the new array of grouped elements. * @example * * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { * return a + b + c; * }); * // => [111, 222] */ var zipWith = baseRest(function(arrays) { var length = arrays.length, iteratee = length > 1 ? arrays[length - 1] : undefined; iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; return unzipWith(arrays, iteratee); }); /*------------------------------------------------------------------------*/ /** * Creates a `lodash` wrapper instance that wraps `value` with explicit method * chain sequences enabled. The result of such sequences must be unwrapped * with `_#value`. * * @static * @memberOf _ * @since 1.3.0 * @category Seq * @param {*} value The value to wrap. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var users = [ * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'pebbles', 'age': 1 } * ]; * * var youngest = _ * .chain(users) * .sortBy('age') * .map(function(o) { * return o.user + ' is ' + o.age; * }) * .head() * .value(); * // => 'pebbles is 1' */ function chain(value) { var result = lodash(value); result.__chain__ = true; return result; } /** * This method invokes `interceptor` and returns `value`. The interceptor * is invoked with one argument; (value). The purpose of this method is to * "tap into" a method chain sequence in order to modify intermediate results. * * @static * @memberOf _ * @since 0.1.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. * @returns {*} Returns `value`. * @example * * _([1, 2, 3]) * .tap(function(array) { * // Mutate input array. * array.pop(); * }) * .reverse() * .value(); * // => [2, 1] */ function tap(value, interceptor) { interceptor(value); return value; } /** * This method is like `_.tap` except that it returns the result of `interceptor`. * The purpose of this method is to "pass thru" values replacing intermediate * results in a method chain sequence. * * @static * @memberOf _ * @since 3.0.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. * @returns {*} Returns the result of `interceptor`. * @example * * _(' abc ') * .chain() * .trim() * .thru(function(value) { * return [value]; * }) * .value(); * // => ['abc'] */ function thru(value, interceptor) { return interceptor(value); } /** * This method is the wrapper version of `_.at`. * * @name at * @memberOf _ * @since 1.0.0 * @category Seq * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; * * _(object).at(['a[0].b.c', 'a[1]']).value(); * // => [3, 4] */ var wrapperAt = flatRest(function(paths) { var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) { return baseAt(object, paths); }; if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) { return this.thru(interceptor); } value = value.slice(start, +start + (length ? 1 : 0)); value.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); return new LodashWrapper(value, this.__chain__).thru(function(array) { if (length && !array.length) { array.push(undefined); } return array; }); }); /** * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. * * @name chain * @memberOf _ * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var users = [ * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 } * ]; * * // A sequence without explicit chaining. * _(users).head(); * // => { 'user': 'barney', 'age': 36 } * * // A sequence with explicit chaining. * _(users) * .chain() * .head() * .pick('user') * .value(); * // => { 'user': 'barney' } */ function wrapperChain() { return chain(this); } /** * Executes the chain sequence and returns the wrapped result. * * @name commit * @memberOf _ * @since 3.2.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2]; * var wrapped = _(array).push(3); * * console.log(array); * // => [1, 2] * * wrapped = wrapped.commit(); * console.log(array); * // => [1, 2, 3] * * wrapped.last(); * // => 3 * * console.log(array); * // => [1, 2, 3] */ function wrapperCommit() { return new LodashWrapper(this.value(), this.__chain__); } /** * Gets the next value on a wrapped object following the * [iterator protocol](https://mdn.io/iteration_protocols#iterator). * * @name next * @memberOf _ * @since 4.0.0 * @category Seq * @returns {Object} Returns the next iterator value. * @example * * var wrapped = _([1, 2]); * * wrapped.next(); * // => { 'done': false, 'value': 1 } * * wrapped.next(); * // => { 'done': false, 'value': 2 } * * wrapped.next(); * // => { 'done': true, 'value': undefined } */ function wrapperNext() { if (this.__values__ === undefined) { this.__values__ = toArray(this.value()); } var done = this.__index__ >= this.__values__.length, value = done ? undefined : this.__values__[this.__index__++]; return { 'done': done, 'value': value }; } /** * Enables the wrapper to be iterable. * * @name Symbol.iterator * @memberOf _ * @since 4.0.0 * @category Seq * @returns {Object} Returns the wrapper object. * @example * * var wrapped = _([1, 2]); * * wrapped[Symbol.iterator]() === wrapped; * // => true * * Array.from(wrapped); * // => [1, 2] */ function wrapperToIterator() { return this; } /** * Creates a clone of the chain sequence planting `value` as the wrapped value. * * @name plant * @memberOf _ * @since 3.2.0 * @category Seq * @param {*} value The value to plant. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2]).map(square); * var other = wrapped.plant([3, 4]); * * other.value(); * // => [9, 16] * * wrapped.value(); * // => [1, 4] */ function wrapperPlant(value) { var result, parent = this; while (parent instanceof baseLodash) { var clone = wrapperClone(parent); clone.__index__ = 0; clone.__values__ = undefined; if (result) { previous.__wrapped__ = clone; } else { result = clone; } var previous = clone; parent = parent.__wrapped__; } previous.__wrapped__ = value; return result; } /** * This method is the wrapper version of `_.reverse`. * * **Note:** This method mutates the wrapped array. * * @name reverse * @memberOf _ * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2, 3]; * * _(array).reverse().value() * // => [3, 2, 1] * * console.log(array); * // => [3, 2, 1] */ function wrapperReverse() { var value = this.__wrapped__; if (value instanceof LazyWrapper) { var wrapped = value; if (this.__actions__.length) { wrapped = new LazyWrapper(this); } wrapped = wrapped.reverse(); wrapped.__actions__.push({ 'func': thru, 'args': [reverse], 'thisArg': undefined }); return new LodashWrapper(wrapped, this.__chain__); } return this.thru(reverse); } /** * Executes the chain sequence to resolve the unwrapped value. * * @name value * @memberOf _ * @since 0.1.0 * @alias toJSON, valueOf * @category Seq * @returns {*} Returns the resolved unwrapped value. * @example * * _([1, 2, 3]).value(); * // => [1, 2, 3] */ function wrapperValue() { return baseWrapperValue(this.__wrapped__, this.__actions__); } /*------------------------------------------------------------------------*/ /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the number of times the key was returned by `iteratee`. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.5.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.countBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': 1, '6': 2 } * * // The `_.property` iteratee shorthand. * _.countBy(['one', 'two', 'three'], 'length'); * // => { '3': 2, '5': 1 } */ var countBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { ++result[key]; } else { baseAssignValue(result, key, 1); } }); /** * Checks if `predicate` returns truthy for **all** elements of `collection`. * Iteration is stopped once `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index|key, collection). * * **Note:** This method returns `true` for * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of * elements of empty collections. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. * @example * * _.every([true, 1, null, 'yes'], Boolean); * // => false * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.every(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.every(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.every(users, 'active'); * // => false */ function every(collection, predicate, guard) { var func = isArray(collection) ? arrayEvery : baseEvery; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, getIteratee(predicate, 3)); } /** * Iterates over elements of `collection`, returning an array of all elements * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * **Note:** Unlike `_.remove`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.reject * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * _.filter(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.filter(users, { 'age': 36, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.filter(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.filter(users, 'active'); * // => objects for ['barney'] */ function filter(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, getIteratee(predicate, 3)); } /** * Iterates over elements of `collection`, returning the first element * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false }, * { 'user': 'pebbles', 'age': 1, 'active': true } * ]; * * _.find(users, function(o) { return o.age < 40; }); * // => object for 'barney' * * // The `_.matches` iteratee shorthand. * _.find(users, { 'age': 1, 'active': true }); * // => object for 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.find(users, ['active', false]); * // => object for 'fred' * * // The `_.property` iteratee shorthand. * _.find(users, 'active'); * // => object for 'barney' */ var find = createFind(findIndex); /** * This method is like `_.find` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=collection.length-1] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * _.findLast([1, 2, 3, 4], function(n) { * return n % 2 == 1; * }); * // => 3 */ var findLast = createFind(findLastIndex); /** * Creates a flattened array of values by running each element in `collection` * thru `iteratee` and flattening the mapped results. The iteratee is invoked * with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [n, n]; * } * * _.flatMap([1, 2], duplicate); * // => [1, 1, 2, 2] */ function flatMap(collection, iteratee) { return baseFlatten(map(collection, iteratee), 1); } /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results. * * @static * @memberOf _ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDeep([1, 2], duplicate); * // => [1, 1, 2, 2] */ function flatMapDeep(collection, iteratee) { return baseFlatten(map(collection, iteratee), INFINITY); } /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results up to `depth` times. * * @static * @memberOf _ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDepth([1, 2], duplicate, 2); * // => [[1, 1], [2, 2]] */ function flatMapDepth(collection, iteratee, depth) { depth = depth === undefined ? 1 : toInteger(depth); return baseFlatten(map(collection, iteratee), depth); } /** * Iterates over elements of `collection` and invokes `iteratee` for each element. * The iteratee is invoked with three arguments: (value, index|key, collection). * Iteratee functions may exit iteration early by explicitly returning `false`. * * **Note:** As with other "Collections" methods, objects with a "length" * property are iterated like arrays. To avoid this behavior use `_.forIn` * or `_.forOwn` for object iteration. * * @static * @memberOf _ * @since 0.1.0 * @alias each * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEachRight * @example * * _.forEach([1, 2], function(value) { * console.log(value); * }); * // => Logs `1` then `2`. * * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { var func = isArray(collection) ? arrayEach : baseEach; return func(collection, getIteratee(iteratee, 3)); } /** * This method is like `_.forEach` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @alias eachRight * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEach * @example * * _.forEachRight([1, 2], function(value) { * console.log(value); * }); * // => Logs `2` then `1`. */ function forEachRight(collection, iteratee) { var func = isArray(collection) ? arrayEachRight : baseEachRight; return func(collection, getIteratee(iteratee, 3)); } /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The order of grouped values * is determined by the order they occur in `collection`. The corresponding * value of each key is an array of elements responsible for generating the * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.groupBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': [4.2], '6': [6.1, 6.3] } * * // The `_.property` iteratee shorthand. * _.groupBy(['one', 'two', 'three'], 'length'); * // => { '3': ['one', 'two'], '5': ['three'] } */ var groupBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { result[key].push(value); } else { baseAssignValue(result, key, [value]); } }); /** * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * * _.includes([1, 2, 3], 1); * // => true * * _.includes([1, 2, 3], 1, 2); * // => false * * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * * _.includes('abcd', 'bc'); * // => true */ function includes(collection, value, fromIndex, guard) { collection = isArrayLike(collection) ? collection : values(collection); fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax(length + fromIndex, 0); } return isString(collection) ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) : (!!length && baseIndexOf(collection, value, fromIndex) > -1); } /** * Invokes the method at `path` of each element in `collection`, returning * an array of the results of each invoked method. Any additional arguments * are provided to each invoked method. If `path` is a function, it's invoked * for, and `this` bound to, each element in `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array|Function|string} path The path of the method to invoke or * the function invoked per iteration. * @param {...*} [args] The arguments to invoke each method with. * @returns {Array} Returns the array of results. * @example * * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); * // => [[1, 5, 7], [1, 2, 3]] * * _.invokeMap([123, 456], String.prototype.split, ''); * // => [['1', '2', '3'], ['4', '5', '6']] */ var invokeMap = baseRest(function(collection, path, args) { var index = -1, isFunc = typeof path == 'function', result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value) { result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); }); return result; }); /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the last element responsible for generating the key. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * var array = [ * { 'dir': 'left', 'code': 97 }, * { 'dir': 'right', 'code': 100 } * ]; * * _.keyBy(array, function(o) { * return String.fromCharCode(o.code); * }); * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } * * _.keyBy(array, 'dir'); * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ var keyBy = createAggregator(function(result, value, key) { baseAssignValue(result, key, value); }); /** * Creates an array of values by running each element in `collection` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. * * The guarded methods are: * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, * `template`, `trim`, `trimEnd`, `trimStart`, and `words` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * * function square(n) { * return n * n; * } * * _.map([4, 8], square); * // => [16, 64] * * _.map({ 'a': 4, 'b': 8 }, square); * // => [16, 64] (iteration order is not guaranteed) * * var users = [ * { 'user': 'barney' }, * { 'user': 'fred' } * ]; * * // The `_.property` iteratee shorthand. * _.map(users, 'user'); * // => ['barney', 'fred'] */ function map(collection, iteratee) { var func = isArray(collection) ? arrayMap : baseMap; return func(collection, getIteratee(iteratee, 3)); } /** * This method is like `_.sortBy` except that it allows specifying the sort * orders of the iteratees to sort by. If `orders` is unspecified, all values * are sorted in ascending order. Otherwise, specify an order of "desc" for * descending or "asc" for ascending sort order of corresponding values. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] * The iteratees to sort by. * @param {string[]} [orders] The sort orders of `iteratees`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 34 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 36 } * ]; * * // Sort by `user` in ascending order and by `age` in descending order. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ function orderBy(collection, iteratees, orders, guard) { if (collection == null) { return []; } if (!isArray(iteratees)) { iteratees = iteratees == null ? [] : [iteratees]; } orders = guard ? undefined : orders; if (!isArray(orders)) { orders = orders == null ? [] : [orders]; } return baseOrderBy(collection, iteratees, orders); } /** * Creates an array of elements split into two groups, the first of which * contains elements `predicate` returns truthy for, the second of which * contains elements `predicate` returns falsey for. The predicate is * invoked with one argument: (value). * * @static * @memberOf _ * @since 3.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the array of grouped elements. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true }, * { 'user': 'pebbles', 'age': 1, 'active': false } * ]; * * _.partition(users, function(o) { return o.active; }); * // => objects for [['fred'], ['barney', 'pebbles']] * * // The `_.matches` iteratee shorthand. * _.partition(users, { 'age': 1, 'active': false }); * // => objects for [['pebbles'], ['barney', 'fred']] * * // The `_.matchesProperty` iteratee shorthand. * _.partition(users, ['active', false]); * // => objects for [['barney', 'pebbles'], ['fred']] * * // The `_.property` iteratee shorthand. * _.partition(users, 'active'); * // => objects for [['fred'], ['barney', 'pebbles']] */ var partition = createAggregator(function(result, value, key) { result[key ? 0 : 1].push(value); }, function() { return [[], []]; }); /** * Reduces `collection` to a value which is the accumulated result of running * each element in `collection` thru `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` * is not given, the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.reduce`, `_.reduceRight`, and `_.transform`. * * The guarded methods are: * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, * and `sortBy` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduceRight * @example * * _.reduce([1, 2], function(sum, n) { * return sum + n; * }, 0); * // => 3 * * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * return result; * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) */ function reduce(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); } /** * This method is like `_.reduce` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduce * @example * * var array = [[0, 1], [2, 3], [4, 5]]; * * _.reduceRight(array, function(flattened, other) { * return flattened.concat(other); * }, []); * // => [4, 5, 2, 3, 0, 1] */ function reduceRight(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); } /** * The opposite of `_.filter`; this method returns the elements of `collection` * that `predicate` does **not** return truthy for. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.filter * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true } * ]; * * _.reject(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.reject(users, { 'age': 40, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.reject(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.reject(users, 'active'); * // => objects for ['barney'] */ function reject(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, negate(getIteratee(predicate, 3))); } /** * Gets a random element from `collection`. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. * @example * * _.sample([1, 2, 3, 4]); * // => 2 */ function sample(collection) { var func = isArray(collection) ? arraySample : baseSample; return func(collection); } /** * Gets `n` random elements at unique keys from `collection` up to the * size of `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @param {number} [n=1] The number of elements to sample. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the random elements. * @example * * _.sampleSize([1, 2, 3], 2); * // => [3, 1] * * _.sampleSize([1, 2, 3], 4); * // => [2, 3, 1] */ function sampleSize(collection, n, guard) { if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { n = 1; } else { n = toInteger(n); } var func = isArray(collection) ? arraySampleSize : baseSampleSize; return func(collection, n); } /** * Creates an array of shuffled values, using a version of the * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. * @example * * _.shuffle([1, 2, 3, 4]); * // => [4, 1, 3, 2] */ function shuffle(collection) { var func = isArray(collection) ? arrayShuffle : baseShuffle; return func(collection); } /** * Gets the size of `collection` by returning its length for array-like * values or the number of own enumerable string keyed properties for objects. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @returns {number} Returns the collection size. * @example * * _.size([1, 2, 3]); * // => 3 * * _.size({ 'a': 1, 'b': 2 }); * // => 2 * * _.size('pebbles'); * // => 7 */ function size(collection) { if (collection == null) { return 0; } if (isArrayLike(collection)) { return isString(collection) ? stringSize(collection) : collection.length; } var tag = getTag(collection); if (tag == mapTag || tag == setTag) { return collection.size; } return baseKeys(collection).length; } /** * Checks if `predicate` returns truthy for **any** element of `collection`. * Iteration is stopped once `predicate` returns truthy. The predicate is * invoked with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. * @example * * _.some([null, 0, 'yes', false], Boolean); * // => true * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.some(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.some(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.some(users, 'active'); * // => true */ function some(collection, predicate, guard) { var func = isArray(collection) ? arraySome : baseSome; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, getIteratee(predicate, 3)); } /** * Creates an array of elements, sorted in ascending order by the results of * running each element in a collection thru each iteratee. This method * performs a stable sort, that is, it preserves the original sort order of * equal elements. The iteratees are invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {...(Function|Function[])} [iteratees=[_.identity]] * The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, [function(o) { return o.user; }]); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] * * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] */ var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { return []; } var length = iteratees.length; if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { iteratees = []; } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); /*------------------------------------------------------------------------*/ /** * Gets the timestamp of the number of milliseconds that have elapsed since * the Unix epoch (1 January 1970 00:00:00 UTC). * * @static * @memberOf _ * @since 2.4.0 * @category Date * @returns {number} Returns the timestamp. * @example * * _.defer(function(stamp) { * console.log(_.now() - stamp); * }, _.now()); * // => Logs the number of milliseconds it took for the deferred invocation. */ var now = ctxNow || function() { return root.Date.now(); }; /*------------------------------------------------------------------------*/ /** * The opposite of `_.before`; this method creates a function that invokes * `func` once it's called `n` or more times. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {number} n The number of calls before `func` is invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var saves = ['profile', 'settings']; * * var done = _.after(saves.length, function() { * console.log('done saving!'); * }); * * _.forEach(saves, function(type) { * asyncSave({ 'type': type, 'complete': done }); * }); * // => Logs 'done saving!' after the two async saves have completed. */ function after(n, func) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n < 1) { return func.apply(this, arguments); } }; } /** * Creates a function that invokes `func`, with up to `n` arguments, * ignoring any additional arguments. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @param {number} [n=func.length] The arity cap. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.ary(parseInt, 1)); * // => [6, 8, 10] */ function ary(func, n, guard) { n = guard ? undefined : n; n = (func && n == null) ? func.length : n; return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); } /** * Creates a function that invokes `func`, with the `this` binding and arguments * of the created function, while it's called less than `n` times. Subsequent * calls to the created function return the result of the last `func` invocation. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {number} n The number of calls at which `func` is no longer invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * jQuery(element).on('click', _.before(5, addContactToList)); * // => Allows adding up to 4 contacts to the list. */ function before(n, func) { var result; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n > 0) { result = func.apply(this, arguments); } if (n <= 1) { func = undefined; } return result; }; } /** * Creates a function that invokes `func` with the `this` binding of `thisArg` * and `partials` prepended to the arguments it receives. * * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. * * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" * property of bound functions. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * function greet(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * * var object = { 'user': 'fred' }; * * var bound = _.bind(greet, object, 'hi'); * bound('!'); * // => 'hi fred!' * * // Bound with placeholders. * var bound = _.bind(greet, object, _, '!'); * bound('hi'); * // => 'hi fred!' */ var bind = baseRest(function(func, thisArg, partials) { var bitmask = WRAP_BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bind)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(func, bitmask, thisArg, partials, holders); }); /** * Creates a function that invokes the method at `object[key]` with `partials` * prepended to the arguments it receives. * * This method differs from `_.bind` by allowing bound functions to reference * methods that may be redefined or don't yet exist. See * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) * for more details. * * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * @static * @memberOf _ * @since 0.10.0 * @category Function * @param {Object} object The object to invoke the method on. * @param {string} key The key of the method. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * var object = { * 'user': 'fred', * 'greet': function(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * }; * * var bound = _.bindKey(object, 'greet', 'hi'); * bound('!'); * // => 'hi fred!' * * object.greet = function(greeting, punctuation) { * return greeting + 'ya ' + this.user + punctuation; * }; * * bound('!'); * // => 'hiya fred!' * * // Bound with placeholders. * var bound = _.bindKey(object, 'greet', _, '!'); * bound('hi'); * // => 'hiya fred!' */ var bindKey = baseRest(function(object, key, partials) { var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bindKey)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(key, bitmask, object, partials, holders); }); /** * Creates a function that accepts arguments of `func` and either invokes * `func` returning its result, if at least `arity` number of arguments have * been provided, or returns a function that accepts the remaining `func` * arguments, and so on. The arity of `func` may be specified if `func.length` * is not sufficient. * * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for provided arguments. * * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @since 2.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * * var abc = function(a, b, c) { * return [a, b, c]; * }; * * var curried = _.curry(abc); * * curried(1)(2)(3); * // => [1, 2, 3] * * curried(1, 2)(3); * // => [1, 2, 3] * * curried(1, 2, 3); * // => [1, 2, 3] * * // Curried with placeholders. * curried(1)(_, 3)(2); * // => [1, 2, 3] */ function curry(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curry.placeholder; return result; } /** * This method is like `_.curry` except that arguments are applied to `func` * in the manner of `_.partialRight` instead of `_.partial`. * * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for provided arguments. * * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * * var abc = function(a, b, c) { * return [a, b, c]; * }; * * var curried = _.curryRight(abc); * * curried(3)(2)(1); * // => [1, 2, 3] * * curried(2, 3)(1); * // => [1, 2, 3] * * curried(1, 2, 3); * // => [1, 2, 3] * * // Curried with placeholders. * curried(3)(1, _)(2); * // => [1, 2, 3] */ function curryRight(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curryRight.placeholder; return result; } /** * Creates a debounced function that delays invoking `func` until after `wait` * milliseconds have elapsed since the last time the debounced function was * invoked. The debounced function comes with a `cancel` method to cancel * delayed `func` invocations and a `flush` method to immediately invoke them. * Provide `options` to indicate whether `func` should be invoked on the * leading and/or trailing edge of the `wait` timeout. The `func` is invoked * with the last arguments provided to the debounced function. Subsequent * calls to the debounced function return the result of the last `func` * invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the debounced function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.debounce` and `_.throttle`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to debounce. * @param {number} [wait=0] The number of milliseconds to delay. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=false] * Specify invoking on the leading edge of the timeout. * @param {number} [options.maxWait] * The maximum time `func` is allowed to be delayed before it's invoked. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new debounced function. * @example * * // Avoid costly calculations while the window size is in flux. * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); * * // Invoke `sendMail` when clicked, debouncing subsequent calls. * jQuery(element).on('click', _.debounce(sendMail, 300, { * 'leading': true, * 'trailing': false * })); * * // Ensure `batchLog` is invoked once after 1 second of debounced calls. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); * var source = new EventSource('/stream'); * jQuery(source).on('message', debounced); * * // Cancel the trailing debounced invocation. * jQuery(window).on('popstate', debounced.cancel); */ function debounce(func, wait, options) { var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } wait = toNumber(wait) || 0; if (isObject(options)) { leading = !!options.leading; maxing = 'maxWait' in options; maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; trailing = 'trailing' in options ? !!options.trailing : trailing; } function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; lastArgs = lastThis = undefined; lastInvokeTime = time; result = func.apply(thisArg, args); return result; } function leadingEdge(time) { // Reset any `maxWait` timer. lastInvokeTime = time; // Start the timer for the trailing edge. timerId = setTimeout(timerExpired, wait); // Invoke the leading edge. return leading ? invokeFunc(time) : result; } function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; } function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the // trailing edge, the system time has gone backwards and we're treating // it as the trailing edge, or we've hit the `maxWait` limit. return (lastCallTime === undefined || (timeSinceLastCall >= wait) || (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); } function timerExpired() { var time = now(); if (shouldInvoke(time)) { return trailingEdge(time); } // Restart the timer. timerId = setTimeout(timerExpired, remainingWait(time)); } function trailingEdge(time) { timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been // debounced at least once. if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = undefined; return result; } function cancel() { if (timerId !== undefined) { clearTimeout(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined; } function flush() { return timerId === undefined ? result : trailingEdge(now()); } function debounced() { var time = now(), isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === undefined) { return leadingEdge(lastCallTime); } if (maxing) { // Handle invocations in a tight loop. timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === undefined) { timerId = setTimeout(timerExpired, wait); } return result; } debounced.cancel = cancel; debounced.flush = flush; return debounced; } /** * Defers invoking the `func` until the current call stack has cleared. Any * additional arguments are provided to `func` when it's invoked. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to defer. * @param {...*} [args] The arguments to invoke `func` with. * @returns {number} Returns the timer id. * @example * * _.defer(function(text) { * console.log(text); * }, 'deferred'); * // => Logs 'deferred' after one millisecond. */ var defer = baseRest(function(func, args) { return baseDelay(func, 1, args); }); /** * Invokes `func` after `wait` milliseconds. Any additional arguments are * provided to `func` when it's invoked. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @param {...*} [args] The arguments to invoke `func` with. * @returns {number} Returns the timer id. * @example * * _.delay(function(text) { * console.log(text); * }, 1000, 'later'); * // => Logs 'later' after one second. */ var delay = baseRest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); }); /** * Creates a function that invokes `func` with arguments reversed. * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to flip arguments for. * @returns {Function} Returns the new flipped function. * @example * * var flipped = _.flip(function() { * return _.toArray(arguments); * }); * * flipped('a', 'b', 'c', 'd'); * // => ['d', 'c', 'b', 'a'] */ function flip(func) { return createWrap(func, WRAP_FLIP_FLAG); } /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache); return memoized; } // Expose `MapCache`. memoize.Cache = MapCache; /** * Creates a function that negates the result of the predicate `func`. The * `func` predicate is invoked with the `this` binding and arguments of the * created function. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} predicate The predicate to negate. * @returns {Function} Returns the new negated function. * @example * * function isEven(n) { * return n % 2 == 0; * } * * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); * // => [1, 3, 5] */ function negate(predicate) { if (typeof predicate != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return function() { var args = arguments; switch (args.length) { case 0: return !predicate.call(this); case 1: return !predicate.call(this, args[0]); case 2: return !predicate.call(this, args[0], args[1]); case 3: return !predicate.call(this, args[0], args[1], args[2]); } return !predicate.apply(this, args); }; } /** * Creates a function that is restricted to invoking `func` once. Repeat calls * to the function return the value of the first invocation. The `func` is * invoked with the `this` binding and arguments of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var initialize = _.once(createApplication); * initialize(); * initialize(); * // => `createApplication` is invoked once */ function once(func) { return before(2, func); } /** * Creates a function that invokes `func` with its arguments transformed. * * @static * @since 4.0.0 * @memberOf _ * @category Function * @param {Function} func The function to wrap. * @param {...(Function|Function[])} [transforms=[_.identity]] * The argument transforms. * @returns {Function} Returns the new function. * @example * * function doubled(n) { * return n * 2; * } * * function square(n) { * return n * n; * } * * var func = _.overArgs(function(x, y) { * return [x, y]; * }, [square, doubled]); * * func(9, 3); * // => [81, 6] * * func(10, 5); * // => [100, 10] */ var overArgs = castRest(function(func, transforms) { transforms = (transforms.length == 1 && isArray(transforms[0])) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); var funcsLength = transforms.length; return baseRest(function(args) { var index = -1, length = nativeMin(args.length, funcsLength); while (++index < length) { args[index] = transforms[index].call(this, args[index]); } return apply(func, this, args); }); }); /** * Creates a function that invokes `func` with `partials` prepended to the * arguments it receives. This method is like `_.bind` except it does **not** * alter the `this` binding. * * The `_.partial.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 0.2.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var sayHelloTo = _.partial(greet, 'hello'); * sayHelloTo('fred'); * // => 'hello fred' * * // Partially applied with placeholders. * var greetFred = _.partial(greet, _, 'fred'); * greetFred('hi'); * // => 'hi fred' */ var partial = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partial)); return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); }); /** * This method is like `_.partial` except that partially applied arguments * are appended to the arguments it receives. * * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 1.0.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var greetFred = _.partialRight(greet, 'fred'); * greetFred('hi'); * // => 'hi fred' * * // Partially applied with placeholders. * var sayHelloTo = _.partialRight(greet, 'hello', _); * sayHelloTo('fred'); * // => 'hello fred' */ var partialRight = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partialRight)); return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); }); /** * Creates a function that invokes `func` with arguments arranged according * to the specified `indexes` where the argument value at the first index is * provided as the first argument, the argument value at the second index is * provided as the second argument, and so on. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to rearrange arguments for. * @param {...(number|number[])} indexes The arranged argument indexes. * @returns {Function} Returns the new function. * @example * * var rearged = _.rearg(function(a, b, c) { * return [a, b, c]; * }, [2, 0, 1]); * * rearged('b', 'c', 'a') * // => ['a', 'b', 'c'] */ var rearg = flatRest(function(func, indexes) { return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); }); /** * Creates a function that invokes `func` with the `this` binding of the * created function and arguments from `start` and beyond provided as * an array. * * **Note:** This method is based on the * [rest parameter](https://mdn.io/rest_parameters). * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. * @example * * var say = _.rest(function(what, names) { * return what + ' ' + _.initial(names).join(', ') + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); * }); * * say('hello', 'fred', 'barney', 'pebbles'); * // => 'hello fred, barney, & pebbles' */ function rest(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = start === undefined ? start : toInteger(start); return baseRest(func, start); } /** * Creates a function that invokes `func` with the `this` binding of the * create function and an array of arguments much like * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). * * **Note:** This method is based on the * [spread operator](https://mdn.io/spread_operator). * * @static * @memberOf _ * @since 3.2.0 * @category Function * @param {Function} func The function to spread arguments over. * @param {number} [start=0] The start position of the spread. * @returns {Function} Returns the new function. * @example * * var say = _.spread(function(who, what) { * return who + ' says ' + what; * }); * * say(['fred', 'hello']); * // => 'fred says hello' * * var numbers = Promise.all([ * Promise.resolve(40), * Promise.resolve(36) * ]); * * numbers.then(_.spread(function(x, y) { * return x + y; * })); * // => a Promise of 76 */ function spread(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = start == null ? 0 : nativeMax(toInteger(start), 0); return baseRest(function(args) { var array = args[start], otherArgs = castSlice(args, 0, start); if (array) { arrayPush(otherArgs, array); } return apply(func, this, otherArgs); }); } /** * Creates a throttled function that only invokes `func` at most once per * every `wait` milliseconds. The throttled function comes with a `cancel` * method to cancel delayed `func` invocations and a `flush` method to * immediately invoke them. Provide `options` to indicate whether `func` * should be invoked on the leading and/or trailing edge of the `wait` * timeout. The `func` is invoked with the last arguments provided to the * throttled function. Subsequent calls to the throttled function return the * result of the last `func` invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the throttled function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.throttle` and `_.debounce`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to throttle. * @param {number} [wait=0] The number of milliseconds to throttle invocations to. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=true] * Specify invoking on the leading edge of the timeout. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new throttled function. * @example * * // Avoid excessively updating the position while scrolling. * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); * * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); * jQuery(element).on('click', throttled); * * // Cancel the trailing throttled invocation. * jQuery(window).on('popstate', throttled.cancel); */ function throttle(func, wait, options) { var leading = true, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (isObject(options)) { leading = 'leading' in options ? !!options.leading : leading; trailing = 'trailing' in options ? !!options.trailing : trailing; } return debounce(func, wait, { 'leading': leading, 'maxWait': wait, 'trailing': trailing }); } /** * Creates a function that accepts up to one argument, ignoring any * additional arguments. * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.unary(parseInt)); * // => [6, 8, 10] */ function unary(func) { return ary(func, 1); } /** * Creates a function that provides `value` to `wrapper` as its first * argument. Any additional arguments provided to the function are appended * to those provided to the `wrapper`. The wrapper is invoked with the `this` * binding of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {*} value The value to wrap. * @param {Function} [wrapper=identity] The wrapper function. * @returns {Function} Returns the new function. * @example * * var p = _.wrap(_.escape, function(func, text) { * return '

' + func(text) + '

'; * }); * * p('fred, barney, & pebbles'); * // => '

fred, barney, & pebbles

' */ function wrap(value, wrapper) { return partial(castFunction(wrapper), value); } /*------------------------------------------------------------------------*/ /** * Casts `value` as an array if it's not one. * * @static * @memberOf _ * @since 4.4.0 * @category Lang * @param {*} value The value to inspect. * @returns {Array} Returns the cast array. * @example * * _.castArray(1); * // => [1] * * _.castArray({ 'a': 1 }); * // => [{ 'a': 1 }] * * _.castArray('abc'); * // => ['abc'] * * _.castArray(null); * // => [null] * * _.castArray(undefined); * // => [undefined] * * _.castArray(); * // => [] * * var array = [1, 2, 3]; * console.log(_.castArray(array) === array); * // => true */ function castArray() { if (!arguments.length) { return []; } var value = arguments[0]; return isArray(value) ? value : [value]; } /** * Creates a shallow clone of `value`. * * **Note:** This method is loosely based on the * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) * and supports cloning arrays, array buffers, booleans, date objects, maps, * numbers, `Object` objects, regexes, sets, strings, symbols, and typed * arrays. The own enumerable properties of `arguments` objects are cloned * as plain objects. An empty object is returned for uncloneable values such * as error objects, functions, DOM nodes, and WeakMaps. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to clone. * @returns {*} Returns the cloned value. * @see _.cloneDeep * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var shallow = _.clone(objects); * console.log(shallow[0] === objects[0]); * // => true */ function clone(value) { return baseClone(value, CLONE_SYMBOLS_FLAG); } /** * This method is like `_.clone` except that it accepts `customizer` which * is invoked to produce the cloned value. If `customizer` returns `undefined`, * cloning is handled by the method instead. The `customizer` is invoked with * up to four arguments; (value [, index|key, object, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the cloned value. * @see _.cloneDeepWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(false); * } * } * * var el = _.cloneWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 0 */ function cloneWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); } /** * This method is like `_.clone` except that it recursively clones `value`. * * @static * @memberOf _ * @since 1.0.0 * @category Lang * @param {*} value The value to recursively clone. * @returns {*} Returns the deep cloned value. * @see _.clone * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var deep = _.cloneDeep(objects); * console.log(deep[0] === objects[0]); * // => false */ function cloneDeep(value) { return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } /** * This method is like `_.cloneWith` except that it recursively clones `value`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to recursively clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the deep cloned value. * @see _.cloneWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(true); * } * } * * var el = _.cloneDeepWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 20 */ function cloneDeepWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); } /** * Checks if `object` conforms to `source` by invoking the predicate * properties of `source` with the corresponding property values of `object`. * * **Note:** This method is equivalent to `_.conforms` when `source` is * partially applied. * * @static * @memberOf _ * @since 4.14.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property predicates to conform to. * @returns {boolean} Returns `true` if `object` conforms, else `false`. * @example * * var object = { 'a': 1, 'b': 2 }; * * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); * // => true * * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); * // => false */ function conformsTo(object, source) { return source == null || baseConformsTo(object, source, keys(source)); } /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } /** * Checks if `value` is greater than `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. * @see _.lt * @example * * _.gt(3, 1); * // => true * * _.gt(3, 3); * // => false * * _.gt(1, 3); * // => false */ var gt = createRelationalOperation(baseGt); /** * Checks if `value` is greater than or equal to `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than or equal to * `other`, else `false`. * @see _.lte * @example * * _.gte(3, 1); * // => true * * _.gte(3, 3); * // => true * * _.gte(1, 3); * // => false */ var gte = createRelationalOperation(function(value, other) { return value >= other; }); /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** * Checks if `value` is classified as an `ArrayBuffer` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. * @example * * _.isArrayBuffer(new ArrayBuffer(2)); * // => true * * _.isArrayBuffer(new Array(2)); * // => false */ var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } /** * Checks if `value` is classified as a boolean primitive or object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. * @example * * _.isBoolean(false); * // => true * * _.isBoolean(null); * // => false */ function isBoolean(value) { return value === true || value === false || (isObjectLike(value) && baseGetTag(value) == boolTag); } /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse; /** * Checks if `value` is classified as a `Date` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * * _.isDate(new Date); * // => true * * _.isDate('Mon April 23 2012'); * // => false */ var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; /** * Checks if `value` is likely a DOM element. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. * @example * * _.isElement(document.body); * // => true * * _.isElement(''); * // => false */ function isElement(value) { return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); } /** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have a `length` of `0`. * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * _.isEmpty(null); * // => true * * _.isEmpty(true); * // => true * * _.isEmpty(1); * // => true * * _.isEmpty([1, 2, 3]); * // => false * * _.isEmpty({ 'a': 1 }); * // => false */ function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); if (tag == mapTag || tag == setTag) { return !value.size; } if (isPrototype(value)) { return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } return true; } /** * Performs a deep comparison between two values to determine if they are * equivalent. * * **Note:** This method supports comparing arrays, array buffers, booleans, * date objects, error objects, maps, numbers, `Object` objects, regexes, * sets, strings, symbols, and typed arrays. `Object` objects are compared * by their own, not inherited, enumerable properties. Functions and DOM * nodes are compared by strict equality, i.e. `===`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true * * object === other; * // => false */ function isEqual(value, other) { return baseIsEqual(value, other); } /** * This method is like `_.isEqual` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with up to * six arguments: (objValue, othValue [, index|key, object, other, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * function isGreeting(value) { * return /^h(?:i|ello)$/.test(value); * } * * function customizer(objValue, othValue) { * if (isGreeting(objValue) && isGreeting(othValue)) { * return true; * } * } * * var array = ['hello', 'goodbye']; * var other = ['hi', 'goodbye']; * * _.isEqualWith(array, other, customizer); * // => true */ function isEqualWith(value, other, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; var result = customizer ? customizer(value, other) : undefined; return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; } /** * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, * `SyntaxError`, `TypeError`, or `URIError` object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an error object, else `false`. * @example * * _.isError(new Error); * // => true * * _.isError(Error); * // => false */ function isError(value) { if (!isObjectLike(value)) { return false; } var tag = baseGetTag(value); return tag == errorTag || tag == domExcTag || (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); } /** * Checks if `value` is a finite primitive number. * * **Note:** This method is based on * [`Number.isFinite`](https://mdn.io/Number/isFinite). * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. * @example * * _.isFinite(3); * // => true * * _.isFinite(Number.MIN_VALUE); * // => true * * _.isFinite(Infinity); * // => false * * _.isFinite('3'); * // => false */ function isFinite(value) { return typeof value == 'number' && nativeIsFinite(value); } /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } /** * Checks if `value` is an integer. * * **Note:** This method is based on * [`Number.isInteger`](https://mdn.io/Number/isInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an integer, else `false`. * @example * * _.isInteger(3); * // => true * * _.isInteger(Number.MIN_VALUE); * // => false * * _.isInteger(Infinity); * // => false * * _.isInteger('3'); * // => false */ function isInteger(value) { return typeof value == 'number' && value == toInteger(value); } /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } /** * Checks if `value` is classified as a `Map` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. * @example * * _.isMap(new Map); * // => true * * _.isMap(new WeakMap); * // => false */ var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; /** * Performs a partial deep comparison between `object` and `source` to * determine if `object` contains equivalent property values. * * **Note:** This method is equivalent to `_.matches` when `source` is * partially applied. * * Partial comparisons will match empty array and empty object `source` * values against any array or object value, respectively. See `_.isEqual` * for a list of supported value comparisons. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * * var object = { 'a': 1, 'b': 2 }; * * _.isMatch(object, { 'b': 2 }); * // => true * * _.isMatch(object, { 'b': 1 }); * // => false */ function isMatch(object, source) { return object === source || baseIsMatch(object, source, getMatchData(source)); } /** * This method is like `_.isMatch` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with five * arguments: (objValue, srcValue, index|key, object, source). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * * function isGreeting(value) { * return /^h(?:i|ello)$/.test(value); * } * * function customizer(objValue, srcValue) { * if (isGreeting(objValue) && isGreeting(srcValue)) { * return true; * } * } * * var object = { 'greeting': 'hello' }; * var source = { 'greeting': 'hi' }; * * _.isMatchWith(object, source, customizer); * // => true */ function isMatchWith(object, source, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseIsMatch(object, source, getMatchData(source), customizer); } /** * Checks if `value` is `NaN`. * * **Note:** This method is based on * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for * `undefined` and other non-number values. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. * @example * * _.isNaN(NaN); * // => true * * _.isNaN(new Number(NaN)); * // => true * * isNaN(undefined); * // => true * * _.isNaN(undefined); * // => false */ function isNaN(value) { // An `NaN` primitive is the only value that is not equal to itself. // Perform the `toStringTag` check first to avoid errors with some // ActiveX objects in IE. return isNumber(value) && value != +value; } /** * Checks if `value` is a pristine native function. * * **Note:** This method can't reliably detect native functions in the presence * of the core-js package because core-js circumvents this kind of detection. * Despite multiple requests, the core-js maintainer has made it clear: any * attempt to fix the detection will be obstructed. As a result, we're left * with little choice but to throw an error. Unfortunately, this also affects * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), * which rely on core-js. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. * @example * * _.isNative(Array.prototype.push); * // => true * * _.isNative(_); * // => false */ function isNative(value) { if (isMaskable(value)) { throw new Error(CORE_ERROR_TEXT); } return baseIsNative(value); } /** * Checks if `value` is `null`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `null`, else `false`. * @example * * _.isNull(null); * // => true * * _.isNull(void 0); * // => false */ function isNull(value) { return value === null; } /** * Checks if `value` is `null` or `undefined`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is nullish, else `false`. * @example * * _.isNil(null); * // => true * * _.isNil(void 0); * // => true * * _.isNil(NaN); * // => false */ function isNil(value) { return value == null; } /** * Checks if `value` is classified as a `Number` primitive or object. * * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are * classified as numbers, use the `_.isFinite` method. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @example * * _.isNumber(3); * // => true * * _.isNumber(Number.MIN_VALUE); * // => true * * _.isNumber(Infinity); * // => true * * _.isNumber('3'); * // => false */ function isNumber(value) { return typeof value == 'number' || (isObjectLike(value) && baseGetTag(value) == numberTag); } /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } /** * Checks if `value` is classified as a `RegExp` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. * @example * * _.isRegExp(/abc/); * // => true * * _.isRegExp('/abc/'); * // => false */ var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; /** * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 * double precision number which isn't the result of a rounded unsafe integer. * * **Note:** This method is based on * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. * @example * * _.isSafeInteger(3); * // => true * * _.isSafeInteger(Number.MIN_VALUE); * // => false * * _.isSafeInteger(Infinity); * // => false * * _.isSafeInteger('3'); * // => false */ function isSafeInteger(value) { return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is classified as a `Set` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. * @example * * _.isSet(new Set); * // => true * * _.isSet(new WeakSet); * // => false */ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; /** * Checks if `value` is classified as a `String` primitive or object. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); * // => true * * _.isString(1); * // => false */ function isString(value) { return typeof value == 'string' || (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); } /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike(value) && baseGetTag(value) == symbolTag); } /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; /** * Checks if `value` is `undefined`. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. * @example * * _.isUndefined(void 0); * // => true * * _.isUndefined(null); * // => false */ function isUndefined(value) { return value === undefined; } /** * Checks if `value` is classified as a `WeakMap` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. * @example * * _.isWeakMap(new WeakMap); * // => true * * _.isWeakMap(new Map); * // => false */ function isWeakMap(value) { return isObjectLike(value) && getTag(value) == weakMapTag; } /** * Checks if `value` is classified as a `WeakSet` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. * @example * * _.isWeakSet(new WeakSet); * // => true * * _.isWeakSet(new Set); * // => false */ function isWeakSet(value) { return isObjectLike(value) && baseGetTag(value) == weakSetTag; } /** * Checks if `value` is less than `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. * @see _.gt * @example * * _.lt(1, 3); * // => true * * _.lt(3, 3); * // => false * * _.lt(3, 1); * // => false */ var lt = createRelationalOperation(baseLt); /** * Checks if `value` is less than or equal to `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than or equal to * `other`, else `false`. * @see _.gte * @example * * _.lte(1, 3); * // => true * * _.lte(3, 3); * // => true * * _.lte(3, 1); * // => false */ var lte = createRelationalOperation(function(value, other) { return value <= other; }); /** * Converts `value` to an array. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to convert. * @returns {Array} Returns the converted array. * @example * * _.toArray({ 'a': 1, 'b': 2 }); * // => [1, 2] * * _.toArray('abc'); * // => ['a', 'b', 'c'] * * _.toArray(1); * // => [] * * _.toArray(null); * // => [] */ function toArray(value) { if (!value) { return []; } if (isArrayLike(value)) { return isString(value) ? stringToArray(value) : copyArray(value); } if (symIterator && value[symIterator]) { return iteratorToArray(value[symIterator]()); } var tag = getTag(value), func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); return func(value); } /** * Converts `value` to a finite number. * * @static * @memberOf _ * @since 4.12.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted number. * @example * * _.toFinite(3.2); * // => 3.2 * * _.toFinite(Number.MIN_VALUE); * // => 5e-324 * * _.toFinite(Infinity); * // => 1.7976931348623157e+308 * * _.toFinite('3.2'); * // => 3.2 */ function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = (value < 0 ? -1 : 1); return sign * MAX_INTEGER; } return value === value ? value : 0; } /** * Converts `value` to an integer. * * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { var result = toFinite(value), remainder = result % 1; return result === result ? (remainder ? result - remainder : result) : 0; } /** * Converts `value` to an integer suitable for use as the length of an * array-like object. * * **Note:** This method is based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toLength(3.2); * // => 3 * * _.toLength(Number.MIN_VALUE); * // => 0 * * _.toLength(Infinity); * // => 4294967295 * * _.toLength('3.2'); * // => 3 */ function toLength(value) { return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; } /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = value.replace(reTrim, ''); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : (reIsBadHex.test(value) ? NAN : +value); } /** * Converts `value` to a plain object flattening inherited enumerable string * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. * @example * * function Foo() { * this.b = 2; * } * * Foo.prototype.c = 3; * * _.assign({ 'a': 1 }, new Foo); * // => { 'a': 1, 'b': 2 } * * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); * // => { 'a': 1, 'b': 2, 'c': 3 } */ function toPlainObject(value) { return copyObject(value, keysIn(value)); } /** * Converts `value` to a safe integer. A safe integer can be compared and * represented correctly. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toSafeInteger(3.2); * // => 3 * * _.toSafeInteger(Number.MIN_VALUE); * // => 0 * * _.toSafeInteger(Infinity); * // => 9007199254740991 * * _.toSafeInteger('3.2'); * // => 3 */ function toSafeInteger(value) { return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : (value === 0 ? value : 0); } /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {string} Returns the converted string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } /*------------------------------------------------------------------------*/ /** * Assigns own enumerable string keyed properties of source objects to the * destination object. Source objects are applied from left to right. * Subsequent sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object` and is loosely based on * [`Object.assign`](https://mdn.io/Object/assign). * * @static * @memberOf _ * @since 0.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assignIn * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assign({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'c': 3 } */ var assign = createAssigner(function(object, source) { if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object); return; } for (var key in source) { if (hasOwnProperty.call(source, key)) { assignValue(object, key, source[key]); } } }); /** * This method is like `_.assign` except that it iterates over own and * inherited source properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extend * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assign * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assignIn({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ var assignIn = createAssigner(function(object, source) { copyObject(source, keysIn(source), object); }); /** * This method is like `_.assignIn` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extendWith * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignInWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keysIn(source), object, customizer); }); /** * This method is like `_.assign` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignInWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keys(source), object, customizer); }); /** * Creates an array of values corresponding to `paths` of `object`. * * @static * @memberOf _ * @since 1.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Array} Returns the picked values. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; * * _.at(object, ['a[0].b.c', 'a[1]']); * // => [3, 4] */ var at = flatRest(baseAt); /** * Creates an object that inherits from the `prototype` object. If a * `properties` object is given, its own enumerable string keyed properties * are assigned to the created object. * * @static * @memberOf _ * @since 2.3.0 * @category Object * @param {Object} prototype The object to inherit from. * @param {Object} [properties] The properties to assign to the object. * @returns {Object} Returns the new object. * @example * * function Shape() { * this.x = 0; * this.y = 0; * } * * function Circle() { * Shape.call(this); * } * * Circle.prototype = _.create(Shape.prototype, { * 'constructor': Circle * }); * * var circle = new Circle; * circle instanceof Circle; * // => true * * circle instanceof Shape; * // => true */ function create(prototype, properties) { var result = baseCreate(prototype); return properties == null ? result : baseAssign(result, properties); } /** * Assigns own and inherited enumerable string keyed properties of source * objects to the destination object for all destination properties that * resolve to `undefined`. Source objects are applied from left to right. * Once a property is set, additional values of the same property are ignored. * * **Note:** This method mutates `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaultsDeep * @example * * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var defaults = baseRest(function(object, sources) { object = Object(object); var index = -1; var length = sources.length; var guard = length > 2 ? sources[2] : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { length = 1; } while (++index < length) { var source = sources[index]; var props = keysIn(source); var propsIndex = -1; var propsLength = props.length; while (++propsIndex < propsLength) { var key = props[propsIndex]; var value = object[key]; if (value === undefined || (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { object[key] = source[key]; } } } return object; }); /** * This method is like `_.defaults` except that it recursively assigns * default properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaults * @example * * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); * // => { 'a': { 'b': 2, 'c': 3 } } */ var defaultsDeep = baseRest(function(args) { args.push(undefined, customDefaultsMerge); return apply(mergeWith, undefined, args); }); /** * This method is like `_.find` except that it returns the key of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Object * @param {Object} object The object to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example * * var users = { * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } * }; * * _.findKey(users, function(o) { return o.age < 40; }); * // => 'barney' (iteration order is not guaranteed) * * // The `_.matches` iteratee shorthand. * _.findKey(users, { 'age': 1, 'active': true }); * // => 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.findKey(users, ['active', false]); * // => 'fred' * * // The `_.property` iteratee shorthand. * _.findKey(users, 'active'); * // => 'barney' */ function findKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); } /** * This method is like `_.findKey` except that it iterates over elements of * a collection in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example * * var users = { * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } * }; * * _.findLastKey(users, function(o) { return o.age < 40; }); * // => returns 'pebbles' assuming `_.findKey` returns 'barney' * * // The `_.matches` iteratee shorthand. * _.findLastKey(users, { 'age': 36, 'active': true }); * // => 'barney' * * // The `_.matchesProperty` iteratee shorthand. * _.findLastKey(users, ['active', false]); * // => 'fred' * * // The `_.property` iteratee shorthand. * _.findLastKey(users, 'active'); * // => 'pebbles' */ function findLastKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); } /** * Iterates over own and inherited enumerable string keyed properties of an * object and invokes `iteratee` for each property. The iteratee is invoked * with three arguments: (value, key, object). Iteratee functions may exit * iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forInRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forIn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). */ function forIn(object, iteratee) { return object == null ? object : baseFor(object, getIteratee(iteratee, 3), keysIn); } /** * This method is like `_.forIn` except that it iterates over properties of * `object` in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forIn * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forInRight(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. */ function forInRight(object, iteratee) { return object == null ? object : baseForRight(object, getIteratee(iteratee, 3), keysIn); } /** * Iterates over own enumerable string keyed properties of an object and * invokes `iteratee` for each property. The iteratee is invoked with three * arguments: (value, key, object). Iteratee functions may exit iteration * early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwnRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forOwn(object, iteratee) { return object && baseForOwn(object, getIteratee(iteratee, 3)); } /** * This method is like `_.forOwn` except that it iterates over properties of * `object` in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwn * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwnRight(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. */ function forOwnRight(object, iteratee) { return object && baseForOwnRight(object, getIteratee(iteratee, 3)); } /** * Creates an array of function property names from own enumerable properties * of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the function names. * @see _.functionsIn * @example * * function Foo() { * this.a = _.constant('a'); * this.b = _.constant('b'); * } * * Foo.prototype.c = _.constant('c'); * * _.functions(new Foo); * // => ['a', 'b'] */ function functions(object) { return object == null ? [] : baseFunctions(object, keys(object)); } /** * Creates an array of function property names from own and inherited * enumerable properties of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the function names. * @see _.functions * @example * * function Foo() { * this.a = _.constant('a'); * this.b = _.constant('b'); * } * * Foo.prototype.c = _.constant('c'); * * _.functionsIn(new Foo); * // => ['a', 'b', 'c'] */ function functionsIn(object) { return object == null ? [] : baseFunctions(object, keysIn(object)); } /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, path); return result === undefined ? defaultValue : result; } /** * Checks if `path` is a direct property of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = { 'a': { 'b': 2 } }; * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * * _.has(object, 'a.b'); * // => true * * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); * // => false */ function has(object, path) { return object != null && hasPath(object, path, baseHas); } /** * Checks if `path` is a direct or inherited property of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * * _.hasIn(object, 'a.b'); * // => true * * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); * // => false */ function hasIn(object, path) { return object != null && hasPath(object, path, baseHasIn); } /** * Creates an object composed of the inverted keys and values of `object`. * If `object` contains duplicate values, subsequent values overwrite * property assignments of previous values. * * @static * @memberOf _ * @since 0.7.0 * @category Object * @param {Object} object The object to invert. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invert(object); * // => { '1': 'c', '2': 'b' } */ var invert = createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString.call(value); } result[value] = key; }, constant(identity)); /** * This method is like `_.invert` except that the inverted object is generated * from the results of running each element of `object` thru `iteratee`. The * corresponding inverted value of each inverted key is an array of keys * responsible for generating the inverted value. The iteratee is invoked * with one argument: (value). * * @static * @memberOf _ * @since 4.1.0 * @category Object * @param {Object} object The object to invert. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invertBy(object); * // => { '1': ['a', 'c'], '2': ['b'] } * * _.invertBy(object, function(value) { * return 'group' + value; * }); * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ var invertBy = createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString.call(value); } if (hasOwnProperty.call(result, value)) { result[value].push(key); } else { result[value] = [key]; } }, getIteratee); /** * Invokes the method at `path` of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {...*} [args] The arguments to invoke the method with. * @returns {*} Returns the result of the invoked method. * @example * * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; * * _.invoke(object, 'a[0].b.c.slice', 1, 3); * // => [2, 3] */ var invoke = baseRest(baseInvoke); /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */ function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } /** * The opposite of `_.mapValues`; this method creates an object with the * same values as `object` and keys generated by running each own enumerable * string keyed property of `object` thru `iteratee`. The iteratee is invoked * with three arguments: (value, key, object). * * @static * @memberOf _ * @since 3.8.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapValues * @example * * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { * return key + value; * }); * // => { 'a1': 1, 'b2': 2 } */ function mapKeys(object, iteratee) { var result = {}; iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, iteratee(value, key, object), value); }); return result; } /** * Creates an object with the same keys as `object` and values generated * by running each own enumerable string keyed property of `object` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, key, object). * * @static * @memberOf _ * @since 2.4.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapKeys * @example * * var users = { * 'fred': { 'user': 'fred', 'age': 40 }, * 'pebbles': { 'user': 'pebbles', 'age': 1 } * }; * * _.mapValues(users, function(o) { return o.age; }); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) * * // The `_.property` iteratee shorthand. * _.mapValues(users, 'age'); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) */ function mapValues(object, iteratee) { var result = {}; iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, key, iteratee(value, key, object)); }); return result; } /** * This method is like `_.assign` except that it recursively merges own and * inherited enumerable string keyed properties of source objects into the * destination object. Source properties that resolve to `undefined` are * skipped if a destination value exists. Array and plain object properties * are merged recursively. Other objects and value types are overridden by * assignment. Source objects are applied from left to right. Subsequent * sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 0.5.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @example * * var object = { * 'a': [{ 'b': 2 }, { 'd': 4 }] * }; * * var other = { * 'a': [{ 'c': 3 }, { 'e': 5 }] * }; * * _.merge(object, other); * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ var merge = createAssigner(function(object, source, srcIndex) { baseMerge(object, source, srcIndex); }); /** * This method is like `_.merge` except that it accepts `customizer` which * is invoked to produce the merged values of the destination and source * properties. If `customizer` returns `undefined`, merging is handled by the * method instead. The `customizer` is invoked with six arguments: * (objValue, srcValue, key, object, source, stack). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} customizer The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * function customizer(objValue, srcValue) { * if (_.isArray(objValue)) { * return objValue.concat(srcValue); * } * } * * var object = { 'a': [1], 'b': [2] }; * var other = { 'a': [3], 'b': [4] }; * * _.mergeWith(object, other, customizer); * // => { 'a': [1, 3], 'b': [2, 4] } */ var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); }); /** * The opposite of `_.pick`; this method creates an object composed of the * own and inherited enumerable property paths of `object` that are not omitted. * * **Note:** This method is considerably slower than `_.pick`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to omit. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ var omit = flatRest(function(object, paths) { var result = {}; if (object == null) { return result; } var isDeep = false; paths = arrayMap(paths, function(path) { path = castPath(path, object); isDeep || (isDeep = path.length > 1); return path; }); copyObject(object, getAllKeysIn(object), result); if (isDeep) { result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); } var length = paths.length; while (length--) { baseUnset(result, paths[length]); } return result; }); /** * The opposite of `_.pickBy`; this method creates an object composed of * the own and inherited enumerable string keyed properties of `object` that * `predicate` doesn't return truthy for. The predicate is invoked with two * arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omitBy(object, _.isNumber); * // => { 'b': '2' } */ function omitBy(object, predicate) { return pickBy(object, negate(getIteratee(predicate))); } /** * Creates an object composed of the picked `object` properties. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ var pick = flatRest(function(object, paths) { return object == null ? {} : basePick(object, paths); }); /** * Creates an object composed of the `object` properties `predicate` returns * truthy for. The predicate is invoked with two arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pickBy(object, _.isNumber); * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { if (object == null) { return {}; } var props = arrayMap(getAllKeysIn(object), function(prop) { return [prop]; }); predicate = getIteratee(predicate); return basePickBy(object, props, function(value, path) { return predicate(value, path[0]); }); } /** * This method is like `_.get` except that if the resolved value is a * function it's invoked with the `this` binding of its parent object and * its result is returned. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to resolve. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; * * _.result(object, 'a[0].b.c1'); * // => 3 * * _.result(object, 'a[0].b.c2'); * // => 4 * * _.result(object, 'a[0].b.c3', 'default'); * // => 'default' * * _.result(object, 'a[0].b.c3', _.constant('default')); * // => 'default' */ function result(object, path, defaultValue) { path = castPath(path, object); var index = -1, length = path.length; // Ensure the loop is entered when path is empty. if (!length) { length = 1; object = undefined; } while (++index < length) { var value = object == null ? undefined : object[toKey(path[index])]; if (value === undefined) { index = length; value = defaultValue; } object = isFunction(value) ? value.call(object) : value; } return object; } /** * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, * it's created. Arrays are created for missing index properties while objects * are created for all other missing properties. Use `_.setWith` to customize * `path` creation. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.set(object, 'a[0].b.c', 4); * console.log(object.a[0].b.c); * // => 4 * * _.set(object, ['x', '0', 'y', 'z'], 5); * console.log(object.x[0].y.z); * // => 5 */ function set(object, path, value) { return object == null ? object : baseSet(object, path, value); } /** * This method is like `_.set` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked * with three arguments: (nsValue, key, nsObject). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * var object = {}; * * _.setWith(object, '[0][1]', 'a', Object); * // => { '0': { '1': 'a' } } */ function setWith(object, path, value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return object == null ? object : baseSet(object, path, value, customizer); } /** * Creates an array of own enumerable string keyed-value pairs for `object` * which can be consumed by `_.fromPairs`. If `object` is a map or set, its * entries are returned. * * @static * @memberOf _ * @since 4.0.0 * @alias entries * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.toPairs(new Foo); * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) */ var toPairs = createToPairs(keys); /** * Creates an array of own and inherited enumerable string keyed-value pairs * for `object` which can be consumed by `_.fromPairs`. If `object` is a map * or set, its entries are returned. * * @static * @memberOf _ * @since 4.0.0 * @alias entriesIn * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.toPairsIn(new Foo); * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) */ var toPairsIn = createToPairs(keysIn); /** * An alternative to `_.reduce`; this method transforms `object` to a new * `accumulator` object which is the result of running each of its own * enumerable string keyed properties thru `iteratee`, with each invocation * potentially mutating the `accumulator` object. If `accumulator` is not * provided, a new object with the same `[[Prototype]]` will be used. The * iteratee is invoked with four arguments: (accumulator, value, key, object). * Iteratee functions may exit iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 1.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The custom accumulator value. * @returns {*} Returns the accumulated value. * @example * * _.transform([2, 3, 4], function(result, n) { * result.push(n *= n); * return n % 2 == 0; * }, []); * // => [4, 9] * * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } */ function transform(object, iteratee, accumulator) { var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object); iteratee = getIteratee(iteratee, 4); if (accumulator == null) { var Ctor = object && object.constructor; if (isArrLike) { accumulator = isArr ? new Ctor : []; } else if (isObject(object)) { accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; } else { accumulator = {}; } } (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { return iteratee(accumulator, value, index, object); }); return accumulator; } /** * Removes the property at `path` of `object`. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. * @example * * var object = { 'a': [{ 'b': { 'c': 7 } }] }; * _.unset(object, 'a[0].b.c'); * // => true * * console.log(object); * // => { 'a': [{ 'b': {} }] }; * * _.unset(object, ['a', '0', 'b', 'c']); * // => true * * console.log(object); * // => { 'a': [{ 'b': {} }] }; */ function unset(object, path) { return object == null ? true : baseUnset(object, path); } /** * This method is like `_.set` except that accepts `updater` to produce the * value to set. Use `_.updateWith` to customize `path` creation. The `updater` * is invoked with one argument: (value). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.6.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {Function} updater The function to produce the updated value. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.update(object, 'a[0].b.c', function(n) { return n * n; }); * console.log(object.a[0].b.c); * // => 9 * * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); * console.log(object.x[0].y.z); * // => 0 */ function update(object, path, updater) { return object == null ? object : baseUpdate(object, path, castFunction(updater)); } /** * This method is like `_.update` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked * with three arguments: (nsValue, key, nsObject). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.6.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {Function} updater The function to produce the updated value. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * var object = {}; * * _.updateWith(object, '[0][1]', _.constant('a'), Object); * // => { '0': { '1': 'a' } } */ function updateWith(object, path, updater, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); } /** * Creates an array of the own enumerable string keyed property values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.values(new Foo); * // => [1, 2] (iteration order is not guaranteed) * * _.values('hi'); * // => ['h', 'i'] */ function values(object) { return object == null ? [] : baseValues(object, keys(object)); } /** * Creates an array of the own and inherited enumerable string keyed property * values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.valuesIn(new Foo); * // => [1, 2, 3] (iteration order is not guaranteed) */ function valuesIn(object) { return object == null ? [] : baseValues(object, keysIn(object)); } /*------------------------------------------------------------------------*/ /** * Clamps `number` within the inclusive `lower` and `upper` bounds. * * @static * @memberOf _ * @since 4.0.0 * @category Number * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. * @example * * _.clamp(-10, -5, 5); * // => -5 * * _.clamp(10, -5, 5); * // => 5 */ function clamp(number, lower, upper) { if (upper === undefined) { upper = lower; lower = undefined; } if (upper !== undefined) { upper = toNumber(upper); upper = upper === upper ? upper : 0; } if (lower !== undefined) { lower = toNumber(lower); lower = lower === lower ? lower : 0; } return baseClamp(toNumber(number), lower, upper); } /** * Checks if `n` is between `start` and up to, but not including, `end`. If * `end` is not specified, it's set to `start` with `start` then set to `0`. * If `start` is greater than `end` the params are swapped to support * negative ranges. * * @static * @memberOf _ * @since 3.3.0 * @category Number * @param {number} number The number to check. * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @returns {boolean} Returns `true` if `number` is in the range, else `false`. * @see _.range, _.rangeRight * @example * * _.inRange(3, 2, 4); * // => true * * _.inRange(4, 8); * // => true * * _.inRange(4, 2); * // => false * * _.inRange(2, 2); * // => false * * _.inRange(1.2, 2); * // => true * * _.inRange(5.2, 4); * // => false * * _.inRange(-3, -2, -6); * // => true */ function inRange(number, start, end) { start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } number = toNumber(number); return baseInRange(number, start, end); } /** * Produces a random number between the inclusive `lower` and `upper` bounds. * If only one argument is provided a number between `0` and the given number * is returned. If `floating` is `true`, or either `lower` or `upper` are * floats, a floating-point number is returned instead of an integer. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * @static * @memberOf _ * @since 0.7.0 * @category Number * @param {number} [lower=0] The lower bound. * @param {number} [upper=1] The upper bound. * @param {boolean} [floating] Specify returning a floating-point number. * @returns {number} Returns the random number. * @example * * _.random(0, 5); * // => an integer between 0 and 5 * * _.random(5); * // => also an integer between 0 and 5 * * _.random(5, true); * // => a floating-point number between 0 and 5 * * _.random(1.2, 5.2); * // => a floating-point number between 1.2 and 5.2 */ function random(lower, upper, floating) { if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { upper = floating = undefined; } if (floating === undefined) { if (typeof upper == 'boolean') { floating = upper; upper = undefined; } else if (typeof lower == 'boolean') { floating = lower; lower = undefined; } } if (lower === undefined && upper === undefined) { lower = 0; upper = 1; } else { lower = toFinite(lower); if (upper === undefined) { upper = lower; lower = 0; } else { upper = toFinite(upper); } } if (lower > upper) { var temp = lower; lower = upper; upper = temp; } if (floating || lower % 1 || upper % 1) { var rand = nativeRandom(); return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); } return baseRandom(lower, upper); } /*------------------------------------------------------------------------*/ /** * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the camel cased string. * @example * * _.camelCase('Foo Bar'); * // => 'fooBar' * * _.camelCase('--foo-bar--'); * // => 'fooBar' * * _.camelCase('__FOO_BAR__'); * // => 'fooBar' */ var camelCase = createCompounder(function(result, word, index) { word = word.toLowerCase(); return result + (index ? capitalize(word) : word); }); /** * Converts the first character of `string` to upper case and the remaining * to lower case. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to capitalize. * @returns {string} Returns the capitalized string. * @example * * _.capitalize('FRED'); * // => 'Fred' */ function capitalize(string) { return upperFirst(toString(string).toLowerCase()); } /** * Deburrs `string` by converting * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) * letters to basic Latin letters and removing * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to deburr. * @returns {string} Returns the deburred string. * @example * * _.deburr('déjà vu'); * // => 'deja vu' */ function deburr(string) { string = toString(string); return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); } /** * Checks if `string` ends with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=string.length] The position to search up to. * @returns {boolean} Returns `true` if `string` ends with `target`, * else `false`. * @example * * _.endsWith('abc', 'c'); * // => true * * _.endsWith('abc', 'b'); * // => false * * _.endsWith('abc', 'b', 2); * // => true */ function endsWith(string, target, position) { string = toString(string); target = baseToString(target); var length = string.length; position = position === undefined ? length : baseClamp(toInteger(position), 0, length); var end = position; position -= target.length; return position >= 0 && string.slice(position, end) == target; } /** * Converts the characters "&", "<", ">", '"', and "'" in `string` to their * corresponding HTML entities. * * **Note:** No other characters are escaped. To escape additional * characters use a third-party library like [_he_](https://mths.be/he). * * Though the ">" character is escaped for symmetry, characters like * ">" and "/" don't need escaping in HTML and have no special meaning * unless they're part of a tag or unquoted attribute value. See * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * * When working with HTML you should always * [quote attribute values](http://wonko.com/post/html-escaping) to reduce * XSS vectors. * * @static * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escape('fred, barney, & pebbles'); * // => 'fred, barney, & pebbles' */ function escape(string) { string = toString(string); return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; } /** * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escapeRegExp('[lodash](https://lodash.com/)'); * // => '\[lodash\]\(https://lodash\.com/\)' */ function escapeRegExp(string) { string = toString(string); return (string && reHasRegExpChar.test(string)) ? string.replace(reRegExpChar, '\\$&') : string; } /** * Converts `string` to * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the kebab cased string. * @example * * _.kebabCase('Foo Bar'); * // => 'foo-bar' * * _.kebabCase('fooBar'); * // => 'foo-bar' * * _.kebabCase('__FOO_BAR__'); * // => 'foo-bar' */ var kebabCase = createCompounder(function(result, word, index) { return result + (index ? '-' : '') + word.toLowerCase(); }); /** * Converts `string`, as space separated words, to lower case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the lower cased string. * @example * * _.lowerCase('--Foo-Bar--'); * // => 'foo bar' * * _.lowerCase('fooBar'); * // => 'foo bar' * * _.lowerCase('__FOO_BAR__'); * // => 'foo bar' */ var lowerCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + word.toLowerCase(); }); /** * Converts the first character of `string` to lower case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. * @example * * _.lowerFirst('Fred'); * // => 'fred' * * _.lowerFirst('FRED'); * // => 'fRED' */ var lowerFirst = createCaseFirst('toLowerCase'); /** * Pads `string` on the left and right sides if it's shorter than `length`. * Padding characters are truncated if they can't be evenly divided by `length`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.pad('abc', 8); * // => ' abc ' * * _.pad('abc', 8, '_-'); * // => '_-abc_-_' * * _.pad('abc', 3); * // => 'abc' */ function pad(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; if (!length || strLength >= length) { return string; } var mid = (length - strLength) / 2; return ( createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars) ); } /** * Pads `string` on the right side if it's shorter than `length`. Padding * characters are truncated if they exceed `length`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.padEnd('abc', 6); * // => 'abc ' * * _.padEnd('abc', 6, '_-'); * // => 'abc_-_' * * _.padEnd('abc', 3); * // => 'abc' */ function padEnd(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return (length && strLength < length) ? (string + createPadding(length - strLength, chars)) : string; } /** * Pads `string` on the left side if it's shorter than `length`. Padding * characters are truncated if they exceed `length`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.padStart('abc', 6); * // => ' abc' * * _.padStart('abc', 6, '_-'); * // => '_-_abc' * * _.padStart('abc', 3); * // => 'abc' */ function padStart(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return (length && strLength < length) ? (createPadding(length - strLength, chars) + string) : string; } /** * Converts `string` to an integer of the specified radix. If `radix` is * `undefined` or `0`, a `radix` of `10` is used unless `value` is a * hexadecimal, in which case a `radix` of `16` is used. * * **Note:** This method aligns with the * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. * * @static * @memberOf _ * @since 1.1.0 * @category String * @param {string} string The string to convert. * @param {number} [radix=10] The radix to interpret `value` by. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {number} Returns the converted integer. * @example * * _.parseInt('08'); * // => 8 * * _.map(['6', '08', '10'], _.parseInt); * // => [6, 8, 10] */ function parseInt(string, radix, guard) { if (guard || radix == null) { radix = 0; } else if (radix) { radix = +radix; } return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); } /** * Repeats the given string `n` times. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to repeat. * @param {number} [n=1] The number of times to repeat the string. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the repeated string. * @example * * _.repeat('*', 3); * // => '***' * * _.repeat('abc', 2); * // => 'abcabc' * * _.repeat('abc', 0); * // => '' */ function repeat(string, n, guard) { if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { n = 1; } else { n = toInteger(n); } return baseRepeat(toString(string), n); } /** * Replaces matches for `pattern` in `string` with `replacement`. * * **Note:** This method is based on * [`String#replace`](https://mdn.io/String/replace). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to modify. * @param {RegExp|string} pattern The pattern to replace. * @param {Function|string} replacement The match replacement. * @returns {string} Returns the modified string. * @example * * _.replace('Hi Fred', 'Fred', 'Barney'); * // => 'Hi Barney' */ function replace() { var args = arguments, string = toString(args[0]); return args.length < 3 ? string : string.replace(args[1], args[2]); } /** * Converts `string` to * [snake case](https://en.wikipedia.org/wiki/Snake_case). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the snake cased string. * @example * * _.snakeCase('Foo Bar'); * // => 'foo_bar' * * _.snakeCase('fooBar'); * // => 'foo_bar' * * _.snakeCase('--FOO-BAR--'); * // => 'foo_bar' */ var snakeCase = createCompounder(function(result, word, index) { return result + (index ? '_' : '') + word.toLowerCase(); }); /** * Splits `string` by `separator`. * * **Note:** This method is based on * [`String#split`](https://mdn.io/String/split). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to split. * @param {RegExp|string} separator The separator pattern to split by. * @param {number} [limit] The length to truncate results to. * @returns {Array} Returns the string segments. * @example * * _.split('a-b-c', '-', 2); * // => ['a', 'b'] */ function split(string, separator, limit) { if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { separator = limit = undefined; } limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; if (!limit) { return []; } string = toString(string); if (string && ( typeof separator == 'string' || (separator != null && !isRegExp(separator)) )) { separator = baseToString(separator); if (!separator && hasUnicode(string)) { return castSlice(stringToArray(string), 0, limit); } } return string.split(separator, limit); } /** * Converts `string` to * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). * * @static * @memberOf _ * @since 3.1.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the start cased string. * @example * * _.startCase('--foo-bar--'); * // => 'Foo Bar' * * _.startCase('fooBar'); * // => 'Foo Bar' * * _.startCase('__FOO_BAR__'); * // => 'FOO BAR' */ var startCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + upperFirst(word); }); /** * Checks if `string` starts with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. * @returns {boolean} Returns `true` if `string` starts with `target`, * else `false`. * @example * * _.startsWith('abc', 'a'); * // => true * * _.startsWith('abc', 'b'); * // => false * * _.startsWith('abc', 'b', 1); * // => true */ function startsWith(string, target, position) { string = toString(string); position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); target = baseToString(target); return string.slice(position, position + target.length) == target; } /** * Creates a compiled template function that can interpolate data properties * in "interpolate" delimiters, HTML-escape interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data * properties may be accessed as free variables in the template. If a setting * object is given, it takes precedence over `_.templateSettings` values. * * **Note:** In the development build `_.template` utilizes * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) * for easier debugging. * * For more information on precompiling templates see * [lodash's custom builds documentation](https://lodash.com/custom-builds). * * For more information on Chrome extension sandboxes see * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). * * @static * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The template string. * @param {Object} [options={}] The options object. * @param {RegExp} [options.escape=_.templateSettings.escape] * The HTML "escape" delimiter. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] * The "evaluate" delimiter. * @param {Object} [options.imports=_.templateSettings.imports] * An object to import into the template as free variables. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] * The "interpolate" delimiter. * @param {string} [options.sourceURL='lodash.templateSources[n]'] * The sourceURL of the compiled template. * @param {string} [options.variable='obj'] * The data object variable name. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the compiled template function. * @example * * // Use the "interpolate" delimiter to create a compiled template. * var compiled = _.template('hello <%= user %>!'); * compiled({ 'user': 'fred' }); * // => 'hello fred!' * * // Use the HTML "escape" delimiter to escape data property values. * var compiled = _.template('<%- value %>'); * compiled({ 'value': ' ================================================ FILE: docs/index.html ================================================ polished | A lightweight toolset for writing styles in JavaScript

A lightweight toolset for writing styles in JavaScript

View on GitHub Docs

Installation

npm install --save polished

Usage

import { lighten, modularScale } from 'polished'

Open the console and play around with it!

const styles = {
  color: lighten(0.2, '#000'),
  "font-size": modularScale(1),
  [hiDPI(1.5)]: {
    "font-size": modularScale(1.25)
  }
}
const styles = {
  color: '#333',
  "font-size": '1.33em',
  '@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 1.5/1), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx)': {
    "font-size": '1.66625em',
  }
}
================================================ FILE: docs-theme/assets/anchor.js ================================================ /*! * AnchorJS - v1.2.1 - 2015-07-02 * https://github.com/bryanbraun/anchorjs * Copyright (c) 2015 Bryan Braun; Licensed MIT */ function AnchorJS(options) { 'use strict'; this.options = options || {}; this._applyRemainingDefaultOptions = function(opts) { this.options.icon = this.options.hasOwnProperty('icon') ? opts.icon : '\ue9cb'; // Accepts characters (and also URLs?), like '#', '¶', '❡', or '§'. this.options.visible = this.options.hasOwnProperty('visible') ? opts.visible : 'hover'; // Also accepts 'always' this.options.placement = this.options.hasOwnProperty('placement') ? opts.placement : 'right'; // Also accepts 'left' this.options.class = this.options.hasOwnProperty('class') ? opts.class : ''; // Accepts any class name. }; this._applyRemainingDefaultOptions(options); this.add = function(selector) { var elements, elsWithIds, idList, elementID, i, roughText, tidyText, index, count, newTidyText, readableID, anchor; this._applyRemainingDefaultOptions(this.options); // Provide a sensible default selector, if none is given. if (!selector) { selector = 'h1, h2, h3, h4, h5, h6'; } else if (typeof selector !== 'string') { throw new Error('The selector provided to AnchorJS was invalid.'); } elements = document.querySelectorAll(selector); if (elements.length === 0) { return false; } this._addBaselineStyles(); // We produce a list of existing IDs so we don't generate a duplicate. elsWithIds = document.querySelectorAll('[id]'); idList = [].map.call(elsWithIds, function assign(el) { return el.id; }); for (i = 0; i < elements.length; i++) { if (elements[i].hasAttribute('id')) { elementID = elements[i].getAttribute('id'); } else { roughText = elements[i].textContent; // Refine it so it makes a good ID. Strip out non-safe characters, replace // spaces with hyphens, truncate to 32 characters, and make toLowerCase. // // Example string: // '⚡⚡⚡ Unicode icons are cool--but they definitely don't belong in a URL fragment.' tidyText = roughText.replace(/[^\w\s-]/gi, '') // ' Unicode icons are cool--but they definitely dont belong in a URL fragment' .replace(/\s+/g, '-') // '-Unicode-icons-are-cool--but-they-definitely-dont-belong-in-a-URL-fragment' .replace(/-{2,}/g, '-') // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL-fragment' .substring(0, 64) // '-Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL' .replace(/^-+|-+$/gm, '') // 'Unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-URL' .toLowerCase(); // 'unicode-icons-are-cool-but-they-definitely-dont-belong-in-a-url' // Compare our generated ID to existing IDs (and increment it if needed) // before we add it to the page. newTidyText = tidyText; count = 0; do { if (index !== undefined) { newTidyText = tidyText + '-' + count; } // .indexOf is supported in IE9+. index = idList.indexOf(newTidyText); count += 1; } while (index !== -1); index = undefined; idList.push(newTidyText); // Assign it to our element. // Currently the setAttribute element is only supported in IE9 and above. elements[i].setAttribute('id', newTidyText); elementID = newTidyText; } readableID = elementID.replace(/-/g, ' '); // The following code builds the following DOM structure in a more effiecient (albeit opaque) way. // ''; anchor = document.createElement('a'); anchor.className = 'anchorjs-link ' + this.options.class; anchor.href = '#' + elementID; anchor.setAttribute('aria-label', 'Anchor link for: ' + readableID); anchor.setAttribute('data-anchorjs-icon', this.options.icon); if (this.options.visible === 'always') { anchor.style.opacity = '1'; } if (this.options.icon === '\ue9cb') { anchor.style.fontFamily = 'anchorjs-icons'; anchor.style.fontStyle = 'normal'; anchor.style.fontVariant = 'normal'; anchor.style.fontWeight = 'normal'; anchor.style.lineHeight = 1; } if (this.options.placement === 'left') { anchor.style.position = 'absolute'; anchor.style.marginLeft = '-1em'; anchor.style.paddingRight = '0.5em'; elements[i].insertBefore(anchor, elements[i].firstChild); } else { // if the option provided is `right` (or anything else). anchor.style.paddingLeft = '0.375em'; elements[i].appendChild(anchor); } } return this; }; this.remove = function(selector) { var domAnchor, elements = document.querySelectorAll(selector); for (var i = 0; i < elements.length; i++) { domAnchor = elements[i].querySelector('.anchorjs-link'); if (domAnchor) { elements[i].removeChild(domAnchor); } } return this; }; this._addBaselineStyles = function() { // We don't want to add global baseline styles if they've been added before. if (document.head.querySelector('style.anchorjs') !== null) { return; } var style = document.createElement('style'), linkRule = ' .anchorjs-link {' + ' opacity: 0;' + ' text-decoration: none;' + ' -webkit-font-smoothing: antialiased;' + ' -moz-osx-font-smoothing: grayscale;' + ' }', hoverRule = ' *:hover > .anchorjs-link,' + ' .anchorjs-link:focus {' + ' opacity: 1;' + ' }', anchorjsLinkFontFace = ' @font-face {' + ' font-family: "anchorjs-icons";' + ' font-style: normal;' + ' font-weight: normal;' + // Icon from icomoon; 10px wide & 10px tall; 2 empty below & 4 above ' src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBTUAAAC8AAAAYGNtYXAWi9QdAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5Zgq29TcAAAF4AAABNGhlYWQEZM3pAAACrAAAADZoaGVhBhUDxgAAAuQAAAAkaG10eASAADEAAAMIAAAAFGxvY2EAKACuAAADHAAAAAxtYXhwAAgAVwAAAygAAAAgbmFtZQ5yJ3cAAANIAAAB2nBvc3QAAwAAAAAFJAAAACAAAwJAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpywPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6cv//f//AAAAAAAg6cv//f//AAH/4xY5AAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAACADEARAJTAsAAKwBUAAABIiYnJjQ/AT4BMzIWFxYUDwEGIicmND8BNjQnLgEjIgYPAQYUFxYUBw4BIwciJicmND8BNjIXFhQPAQYUFx4BMzI2PwE2NCcmNDc2MhcWFA8BDgEjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAEAAAABAACiToc1Xw889QALBAAAAAAA0XnFFgAAAADRecUWAAAAAAJTAsAAAAAIAAIAAAAAAAAAAQAAA8D/wAAABAAAAAAAAlMAAQAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAACAAAAAoAAMQAAAAAACgAUAB4AmgABAAAABQBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEADgAAAAEAAAAAAAIABwCfAAEAAAAAAAMADgBLAAEAAAAAAAQADgC0AAEAAAAAAAUACwAqAAEAAAAAAAYADgB1AAEAAAAAAAoAGgDeAAMAAQQJAAEAHAAOAAMAAQQJAAIADgCmAAMAAQQJAAMAHABZAAMAAQQJAAQAHADCAAMAAQQJAAUAFgA1AAMAAQQJAAYAHACDAAMAAQQJAAoANAD4YW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzUmVndWxhcgBSAGUAZwB1AGwAYQByYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format("truetype");' + ' }', pseudoElContent = ' [data-anchorjs-icon]::after {' + ' content: attr(data-anchorjs-icon);' + ' }', firstStyleEl; style.className = 'anchorjs'; style.appendChild(document.createTextNode('')); // Necessary for Webkit. // We place it in the head with the other style tags, if possible, so as to // not look out of place. We insert before the others so these styles can be // overridden if necessary. firstStyleEl = document.head.querySelector('[rel="stylesheet"], style'); if (firstStyleEl === undefined) { document.head.appendChild(style); } else { document.head.insertBefore(style, firstStyleEl); } style.sheet.insertRule(linkRule, style.sheet.cssRules.length); style.sheet.insertRule(hoverRule, style.sheet.cssRules.length); style.sheet.insertRule(pseudoElContent, style.sheet.cssRules.length); style.sheet.insertRule(anchorjsLinkFontFace, style.sheet.cssRules.length); }; } var anchors = new AnchorJS(); ================================================ FILE: docs-theme/assets/bass-addons.css ================================================ .input { font-family: inherit; display: block; width: 100%; height: 2rem; padding: .5rem; margin-bottom: 1rem; border: 1px solid #ccc; font-size: .875rem; border-radius: 3px; box-sizing: border-box; } ================================================ FILE: docs-theme/assets/bass.css ================================================ /*! Basscss | http://basscss.com | MIT License */ .h1{ font-size: 2rem } .h2{ font-size: 1.5rem } .h3{ font-size: 1.25rem } .h4{ font-size: 1rem } .h5{ font-size: .875rem } .h6{ font-size: .75rem } .font-family-inherit{ font-family:inherit } .font-size-inherit{ font-size:inherit } .text-decoration-none{ text-decoration:none } .bold{ font-weight: bold; font-weight: bold } .regular{ font-weight:normal } .italic{ font-style:italic } .caps{ text-transform:uppercase; letter-spacing: .2em; } .left-align{ text-align:left } .center{ text-align:center } .right-align{ text-align:right } .justify{ text-align:justify } .nowrap{ white-space:nowrap } .break-word{ word-wrap:break-word } .line-height-1{ line-height: 1 } .line-height-2{ line-height: 1.125 } .line-height-3{ line-height: 1.25 } .line-height-4{ line-height: 1.5 } .list-style-none{ list-style:none } .underline{ text-decoration:underline } .truncate{ max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .list-reset{ list-style:none; padding-left:0; } .inline{ display:inline } .block{ display:block } .inline-block{ display:inline-block } .table{ display:table } .table-cell{ display:table-cell } .overflow-hidden{ overflow:hidden } .overflow-scroll{ overflow:scroll } .overflow-auto{ overflow:auto } .clearfix:before, .clearfix:after{ content:" "; display:table } .clearfix:after{ clear:both } .left{ float:left } .right{ float:right } .fit{ max-width:100% } .max-width-1{ max-width: 24rem } .max-width-2{ max-width: 32rem } .max-width-3{ max-width: 48rem } .max-width-4{ max-width: 64rem } .border-box{ box-sizing:border-box } .align-baseline{ vertical-align:baseline } .align-top{ vertical-align:top } .align-middle{ vertical-align:middle } .align-bottom{ vertical-align:bottom } .m0{ margin:0 } .mt0{ margin-top:0 } .mr0{ margin-right:0 } .mb0{ margin-bottom:0 } .ml0{ margin-left:0 } .mx0{ margin-left:0; margin-right:0 } .my0{ margin-top:0; margin-bottom:0 } .m1{ margin: .5rem } .mt1{ margin-top: .5rem } .mr1{ margin-right: .5rem } .mb1{ margin-bottom: .5rem } .ml1{ margin-left: .5rem } .mx1{ margin-left: .5rem; margin-right: .5rem } .my1{ margin-top: .5rem; margin-bottom: .5rem } .m2{ margin: 1rem } .mt2{ margin-top: 1rem } .mr2{ margin-right: 1rem } .mb2{ margin-bottom: 1rem } .ml2{ margin-left: 1rem } .mx2{ margin-left: 1rem; margin-right: 1rem } .my2{ margin-top: 1rem; margin-bottom: 1rem } .m3{ margin: 2rem } .mt3{ margin-top: 2rem } .mr3{ margin-right: 2rem } .mb3{ margin-bottom: 2rem } .ml3{ margin-left: 2rem } .mx3{ margin-left: 2rem; margin-right: 2rem } .my3{ margin-top: 2rem; margin-bottom: 2rem } .m4{ margin: 4rem } .mt4{ margin-top: 4rem } .mr4{ margin-right: 4rem } .mb4{ margin-bottom: 4rem } .ml4{ margin-left: 4rem } .mx4{ margin-left: 4rem; margin-right: 4rem } .my4{ margin-top: 4rem; margin-bottom: 4rem } .mxn1{ margin-left: -.5rem; margin-right: -.5rem; } .mxn2{ margin-left: -1rem; margin-right: -1rem; } .mxn3{ margin-left: -2rem; margin-right: -2rem; } .mxn4{ margin-left: -4rem; margin-right: -4rem; } .ml-auto{ margin-left:auto } .mr-auto{ margin-right:auto } .mx-auto{ margin-left:auto; margin-right:auto; } .p0{ padding:0 } .pt0{ padding-top:0 } .pr0{ padding-right:0 } .pb0{ padding-bottom:0 } .pl0{ padding-left:0 } .px0{ padding-left:0; padding-right:0 } .py0{ padding-top:0; padding-bottom:0 } .p1{ padding: .5rem } .pt1{ padding-top: .5rem } .pr1{ padding-right: .5rem } .pb1{ padding-bottom: .5rem } .pl1{ padding-left: .5rem } .py1{ padding-top: .5rem; padding-bottom: .5rem } .px1{ padding-left: .5rem; padding-right: .5rem } .p2{ padding: 1rem } .pt2{ padding-top: 1rem } .pr2{ padding-right: 1rem } .pb2{ padding-bottom: 1rem } .pl2{ padding-left: 1rem } .py2{ padding-top: 1rem; padding-bottom: 1rem } .px2{ padding-left: 1rem; padding-right: 1rem } .p3{ padding: 2rem } .pt3{ padding-top: 2rem } .pr3{ padding-right: 2rem } .pb3{ padding-bottom: 2rem } .pl3{ padding-left: 2rem } .py3{ padding-top: 2rem; padding-bottom: 2rem } .px3{ padding-left: 2rem; padding-right: 2rem } .p4{ padding: 4rem } .pt4{ padding-top: 4rem } .pr4{ padding-right: 4rem } .pb4{ padding-bottom: 4rem } .pl4{ padding-left: 4rem } .py4{ padding-top: 4rem; padding-bottom: 4rem } .px4{ padding-left: 4rem; padding-right: 4rem } .col{ float:left; box-sizing:border-box; } .col-right{ float:right; box-sizing:border-box; } .col-1{ width:8.33333%; } .col-2{ width:16.66667%; } .col-3{ width:25%; } .col-4{ width:33.33333%; } .col-5{ width:41.66667%; } .col-6{ width:50%; } .col-7{ width:58.33333%; } .col-8{ width:66.66667%; } .col-9{ width:75%; } .col-10{ width:83.33333%; } .col-11{ width:91.66667%; } .col-12{ width:100%; } @media (min-width: 40em){ .sm-col{ float:left; box-sizing:border-box; } .sm-col-right{ float:right; box-sizing:border-box; } .sm-col-1{ width:8.33333%; } .sm-col-2{ width:16.66667%; } .sm-col-3{ width:25%; } .sm-col-4{ width:33.33333%; } .sm-col-5{ width:41.66667%; } .sm-col-6{ width:50%; } .sm-col-7{ width:58.33333%; } .sm-col-8{ width:66.66667%; } .sm-col-9{ width:75%; } .sm-col-10{ width:83.33333%; } .sm-col-11{ width:91.66667%; } .sm-col-12{ width:100%; } } @media (min-width: 52em){ .md-col{ float:left; box-sizing:border-box; } .md-col-right{ float:right; box-sizing:border-box; } .md-col-1{ width:8.33333%; } .md-col-2{ width:16.66667%; } .md-col-3{ width:25%; } .md-col-4{ width:33.33333%; } .md-col-5{ width:41.66667%; } .md-col-6{ width:50%; } .md-col-7{ width:58.33333%; } .md-col-8{ width:66.66667%; } .md-col-9{ width:75%; } .md-col-10{ width:83.33333%; } .md-col-11{ width:91.66667%; } .md-col-12{ width:100%; } } @media (min-width: 64em){ .lg-col{ float:left; box-sizing:border-box; } .lg-col-right{ float:right; box-sizing:border-box; } .lg-col-1{ width:8.33333%; } .lg-col-2{ width:16.66667%; } .lg-col-3{ width:25%; } .lg-col-4{ width:33.33333%; } .lg-col-5{ width:41.66667%; } .lg-col-6{ width:50%; } .lg-col-7{ width:58.33333%; } .lg-col-8{ width:66.66667%; } .lg-col-9{ width:75%; } .lg-col-10{ width:83.33333%; } .lg-col-11{ width:91.66667%; } .lg-col-12{ width:100%; } } .flex{ display:-webkit-box; display:-webkit-flex; display:-ms-flexbox; display:flex } @media (min-width: 40em){ .sm-flex{ display:-webkit-box; display:-webkit-flex; display:-ms-flexbox; display:flex } } @media (min-width: 52em){ .md-flex{ display:-webkit-box; display:-webkit-flex; display:-ms-flexbox; display:flex } } @media (min-width: 64em){ .lg-flex{ display:-webkit-box; display:-webkit-flex; display:-ms-flexbox; display:flex } } .flex-column{ -webkit-box-orient:vertical; -webkit-box-direction:normal; -webkit-flex-direction:column; -ms-flex-direction:column; flex-direction:column } .flex-wrap{ -webkit-flex-wrap:wrap; -ms-flex-wrap:wrap; flex-wrap:wrap } .items-start{ -webkit-box-align:start; -webkit-align-items:flex-start; -ms-flex-align:start; -ms-grid-row-align:flex-start; align-items:flex-start } .items-end{ -webkit-box-align:end; -webkit-align-items:flex-end; -ms-flex-align:end; -ms-grid-row-align:flex-end; align-items:flex-end } .items-center{ -webkit-box-align:center; -webkit-align-items:center; -ms-flex-align:center; -ms-grid-row-align:center; align-items:center } .items-baseline{ -webkit-box-align:baseline; -webkit-align-items:baseline; -ms-flex-align:baseline; -ms-grid-row-align:baseline; align-items:baseline } .items-stretch{ -webkit-box-align:stretch; -webkit-align-items:stretch; -ms-flex-align:stretch; -ms-grid-row-align:stretch; align-items:stretch } .self-start{ -webkit-align-self:flex-start; -ms-flex-item-align:start; align-self:flex-start } .self-end{ -webkit-align-self:flex-end; -ms-flex-item-align:end; align-self:flex-end } .self-center{ -webkit-align-self:center; -ms-flex-item-align:center; align-self:center } .self-baseline{ -webkit-align-self:baseline; -ms-flex-item-align:baseline; align-self:baseline } .self-stretch{ -webkit-align-self:stretch; -ms-flex-item-align:stretch; align-self:stretch } .justify-start{ -webkit-box-pack:start; -webkit-justify-content:flex-start; -ms-flex-pack:start; justify-content:flex-start } .justify-end{ -webkit-box-pack:end; -webkit-justify-content:flex-end; -ms-flex-pack:end; justify-content:flex-end } .justify-center{ -webkit-box-pack:center; -webkit-justify-content:center; -ms-flex-pack:center; justify-content:center } .justify-between{ -webkit-box-pack:justify; -webkit-justify-content:space-between; -ms-flex-pack:justify; justify-content:space-between } .justify-around{ -webkit-justify-content:space-around; -ms-flex-pack:distribute; justify-content:space-around } .content-start{ -webkit-align-content:flex-start; -ms-flex-line-pack:start; align-content:flex-start } .content-end{ -webkit-align-content:flex-end; -ms-flex-line-pack:end; align-content:flex-end } .content-center{ -webkit-align-content:center; -ms-flex-line-pack:center; align-content:center } .content-between{ -webkit-align-content:space-between; -ms-flex-line-pack:justify; align-content:space-between } .content-around{ -webkit-align-content:space-around; -ms-flex-line-pack:distribute; align-content:space-around } .content-stretch{ -webkit-align-content:stretch; -ms-flex-line-pack:stretch; align-content:stretch } .flex-auto{ -webkit-box-flex:1; -webkit-flex:1 1 auto; -ms-flex:1 1 auto; flex:1 1 auto; min-width:0; min-height:0; } .flex-none{ -webkit-box-flex:0; -webkit-flex:none; -ms-flex:none; flex:none } .order-0{ -webkit-box-ordinal-group:1; -webkit-order:0; -ms-flex-order:0; order:0 } .order-1{ -webkit-box-ordinal-group:2; -webkit-order:1; -ms-flex-order:1; order:1 } .order-2{ -webkit-box-ordinal-group:3; -webkit-order:2; -ms-flex-order:2; order:2 } .order-3{ -webkit-box-ordinal-group:4; -webkit-order:3; -ms-flex-order:3; order:3 } .order-last{ -webkit-box-ordinal-group:100000; -webkit-order:99999; -ms-flex-order:99999; order:99999 } .relative{ position:relative } .absolute{ position:absolute } .fixed{ position:fixed } .top-0{ top:0 } .right-0{ right:0 } .bottom-0{ bottom:0 } .left-0{ left:0 } .z1{ z-index: 1 } .z2{ z-index: 2 } .z3{ z-index: 3 } .z4{ z-index: 4 } .border{ border-style:solid; border-width: 1px; } .border-top{ border-top-style:solid; border-top-width: 1px; } .border-right{ border-right-style:solid; border-right-width: 1px; } .border-bottom{ border-bottom-style:solid; border-bottom-width: 1px; } .border-left{ border-left-style:solid; border-left-width: 1px; } .border-none{ border:0 } .rounded{ border-radius: 3px } .circle{ border-radius:50% } .rounded-top{ border-radius: 3px 3px 0 0 } .rounded-right{ border-radius: 0 3px 3px 0 } .rounded-bottom{ border-radius: 0 0 3px 3px } .rounded-left{ border-radius: 3px 0 0 3px } .not-rounded{ border-radius:0 } .hide{ position:absolute !important; height:1px; width:1px; overflow:hidden; clip:rect(1px, 1px, 1px, 1px); } @media (max-width: 40em){ .xs-hide{ display:none !important } } @media (min-width: 40em) and (max-width: 52em){ .sm-hide{ display:none !important } } @media (min-width: 52em) and (max-width: 64em){ .md-hide{ display:none !important } } @media (min-width: 64em){ .lg-hide{ display:none !important } } .display-none{ display:none !important } ================================================ FILE: docs-theme/assets/docs.js ================================================ /* global anchors */ // add anchor links to headers anchors.options.placement = 'left'; anchors.add('h3'); // Filter UI var tocElements = document.getElementById('toc') .getElementsByTagName('li'); document.getElementById('filter-input') .addEventListener('keyup', function (e) { var i, element, children; // enter key if (e.keyCode === 13) { // go to the first displayed item in the toc for (i = 0; i < tocElements.length; i++) { element = tocElements[i]; if (!element.classList.contains('display-none')) { location.replace(element.firstChild.href); return e.preventDefault(); } } } var match = function () { return true; }; var value = this.value.toLowerCase(); if (!value.match(/^\s*$/)) { match = function (element) { return element.firstChild.innerHTML.toLowerCase().indexOf(value) !== -1; }; } for (i = 0; i < tocElements.length; i++) { element = tocElements[i]; children = Array.from(element.getElementsByTagName('li')); if (match(element) || children.some(match)) { element.classList.remove('display-none'); } else { element.classList.add('display-none'); } } }); var toggles = document.getElementsByClassName('toggle-step-sibling'); for (var i = 0; i < toggles.length; i++) { toggles[i].addEventListener('click', toggleStepSibling); } function toggleStepSibling() { var stepSibling = this.parentNode.parentNode.parentNode.getElementsByClassName('toggle-target')[0]; var klass = 'display-none'; if (stepSibling.classList.contains(klass)) { stepSibling.classList.remove(klass); stepSibling.innerHTML = '▾'; } else { stepSibling.classList.add(klass); stepSibling.innerHTML = '▸'; } } var items = document.getElementsByClassName('toggle-sibling'); for (var j = 0; j < items.length; j++) { items[j].addEventListener('click', toggleSibling); } function toggleSibling() { var stepSibling = this.parentNode.getElementsByClassName('toggle-target')[0]; var icon = this.getElementsByClassName('icon')[0]; var klass = 'display-none'; if (stepSibling.classList.contains(klass)) { stepSibling.classList.remove(klass); icon.innerHTML = '▾'; } else { stepSibling.classList.add(klass); icon.innerHTML = '▸'; } } function showHashTarget(targetId) { var hashTarget = document.getElementById(targetId); // new target is hidden if (hashTarget && hashTarget.offsetHeight === 0 && hashTarget.parentNode.parentNode.classList.contains('display-none')) { hashTarget.parentNode.parentNode.classList.remove('display-none'); } } window.addEventListener('hashchange', function() { showHashTarget(location.hash.substring(1)); }); showHashTarget(location.hash.substring(1)); var toclinks = document.getElementsByClassName('pre-open'); for (var k = 0; k < toclinks.length; k++) { toclinks[k].addEventListener('mousedown', preOpen, false); } function preOpen() { showHashTarget(this.hash.substring(1)); } ================================================ FILE: docs-theme/assets/fonts/LICENSE.txt ================================================ Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL ----------------------------------------------------------- SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ----------------------------------------------------------- PREAMBLE The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others. The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives. DEFINITIONS "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation. "Reserved Font Name" refers to any names specified as such after the copyright statement(s). "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s). "Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment. "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software. PERMISSION & CONDITIONS Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions: 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself. 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user. 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users. 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission. 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software. TERMINATION This license becomes null and void if any of the above conditions are not met. DISCLAIMER THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. ================================================ FILE: docs-theme/assets/fonts/source-code-pro.css ================================================ @font-face{ font-family: 'Source Code Pro'; font-weight: 400; font-style: normal; font-stretch: normal; src: url('EOT/SourceCodePro-Regular.eot') format('embedded-opentype'), url('WOFF2/TTF/SourceCodePro-Regular.ttf.woff2') format('woff2'), url('WOFF/OTF/SourceCodePro-Regular.otf.woff') format('woff'), url('OTF/SourceCodePro-Regular.otf') format('opentype'), url('TTF/SourceCodePro-Regular.ttf') format('truetype'); } @font-face{ font-family: 'Source Code Pro'; font-weight: 700; font-style: normal; font-stretch: normal; src: url('EOT/SourceCodePro-Bold.eot') format('embedded-opentype'), url('WOFF2/TTF/SourceCodePro-Bold.ttf.woff2') format('woff2'), url('WOFF/OTF/SourceCodePro-Bold.otf.woff') format('woff'), url('OTF/SourceCodePro-Bold.otf') format('opentype'), url('TTF/SourceCodePro-Bold.ttf') format('truetype'); } ================================================ FILE: docs-theme/assets/github.css ================================================ /* grayscale style (c) MY Sun */ .hljs { display: block; overflow-x: auto; padding: 0.5em; color: #333; background: #fff; } .hljs-comment, .hljs-quote { color: #777; font-style: italic; } .hljs-keyword, .hljs-selector-tag, .hljs-subst { color: #333; font-weight: bold; } .hljs-string, .hljs-doctag, .hljs-formula, .hljs-number, .hljs-literal { color: #333; } .hljs-title, .hljs-section, .hljs-selector-id { color: #000; font-weight: bold; } .hljs-subst { font-weight: normal; } .hljs-class .hljs-title, .hljs-type, .hljs-name { color: #333; font-weight: bold; } .hljs-tag { color: #333; } .hljs-regexp { color: #333; } .hljs-symbol, .hljs-bullet, .hljs-link { color: #000; } .hljs-built_in, .hljs-builtin-name { color: #000; text-decoration: underline; } .hljs-meta { color: #999; font-weight: bold; } .hljs-deletion { color: #fff; } .hljs-addition { color: #000; } .hljs-emphasis { font-style: italic; } .hljs-strong { font-weight: bold; } ================================================ FILE: docs-theme/assets/highlight.pack.js ================================================ /*! highlight.js v9.9.0 | BSD3 License | git.io/hljslicense */ !function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/[&<>]/gm,function(e){return I[e]})}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function i(e){return k.test(e)}function a(e){var n,t,r,a,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",t=B.exec(o))return R(t[1])?t[1]:"no-highlight";for(o=o.split(/\s+/),n=0,r=o.length;r>n;n++)if(a=o[n],i(a)||R(a))return a}function o(e,n){var t,r={};for(t in e)r[t]=e[t];if(n)for(t in n)r[t]=n[t];return r}function u(e){var n=[];return function r(e,i){for(var a=e.firstChild;a;a=a.nextSibling)3===a.nodeType?i+=a.nodeValue.length:1===a.nodeType&&(n.push({event:"start",offset:i,node:a}),i=r(a,i),t(a).match(/br|hr|img|input/)||n.push({event:"stop",offset:i,node:a}));return i}(e,0),n}function c(e,r,i){function a(){return e.length&&r.length?e[0].offset!==r[0].offset?e[0].offset"}function u(e){l+=""}function c(e){("start"===e.event?o:u)(e.node)}for(var s=0,l="",f=[];e.length||r.length;){var g=a();if(l+=n(i.substring(s,g[0].offset)),s=g[0].offset,g===e){f.reverse().forEach(u);do c(g.splice(0,1)[0]),g=a();while(g===e&&g.length&&g[0].offset===s);f.reverse().forEach(o)}else"start"===g[0].event?f.push(g[0].node):f.pop(),c(g.splice(0,1)[0])}return l+n(i.substr(s))}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(i,a){if(!i.compiled){if(i.compiled=!0,i.k=i.k||i.bK,i.k){var u={},c=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");u[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof i.k?c("keyword",i.k):E(i.k).forEach(function(e){c(e,i.k[e])}),i.k=u}i.lR=t(i.l||/\w+/,!0),a&&(i.bK&&(i.b="\\b("+i.bK.split(" ").join("|")+")\\b"),i.b||(i.b=/\B|\b/),i.bR=t(i.b),i.e||i.eW||(i.e=/\B|\b/),i.e&&(i.eR=t(i.e)),i.tE=n(i.e)||"",i.eW&&a.tE&&(i.tE+=(i.e?"|":"")+a.tE)),i.i&&(i.iR=t(i.i)),null==i.r&&(i.r=1),i.c||(i.c=[]);var s=[];i.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push("self"===e?i:e)}),i.c=s,i.c.forEach(function(e){r(e,i)}),i.starts&&r(i.starts,a);var l=i.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([i.tE,i.i]).map(n).filter(Boolean);i.t=l.length?t(l.join("|"),!0):{exec:function(){return null}}}}r(e)}function l(e,t,i,a){function o(e,n){var t,i;for(t=0,i=n.c.length;i>t;t++)if(r(n.c[t].bR,e))return n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function c(e,n){return!i&&r(n.iR,e)}function g(e,n){var t=N.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function h(e,n,t,r){var i=r?"":y.classPrefix,a='',a+n+o}function p(){var e,t,r,i;if(!E.k)return n(B);for(i="",t=0,E.lR.lastIndex=0,r=E.lR.exec(B);r;)i+=n(B.substring(t,r.index)),e=g(E,r),e?(M+=e[1],i+=h(e[0],n(r[0]))):i+=n(r[0]),t=E.lR.lastIndex,r=E.lR.exec(B);return i+n(B.substr(t))}function d(){var e="string"==typeof E.sL;if(e&&!x[E.sL])return n(B);var t=e?l(E.sL,B,!0,L[E.sL]):f(B,E.sL.length?E.sL:void 0);return E.r>0&&(M+=t.r),e&&(L[E.sL]=t.top),h(t.language,t.value,!1,!0)}function b(){k+=null!=E.sL?d():p(),B=""}function v(e){k+=e.cN?h(e.cN,"",!0):"",E=Object.create(e,{parent:{value:E}})}function m(e,n){if(B+=e,null==n)return b(),0;var t=o(n,E);if(t)return t.skip?B+=n:(t.eB&&(B+=n),b(),t.rB||t.eB||(B=n)),v(t,n),t.rB?0:n.length;var r=u(E,n);if(r){var i=E;i.skip?B+=n:(i.rE||i.eE||(B+=n),b(),i.eE&&(B=n));do E.cN&&(k+=C),E.skip||(M+=E.r),E=E.parent;while(E!==r.parent);return r.starts&&v(r.starts,""),i.rE?0:n.length}if(c(n,E))throw new Error('Illegal lexeme "'+n+'" for mode "'+(E.cN||"")+'"');return B+=n,n.length||1}var N=R(e);if(!N)throw new Error('Unknown language: "'+e+'"');s(N);var w,E=a||N,L={},k="";for(w=E;w!==N;w=w.parent)w.cN&&(k=h(w.cN,"",!0)+k);var B="",M=0;try{for(var I,j,O=0;;){if(E.t.lastIndex=O,I=E.t.exec(t),!I)break;j=m(t.substring(O,I.index),I[0]),O=I.index+j}for(m(t.substr(O)),w=E;w.parent;w=w.parent)w.cN&&(k+=C);return{r:M,value:k,language:e,top:E}}catch(T){if(T.message&&-1!==T.message.indexOf("Illegal"))return{r:0,value:n(t)};throw T}}function f(e,t){t=t||y.languages||E(x);var r={r:0,value:n(e)},i=r;return t.filter(R).forEach(function(n){var t=l(n,e,!1);t.language=n,t.r>i.r&&(i=t),t.r>r.r&&(i=r,r=t)}),i.language&&(r.second_best=i),r}function g(e){return y.tabReplace||y.useBR?e.replace(M,function(e,n){return y.useBR&&"\n"===e?"
":y.tabReplace?n.replace(/\t/g,y.tabReplace):void 0}):e}function h(e,n,t){var r=n?L[n]:t,i=[e.trim()];return e.match(/\bhljs\b/)||i.push("hljs"),-1===e.indexOf(r)&&i.push(r),i.join(" ").trim()}function p(e){var n,t,r,o,s,p=a(e);i(p)||(y.useBR?(n=document.createElementNS("http://www.w3.org/1999/xhtml","div"),n.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):n=e,s=n.textContent,r=p?l(p,s,!0):f(s),t=u(n),t.length&&(o=document.createElementNS("http://www.w3.org/1999/xhtml","div"),o.innerHTML=r.value,r.value=c(t,u(o),s)),r.value=g(r.value),e.innerHTML=r.value,e.className=h(e.className,p,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function d(e){y=o(y,e)}function b(){if(!b.called){b.called=!0;var e=document.querySelectorAll("pre code");w.forEach.call(e,p)}}function v(){addEventListener("DOMContentLoaded",b,!1),addEventListener("load",b,!1)}function m(n,t){var r=x[n]=t(e);r.aliases&&r.aliases.forEach(function(e){L[e]=n})}function N(){return E(x)}function R(e){return e=(e||"").toLowerCase(),x[e]||x[L[e]]}var w=[],E=Object.keys,x={},L={},k=/^(no-?highlight|plain|text)$/i,B=/\blang(?:uage)?-([\w-]+)\b/i,M=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,C="
",y={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},I={"&":"&","<":"<",">":">"};return e.highlight=l,e.highlightAuto=f,e.fixMarkup=g,e.highlightBlock=p,e.configure=d,e.initHighlighting=b,e.initHighlightingOnLoad=v,e.registerLanguage=m,e.listLanguages=N,e.getLanguage=R,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|like)\b/},e.C=function(n,t,r){var i=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return i.c.push(e.PWM),i.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),i},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e.METHOD_GUARD={b:"\\.\\s*"+e.UIR,r:0},e});hljs.registerLanguage("javascript",function(e){var r="[A-Za-z$_][0-9A-Za-z$_]*",t={keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},a={cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},n={cN:"subst",b:"\\$\\{",e:"\\}",k:t,c:[]},c={cN:"string",b:"`",e:"`",c:[e.BE,n]};n.c=[e.ASM,e.QSM,c,a,e.RM];var s=n.c.concat([e.CBCM,e.CLCM]);return{aliases:["js","jsx"],k:t,c:[{cN:"meta",r:10,b:/^\s*['"]use (strict|asm)['"]/},{cN:"meta",b:/^#!/,e:/$/},e.ASM,e.QSM,c,e.CLCM,e.CBCM,a,{b:/[{,]\s*/,r:0,c:[{b:r+"\\s*:",rB:!0,r:0,c:[{cN:"attr",b:r,r:0}]}]},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{cN:"function",b:"(\\(.*?\\)|"+r+")\\s*=>",rB:!0,e:"\\s*=>",c:[{cN:"params",v:[{b:r},{b:/\(\s*\)/},{b:/\(/,e:/\)/,eB:!0,eE:!0,k:t,c:s}]}]},{b://,sL:"xml",c:[{b:/<\w+\s*\/>/,skip:!0},{b:/<\w+/,e:/(\/\w+|\w+\/)>/,skip:!0,c:[{b:/<\w+\s*\/>/,skip:!0},"self"]}]}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:r}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:s}],i:/\[|%/},{b:/\$[(.]/},e.METHOD_GUARD,{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]},{bK:"constructor",e:/\{/,eE:!0}],i:/#(?!!)/}}); // Line numbers plugin !function(e){"use strict";function t(){"complete"===document.readyState?n():e.addEventListener("DOMContentLoaded",n)}function n(){try{var e=document.querySelectorAll("code.hljs");for(var t in e)e.hasOwnProperty(t)&&r(e[t])}catch(n){console.error("LineNumbers error: ",n)}}function r(e){if("object"==typeof e){var t=e.parentNode,n=o(t.textContent);if(n>1){for(var r="",c=0;n>c;c++)r+=c+1+"\n";var l=document.createElement("code");l.className="hljs hljs-line-numbers",l.style["float"]="left",l.textContent=r,t.insertBefore(l,e)}}}function o(e){if(0===e.length)return 0;var t=/\r\n|\r|\n/g,n=e.match(t);return n=n?n.length:0,e[e.length-1].match(t)||(n+=1),n}"undefined"==typeof e.hljs?console.error("highlight.js not detected!"):(e.hljs.initLineNumbersOnLoad=t,e.hljs.lineNumbersBlock=r)}(window); ================================================ FILE: docs-theme/assets/script.js ================================================ Object.assign(window, polished) console.log('> console.log(polished)') console.log(polished) ================================================ FILE: docs-theme/assets/style.css ================================================ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; color: #222; line-height: 1.5; font-size: 16px; } .documentation { background: #65daa2; } .home { background: #65daa2; color: #fff!important; } .header { text-align: center; margin-top: 5em; } .logo { height: 10em; background-color: #fff; } .home h2, .home h3 { text-shadow: 0 1px 1px #3a9b6d; text-shadow: 0 1px 1px rgba(58, 155, 109, 0.37); } .home a { color: #fff!important; text-decoration: underline; } .home h2 { font-size: 2em; } .home h3 { font-size: 1.5em; } .installation { margin-bottom: 1.5em; margin-top: 1.5em; color: #fff; } .command, .javascript { background-color: #3a9b6d; color: #d6f5e6; border-radius: 4px; padding: 0.5em 1.5em; display: inline-block; font-size: 1em; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06); } #installation ~ .installation, #usage ~ .usage { text-align: center; margin-bottom: 0; } .command:before { content: "$"; margin-right: 0.5em; } .button { background-color: #ff583f; border-bottom: 4px solid #D7493A; border-radius: 4px; padding: 1em 2em; color: #fff!important; font-weight: bold; font-size: 1em; display: inline-block; text-decoration: none!important; } .button img { height: 1em; width: 1em; transform: translateY(0.1em); margin-right: 0.5em; } .button:hover { text-decoration: none; border-bottom: 5px solid #D7493A; transform: translateY(-1px); margin-bottom: -1px; } .button:active { text-decoration: none; border-bottom: 3px solid #D7493A; transform: translateY(1px); margin-bottom: 1px; } .main { text-align: center; max-width: 35em; text-align: left; margin: 0 auto; width: 100%; text-shadow: 0 1px 1px #3a9b6d; text-shadow: 0 1px 1px rgba(58, 155, 109, 0.37); } .repl { position: relative; width: 100%; max-width: 35em; height: 10em; display: flex; flex-direction: row; margin: 2em auto; background: #48be85; padding: 1em; border-radius: 4px; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06); } .repl__input, .repl__output { position: relative; text-align: left; padding: 0; margin: 0; width: 50%; overflow: scroll; color: #1e7b4f; } .repl__arg { font-weight: bold; } .repl__func { color: #0a291a; font-weight: bold; } .footer { text-align: center; text-shadow: 0 1px 1px #3a9b6d; text-shadow: 0 1px 1px rgba(58, 155, 109, 0.37); } .bg-white { background-color: #fff; } h4 { margin: 20px 0 10px 0; } .documentation h3 { color: #000; } .border-bottom { border-color: #ddd; } a { color: #0D3523; text-decoration: none; } .section__heading { text-align: center; color: #fff; text-shadow: 0 1px 1px #3a9b6d; text-shadow: 0 1px 1px rgba(58, 155, 109, 0.37); font-size: 2em; } .documentation a[href]:hover { text-decoration: underline; } a:hover { cursor: pointer; } .py1-ul li { padding: 5px 0; } .max-height-100 { max-height: 100%; } section:target h3 { font-weight:700; } .documentation td, .documentation th { padding: .25rem .25rem; } h1:hover .anchorjs-link, h2:hover .anchorjs-link, h3:hover .anchorjs-link, h4:hover .anchorjs-link { opacity: 1; } .fix-3 { width: 25%; max-width: 244px; } .fix-3 { width: 25%; max-width: 244px; } @media (min-width: 52em) { .fix-margin-3 { margin-left: 25%; } } .pre, pre, code, .code { font-family: Source Code Pro,Menlo,Consolas,Liberation Mono,monospace; font-size: 14px; } .fill-light { background: #F9F9F9; } .width2 { width: 1rem; } .input { font-family: inherit; display: block; width: 100%; height: 2rem; padding: .5rem; margin-bottom: 1rem; border: 1px solid #ccc; font-size: .875rem; border-radius: 3px; box-sizing: border-box; } table { border-collapse: collapse; } .prose table th, .prose table td { text-align: left; padding:8px; border:1px solid #ddd; } .prose table th:nth-child(1) { border-right: none; } .prose table th:nth-child(2) { border-left: none; } .prose table { border:1px solid #ddd; } .prose-big { font-size: 18px; line-height: 30px; } .quiet { opacity: 0.7; } .minishadow { box-shadow: 2px 2px 10px #f3f3f3; } ================================================ FILE: docs-theme/docs/index._ ================================================

<%- config.name %>

    <% docs.forEach(function(doc) { %> <% var hasMembers = doc.members.static.length || doc.members.instance.length %>
  • <%- doc.name %> <% if (hasMembers) { %><% } %> <% if (hasMembers) { %> <% } %>
  • <% }) %>
<% docs.forEach(function(s) { %> <% if (s.kind !== 'note') { %> <%= renderSection({ section: s, renderSection: renderSection, renderSectionList: renderSectionList }) %> <% } else { %>
<%=renderNote({ note: s })%>
<% } %> <% }) %>
================================================ FILE: docs-theme/index._ ================================================

A lightweight toolset for writing styles in JavaScript

View on GitHub Docs

Installation

npm install --save polished

Usage

import { lighten, modularScale } from 'polished'

Open the console and play around with it!

const styles = {
  color: lighten(0.2, '#000'),
  "font-size": modularScale(1),
  [hiDPI(1.5)]: {
    "font-size": modularScale(1.25)
  }
}
const styles = {
  color: '#333',
  "font-size": '1.33em',
  '@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 1.5/1), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx)': {
    "font-size": '1.66625em',
  }
}
================================================ FILE: docs-theme/index.js ================================================ const fs = require('fs') const path = require('path') const File = require('vinyl') const vfs = require('vinyl-fs') const _ = require('lodash') const concat = require('concat-stream') const GithubSlugger = require('github-slugger') const createFormatters = require('documentation').util.createFormatters const LinkerStack = require('documentation').util.LinkerStack const hljs = require('highlight.js') function isFunction(section) { return ( section.kind === 'function' || (section.kind === 'typedef' && section.type.type === 'NameExpression' && section.type.name === 'Function') ) } module.exports = function (comments, config, callback) { const linkerStack = new LinkerStack(config).namespaceResolver( comments, function (namespace) { const slugger = new GithubSlugger() return '#' + slugger.slug(namespace) } ) const formatters = createFormatters(linkerStack.link) hljs.configure(config.hljs || {}) const sharedImports = { imports: { slug(str) { let slugger = new GithubSlugger() return slugger.slug(str) }, shortSignature(section) { let prefix = '' if (section.kind === 'class') { prefix = 'new ' } else if (!isFunction(section)) { return section.name } return prefix + section.name + formatters.parameters(section, true) }, signature(section) { let returns = '' let prefix = '' if (section.kind === 'class') { prefix = 'new ' } else if (!isFunction(section)) { return section.name } if (section.returns.length) { returns = ': ' + formatters.type(section.returns[0].type) } return prefix + section.name + formatters.parameters(section) + returns }, md(ast, inline) { if ( inline && ast && ast.children.length && ast.children[0].type === 'paragraph' ) { ast = { type: 'root', children: ast.children[0].children.concat(ast.children.slice(1)) } } return formatters.markdown(ast) }, formatType: formatters.type, autolink: formatters.autolink, highlight(example) { if (config.hljs && config.hljs.highlightAuto) { return hljs.highlightAuto(example).value } return hljs.highlight('js', example).value } } } sharedImports.imports.renderSectionList = _.template(fs.readFileSync(path.join(__dirname, 'partials/section_list._'), 'utf8'), sharedImports) sharedImports.imports.renderSection = _.template(fs.readFileSync(path.join(__dirname, 'partials/section._'), 'utf8'), sharedImports) sharedImports.imports.renderNote = _.template(fs.readFileSync(path.join(__dirname, 'partials/note._'), 'utf8'), sharedImports) sharedImports.imports.renderDocs = _.template(fs.readFileSync(path.join(__dirname, 'docs/index._'), 'utf8'), sharedImports) sharedImports.imports.renderHome = _.template(fs.readFileSync(path.join(__dirname, 'index._'), 'utf8'), sharedImports) const mainTemplate = _.template(fs.readFileSync(path.join(__dirname, 'partials/base._'), 'utf8'), sharedImports) const pages = [{ path: 'index.html', }, { path: 'docs/index.html', data: { docs: comments, }, }] const pageTemplate = _.template( fs.readFileSync(path.join(__dirname, 'index._'), 'utf8'), sharedImports ) // push assets into the pipeline as well. return new Promise(resolve => { vfs.src([`${__dirname}/assets/**`, `${__dirname}/favicon.png`], { base: __dirname }) .pipe(concat(function (files) { resolve( files.concat( pages.map((page) => { const data = Object.assign({}, { config, }, page.data) const compiled = mainTemplate(data) return new File({ path: page.path, contents: Buffer.from(compiled, 'utf8'), }) }) ) ) }) ) }) } ================================================ FILE: docs-theme/partials/base._ ================================================ polished | <% if (typeof docs !== 'undefined') { %>Documentation<% } else { %>A lightweight toolset for writing styles in JavaScript<% } %> documentation<% } else { %>home<% } %>'> <% if (typeof docs !== 'undefined') { %> <%= renderDocs({ config: config, docs: docs, renderSection: renderSection, renderSectionList: renderSectionList, renderNote: renderNote, }) %> <% } else { %> <%= renderHome({ config: config, }) %> <% } %> <% if (typeof docs !== 'undefined') { %> <% } else { %> <% } %> ================================================ FILE: docs-theme/partials/note._ ================================================

<%- note.name %>

<% if (note.description) { %> <%= md(note.description) %> <% } %>
================================================ FILE: docs-theme/partials/section._ ================================================
<% if (typeof nested === 'undefined' || (section.context && section.context.github)) { %>
<% if (typeof nested === 'undefined') { %>

<%- section.name %>

<% } %> <% if (section.context && section.context.github) { %> <%= section.context.path %> <% } %>
<% } %> <%= md(section.description) %>
<%= signature(section) %>
<% if (section.type) { %>

Type: <%= formatType(section.type) %>

<% } %> <% if (section.augments) { %>

Extends <% if (section.augments) { %> <%= section.augments.map(function(tag) { return autolink(tag.name); }).join(', ') %> <% } %>

<% } %> <% if (section.version) { %>
Version: <%- section.version %>
<% }%> <% if (section.license) { %>
License: <%- section.license %>
<% }%> <% if (section.author) { %>
Author: <%- section.author %>
<% }%> <% if (section.copyright) { %>
Copyright: <%- section.copyright %>
<% }%> <% if (section.since) { %>
Since: <%- section.since %>
<% }%> <% if (section.params) { %>
Parameters
<% section.params.forEach(function(param) { %>
<%- param.name%> (<%= formatType(param.type) %><% if (param.default) { %> = <%- param.default %><% } %>) <%= md(param.description, true) %>
<% if (param.properties) { %> <% param.properties.forEach(function(property) { %> <% }) %>
Name Description
<%- property.name %> <%= formatType(property.type) %> <% if (property.default) { %> (default <%- property.default %>) <% } %> <%= md(property.description, true) %>
<% } %>
<% }) %>
<% } %> <% if (section.properties) { %>
Properties
<% section.properties.forEach(function(property) { %>
<%- property.name%> (<%= formatType(property.type) %>) <% if (property.default) { %> (default <%- property.default %>) <% } %><% if (property.description) { %>: <%= md(property.description, true) %><% } %> <% if (property.properties) { %>
    <% property.properties.forEach(function(property) { %>
  • <%- property.name %> <%= formatType(property.type) %> <% if (property.default) { %> (default <%- property.default %>) <% } %> <%= md(property.description) %>
  • <% }) %>
<% } %>
<% }) %>
<% } %> <% if (section.returns) { %> <% section.returns.forEach(function(ret) { %>
Returns
<%= formatType(ret.type) %><% if (ret.description) { %>: <%= md(ret.description, true) %> <% }%> <% }) %> <% } %> <% if (section.throws) { %>
Throws
    <% section.throws.forEach(function(throws) { %>
  • <%= formatType(throws.type) %>: <%= md(throws.description, true) %>
  • <% }); %>
<% } %> <% if (section.examples) { %>
Example
<% section.examples.forEach(function(example) { %> <% if (example.caption) { %>

<%= md(example.caption) %>

<% } %>
<%= highlight(example.description) %>
<% }) %> <% } %> <% if (section.members.static && section.members.static.length) { %>
Static Members
<%= renderSectionList({ members: section.members.static, renderSection: renderSection, noun: 'Static Member' }) %> <% } %> <% if (section.members.instance && section.members.instance.length) { %>
Instance Members
<%= renderSectionList({ members: section.members.instance, renderSection: renderSection, noun: 'Instance Member' }) %> <% } %> <% if (section.members.events && section.members.events.length) { %>
Events
<%= renderSectionList({ members: section.members.events, renderSection: renderSection, noun: 'Event' }) %> <% } %>
================================================ FILE: docs-theme/partials/section_list._ ================================================
<% members.forEach(function(member) { %>
<%= shortSignature(member) %>
<% }) %>
================================================ FILE: flow-typed/npm/@babel/cli_vx.x.x.js ================================================ // flow-typed signature: cc1d1a2ec09f3b899ef47a856742f08f // flow-typed version: <>/@babel/cli_v^7.4.4/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * '@babel/cli' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module '@babel/cli' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module '@babel/cli/bin/babel-external-helpers' { declare module.exports: any; } declare module '@babel/cli/bin/babel' { declare module.exports: any; } declare module '@babel/cli/lib/babel-external-helpers' { declare module.exports: any; } declare module '@babel/cli/lib/babel/dir' { declare module.exports: any; } declare module '@babel/cli/lib/babel/file' { declare module.exports: any; } declare module '@babel/cli/lib/babel/index' { declare module.exports: any; } declare module '@babel/cli/lib/babel/options' { declare module.exports: any; } declare module '@babel/cli/lib/babel/util' { declare module.exports: any; } // Filename aliases declare module '@babel/cli/bin/babel-external-helpers.js' { declare module.exports: $Exports<'@babel/cli/bin/babel-external-helpers'>; } declare module '@babel/cli/bin/babel.js' { declare module.exports: $Exports<'@babel/cli/bin/babel'>; } declare module '@babel/cli/index' { declare module.exports: $Exports<'@babel/cli'>; } declare module '@babel/cli/index.js' { declare module.exports: $Exports<'@babel/cli'>; } declare module '@babel/cli/lib/babel-external-helpers.js' { declare module.exports: $Exports<'@babel/cli/lib/babel-external-helpers'>; } declare module '@babel/cli/lib/babel/dir.js' { declare module.exports: $Exports<'@babel/cli/lib/babel/dir'>; } declare module '@babel/cli/lib/babel/file.js' { declare module.exports: $Exports<'@babel/cli/lib/babel/file'>; } declare module '@babel/cli/lib/babel/index.js' { declare module.exports: $Exports<'@babel/cli/lib/babel/index'>; } declare module '@babel/cli/lib/babel/options.js' { declare module.exports: $Exports<'@babel/cli/lib/babel/options'>; } declare module '@babel/cli/lib/babel/util.js' { declare module.exports: $Exports<'@babel/cli/lib/babel/util'>; } ================================================ FILE: flow-typed/npm/@babel/core_vx.x.x.js ================================================ // flow-typed signature: 2b173c73804c7b43d7d6c738802c5ad0 // flow-typed version: <>/@babel/core_v^7.4.5/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * '@babel/core' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module '@babel/core' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module '@babel/core/lib/config/caching' { declare module.exports: any; } declare module '@babel/core/lib/config/config-chain' { declare module.exports: any; } declare module '@babel/core/lib/config/config-descriptors' { declare module.exports: any; } declare module '@babel/core/lib/config/files/configuration' { declare module.exports: any; } declare module '@babel/core/lib/config/files/index-browser' { declare module.exports: any; } declare module '@babel/core/lib/config/files/index' { declare module.exports: any; } declare module '@babel/core/lib/config/files/package' { declare module.exports: any; } declare module '@babel/core/lib/config/files/plugins' { declare module.exports: any; } declare module '@babel/core/lib/config/files/types' { declare module.exports: any; } declare module '@babel/core/lib/config/files/utils' { declare module.exports: any; } declare module '@babel/core/lib/config/full' { declare module.exports: any; } declare module '@babel/core/lib/config/helpers/config-api' { declare module.exports: any; } declare module '@babel/core/lib/config/helpers/environment' { declare module.exports: any; } declare module '@babel/core/lib/config/index' { declare module.exports: any; } declare module '@babel/core/lib/config/item' { declare module.exports: any; } declare module '@babel/core/lib/config/partial' { declare module.exports: any; } declare module '@babel/core/lib/config/pattern-to-regex' { declare module.exports: any; } declare module '@babel/core/lib/config/plugin' { declare module.exports: any; } declare module '@babel/core/lib/config/util' { declare module.exports: any; } declare module '@babel/core/lib/config/validation/option-assertions' { declare module.exports: any; } declare module '@babel/core/lib/config/validation/options' { declare module.exports: any; } declare module '@babel/core/lib/config/validation/plugins' { declare module.exports: any; } declare module '@babel/core/lib/config/validation/removed' { declare module.exports: any; } declare module '@babel/core/lib/index' { declare module.exports: any; } declare module '@babel/core/lib/parse' { declare module.exports: any; } declare module '@babel/core/lib/tools/build-external-helpers' { declare module.exports: any; } declare module '@babel/core/lib/transform-ast' { declare module.exports: any; } declare module '@babel/core/lib/transform-file-browser' { declare module.exports: any; } declare module '@babel/core/lib/transform-file' { declare module.exports: any; } declare module '@babel/core/lib/transform' { declare module.exports: any; } declare module '@babel/core/lib/transformation/block-hoist-plugin' { declare module.exports: any; } declare module '@babel/core/lib/transformation/file/file' { declare module.exports: any; } declare module '@babel/core/lib/transformation/file/generate' { declare module.exports: any; } declare module '@babel/core/lib/transformation/file/merge-map' { declare module.exports: any; } declare module '@babel/core/lib/transformation/index' { declare module.exports: any; } declare module '@babel/core/lib/transformation/normalize-file' { declare module.exports: any; } declare module '@babel/core/lib/transformation/normalize-opts' { declare module.exports: any; } declare module '@babel/core/lib/transformation/plugin-pass' { declare module.exports: any; } declare module '@babel/core/lib/transformation/util/missing-plugin-helper' { declare module.exports: any; } // Filename aliases declare module '@babel/core/lib/config/caching.js' { declare module.exports: $Exports<'@babel/core/lib/config/caching'>; } declare module '@babel/core/lib/config/config-chain.js' { declare module.exports: $Exports<'@babel/core/lib/config/config-chain'>; } declare module '@babel/core/lib/config/config-descriptors.js' { declare module.exports: $Exports<'@babel/core/lib/config/config-descriptors'>; } declare module '@babel/core/lib/config/files/configuration.js' { declare module.exports: $Exports<'@babel/core/lib/config/files/configuration'>; } declare module '@babel/core/lib/config/files/index-browser.js' { declare module.exports: $Exports<'@babel/core/lib/config/files/index-browser'>; } declare module '@babel/core/lib/config/files/index.js' { declare module.exports: $Exports<'@babel/core/lib/config/files/index'>; } declare module '@babel/core/lib/config/files/package.js' { declare module.exports: $Exports<'@babel/core/lib/config/files/package'>; } declare module '@babel/core/lib/config/files/plugins.js' { declare module.exports: $Exports<'@babel/core/lib/config/files/plugins'>; } declare module '@babel/core/lib/config/files/types.js' { declare module.exports: $Exports<'@babel/core/lib/config/files/types'>; } declare module '@babel/core/lib/config/files/utils.js' { declare module.exports: $Exports<'@babel/core/lib/config/files/utils'>; } declare module '@babel/core/lib/config/full.js' { declare module.exports: $Exports<'@babel/core/lib/config/full'>; } declare module '@babel/core/lib/config/helpers/config-api.js' { declare module.exports: $Exports<'@babel/core/lib/config/helpers/config-api'>; } declare module '@babel/core/lib/config/helpers/environment.js' { declare module.exports: $Exports<'@babel/core/lib/config/helpers/environment'>; } declare module '@babel/core/lib/config/index.js' { declare module.exports: $Exports<'@babel/core/lib/config/index'>; } declare module '@babel/core/lib/config/item.js' { declare module.exports: $Exports<'@babel/core/lib/config/item'>; } declare module '@babel/core/lib/config/partial.js' { declare module.exports: $Exports<'@babel/core/lib/config/partial'>; } declare module '@babel/core/lib/config/pattern-to-regex.js' { declare module.exports: $Exports<'@babel/core/lib/config/pattern-to-regex'>; } declare module '@babel/core/lib/config/plugin.js' { declare module.exports: $Exports<'@babel/core/lib/config/plugin'>; } declare module '@babel/core/lib/config/util.js' { declare module.exports: $Exports<'@babel/core/lib/config/util'>; } declare module '@babel/core/lib/config/validation/option-assertions.js' { declare module.exports: $Exports<'@babel/core/lib/config/validation/option-assertions'>; } declare module '@babel/core/lib/config/validation/options.js' { declare module.exports: $Exports<'@babel/core/lib/config/validation/options'>; } declare module '@babel/core/lib/config/validation/plugins.js' { declare module.exports: $Exports<'@babel/core/lib/config/validation/plugins'>; } declare module '@babel/core/lib/config/validation/removed.js' { declare module.exports: $Exports<'@babel/core/lib/config/validation/removed'>; } declare module '@babel/core/lib/index.js' { declare module.exports: $Exports<'@babel/core/lib/index'>; } declare module '@babel/core/lib/parse.js' { declare module.exports: $Exports<'@babel/core/lib/parse'>; } declare module '@babel/core/lib/tools/build-external-helpers.js' { declare module.exports: $Exports<'@babel/core/lib/tools/build-external-helpers'>; } declare module '@babel/core/lib/transform-ast.js' { declare module.exports: $Exports<'@babel/core/lib/transform-ast'>; } declare module '@babel/core/lib/transform-file-browser.js' { declare module.exports: $Exports<'@babel/core/lib/transform-file-browser'>; } declare module '@babel/core/lib/transform-file.js' { declare module.exports: $Exports<'@babel/core/lib/transform-file'>; } declare module '@babel/core/lib/transform.js' { declare module.exports: $Exports<'@babel/core/lib/transform'>; } declare module '@babel/core/lib/transformation/block-hoist-plugin.js' { declare module.exports: $Exports<'@babel/core/lib/transformation/block-hoist-plugin'>; } declare module '@babel/core/lib/transformation/file/file.js' { declare module.exports: $Exports<'@babel/core/lib/transformation/file/file'>; } declare module '@babel/core/lib/transformation/file/generate.js' { declare module.exports: $Exports<'@babel/core/lib/transformation/file/generate'>; } declare module '@babel/core/lib/transformation/file/merge-map.js' { declare module.exports: $Exports<'@babel/core/lib/transformation/file/merge-map'>; } declare module '@babel/core/lib/transformation/index.js' { declare module.exports: $Exports<'@babel/core/lib/transformation/index'>; } declare module '@babel/core/lib/transformation/normalize-file.js' { declare module.exports: $Exports<'@babel/core/lib/transformation/normalize-file'>; } declare module '@babel/core/lib/transformation/normalize-opts.js' { declare module.exports: $Exports<'@babel/core/lib/transformation/normalize-opts'>; } declare module '@babel/core/lib/transformation/plugin-pass.js' { declare module.exports: $Exports<'@babel/core/lib/transformation/plugin-pass'>; } declare module '@babel/core/lib/transformation/util/missing-plugin-helper.js' { declare module.exports: $Exports<'@babel/core/lib/transformation/util/missing-plugin-helper'>; } ================================================ FILE: flow-typed/npm/@babel/plugin-transform-runtime_vx.x.x.js ================================================ // flow-typed signature: fc3f45535d1387236a5fa25031c434e1 // flow-typed version: <>/@babel/plugin-transform-runtime_v^7.4.4/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * '@babel/plugin-transform-runtime' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module '@babel/plugin-transform-runtime' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module '@babel/plugin-transform-runtime/lib/helpers' { declare module.exports: any; } declare module '@babel/plugin-transform-runtime/lib/index' { declare module.exports: any; } declare module '@babel/plugin-transform-runtime/lib/runtime-corejs2-definitions' { declare module.exports: any; } declare module '@babel/plugin-transform-runtime/lib/runtime-corejs3-definitions' { declare module.exports: any; } // Filename aliases declare module '@babel/plugin-transform-runtime/lib/helpers.js' { declare module.exports: $Exports<'@babel/plugin-transform-runtime/lib/helpers'>; } declare module '@babel/plugin-transform-runtime/lib/index.js' { declare module.exports: $Exports<'@babel/plugin-transform-runtime/lib/index'>; } declare module '@babel/plugin-transform-runtime/lib/runtime-corejs2-definitions.js' { declare module.exports: $Exports<'@babel/plugin-transform-runtime/lib/runtime-corejs2-definitions'>; } declare module '@babel/plugin-transform-runtime/lib/runtime-corejs3-definitions.js' { declare module.exports: $Exports<'@babel/plugin-transform-runtime/lib/runtime-corejs3-definitions'>; } ================================================ FILE: flow-typed/npm/@babel/polyfill_v7.x.x.js ================================================ // flow-typed signature: ebc6e7724cd1da0d1a8b10de36bd7a94 // flow-typed version: 7b122e75af/@babel/polyfill_v7.x.x/flow_>=v0.30.x declare module '@babel/polyfill' {} ================================================ FILE: flow-typed/npm/@babel/preset-env_vx.x.x.js ================================================ // flow-typed signature: 24548170611add19813d134b566d66d1 // flow-typed version: <>/@babel/preset-env_v^7.4.5/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * '@babel/preset-env' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module '@babel/preset-env' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module '@babel/preset-env/data/built-ins.json' { declare module.exports: any; } declare module '@babel/preset-env/data/corejs2-built-in-features' { declare module.exports: any; } declare module '@babel/preset-env/data/plugin-features' { declare module.exports: any; } declare module '@babel/preset-env/data/shipped-proposals' { declare module.exports: any; } declare module '@babel/preset-env/data/unreleased-labels' { declare module.exports: any; } declare module '@babel/preset-env/lib/available-plugins' { declare module.exports: any; } declare module '@babel/preset-env/lib/debug' { declare module.exports: any; } declare module '@babel/preset-env/lib/filter-items' { declare module.exports: any; } declare module '@babel/preset-env/lib/get-option-specific-excludes' { declare module.exports: any; } declare module '@babel/preset-env/lib/index' { declare module.exports: any; } declare module '@babel/preset-env/lib/module-transformations' { declare module.exports: any; } declare module '@babel/preset-env/lib/normalize-options' { declare module.exports: any; } declare module '@babel/preset-env/lib/options' { declare module.exports: any; } declare module '@babel/preset-env/lib/polyfills/corejs2/built-in-definitions' { declare module.exports: any; } declare module '@babel/preset-env/lib/polyfills/corejs2/entry-plugin' { declare module.exports: any; } declare module '@babel/preset-env/lib/polyfills/corejs2/get-platform-specific-default' { declare module.exports: any; } declare module '@babel/preset-env/lib/polyfills/corejs2/usage-plugin' { declare module.exports: any; } declare module '@babel/preset-env/lib/polyfills/corejs3/built-in-definitions' { declare module.exports: any; } declare module '@babel/preset-env/lib/polyfills/corejs3/entry-plugin' { declare module.exports: any; } declare module '@babel/preset-env/lib/polyfills/corejs3/shipped-proposals' { declare module.exports: any; } declare module '@babel/preset-env/lib/polyfills/corejs3/usage-plugin' { declare module.exports: any; } declare module '@babel/preset-env/lib/polyfills/regenerator/entry-plugin' { declare module.exports: any; } declare module '@babel/preset-env/lib/polyfills/regenerator/usage-plugin' { declare module.exports: any; } declare module '@babel/preset-env/lib/targets-parser' { declare module.exports: any; } declare module '@babel/preset-env/lib/utils' { declare module.exports: any; } // Filename aliases declare module '@babel/preset-env/data/built-ins.json.js' { declare module.exports: $Exports<'@babel/preset-env/data/built-ins.json'>; } declare module '@babel/preset-env/data/corejs2-built-in-features.js' { declare module.exports: $Exports<'@babel/preset-env/data/corejs2-built-in-features'>; } declare module '@babel/preset-env/data/plugin-features.js' { declare module.exports: $Exports<'@babel/preset-env/data/plugin-features'>; } declare module '@babel/preset-env/data/shipped-proposals.js' { declare module.exports: $Exports<'@babel/preset-env/data/shipped-proposals'>; } declare module '@babel/preset-env/data/unreleased-labels.js' { declare module.exports: $Exports<'@babel/preset-env/data/unreleased-labels'>; } declare module '@babel/preset-env/lib/available-plugins.js' { declare module.exports: $Exports<'@babel/preset-env/lib/available-plugins'>; } declare module '@babel/preset-env/lib/debug.js' { declare module.exports: $Exports<'@babel/preset-env/lib/debug'>; } declare module '@babel/preset-env/lib/filter-items.js' { declare module.exports: $Exports<'@babel/preset-env/lib/filter-items'>; } declare module '@babel/preset-env/lib/get-option-specific-excludes.js' { declare module.exports: $Exports<'@babel/preset-env/lib/get-option-specific-excludes'>; } declare module '@babel/preset-env/lib/index.js' { declare module.exports: $Exports<'@babel/preset-env/lib/index'>; } declare module '@babel/preset-env/lib/module-transformations.js' { declare module.exports: $Exports<'@babel/preset-env/lib/module-transformations'>; } declare module '@babel/preset-env/lib/normalize-options.js' { declare module.exports: $Exports<'@babel/preset-env/lib/normalize-options'>; } declare module '@babel/preset-env/lib/options.js' { declare module.exports: $Exports<'@babel/preset-env/lib/options'>; } declare module '@babel/preset-env/lib/polyfills/corejs2/built-in-definitions.js' { declare module.exports: $Exports<'@babel/preset-env/lib/polyfills/corejs2/built-in-definitions'>; } declare module '@babel/preset-env/lib/polyfills/corejs2/entry-plugin.js' { declare module.exports: $Exports<'@babel/preset-env/lib/polyfills/corejs2/entry-plugin'>; } declare module '@babel/preset-env/lib/polyfills/corejs2/get-platform-specific-default.js' { declare module.exports: $Exports<'@babel/preset-env/lib/polyfills/corejs2/get-platform-specific-default'>; } declare module '@babel/preset-env/lib/polyfills/corejs2/usage-plugin.js' { declare module.exports: $Exports<'@babel/preset-env/lib/polyfills/corejs2/usage-plugin'>; } declare module '@babel/preset-env/lib/polyfills/corejs3/built-in-definitions.js' { declare module.exports: $Exports<'@babel/preset-env/lib/polyfills/corejs3/built-in-definitions'>; } declare module '@babel/preset-env/lib/polyfills/corejs3/entry-plugin.js' { declare module.exports: $Exports<'@babel/preset-env/lib/polyfills/corejs3/entry-plugin'>; } declare module '@babel/preset-env/lib/polyfills/corejs3/shipped-proposals.js' { declare module.exports: $Exports<'@babel/preset-env/lib/polyfills/corejs3/shipped-proposals'>; } declare module '@babel/preset-env/lib/polyfills/corejs3/usage-plugin.js' { declare module.exports: $Exports<'@babel/preset-env/lib/polyfills/corejs3/usage-plugin'>; } declare module '@babel/preset-env/lib/polyfills/regenerator/entry-plugin.js' { declare module.exports: $Exports<'@babel/preset-env/lib/polyfills/regenerator/entry-plugin'>; } declare module '@babel/preset-env/lib/polyfills/regenerator/usage-plugin.js' { declare module.exports: $Exports<'@babel/preset-env/lib/polyfills/regenerator/usage-plugin'>; } declare module '@babel/preset-env/lib/targets-parser.js' { declare module.exports: $Exports<'@babel/preset-env/lib/targets-parser'>; } declare module '@babel/preset-env/lib/utils.js' { declare module.exports: $Exports<'@babel/preset-env/lib/utils'>; } ================================================ FILE: flow-typed/npm/@babel/preset-flow_vx.x.x.js ================================================ // flow-typed signature: 8f6e2f930870c67d675794ffc0d9b144 // flow-typed version: <>/@babel/preset-flow_v^7.0.0/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * '@babel/preset-flow' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module '@babel/preset-flow' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module '@babel/preset-flow/lib/index' { declare module.exports: any; } // Filename aliases declare module '@babel/preset-flow/lib/index.js' { declare module.exports: $Exports<'@babel/preset-flow/lib/index'>; } ================================================ FILE: flow-typed/npm/@babel/runtime_vx.x.x.js ================================================ // flow-typed signature: 9e01724c2e66dfd3fae8ada8dc737b85 // flow-typed version: <>/@babel/runtime_v^7.4.5/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * '@babel/runtime' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module '@babel/runtime' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module '@babel/runtime/helpers/applyDecoratedDescriptor' { declare module.exports: any; } declare module '@babel/runtime/helpers/arrayWithHoles' { declare module.exports: any; } declare module '@babel/runtime/helpers/arrayWithoutHoles' { declare module.exports: any; } declare module '@babel/runtime/helpers/assertThisInitialized' { declare module.exports: any; } declare module '@babel/runtime/helpers/AsyncGenerator' { declare module.exports: any; } declare module '@babel/runtime/helpers/asyncGeneratorDelegate' { declare module.exports: any; } declare module '@babel/runtime/helpers/asyncIterator' { declare module.exports: any; } declare module '@babel/runtime/helpers/asyncToGenerator' { declare module.exports: any; } declare module '@babel/runtime/helpers/awaitAsyncGenerator' { declare module.exports: any; } declare module '@babel/runtime/helpers/AwaitValue' { declare module.exports: any; } declare module '@babel/runtime/helpers/classCallCheck' { declare module.exports: any; } declare module '@babel/runtime/helpers/classNameTDZError' { declare module.exports: any; } declare module '@babel/runtime/helpers/classPrivateFieldGet' { declare module.exports: any; } declare module '@babel/runtime/helpers/classPrivateFieldLooseBase' { declare module.exports: any; } declare module '@babel/runtime/helpers/classPrivateFieldLooseKey' { declare module.exports: any; } declare module '@babel/runtime/helpers/classPrivateFieldSet' { declare module.exports: any; } declare module '@babel/runtime/helpers/classPrivateMethodGet' { declare module.exports: any; } declare module '@babel/runtime/helpers/classPrivateMethodSet' { declare module.exports: any; } declare module '@babel/runtime/helpers/classStaticPrivateFieldSpecGet' { declare module.exports: any; } declare module '@babel/runtime/helpers/classStaticPrivateFieldSpecSet' { declare module.exports: any; } declare module '@babel/runtime/helpers/classStaticPrivateMethodGet' { declare module.exports: any; } declare module '@babel/runtime/helpers/classStaticPrivateMethodSet' { declare module.exports: any; } declare module '@babel/runtime/helpers/construct' { declare module.exports: any; } declare module '@babel/runtime/helpers/createClass' { declare module.exports: any; } declare module '@babel/runtime/helpers/decorate' { declare module.exports: any; } declare module '@babel/runtime/helpers/defaults' { declare module.exports: any; } declare module '@babel/runtime/helpers/defineEnumerableProperties' { declare module.exports: any; } declare module '@babel/runtime/helpers/defineProperty' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/applyDecoratedDescriptor' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/arrayWithHoles' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/arrayWithoutHoles' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/assertThisInitialized' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/AsyncGenerator' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/asyncGeneratorDelegate' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/asyncIterator' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/asyncToGenerator' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/awaitAsyncGenerator' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/AwaitValue' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/classCallCheck' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/classNameTDZError' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/classPrivateFieldGet' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/classPrivateFieldLooseBase' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/classPrivateFieldLooseKey' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/classPrivateFieldSet' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/classPrivateMethodGet' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/classPrivateMethodSet' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/classStaticPrivateMethodGet' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/classStaticPrivateMethodSet' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/construct' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/createClass' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/decorate' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/defaults' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/defineEnumerableProperties' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/defineProperty' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/extends' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/get' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/getPrototypeOf' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/inherits' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/inheritsLoose' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/initializerDefineProperty' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/initializerWarningHelper' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/instanceof' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/interopRequireDefault' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/interopRequireWildcard' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/isNativeFunction' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/iterableToArray' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/iterableToArrayLimit' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/iterableToArrayLimitLoose' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/jsx' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/newArrowCheck' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/nonIterableRest' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/nonIterableSpread' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/objectDestructuringEmpty' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/objectSpread' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/objectWithoutProperties' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/possibleConstructorReturn' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/readOnlyError' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/set' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/setPrototypeOf' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/skipFirstGeneratorNext' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/slicedToArray' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/slicedToArrayLoose' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/superPropBase' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/taggedTemplateLiteral' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/taggedTemplateLiteralLoose' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/temporalRef' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/temporalUndefined' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/toArray' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/toConsumableArray' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/toPrimitive' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/toPropertyKey' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/typeof' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/wrapAsyncGenerator' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/wrapNativeSuper' { declare module.exports: any; } declare module '@babel/runtime/helpers/esm/wrapRegExp' { declare module.exports: any; } declare module '@babel/runtime/helpers/extends' { declare module.exports: any; } declare module '@babel/runtime/helpers/get' { declare module.exports: any; } declare module '@babel/runtime/helpers/getPrototypeOf' { declare module.exports: any; } declare module '@babel/runtime/helpers/inherits' { declare module.exports: any; } declare module '@babel/runtime/helpers/inheritsLoose' { declare module.exports: any; } declare module '@babel/runtime/helpers/initializerDefineProperty' { declare module.exports: any; } declare module '@babel/runtime/helpers/initializerWarningHelper' { declare module.exports: any; } declare module '@babel/runtime/helpers/instanceof' { declare module.exports: any; } declare module '@babel/runtime/helpers/interopRequireDefault' { declare module.exports: any; } declare module '@babel/runtime/helpers/interopRequireWildcard' { declare module.exports: any; } declare module '@babel/runtime/helpers/isNativeFunction' { declare module.exports: any; } declare module '@babel/runtime/helpers/iterableToArray' { declare module.exports: any; } declare module '@babel/runtime/helpers/iterableToArrayLimit' { declare module.exports: any; } declare module '@babel/runtime/helpers/iterableToArrayLimitLoose' { declare module.exports: any; } declare module '@babel/runtime/helpers/jsx' { declare module.exports: any; } declare module '@babel/runtime/helpers/newArrowCheck' { declare module.exports: any; } declare module '@babel/runtime/helpers/nonIterableRest' { declare module.exports: any; } declare module '@babel/runtime/helpers/nonIterableSpread' { declare module.exports: any; } declare module '@babel/runtime/helpers/objectDestructuringEmpty' { declare module.exports: any; } declare module '@babel/runtime/helpers/objectSpread' { declare module.exports: any; } declare module '@babel/runtime/helpers/objectWithoutProperties' { declare module.exports: any; } declare module '@babel/runtime/helpers/objectWithoutPropertiesLoose' { declare module.exports: any; } declare module '@babel/runtime/helpers/possibleConstructorReturn' { declare module.exports: any; } declare module '@babel/runtime/helpers/readOnlyError' { declare module.exports: any; } declare module '@babel/runtime/helpers/set' { declare module.exports: any; } declare module '@babel/runtime/helpers/setPrototypeOf' { declare module.exports: any; } declare module '@babel/runtime/helpers/skipFirstGeneratorNext' { declare module.exports: any; } declare module '@babel/runtime/helpers/slicedToArray' { declare module.exports: any; } declare module '@babel/runtime/helpers/slicedToArrayLoose' { declare module.exports: any; } declare module '@babel/runtime/helpers/superPropBase' { declare module.exports: any; } declare module '@babel/runtime/helpers/taggedTemplateLiteral' { declare module.exports: any; } declare module '@babel/runtime/helpers/taggedTemplateLiteralLoose' { declare module.exports: any; } declare module '@babel/runtime/helpers/temporalRef' { declare module.exports: any; } declare module '@babel/runtime/helpers/temporalUndefined' { declare module.exports: any; } declare module '@babel/runtime/helpers/toArray' { declare module.exports: any; } declare module '@babel/runtime/helpers/toConsumableArray' { declare module.exports: any; } declare module '@babel/runtime/helpers/toPrimitive' { declare module.exports: any; } declare module '@babel/runtime/helpers/toPropertyKey' { declare module.exports: any; } declare module '@babel/runtime/helpers/typeof' { declare module.exports: any; } declare module '@babel/runtime/helpers/wrapAsyncGenerator' { declare module.exports: any; } declare module '@babel/runtime/helpers/wrapNativeSuper' { declare module.exports: any; } declare module '@babel/runtime/helpers/wrapRegExp' { declare module.exports: any; } declare module '@babel/runtime/regenerator/index' { declare module.exports: any; } // Filename aliases declare module '@babel/runtime/helpers/applyDecoratedDescriptor.js' { declare module.exports: $Exports<'@babel/runtime/helpers/applyDecoratedDescriptor'>; } declare module '@babel/runtime/helpers/arrayWithHoles.js' { declare module.exports: $Exports<'@babel/runtime/helpers/arrayWithHoles'>; } declare module '@babel/runtime/helpers/arrayWithoutHoles.js' { declare module.exports: $Exports<'@babel/runtime/helpers/arrayWithoutHoles'>; } declare module '@babel/runtime/helpers/assertThisInitialized.js' { declare module.exports: $Exports<'@babel/runtime/helpers/assertThisInitialized'>; } declare module '@babel/runtime/helpers/AsyncGenerator.js' { declare module.exports: $Exports<'@babel/runtime/helpers/AsyncGenerator'>; } declare module '@babel/runtime/helpers/asyncGeneratorDelegate.js' { declare module.exports: $Exports<'@babel/runtime/helpers/asyncGeneratorDelegate'>; } declare module '@babel/runtime/helpers/asyncIterator.js' { declare module.exports: $Exports<'@babel/runtime/helpers/asyncIterator'>; } declare module '@babel/runtime/helpers/asyncToGenerator.js' { declare module.exports: $Exports<'@babel/runtime/helpers/asyncToGenerator'>; } declare module '@babel/runtime/helpers/awaitAsyncGenerator.js' { declare module.exports: $Exports<'@babel/runtime/helpers/awaitAsyncGenerator'>; } declare module '@babel/runtime/helpers/AwaitValue.js' { declare module.exports: $Exports<'@babel/runtime/helpers/AwaitValue'>; } declare module '@babel/runtime/helpers/classCallCheck.js' { declare module.exports: $Exports<'@babel/runtime/helpers/classCallCheck'>; } declare module '@babel/runtime/helpers/classNameTDZError.js' { declare module.exports: $Exports<'@babel/runtime/helpers/classNameTDZError'>; } declare module '@babel/runtime/helpers/classPrivateFieldGet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateFieldGet'>; } declare module '@babel/runtime/helpers/classPrivateFieldLooseBase.js' { declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateFieldLooseBase'>; } declare module '@babel/runtime/helpers/classPrivateFieldLooseKey.js' { declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateFieldLooseKey'>; } declare module '@babel/runtime/helpers/classPrivateFieldSet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateFieldSet'>; } declare module '@babel/runtime/helpers/classPrivateMethodGet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateMethodGet'>; } declare module '@babel/runtime/helpers/classPrivateMethodSet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/classPrivateMethodSet'>; } declare module '@babel/runtime/helpers/classStaticPrivateFieldSpecGet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/classStaticPrivateFieldSpecGet'>; } declare module '@babel/runtime/helpers/classStaticPrivateFieldSpecSet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/classStaticPrivateFieldSpecSet'>; } declare module '@babel/runtime/helpers/classStaticPrivateMethodGet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/classStaticPrivateMethodGet'>; } declare module '@babel/runtime/helpers/classStaticPrivateMethodSet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/classStaticPrivateMethodSet'>; } declare module '@babel/runtime/helpers/construct.js' { declare module.exports: $Exports<'@babel/runtime/helpers/construct'>; } declare module '@babel/runtime/helpers/createClass.js' { declare module.exports: $Exports<'@babel/runtime/helpers/createClass'>; } declare module '@babel/runtime/helpers/decorate.js' { declare module.exports: $Exports<'@babel/runtime/helpers/decorate'>; } declare module '@babel/runtime/helpers/defaults.js' { declare module.exports: $Exports<'@babel/runtime/helpers/defaults'>; } declare module '@babel/runtime/helpers/defineEnumerableProperties.js' { declare module.exports: $Exports<'@babel/runtime/helpers/defineEnumerableProperties'>; } declare module '@babel/runtime/helpers/defineProperty.js' { declare module.exports: $Exports<'@babel/runtime/helpers/defineProperty'>; } declare module '@babel/runtime/helpers/esm/applyDecoratedDescriptor.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/applyDecoratedDescriptor'>; } declare module '@babel/runtime/helpers/esm/arrayWithHoles.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/arrayWithHoles'>; } declare module '@babel/runtime/helpers/esm/arrayWithoutHoles.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/arrayWithoutHoles'>; } declare module '@babel/runtime/helpers/esm/assertThisInitialized.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/assertThisInitialized'>; } declare module '@babel/runtime/helpers/esm/AsyncGenerator.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/AsyncGenerator'>; } declare module '@babel/runtime/helpers/esm/asyncGeneratorDelegate.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/asyncGeneratorDelegate'>; } declare module '@babel/runtime/helpers/esm/asyncIterator.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/asyncIterator'>; } declare module '@babel/runtime/helpers/esm/asyncToGenerator.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/asyncToGenerator'>; } declare module '@babel/runtime/helpers/esm/awaitAsyncGenerator.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/awaitAsyncGenerator'>; } declare module '@babel/runtime/helpers/esm/AwaitValue.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/AwaitValue'>; } declare module '@babel/runtime/helpers/esm/classCallCheck.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/classCallCheck'>; } declare module '@babel/runtime/helpers/esm/classNameTDZError.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/classNameTDZError'>; } declare module '@babel/runtime/helpers/esm/classPrivateFieldGet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateFieldGet'>; } declare module '@babel/runtime/helpers/esm/classPrivateFieldLooseBase.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateFieldLooseBase'>; } declare module '@babel/runtime/helpers/esm/classPrivateFieldLooseKey.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateFieldLooseKey'>; } declare module '@babel/runtime/helpers/esm/classPrivateFieldSet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateFieldSet'>; } declare module '@babel/runtime/helpers/esm/classPrivateMethodGet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateMethodGet'>; } declare module '@babel/runtime/helpers/esm/classPrivateMethodSet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/classPrivateMethodSet'>; } declare module '@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/classStaticPrivateFieldSpecGet'>; } declare module '@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/classStaticPrivateFieldSpecSet'>; } declare module '@babel/runtime/helpers/esm/classStaticPrivateMethodGet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/classStaticPrivateMethodGet'>; } declare module '@babel/runtime/helpers/esm/classStaticPrivateMethodSet.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/classStaticPrivateMethodSet'>; } declare module '@babel/runtime/helpers/esm/construct.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/construct'>; } declare module '@babel/runtime/helpers/esm/createClass.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/createClass'>; } declare module '@babel/runtime/helpers/esm/decorate.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/decorate'>; } declare module '@babel/runtime/helpers/esm/defaults.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/defaults'>; } declare module '@babel/runtime/helpers/esm/defineEnumerableProperties.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/defineEnumerableProperties'>; } declare module '@babel/runtime/helpers/esm/defineProperty.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/defineProperty'>; } declare module '@babel/runtime/helpers/esm/extends.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/extends'>; } declare module '@babel/runtime/helpers/esm/get.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/get'>; } declare module '@babel/runtime/helpers/esm/getPrototypeOf.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/getPrototypeOf'>; } declare module '@babel/runtime/helpers/esm/inherits.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/inherits'>; } declare module '@babel/runtime/helpers/esm/inheritsLoose.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/inheritsLoose'>; } declare module '@babel/runtime/helpers/esm/initializerDefineProperty.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/initializerDefineProperty'>; } declare module '@babel/runtime/helpers/esm/initializerWarningHelper.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/initializerWarningHelper'>; } declare module '@babel/runtime/helpers/esm/instanceof.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/instanceof'>; } declare module '@babel/runtime/helpers/esm/interopRequireDefault.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/interopRequireDefault'>; } declare module '@babel/runtime/helpers/esm/interopRequireWildcard.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/interopRequireWildcard'>; } declare module '@babel/runtime/helpers/esm/isNativeFunction.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/isNativeFunction'>; } declare module '@babel/runtime/helpers/esm/iterableToArray.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/iterableToArray'>; } declare module '@babel/runtime/helpers/esm/iterableToArrayLimit.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/iterableToArrayLimit'>; } declare module '@babel/runtime/helpers/esm/iterableToArrayLimitLoose.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/iterableToArrayLimitLoose'>; } declare module '@babel/runtime/helpers/esm/jsx.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/jsx'>; } declare module '@babel/runtime/helpers/esm/newArrowCheck.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/newArrowCheck'>; } declare module '@babel/runtime/helpers/esm/nonIterableRest.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/nonIterableRest'>; } declare module '@babel/runtime/helpers/esm/nonIterableSpread.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/nonIterableSpread'>; } declare module '@babel/runtime/helpers/esm/objectDestructuringEmpty.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/objectDestructuringEmpty'>; } declare module '@babel/runtime/helpers/esm/objectSpread.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/objectSpread'>; } declare module '@babel/runtime/helpers/esm/objectWithoutProperties.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/objectWithoutProperties'>; } declare module '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/objectWithoutPropertiesLoose'>; } declare module '@babel/runtime/helpers/esm/possibleConstructorReturn.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/possibleConstructorReturn'>; } declare module '@babel/runtime/helpers/esm/readOnlyError.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/readOnlyError'>; } declare module '@babel/runtime/helpers/esm/set.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/set'>; } declare module '@babel/runtime/helpers/esm/setPrototypeOf.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/setPrototypeOf'>; } declare module '@babel/runtime/helpers/esm/skipFirstGeneratorNext.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/skipFirstGeneratorNext'>; } declare module '@babel/runtime/helpers/esm/slicedToArray.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/slicedToArray'>; } declare module '@babel/runtime/helpers/esm/slicedToArrayLoose.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/slicedToArrayLoose'>; } declare module '@babel/runtime/helpers/esm/superPropBase.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/superPropBase'>; } declare module '@babel/runtime/helpers/esm/taggedTemplateLiteral.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/taggedTemplateLiteral'>; } declare module '@babel/runtime/helpers/esm/taggedTemplateLiteralLoose.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/taggedTemplateLiteralLoose'>; } declare module '@babel/runtime/helpers/esm/temporalRef.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/temporalRef'>; } declare module '@babel/runtime/helpers/esm/temporalUndefined.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/temporalUndefined'>; } declare module '@babel/runtime/helpers/esm/toArray.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/toArray'>; } declare module '@babel/runtime/helpers/esm/toConsumableArray.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/toConsumableArray'>; } declare module '@babel/runtime/helpers/esm/toPrimitive.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/toPrimitive'>; } declare module '@babel/runtime/helpers/esm/toPropertyKey.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/toPropertyKey'>; } declare module '@babel/runtime/helpers/esm/typeof.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/typeof'>; } declare module '@babel/runtime/helpers/esm/wrapAsyncGenerator.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/wrapAsyncGenerator'>; } declare module '@babel/runtime/helpers/esm/wrapNativeSuper.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/wrapNativeSuper'>; } declare module '@babel/runtime/helpers/esm/wrapRegExp.js' { declare module.exports: $Exports<'@babel/runtime/helpers/esm/wrapRegExp'>; } declare module '@babel/runtime/helpers/extends.js' { declare module.exports: $Exports<'@babel/runtime/helpers/extends'>; } declare module '@babel/runtime/helpers/get.js' { declare module.exports: $Exports<'@babel/runtime/helpers/get'>; } declare module '@babel/runtime/helpers/getPrototypeOf.js' { declare module.exports: $Exports<'@babel/runtime/helpers/getPrototypeOf'>; } declare module '@babel/runtime/helpers/inherits.js' { declare module.exports: $Exports<'@babel/runtime/helpers/inherits'>; } declare module '@babel/runtime/helpers/inheritsLoose.js' { declare module.exports: $Exports<'@babel/runtime/helpers/inheritsLoose'>; } declare module '@babel/runtime/helpers/initializerDefineProperty.js' { declare module.exports: $Exports<'@babel/runtime/helpers/initializerDefineProperty'>; } declare module '@babel/runtime/helpers/initializerWarningHelper.js' { declare module.exports: $Exports<'@babel/runtime/helpers/initializerWarningHelper'>; } declare module '@babel/runtime/helpers/instanceof.js' { declare module.exports: $Exports<'@babel/runtime/helpers/instanceof'>; } declare module '@babel/runtime/helpers/interopRequireDefault.js' { declare module.exports: $Exports<'@babel/runtime/helpers/interopRequireDefault'>; } declare module '@babel/runtime/helpers/interopRequireWildcard.js' { declare module.exports: $Exports<'@babel/runtime/helpers/interopRequireWildcard'>; } declare module '@babel/runtime/helpers/isNativeFunction.js' { declare module.exports: $Exports<'@babel/runtime/helpers/isNativeFunction'>; } declare module '@babel/runtime/helpers/iterableToArray.js' { declare module.exports: $Exports<'@babel/runtime/helpers/iterableToArray'>; } declare module '@babel/runtime/helpers/iterableToArrayLimit.js' { declare module.exports: $Exports<'@babel/runtime/helpers/iterableToArrayLimit'>; } declare module '@babel/runtime/helpers/iterableToArrayLimitLoose.js' { declare module.exports: $Exports<'@babel/runtime/helpers/iterableToArrayLimitLoose'>; } declare module '@babel/runtime/helpers/jsx.js' { declare module.exports: $Exports<'@babel/runtime/helpers/jsx'>; } declare module '@babel/runtime/helpers/newArrowCheck.js' { declare module.exports: $Exports<'@babel/runtime/helpers/newArrowCheck'>; } declare module '@babel/runtime/helpers/nonIterableRest.js' { declare module.exports: $Exports<'@babel/runtime/helpers/nonIterableRest'>; } declare module '@babel/runtime/helpers/nonIterableSpread.js' { declare module.exports: $Exports<'@babel/runtime/helpers/nonIterableSpread'>; } declare module '@babel/runtime/helpers/objectDestructuringEmpty.js' { declare module.exports: $Exports<'@babel/runtime/helpers/objectDestructuringEmpty'>; } declare module '@babel/runtime/helpers/objectSpread.js' { declare module.exports: $Exports<'@babel/runtime/helpers/objectSpread'>; } declare module '@babel/runtime/helpers/objectWithoutProperties.js' { declare module.exports: $Exports<'@babel/runtime/helpers/objectWithoutProperties'>; } declare module '@babel/runtime/helpers/objectWithoutPropertiesLoose.js' { declare module.exports: $Exports<'@babel/runtime/helpers/objectWithoutPropertiesLoose'>; } declare module '@babel/runtime/helpers/possibleConstructorReturn.js' { declare module.exports: $Exports<'@babel/runtime/helpers/possibleConstructorReturn'>; } declare module '@babel/runtime/helpers/readOnlyError.js' { declare module.exports: $Exports<'@babel/runtime/helpers/readOnlyError'>; } declare module '@babel/runtime/helpers/set.js' { declare module.exports: $Exports<'@babel/runtime/helpers/set'>; } declare module '@babel/runtime/helpers/setPrototypeOf.js' { declare module.exports: $Exports<'@babel/runtime/helpers/setPrototypeOf'>; } declare module '@babel/runtime/helpers/skipFirstGeneratorNext.js' { declare module.exports: $Exports<'@babel/runtime/helpers/skipFirstGeneratorNext'>; } declare module '@babel/runtime/helpers/slicedToArray.js' { declare module.exports: $Exports<'@babel/runtime/helpers/slicedToArray'>; } declare module '@babel/runtime/helpers/slicedToArrayLoose.js' { declare module.exports: $Exports<'@babel/runtime/helpers/slicedToArrayLoose'>; } declare module '@babel/runtime/helpers/superPropBase.js' { declare module.exports: $Exports<'@babel/runtime/helpers/superPropBase'>; } declare module '@babel/runtime/helpers/taggedTemplateLiteral.js' { declare module.exports: $Exports<'@babel/runtime/helpers/taggedTemplateLiteral'>; } declare module '@babel/runtime/helpers/taggedTemplateLiteralLoose.js' { declare module.exports: $Exports<'@babel/runtime/helpers/taggedTemplateLiteralLoose'>; } declare module '@babel/runtime/helpers/temporalRef.js' { declare module.exports: $Exports<'@babel/runtime/helpers/temporalRef'>; } declare module '@babel/runtime/helpers/temporalUndefined.js' { declare module.exports: $Exports<'@babel/runtime/helpers/temporalUndefined'>; } declare module '@babel/runtime/helpers/toArray.js' { declare module.exports: $Exports<'@babel/runtime/helpers/toArray'>; } declare module '@babel/runtime/helpers/toConsumableArray.js' { declare module.exports: $Exports<'@babel/runtime/helpers/toConsumableArray'>; } declare module '@babel/runtime/helpers/toPrimitive.js' { declare module.exports: $Exports<'@babel/runtime/helpers/toPrimitive'>; } declare module '@babel/runtime/helpers/toPropertyKey.js' { declare module.exports: $Exports<'@babel/runtime/helpers/toPropertyKey'>; } declare module '@babel/runtime/helpers/typeof.js' { declare module.exports: $Exports<'@babel/runtime/helpers/typeof'>; } declare module '@babel/runtime/helpers/wrapAsyncGenerator.js' { declare module.exports: $Exports<'@babel/runtime/helpers/wrapAsyncGenerator'>; } declare module '@babel/runtime/helpers/wrapNativeSuper.js' { declare module.exports: $Exports<'@babel/runtime/helpers/wrapNativeSuper'>; } declare module '@babel/runtime/helpers/wrapRegExp.js' { declare module.exports: $Exports<'@babel/runtime/helpers/wrapRegExp'>; } declare module '@babel/runtime/regenerator/index.js' { declare module.exports: $Exports<'@babel/runtime/regenerator/index'>; } ================================================ FILE: flow-typed/npm/babel-eslint_vx.x.x.js ================================================ // flow-typed signature: d999e8032009698035bfbb9b10988092 // flow-typed version: <>/babel-eslint_v^10.0.1/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'babel-eslint' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'babel-eslint' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'babel-eslint/lib/analyze-scope' { declare module.exports: any; } declare module 'babel-eslint/lib/babylon-to-espree/attachComments' { declare module.exports: any; } declare module 'babel-eslint/lib/babylon-to-espree/convertComments' { declare module.exports: any; } declare module 'babel-eslint/lib/babylon-to-espree/convertTemplateType' { declare module.exports: any; } declare module 'babel-eslint/lib/babylon-to-espree/index' { declare module.exports: any; } declare module 'babel-eslint/lib/babylon-to-espree/toAST' { declare module.exports: any; } declare module 'babel-eslint/lib/babylon-to-espree/toToken' { declare module.exports: any; } declare module 'babel-eslint/lib/babylon-to-espree/toTokens' { declare module.exports: any; } declare module 'babel-eslint/lib/index' { declare module.exports: any; } declare module 'babel-eslint/lib/parse-with-scope' { declare module.exports: any; } declare module 'babel-eslint/lib/parse' { declare module.exports: any; } declare module 'babel-eslint/lib/visitor-keys' { declare module.exports: any; } // Filename aliases declare module 'babel-eslint/lib/analyze-scope.js' { declare module.exports: $Exports<'babel-eslint/lib/analyze-scope'>; } declare module 'babel-eslint/lib/babylon-to-espree/attachComments.js' { declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/attachComments'>; } declare module 'babel-eslint/lib/babylon-to-espree/convertComments.js' { declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/convertComments'>; } declare module 'babel-eslint/lib/babylon-to-espree/convertTemplateType.js' { declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/convertTemplateType'>; } declare module 'babel-eslint/lib/babylon-to-espree/index.js' { declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/index'>; } declare module 'babel-eslint/lib/babylon-to-espree/toAST.js' { declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/toAST'>; } declare module 'babel-eslint/lib/babylon-to-espree/toToken.js' { declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/toToken'>; } declare module 'babel-eslint/lib/babylon-to-espree/toTokens.js' { declare module.exports: $Exports<'babel-eslint/lib/babylon-to-espree/toTokens'>; } declare module 'babel-eslint/lib/index.js' { declare module.exports: $Exports<'babel-eslint/lib/index'>; } declare module 'babel-eslint/lib/parse-with-scope.js' { declare module.exports: $Exports<'babel-eslint/lib/parse-with-scope'>; } declare module 'babel-eslint/lib/parse.js' { declare module.exports: $Exports<'babel-eslint/lib/parse'>; } declare module 'babel-eslint/lib/visitor-keys.js' { declare module.exports: $Exports<'babel-eslint/lib/visitor-keys'>; } ================================================ FILE: flow-typed/npm/babel-jest_vx.x.x.js ================================================ // flow-typed signature: ae115502bca9c9f90de9e66e5d177a3d // flow-typed version: <>/babel-jest_v^24.8.0/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'babel-jest' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'babel-jest' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'babel-jest/build/index' { declare module.exports: any; } // Filename aliases declare module 'babel-jest/build/index.js' { declare module.exports: $Exports<'babel-jest/build/index'>; } ================================================ FILE: flow-typed/npm/babel-loader_vx.x.x.js ================================================ // flow-typed signature: 37dca9137ba7cab22de088730065b31b // flow-typed version: <>/babel-loader_v^8.0.6/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'babel-loader' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'babel-loader' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'babel-loader/lib/cache' { declare module.exports: any; } declare module 'babel-loader/lib/Error' { declare module.exports: any; } declare module 'babel-loader/lib/index' { declare module.exports: any; } declare module 'babel-loader/lib/injectCaller' { declare module.exports: any; } declare module 'babel-loader/lib/transform' { declare module.exports: any; } // Filename aliases declare module 'babel-loader/lib/cache.js' { declare module.exports: $Exports<'babel-loader/lib/cache'>; } declare module 'babel-loader/lib/Error.js' { declare module.exports: $Exports<'babel-loader/lib/Error'>; } declare module 'babel-loader/lib/index.js' { declare module.exports: $Exports<'babel-loader/lib/index'>; } declare module 'babel-loader/lib/injectCaller.js' { declare module.exports: $Exports<'babel-loader/lib/injectCaller'>; } declare module 'babel-loader/lib/transform.js' { declare module.exports: $Exports<'babel-loader/lib/transform'>; } ================================================ FILE: flow-typed/npm/babel-plugin-add-module-exports_vx.x.x.js ================================================ // flow-typed signature: f2b00cf82efb6e9a6dcc2b976034b6bc // flow-typed version: <>/babel-plugin-add-module-exports_v^1.0.2/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'babel-plugin-add-module-exports' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'babel-plugin-add-module-exports' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'babel-plugin-add-module-exports/lib/index' { declare module.exports: any; } // Filename aliases declare module 'babel-plugin-add-module-exports/lib/index.js' { declare module.exports: $Exports<'babel-plugin-add-module-exports/lib/index'>; } ================================================ FILE: flow-typed/npm/babel-plugin-annotate-pure-calls_vx.x.x.js ================================================ // flow-typed signature: 173a6a1e89e96243802ffaa931a72984 // flow-typed version: <>/babel-plugin-annotate-pure-calls_v^0.4.0/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'babel-plugin-annotate-pure-calls' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'babel-plugin-annotate-pure-calls' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'babel-plugin-annotate-pure-calls/lib/index' { declare module.exports: any; } // Filename aliases declare module 'babel-plugin-annotate-pure-calls/lib/index.js' { declare module.exports: $Exports<'babel-plugin-annotate-pure-calls/lib/index'>; } ================================================ FILE: flow-typed/npm/babel-plugin-preval_vx.x.x.js ================================================ // flow-typed signature: af80e12d8118e55aa3d7b776e3cce4fe // flow-typed version: <>/babel-plugin-preval_v3.0.1/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'babel-plugin-preval' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'babel-plugin-preval' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'babel-plugin-preval/dist/helpers' { declare module.exports: any; } declare module 'babel-plugin-preval/dist/index' { declare module.exports: any; } declare module 'babel-plugin-preval/dist/macro' { declare module.exports: any; } declare module 'babel-plugin-preval/dist/object-to-ast' { declare module.exports: any; } declare module 'babel-plugin-preval/macro' { declare module.exports: any; } // Filename aliases declare module 'babel-plugin-preval/dist/helpers.js' { declare module.exports: $Exports<'babel-plugin-preval/dist/helpers'>; } declare module 'babel-plugin-preval/dist/index.js' { declare module.exports: $Exports<'babel-plugin-preval/dist/index'>; } declare module 'babel-plugin-preval/dist/macro.js' { declare module.exports: $Exports<'babel-plugin-preval/dist/macro'>; } declare module 'babel-plugin-preval/dist/object-to-ast.js' { declare module.exports: $Exports<'babel-plugin-preval/dist/object-to-ast'>; } declare module 'babel-plugin-preval/macro.js' { declare module.exports: $Exports<'babel-plugin-preval/macro'>; } ================================================ FILE: flow-typed/npm/concat-stream_vx.x.x.js ================================================ // flow-typed signature: 179e1697fed2b42c3b56121af161a223 // flow-typed version: <>/concat-stream_v^2.0.0/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'concat-stream' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'concat-stream' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ // Filename aliases declare module 'concat-stream/index' { declare module.exports: $Exports<'concat-stream'>; } declare module 'concat-stream/index.js' { declare module.exports: $Exports<'concat-stream'>; } ================================================ FILE: flow-typed/npm/cross-env_vx.x.x.js ================================================ // flow-typed signature: 635d43f130638127e70bc2fc7c1e3dde // flow-typed version: <>/cross-env_v^5.2.0/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'cross-env' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'cross-env' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'cross-env/dist/bin/cross-env-shell' { declare module.exports: any; } declare module 'cross-env/dist/bin/cross-env' { declare module.exports: any; } declare module 'cross-env/dist/command' { declare module.exports: any; } declare module 'cross-env/dist/index' { declare module.exports: any; } declare module 'cross-env/dist/variable' { declare module.exports: any; } // Filename aliases declare module 'cross-env/dist/bin/cross-env-shell.js' { declare module.exports: $Exports<'cross-env/dist/bin/cross-env-shell'>; } declare module 'cross-env/dist/bin/cross-env.js' { declare module.exports: $Exports<'cross-env/dist/bin/cross-env'>; } declare module 'cross-env/dist/command.js' { declare module.exports: $Exports<'cross-env/dist/command'>; } declare module 'cross-env/dist/index.js' { declare module.exports: $Exports<'cross-env/dist/index'>; } declare module 'cross-env/dist/variable.js' { declare module.exports: $Exports<'cross-env/dist/variable'>; } ================================================ FILE: flow-typed/npm/cz-conventional-changelog_vx.x.x.js ================================================ // flow-typed signature: 5149265bedb8f0f174e3b28b34ccd1e7 // flow-typed version: <>/cz-conventional-changelog_v^2.1.0/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'cz-conventional-changelog' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'cz-conventional-changelog' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'cz-conventional-changelog/engine' { declare module.exports: any; } // Filename aliases declare module 'cz-conventional-changelog/engine.js' { declare module.exports: $Exports<'cz-conventional-changelog/engine'>; } declare module 'cz-conventional-changelog/index' { declare module.exports: $Exports<'cz-conventional-changelog'>; } declare module 'cz-conventional-changelog/index.js' { declare module.exports: $Exports<'cz-conventional-changelog'>; } ================================================ FILE: flow-typed/npm/documentation_vx.x.x.js ================================================ // flow-typed signature: d07522506469a33315ab7f415dc86aeb // flow-typed version: <>/documentation_v9.3.1/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'documentation' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'documentation' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'documentation/babel.config' { declare module.exports: any; } declare module 'documentation/bin/documentation' { declare module.exports: any; } declare module 'documentation/declarations/comment' { declare module.exports: any; } declare module 'documentation/src/commands/build' { declare module.exports: any; } declare module 'documentation/src/commands/index' { declare module.exports: any; } declare module 'documentation/src/commands/lint' { declare module.exports: any; } declare module 'documentation/src/commands/readme' { declare module.exports: any; } declare module 'documentation/src/commands/serve' { declare module.exports: any; } declare module 'documentation/src/commands/shared_options' { declare module.exports: any; } declare module 'documentation/src/default_theme/assets/anchor' { declare module.exports: any; } declare module 'documentation/src/default_theme/assets/site' { declare module.exports: any; } declare module 'documentation/src/default_theme/assets/split' { declare module.exports: any; } declare module 'documentation/src/default_theme/index' { declare module.exports: any; } declare module 'documentation/src/extractors/comments' { declare module.exports: any; } declare module 'documentation/src/extractors/exported' { declare module.exports: any; } declare module 'documentation/src/filter_access' { declare module.exports: any; } declare module 'documentation/src/flow_doctrine' { declare module.exports: any; } declare module 'documentation/src/garbage_collect' { declare module.exports: any; } declare module 'documentation/src/get-readme-file' { declare module.exports: any; } declare module 'documentation/src/git/find_git' { declare module.exports: any; } declare module 'documentation/src/git/url_prefix' { declare module.exports: any; } declare module 'documentation/src/github' { declare module.exports: any; } declare module 'documentation/src/hierarchy' { declare module.exports: any; } declare module 'documentation/src/index' { declare module.exports: any; } declare module 'documentation/src/infer/access' { declare module.exports: any; } declare module 'documentation/src/infer/augments' { declare module.exports: any; } declare module 'documentation/src/infer/finders' { declare module.exports: any; } declare module 'documentation/src/infer/kind' { declare module.exports: any; } declare module 'documentation/src/infer/membership' { declare module.exports: any; } declare module 'documentation/src/infer/name' { declare module.exports: any; } declare module 'documentation/src/infer/params' { declare module.exports: any; } declare module 'documentation/src/infer/properties' { declare module.exports: any; } declare module 'documentation/src/infer/return' { declare module.exports: any; } declare module 'documentation/src/infer/type' { declare module.exports: any; } declare module 'documentation/src/inline_tokenizer' { declare module.exports: any; } declare module 'documentation/src/input/dependency' { declare module.exports: any; } declare module 'documentation/src/input/shallow' { declare module.exports: any; } declare module 'documentation/src/is_jsdoc_comment' { declare module.exports: any; } declare module 'documentation/src/lint' { declare module.exports: any; } declare module 'documentation/src/merge_config' { declare module.exports: any; } declare module 'documentation/src/module_filters' { declare module.exports: any; } declare module 'documentation/src/nest' { declare module.exports: any; } declare module 'documentation/src/output/highlighter' { declare module.exports: any; } declare module 'documentation/src/output/html' { declare module.exports: any; } declare module 'documentation/src/output/json' { declare module.exports: any; } declare module 'documentation/src/output/markdown_ast' { declare module.exports: any; } declare module 'documentation/src/output/markdown' { declare module.exports: any; } declare module 'documentation/src/output/util/format_type' { declare module.exports: any; } declare module 'documentation/src/output/util/formatters' { declare module.exports: any; } declare module 'documentation/src/output/util/linker_stack' { declare module.exports: any; } declare module 'documentation/src/output/util/reroute_links' { declare module.exports: any; } declare module 'documentation/src/parse_markdown' { declare module.exports: any; } declare module 'documentation/src/parse' { declare module.exports: any; } declare module 'documentation/src/parsers/javascript' { declare module.exports: any; } declare module 'documentation/src/parsers/parse_to_ast' { declare module.exports: any; } declare module 'documentation/src/parsers/vue' { declare module.exports: any; } declare module 'documentation/src/serve/error_page' { declare module.exports: any; } declare module 'documentation/src/serve/server' { declare module.exports: any; } declare module 'documentation/src/smart_glob' { declare module.exports: any; } declare module 'documentation/src/sort' { declare module.exports: any; } declare module 'documentation/src/walk' { declare module.exports: any; } // Filename aliases declare module 'documentation/babel.config.js' { declare module.exports: $Exports<'documentation/babel.config'>; } declare module 'documentation/bin/documentation.js' { declare module.exports: $Exports<'documentation/bin/documentation'>; } declare module 'documentation/declarations/comment.js' { declare module.exports: $Exports<'documentation/declarations/comment'>; } declare module 'documentation/src/commands/build.js' { declare module.exports: $Exports<'documentation/src/commands/build'>; } declare module 'documentation/src/commands/index.js' { declare module.exports: $Exports<'documentation/src/commands/index'>; } declare module 'documentation/src/commands/lint.js' { declare module.exports: $Exports<'documentation/src/commands/lint'>; } declare module 'documentation/src/commands/readme.js' { declare module.exports: $Exports<'documentation/src/commands/readme'>; } declare module 'documentation/src/commands/serve.js' { declare module.exports: $Exports<'documentation/src/commands/serve'>; } declare module 'documentation/src/commands/shared_options.js' { declare module.exports: $Exports<'documentation/src/commands/shared_options'>; } declare module 'documentation/src/default_theme/assets/anchor.js' { declare module.exports: $Exports<'documentation/src/default_theme/assets/anchor'>; } declare module 'documentation/src/default_theme/assets/site.js' { declare module.exports: $Exports<'documentation/src/default_theme/assets/site'>; } declare module 'documentation/src/default_theme/assets/split.js' { declare module.exports: $Exports<'documentation/src/default_theme/assets/split'>; } declare module 'documentation/src/default_theme/index.js' { declare module.exports: $Exports<'documentation/src/default_theme/index'>; } declare module 'documentation/src/extractors/comments.js' { declare module.exports: $Exports<'documentation/src/extractors/comments'>; } declare module 'documentation/src/extractors/exported.js' { declare module.exports: $Exports<'documentation/src/extractors/exported'>; } declare module 'documentation/src/filter_access.js' { declare module.exports: $Exports<'documentation/src/filter_access'>; } declare module 'documentation/src/flow_doctrine.js' { declare module.exports: $Exports<'documentation/src/flow_doctrine'>; } declare module 'documentation/src/garbage_collect.js' { declare module.exports: $Exports<'documentation/src/garbage_collect'>; } declare module 'documentation/src/get-readme-file.js' { declare module.exports: $Exports<'documentation/src/get-readme-file'>; } declare module 'documentation/src/git/find_git.js' { declare module.exports: $Exports<'documentation/src/git/find_git'>; } declare module 'documentation/src/git/url_prefix.js' { declare module.exports: $Exports<'documentation/src/git/url_prefix'>; } declare module 'documentation/src/github.js' { declare module.exports: $Exports<'documentation/src/github'>; } declare module 'documentation/src/hierarchy.js' { declare module.exports: $Exports<'documentation/src/hierarchy'>; } declare module 'documentation/src/index.js' { declare module.exports: $Exports<'documentation/src/index'>; } declare module 'documentation/src/infer/access.js' { declare module.exports: $Exports<'documentation/src/infer/access'>; } declare module 'documentation/src/infer/augments.js' { declare module.exports: $Exports<'documentation/src/infer/augments'>; } declare module 'documentation/src/infer/finders.js' { declare module.exports: $Exports<'documentation/src/infer/finders'>; } declare module 'documentation/src/infer/kind.js' { declare module.exports: $Exports<'documentation/src/infer/kind'>; } declare module 'documentation/src/infer/membership.js' { declare module.exports: $Exports<'documentation/src/infer/membership'>; } declare module 'documentation/src/infer/name.js' { declare module.exports: $Exports<'documentation/src/infer/name'>; } declare module 'documentation/src/infer/params.js' { declare module.exports: $Exports<'documentation/src/infer/params'>; } declare module 'documentation/src/infer/properties.js' { declare module.exports: $Exports<'documentation/src/infer/properties'>; } declare module 'documentation/src/infer/return.js' { declare module.exports: $Exports<'documentation/src/infer/return'>; } declare module 'documentation/src/infer/type.js' { declare module.exports: $Exports<'documentation/src/infer/type'>; } declare module 'documentation/src/inline_tokenizer.js' { declare module.exports: $Exports<'documentation/src/inline_tokenizer'>; } declare module 'documentation/src/input/dependency.js' { declare module.exports: $Exports<'documentation/src/input/dependency'>; } declare module 'documentation/src/input/shallow.js' { declare module.exports: $Exports<'documentation/src/input/shallow'>; } declare module 'documentation/src/is_jsdoc_comment.js' { declare module.exports: $Exports<'documentation/src/is_jsdoc_comment'>; } declare module 'documentation/src/lint.js' { declare module.exports: $Exports<'documentation/src/lint'>; } declare module 'documentation/src/merge_config.js' { declare module.exports: $Exports<'documentation/src/merge_config'>; } declare module 'documentation/src/module_filters.js' { declare module.exports: $Exports<'documentation/src/module_filters'>; } declare module 'documentation/src/nest.js' { declare module.exports: $Exports<'documentation/src/nest'>; } declare module 'documentation/src/output/highlighter.js' { declare module.exports: $Exports<'documentation/src/output/highlighter'>; } declare module 'documentation/src/output/html.js' { declare module.exports: $Exports<'documentation/src/output/html'>; } declare module 'documentation/src/output/json.js' { declare module.exports: $Exports<'documentation/src/output/json'>; } declare module 'documentation/src/output/markdown_ast.js' { declare module.exports: $Exports<'documentation/src/output/markdown_ast'>; } declare module 'documentation/src/output/markdown.js' { declare module.exports: $Exports<'documentation/src/output/markdown'>; } declare module 'documentation/src/output/util/format_type.js' { declare module.exports: $Exports<'documentation/src/output/util/format_type'>; } declare module 'documentation/src/output/util/formatters.js' { declare module.exports: $Exports<'documentation/src/output/util/formatters'>; } declare module 'documentation/src/output/util/linker_stack.js' { declare module.exports: $Exports<'documentation/src/output/util/linker_stack'>; } declare module 'documentation/src/output/util/reroute_links.js' { declare module.exports: $Exports<'documentation/src/output/util/reroute_links'>; } declare module 'documentation/src/parse_markdown.js' { declare module.exports: $Exports<'documentation/src/parse_markdown'>; } declare module 'documentation/src/parse.js' { declare module.exports: $Exports<'documentation/src/parse'>; } declare module 'documentation/src/parsers/javascript.js' { declare module.exports: $Exports<'documentation/src/parsers/javascript'>; } declare module 'documentation/src/parsers/parse_to_ast.js' { declare module.exports: $Exports<'documentation/src/parsers/parse_to_ast'>; } declare module 'documentation/src/parsers/vue.js' { declare module.exports: $Exports<'documentation/src/parsers/vue'>; } declare module 'documentation/src/serve/error_page.js' { declare module.exports: $Exports<'documentation/src/serve/error_page'>; } declare module 'documentation/src/serve/server.js' { declare module.exports: $Exports<'documentation/src/serve/server'>; } declare module 'documentation/src/smart_glob.js' { declare module.exports: $Exports<'documentation/src/smart_glob'>; } declare module 'documentation/src/sort.js' { declare module.exports: $Exports<'documentation/src/sort'>; } declare module 'documentation/src/walk.js' { declare module.exports: $Exports<'documentation/src/walk'>; } ================================================ FILE: flow-typed/npm/eslint-config-airbnb-base_vx.x.x.js ================================================ // flow-typed signature: 75193460df477031021f4e42d4a9252b // flow-typed version: <>/eslint-config-airbnb-base_v^13.1.0/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'eslint-config-airbnb-base' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'eslint-config-airbnb-base' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'eslint-config-airbnb-base/legacy' { declare module.exports: any; } declare module 'eslint-config-airbnb-base/rules/best-practices' { declare module.exports: any; } declare module 'eslint-config-airbnb-base/rules/errors' { declare module.exports: any; } declare module 'eslint-config-airbnb-base/rules/es6' { declare module.exports: any; } declare module 'eslint-config-airbnb-base/rules/imports' { declare module.exports: any; } declare module 'eslint-config-airbnb-base/rules/node' { declare module.exports: any; } declare module 'eslint-config-airbnb-base/rules/strict' { declare module.exports: any; } declare module 'eslint-config-airbnb-base/rules/style' { declare module.exports: any; } declare module 'eslint-config-airbnb-base/rules/variables' { declare module.exports: any; } declare module 'eslint-config-airbnb-base/test/requires' { declare module.exports: any; } declare module 'eslint-config-airbnb-base/test/test-base' { declare module.exports: any; } declare module 'eslint-config-airbnb-base/whitespace' { declare module.exports: any; } // Filename aliases declare module 'eslint-config-airbnb-base/index' { declare module.exports: $Exports<'eslint-config-airbnb-base'>; } declare module 'eslint-config-airbnb-base/index.js' { declare module.exports: $Exports<'eslint-config-airbnb-base'>; } declare module 'eslint-config-airbnb-base/legacy.js' { declare module.exports: $Exports<'eslint-config-airbnb-base/legacy'>; } declare module 'eslint-config-airbnb-base/rules/best-practices.js' { declare module.exports: $Exports<'eslint-config-airbnb-base/rules/best-practices'>; } declare module 'eslint-config-airbnb-base/rules/errors.js' { declare module.exports: $Exports<'eslint-config-airbnb-base/rules/errors'>; } declare module 'eslint-config-airbnb-base/rules/es6.js' { declare module.exports: $Exports<'eslint-config-airbnb-base/rules/es6'>; } declare module 'eslint-config-airbnb-base/rules/imports.js' { declare module.exports: $Exports<'eslint-config-airbnb-base/rules/imports'>; } declare module 'eslint-config-airbnb-base/rules/node.js' { declare module.exports: $Exports<'eslint-config-airbnb-base/rules/node'>; } declare module 'eslint-config-airbnb-base/rules/strict.js' { declare module.exports: $Exports<'eslint-config-airbnb-base/rules/strict'>; } declare module 'eslint-config-airbnb-base/rules/style.js' { declare module.exports: $Exports<'eslint-config-airbnb-base/rules/style'>; } declare module 'eslint-config-airbnb-base/rules/variables.js' { declare module.exports: $Exports<'eslint-config-airbnb-base/rules/variables'>; } declare module 'eslint-config-airbnb-base/test/requires.js' { declare module.exports: $Exports<'eslint-config-airbnb-base/test/requires'>; } declare module 'eslint-config-airbnb-base/test/test-base.js' { declare module.exports: $Exports<'eslint-config-airbnb-base/test/test-base'>; } declare module 'eslint-config-airbnb-base/whitespace.js' { declare module.exports: $Exports<'eslint-config-airbnb-base/whitespace'>; } ================================================ FILE: flow-typed/npm/eslint-plugin-import_vx.x.x.js ================================================ // flow-typed signature: d109fd62a71bdd8de7821076a1dac437 // flow-typed version: <>/eslint-plugin-import_v^2.17.3/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'eslint-plugin-import' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'eslint-plugin-import' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'eslint-plugin-import/config/electron' { declare module.exports: any; } declare module 'eslint-plugin-import/config/errors' { declare module.exports: any; } declare module 'eslint-plugin-import/config/react-native' { declare module.exports: any; } declare module 'eslint-plugin-import/config/react' { declare module.exports: any; } declare module 'eslint-plugin-import/config/recommended' { declare module.exports: any; } declare module 'eslint-plugin-import/config/stage-0' { declare module.exports: any; } declare module 'eslint-plugin-import/config/typescript' { declare module.exports: any; } declare module 'eslint-plugin-import/config/warnings' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/core/importType' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/core/staticRequire' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/docsUrl' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/ExportMap' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/importDeclaration' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/index' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/default' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/dynamic-import-chunkname' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/export' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/exports-last' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/extensions' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/first' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/group-exports' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/imports-first' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/max-dependencies' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/named' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/namespace' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/newline-after-import' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-absolute-path' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-amd' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-anonymous-default-export' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-commonjs' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-cycle' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-default-export' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-deprecated' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-duplicates' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-dynamic-require' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-extraneous-dependencies' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-internal-modules' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-mutable-exports' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-named-as-default-member' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-named-as-default' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-named-default' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-named-export' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-namespace' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-nodejs-modules' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-relative-parent-imports' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-restricted-paths' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-self-import' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-unassigned-import' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-unresolved' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-unused-modules' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-useless-path-segments' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/no-webpack-loader-syntax' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/order' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/prefer-default-export' { declare module.exports: any; } declare module 'eslint-plugin-import/lib/rules/unambiguous' { declare module.exports: any; } declare module 'eslint-plugin-import/memo-parser/index' { declare module.exports: any; } // Filename aliases declare module 'eslint-plugin-import/config/electron.js' { declare module.exports: $Exports<'eslint-plugin-import/config/electron'>; } declare module 'eslint-plugin-import/config/errors.js' { declare module.exports: $Exports<'eslint-plugin-import/config/errors'>; } declare module 'eslint-plugin-import/config/react-native.js' { declare module.exports: $Exports<'eslint-plugin-import/config/react-native'>; } declare module 'eslint-plugin-import/config/react.js' { declare module.exports: $Exports<'eslint-plugin-import/config/react'>; } declare module 'eslint-plugin-import/config/recommended.js' { declare module.exports: $Exports<'eslint-plugin-import/config/recommended'>; } declare module 'eslint-plugin-import/config/stage-0.js' { declare module.exports: $Exports<'eslint-plugin-import/config/stage-0'>; } declare module 'eslint-plugin-import/config/typescript.js' { declare module.exports: $Exports<'eslint-plugin-import/config/typescript'>; } declare module 'eslint-plugin-import/config/warnings.js' { declare module.exports: $Exports<'eslint-plugin-import/config/warnings'>; } declare module 'eslint-plugin-import/lib/core/importType.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/core/importType'>; } declare module 'eslint-plugin-import/lib/core/staticRequire.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/core/staticRequire'>; } declare module 'eslint-plugin-import/lib/docsUrl.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/docsUrl'>; } declare module 'eslint-plugin-import/lib/ExportMap.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/ExportMap'>; } declare module 'eslint-plugin-import/lib/importDeclaration.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/importDeclaration'>; } declare module 'eslint-plugin-import/lib/index.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/index'>; } declare module 'eslint-plugin-import/lib/rules/default.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/default'>; } declare module 'eslint-plugin-import/lib/rules/dynamic-import-chunkname.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/dynamic-import-chunkname'>; } declare module 'eslint-plugin-import/lib/rules/export.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/export'>; } declare module 'eslint-plugin-import/lib/rules/exports-last.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/exports-last'>; } declare module 'eslint-plugin-import/lib/rules/extensions.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/extensions'>; } declare module 'eslint-plugin-import/lib/rules/first.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/first'>; } declare module 'eslint-plugin-import/lib/rules/group-exports.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/group-exports'>; } declare module 'eslint-plugin-import/lib/rules/imports-first.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/imports-first'>; } declare module 'eslint-plugin-import/lib/rules/max-dependencies.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/max-dependencies'>; } declare module 'eslint-plugin-import/lib/rules/named.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/named'>; } declare module 'eslint-plugin-import/lib/rules/namespace.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/namespace'>; } declare module 'eslint-plugin-import/lib/rules/newline-after-import.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/newline-after-import'>; } declare module 'eslint-plugin-import/lib/rules/no-absolute-path.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-absolute-path'>; } declare module 'eslint-plugin-import/lib/rules/no-amd.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-amd'>; } declare module 'eslint-plugin-import/lib/rules/no-anonymous-default-export.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-anonymous-default-export'>; } declare module 'eslint-plugin-import/lib/rules/no-commonjs.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-commonjs'>; } declare module 'eslint-plugin-import/lib/rules/no-cycle.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-cycle'>; } declare module 'eslint-plugin-import/lib/rules/no-default-export.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-default-export'>; } declare module 'eslint-plugin-import/lib/rules/no-deprecated.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-deprecated'>; } declare module 'eslint-plugin-import/lib/rules/no-duplicates.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-duplicates'>; } declare module 'eslint-plugin-import/lib/rules/no-dynamic-require.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-dynamic-require'>; } declare module 'eslint-plugin-import/lib/rules/no-extraneous-dependencies.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-extraneous-dependencies'>; } declare module 'eslint-plugin-import/lib/rules/no-internal-modules.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-internal-modules'>; } declare module 'eslint-plugin-import/lib/rules/no-mutable-exports.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-mutable-exports'>; } declare module 'eslint-plugin-import/lib/rules/no-named-as-default-member.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-named-as-default-member'>; } declare module 'eslint-plugin-import/lib/rules/no-named-as-default.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-named-as-default'>; } declare module 'eslint-plugin-import/lib/rules/no-named-default.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-named-default'>; } declare module 'eslint-plugin-import/lib/rules/no-named-export.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-named-export'>; } declare module 'eslint-plugin-import/lib/rules/no-namespace.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-namespace'>; } declare module 'eslint-plugin-import/lib/rules/no-nodejs-modules.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-nodejs-modules'>; } declare module 'eslint-plugin-import/lib/rules/no-relative-parent-imports.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-relative-parent-imports'>; } declare module 'eslint-plugin-import/lib/rules/no-restricted-paths.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-restricted-paths'>; } declare module 'eslint-plugin-import/lib/rules/no-self-import.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-self-import'>; } declare module 'eslint-plugin-import/lib/rules/no-unassigned-import.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-unassigned-import'>; } declare module 'eslint-plugin-import/lib/rules/no-unresolved.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-unresolved'>; } declare module 'eslint-plugin-import/lib/rules/no-unused-modules.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-unused-modules'>; } declare module 'eslint-plugin-import/lib/rules/no-useless-path-segments.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-useless-path-segments'>; } declare module 'eslint-plugin-import/lib/rules/no-webpack-loader-syntax.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/no-webpack-loader-syntax'>; } declare module 'eslint-plugin-import/lib/rules/order.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/order'>; } declare module 'eslint-plugin-import/lib/rules/prefer-default-export.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/prefer-default-export'>; } declare module 'eslint-plugin-import/lib/rules/unambiguous.js' { declare module.exports: $Exports<'eslint-plugin-import/lib/rules/unambiguous'>; } declare module 'eslint-plugin-import/memo-parser/index.js' { declare module.exports: $Exports<'eslint-plugin-import/memo-parser/index'>; } ================================================ FILE: flow-typed/npm/eslint_vx.x.x.js ================================================ // flow-typed signature: e62b09a4c2474f1bbe8d8a402f583d44 // flow-typed version: <>/eslint_v^5.16.0/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'eslint' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'eslint' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'eslint/bin/eslint' { declare module.exports: any; } declare module 'eslint/conf/config-schema' { declare module.exports: any; } declare module 'eslint/conf/default-cli-options' { declare module.exports: any; } declare module 'eslint/conf/environments' { declare module.exports: any; } declare module 'eslint/conf/eslint-all' { declare module.exports: any; } declare module 'eslint/conf/eslint-recommended' { declare module.exports: any; } declare module 'eslint/lib/api' { declare module.exports: any; } declare module 'eslint/lib/built-in-rules-index' { declare module.exports: any; } declare module 'eslint/lib/cli-engine' { declare module.exports: any; } declare module 'eslint/lib/cli' { declare module.exports: any; } declare module 'eslint/lib/code-path-analysis/code-path-analyzer' { declare module.exports: any; } declare module 'eslint/lib/code-path-analysis/code-path-segment' { declare module.exports: any; } declare module 'eslint/lib/code-path-analysis/code-path-state' { declare module.exports: any; } declare module 'eslint/lib/code-path-analysis/code-path' { declare module.exports: any; } declare module 'eslint/lib/code-path-analysis/debug-helpers' { declare module.exports: any; } declare module 'eslint/lib/code-path-analysis/fork-context' { declare module.exports: any; } declare module 'eslint/lib/code-path-analysis/id-generator' { declare module.exports: any; } declare module 'eslint/lib/config' { declare module.exports: any; } declare module 'eslint/lib/config/autoconfig' { declare module.exports: any; } declare module 'eslint/lib/config/config-cache' { declare module.exports: any; } declare module 'eslint/lib/config/config-file' { declare module.exports: any; } declare module 'eslint/lib/config/config-initializer' { declare module.exports: any; } declare module 'eslint/lib/config/config-ops' { declare module.exports: any; } declare module 'eslint/lib/config/config-rule' { declare module.exports: any; } declare module 'eslint/lib/config/config-validator' { declare module.exports: any; } declare module 'eslint/lib/config/environments' { declare module.exports: any; } declare module 'eslint/lib/config/plugins' { declare module.exports: any; } declare module 'eslint/lib/formatters/checkstyle' { declare module.exports: any; } declare module 'eslint/lib/formatters/codeframe' { declare module.exports: any; } declare module 'eslint/lib/formatters/compact' { declare module.exports: any; } declare module 'eslint/lib/formatters/html' { declare module.exports: any; } declare module 'eslint/lib/formatters/jslint-xml' { declare module.exports: any; } declare module 'eslint/lib/formatters/json-with-metadata' { declare module.exports: any; } declare module 'eslint/lib/formatters/json' { declare module.exports: any; } declare module 'eslint/lib/formatters/junit' { declare module.exports: any; } declare module 'eslint/lib/formatters/stylish' { declare module.exports: any; } declare module 'eslint/lib/formatters/table' { declare module.exports: any; } declare module 'eslint/lib/formatters/tap' { declare module.exports: any; } declare module 'eslint/lib/formatters/unix' { declare module.exports: any; } declare module 'eslint/lib/formatters/visualstudio' { declare module.exports: any; } declare module 'eslint/lib/linter' { declare module.exports: any; } declare module 'eslint/lib/load-rules' { declare module.exports: any; } declare module 'eslint/lib/options' { declare module.exports: any; } declare module 'eslint/lib/rules' { declare module.exports: any; } declare module 'eslint/lib/rules/accessor-pairs' { declare module.exports: any; } declare module 'eslint/lib/rules/array-bracket-newline' { declare module.exports: any; } declare module 'eslint/lib/rules/array-bracket-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/array-callback-return' { declare module.exports: any; } declare module 'eslint/lib/rules/array-element-newline' { declare module.exports: any; } declare module 'eslint/lib/rules/arrow-body-style' { declare module.exports: any; } declare module 'eslint/lib/rules/arrow-parens' { declare module.exports: any; } declare module 'eslint/lib/rules/arrow-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/block-scoped-var' { declare module.exports: any; } declare module 'eslint/lib/rules/block-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/brace-style' { declare module.exports: any; } declare module 'eslint/lib/rules/callback-return' { declare module.exports: any; } declare module 'eslint/lib/rules/camelcase' { declare module.exports: any; } declare module 'eslint/lib/rules/capitalized-comments' { declare module.exports: any; } declare module 'eslint/lib/rules/class-methods-use-this' { declare module.exports: any; } declare module 'eslint/lib/rules/comma-dangle' { declare module.exports: any; } declare module 'eslint/lib/rules/comma-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/comma-style' { declare module.exports: any; } declare module 'eslint/lib/rules/complexity' { declare module.exports: any; } declare module 'eslint/lib/rules/computed-property-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/consistent-return' { declare module.exports: any; } declare module 'eslint/lib/rules/consistent-this' { declare module.exports: any; } declare module 'eslint/lib/rules/constructor-super' { declare module.exports: any; } declare module 'eslint/lib/rules/curly' { declare module.exports: any; } declare module 'eslint/lib/rules/default-case' { declare module.exports: any; } declare module 'eslint/lib/rules/dot-location' { declare module.exports: any; } declare module 'eslint/lib/rules/dot-notation' { declare module.exports: any; } declare module 'eslint/lib/rules/eol-last' { declare module.exports: any; } declare module 'eslint/lib/rules/eqeqeq' { declare module.exports: any; } declare module 'eslint/lib/rules/for-direction' { declare module.exports: any; } declare module 'eslint/lib/rules/func-call-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/func-name-matching' { declare module.exports: any; } declare module 'eslint/lib/rules/func-names' { declare module.exports: any; } declare module 'eslint/lib/rules/func-style' { declare module.exports: any; } declare module 'eslint/lib/rules/function-paren-newline' { declare module.exports: any; } declare module 'eslint/lib/rules/generator-star-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/getter-return' { declare module.exports: any; } declare module 'eslint/lib/rules/global-require' { declare module.exports: any; } declare module 'eslint/lib/rules/guard-for-in' { declare module.exports: any; } declare module 'eslint/lib/rules/handle-callback-err' { declare module.exports: any; } declare module 'eslint/lib/rules/id-blacklist' { declare module.exports: any; } declare module 'eslint/lib/rules/id-length' { declare module.exports: any; } declare module 'eslint/lib/rules/id-match' { declare module.exports: any; } declare module 'eslint/lib/rules/implicit-arrow-linebreak' { declare module.exports: any; } declare module 'eslint/lib/rules/indent-legacy' { declare module.exports: any; } declare module 'eslint/lib/rules/indent' { declare module.exports: any; } declare module 'eslint/lib/rules/init-declarations' { declare module.exports: any; } declare module 'eslint/lib/rules/jsx-quotes' { declare module.exports: any; } declare module 'eslint/lib/rules/key-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/keyword-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/line-comment-position' { declare module.exports: any; } declare module 'eslint/lib/rules/linebreak-style' { declare module.exports: any; } declare module 'eslint/lib/rules/lines-around-comment' { declare module.exports: any; } declare module 'eslint/lib/rules/lines-around-directive' { declare module.exports: any; } declare module 'eslint/lib/rules/lines-between-class-members' { declare module.exports: any; } declare module 'eslint/lib/rules/max-classes-per-file' { declare module.exports: any; } declare module 'eslint/lib/rules/max-depth' { declare module.exports: any; } declare module 'eslint/lib/rules/max-len' { declare module.exports: any; } declare module 'eslint/lib/rules/max-lines-per-function' { declare module.exports: any; } declare module 'eslint/lib/rules/max-lines' { declare module.exports: any; } declare module 'eslint/lib/rules/max-nested-callbacks' { declare module.exports: any; } declare module 'eslint/lib/rules/max-params' { declare module.exports: any; } declare module 'eslint/lib/rules/max-statements-per-line' { declare module.exports: any; } declare module 'eslint/lib/rules/max-statements' { declare module.exports: any; } declare module 'eslint/lib/rules/multiline-comment-style' { declare module.exports: any; } declare module 'eslint/lib/rules/multiline-ternary' { declare module.exports: any; } declare module 'eslint/lib/rules/new-cap' { declare module.exports: any; } declare module 'eslint/lib/rules/new-parens' { declare module.exports: any; } declare module 'eslint/lib/rules/newline-after-var' { declare module.exports: any; } declare module 'eslint/lib/rules/newline-before-return' { declare module.exports: any; } declare module 'eslint/lib/rules/newline-per-chained-call' { declare module.exports: any; } declare module 'eslint/lib/rules/no-alert' { declare module.exports: any; } declare module 'eslint/lib/rules/no-array-constructor' { declare module.exports: any; } declare module 'eslint/lib/rules/no-async-promise-executor' { declare module.exports: any; } declare module 'eslint/lib/rules/no-await-in-loop' { declare module.exports: any; } declare module 'eslint/lib/rules/no-bitwise' { declare module.exports: any; } declare module 'eslint/lib/rules/no-buffer-constructor' { declare module.exports: any; } declare module 'eslint/lib/rules/no-caller' { declare module.exports: any; } declare module 'eslint/lib/rules/no-case-declarations' { declare module.exports: any; } declare module 'eslint/lib/rules/no-catch-shadow' { declare module.exports: any; } declare module 'eslint/lib/rules/no-class-assign' { declare module.exports: any; } declare module 'eslint/lib/rules/no-compare-neg-zero' { declare module.exports: any; } declare module 'eslint/lib/rules/no-cond-assign' { declare module.exports: any; } declare module 'eslint/lib/rules/no-confusing-arrow' { declare module.exports: any; } declare module 'eslint/lib/rules/no-console' { declare module.exports: any; } declare module 'eslint/lib/rules/no-const-assign' { declare module.exports: any; } declare module 'eslint/lib/rules/no-constant-condition' { declare module.exports: any; } declare module 'eslint/lib/rules/no-continue' { declare module.exports: any; } declare module 'eslint/lib/rules/no-control-regex' { declare module.exports: any; } declare module 'eslint/lib/rules/no-debugger' { declare module.exports: any; } declare module 'eslint/lib/rules/no-delete-var' { declare module.exports: any; } declare module 'eslint/lib/rules/no-div-regex' { declare module.exports: any; } declare module 'eslint/lib/rules/no-dupe-args' { declare module.exports: any; } declare module 'eslint/lib/rules/no-dupe-class-members' { declare module.exports: any; } declare module 'eslint/lib/rules/no-dupe-keys' { declare module.exports: any; } declare module 'eslint/lib/rules/no-duplicate-case' { declare module.exports: any; } declare module 'eslint/lib/rules/no-duplicate-imports' { declare module.exports: any; } declare module 'eslint/lib/rules/no-else-return' { declare module.exports: any; } declare module 'eslint/lib/rules/no-empty-character-class' { declare module.exports: any; } declare module 'eslint/lib/rules/no-empty-function' { declare module.exports: any; } declare module 'eslint/lib/rules/no-empty-pattern' { declare module.exports: any; } declare module 'eslint/lib/rules/no-empty' { declare module.exports: any; } declare module 'eslint/lib/rules/no-eq-null' { declare module.exports: any; } declare module 'eslint/lib/rules/no-eval' { declare module.exports: any; } declare module 'eslint/lib/rules/no-ex-assign' { declare module.exports: any; } declare module 'eslint/lib/rules/no-extend-native' { declare module.exports: any; } declare module 'eslint/lib/rules/no-extra-bind' { declare module.exports: any; } declare module 'eslint/lib/rules/no-extra-boolean-cast' { declare module.exports: any; } declare module 'eslint/lib/rules/no-extra-label' { declare module.exports: any; } declare module 'eslint/lib/rules/no-extra-parens' { declare module.exports: any; } declare module 'eslint/lib/rules/no-extra-semi' { declare module.exports: any; } declare module 'eslint/lib/rules/no-fallthrough' { declare module.exports: any; } declare module 'eslint/lib/rules/no-floating-decimal' { declare module.exports: any; } declare module 'eslint/lib/rules/no-func-assign' { declare module.exports: any; } declare module 'eslint/lib/rules/no-global-assign' { declare module.exports: any; } declare module 'eslint/lib/rules/no-implicit-coercion' { declare module.exports: any; } declare module 'eslint/lib/rules/no-implicit-globals' { declare module.exports: any; } declare module 'eslint/lib/rules/no-implied-eval' { declare module.exports: any; } declare module 'eslint/lib/rules/no-inline-comments' { declare module.exports: any; } declare module 'eslint/lib/rules/no-inner-declarations' { declare module.exports: any; } declare module 'eslint/lib/rules/no-invalid-regexp' { declare module.exports: any; } declare module 'eslint/lib/rules/no-invalid-this' { declare module.exports: any; } declare module 'eslint/lib/rules/no-irregular-whitespace' { declare module.exports: any; } declare module 'eslint/lib/rules/no-iterator' { declare module.exports: any; } declare module 'eslint/lib/rules/no-label-var' { declare module.exports: any; } declare module 'eslint/lib/rules/no-labels' { declare module.exports: any; } declare module 'eslint/lib/rules/no-lone-blocks' { declare module.exports: any; } declare module 'eslint/lib/rules/no-lonely-if' { declare module.exports: any; } declare module 'eslint/lib/rules/no-loop-func' { declare module.exports: any; } declare module 'eslint/lib/rules/no-magic-numbers' { declare module.exports: any; } declare module 'eslint/lib/rules/no-misleading-character-class' { declare module.exports: any; } declare module 'eslint/lib/rules/no-mixed-operators' { declare module.exports: any; } declare module 'eslint/lib/rules/no-mixed-requires' { declare module.exports: any; } declare module 'eslint/lib/rules/no-mixed-spaces-and-tabs' { declare module.exports: any; } declare module 'eslint/lib/rules/no-multi-assign' { declare module.exports: any; } declare module 'eslint/lib/rules/no-multi-spaces' { declare module.exports: any; } declare module 'eslint/lib/rules/no-multi-str' { declare module.exports: any; } declare module 'eslint/lib/rules/no-multiple-empty-lines' { declare module.exports: any; } declare module 'eslint/lib/rules/no-native-reassign' { declare module.exports: any; } declare module 'eslint/lib/rules/no-negated-condition' { declare module.exports: any; } declare module 'eslint/lib/rules/no-negated-in-lhs' { declare module.exports: any; } declare module 'eslint/lib/rules/no-nested-ternary' { declare module.exports: any; } declare module 'eslint/lib/rules/no-new-func' { declare module.exports: any; } declare module 'eslint/lib/rules/no-new-object' { declare module.exports: any; } declare module 'eslint/lib/rules/no-new-require' { declare module.exports: any; } declare module 'eslint/lib/rules/no-new-symbol' { declare module.exports: any; } declare module 'eslint/lib/rules/no-new-wrappers' { declare module.exports: any; } declare module 'eslint/lib/rules/no-new' { declare module.exports: any; } declare module 'eslint/lib/rules/no-obj-calls' { declare module.exports: any; } declare module 'eslint/lib/rules/no-octal-escape' { declare module.exports: any; } declare module 'eslint/lib/rules/no-octal' { declare module.exports: any; } declare module 'eslint/lib/rules/no-param-reassign' { declare module.exports: any; } declare module 'eslint/lib/rules/no-path-concat' { declare module.exports: any; } declare module 'eslint/lib/rules/no-plusplus' { declare module.exports: any; } declare module 'eslint/lib/rules/no-process-env' { declare module.exports: any; } declare module 'eslint/lib/rules/no-process-exit' { declare module.exports: any; } declare module 'eslint/lib/rules/no-proto' { declare module.exports: any; } declare module 'eslint/lib/rules/no-prototype-builtins' { declare module.exports: any; } declare module 'eslint/lib/rules/no-redeclare' { declare module.exports: any; } declare module 'eslint/lib/rules/no-regex-spaces' { declare module.exports: any; } declare module 'eslint/lib/rules/no-restricted-globals' { declare module.exports: any; } declare module 'eslint/lib/rules/no-restricted-imports' { declare module.exports: any; } declare module 'eslint/lib/rules/no-restricted-modules' { declare module.exports: any; } declare module 'eslint/lib/rules/no-restricted-properties' { declare module.exports: any; } declare module 'eslint/lib/rules/no-restricted-syntax' { declare module.exports: any; } declare module 'eslint/lib/rules/no-return-assign' { declare module.exports: any; } declare module 'eslint/lib/rules/no-return-await' { declare module.exports: any; } declare module 'eslint/lib/rules/no-script-url' { declare module.exports: any; } declare module 'eslint/lib/rules/no-self-assign' { declare module.exports: any; } declare module 'eslint/lib/rules/no-self-compare' { declare module.exports: any; } declare module 'eslint/lib/rules/no-sequences' { declare module.exports: any; } declare module 'eslint/lib/rules/no-shadow-restricted-names' { declare module.exports: any; } declare module 'eslint/lib/rules/no-shadow' { declare module.exports: any; } declare module 'eslint/lib/rules/no-spaced-func' { declare module.exports: any; } declare module 'eslint/lib/rules/no-sparse-arrays' { declare module.exports: any; } declare module 'eslint/lib/rules/no-sync' { declare module.exports: any; } declare module 'eslint/lib/rules/no-tabs' { declare module.exports: any; } declare module 'eslint/lib/rules/no-template-curly-in-string' { declare module.exports: any; } declare module 'eslint/lib/rules/no-ternary' { declare module.exports: any; } declare module 'eslint/lib/rules/no-this-before-super' { declare module.exports: any; } declare module 'eslint/lib/rules/no-throw-literal' { declare module.exports: any; } declare module 'eslint/lib/rules/no-trailing-spaces' { declare module.exports: any; } declare module 'eslint/lib/rules/no-undef-init' { declare module.exports: any; } declare module 'eslint/lib/rules/no-undef' { declare module.exports: any; } declare module 'eslint/lib/rules/no-undefined' { declare module.exports: any; } declare module 'eslint/lib/rules/no-underscore-dangle' { declare module.exports: any; } declare module 'eslint/lib/rules/no-unexpected-multiline' { declare module.exports: any; } declare module 'eslint/lib/rules/no-unmodified-loop-condition' { declare module.exports: any; } declare module 'eslint/lib/rules/no-unneeded-ternary' { declare module.exports: any; } declare module 'eslint/lib/rules/no-unreachable' { declare module.exports: any; } declare module 'eslint/lib/rules/no-unsafe-finally' { declare module.exports: any; } declare module 'eslint/lib/rules/no-unsafe-negation' { declare module.exports: any; } declare module 'eslint/lib/rules/no-unused-expressions' { declare module.exports: any; } declare module 'eslint/lib/rules/no-unused-labels' { declare module.exports: any; } declare module 'eslint/lib/rules/no-unused-vars' { declare module.exports: any; } declare module 'eslint/lib/rules/no-use-before-define' { declare module.exports: any; } declare module 'eslint/lib/rules/no-useless-call' { declare module.exports: any; } declare module 'eslint/lib/rules/no-useless-catch' { declare module.exports: any; } declare module 'eslint/lib/rules/no-useless-computed-key' { declare module.exports: any; } declare module 'eslint/lib/rules/no-useless-concat' { declare module.exports: any; } declare module 'eslint/lib/rules/no-useless-constructor' { declare module.exports: any; } declare module 'eslint/lib/rules/no-useless-escape' { declare module.exports: any; } declare module 'eslint/lib/rules/no-useless-rename' { declare module.exports: any; } declare module 'eslint/lib/rules/no-useless-return' { declare module.exports: any; } declare module 'eslint/lib/rules/no-var' { declare module.exports: any; } declare module 'eslint/lib/rules/no-void' { declare module.exports: any; } declare module 'eslint/lib/rules/no-warning-comments' { declare module.exports: any; } declare module 'eslint/lib/rules/no-whitespace-before-property' { declare module.exports: any; } declare module 'eslint/lib/rules/no-with' { declare module.exports: any; } declare module 'eslint/lib/rules/nonblock-statement-body-position' { declare module.exports: any; } declare module 'eslint/lib/rules/object-curly-newline' { declare module.exports: any; } declare module 'eslint/lib/rules/object-curly-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/object-property-newline' { declare module.exports: any; } declare module 'eslint/lib/rules/object-shorthand' { declare module.exports: any; } declare module 'eslint/lib/rules/one-var-declaration-per-line' { declare module.exports: any; } declare module 'eslint/lib/rules/one-var' { declare module.exports: any; } declare module 'eslint/lib/rules/operator-assignment' { declare module.exports: any; } declare module 'eslint/lib/rules/operator-linebreak' { declare module.exports: any; } declare module 'eslint/lib/rules/padded-blocks' { declare module.exports: any; } declare module 'eslint/lib/rules/padding-line-between-statements' { declare module.exports: any; } declare module 'eslint/lib/rules/prefer-arrow-callback' { declare module.exports: any; } declare module 'eslint/lib/rules/prefer-const' { declare module.exports: any; } declare module 'eslint/lib/rules/prefer-destructuring' { declare module.exports: any; } declare module 'eslint/lib/rules/prefer-named-capture-group' { declare module.exports: any; } declare module 'eslint/lib/rules/prefer-numeric-literals' { declare module.exports: any; } declare module 'eslint/lib/rules/prefer-object-spread' { declare module.exports: any; } declare module 'eslint/lib/rules/prefer-promise-reject-errors' { declare module.exports: any; } declare module 'eslint/lib/rules/prefer-reflect' { declare module.exports: any; } declare module 'eslint/lib/rules/prefer-rest-params' { declare module.exports: any; } declare module 'eslint/lib/rules/prefer-spread' { declare module.exports: any; } declare module 'eslint/lib/rules/prefer-template' { declare module.exports: any; } declare module 'eslint/lib/rules/quote-props' { declare module.exports: any; } declare module 'eslint/lib/rules/quotes' { declare module.exports: any; } declare module 'eslint/lib/rules/radix' { declare module.exports: any; } declare module 'eslint/lib/rules/require-atomic-updates' { declare module.exports: any; } declare module 'eslint/lib/rules/require-await' { declare module.exports: any; } declare module 'eslint/lib/rules/require-jsdoc' { declare module.exports: any; } declare module 'eslint/lib/rules/require-unicode-regexp' { declare module.exports: any; } declare module 'eslint/lib/rules/require-yield' { declare module.exports: any; } declare module 'eslint/lib/rules/rest-spread-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/semi-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/semi-style' { declare module.exports: any; } declare module 'eslint/lib/rules/semi' { declare module.exports: any; } declare module 'eslint/lib/rules/sort-imports' { declare module.exports: any; } declare module 'eslint/lib/rules/sort-keys' { declare module.exports: any; } declare module 'eslint/lib/rules/sort-vars' { declare module.exports: any; } declare module 'eslint/lib/rules/space-before-blocks' { declare module.exports: any; } declare module 'eslint/lib/rules/space-before-function-paren' { declare module.exports: any; } declare module 'eslint/lib/rules/space-in-parens' { declare module.exports: any; } declare module 'eslint/lib/rules/space-infix-ops' { declare module.exports: any; } declare module 'eslint/lib/rules/space-unary-ops' { declare module.exports: any; } declare module 'eslint/lib/rules/spaced-comment' { declare module.exports: any; } declare module 'eslint/lib/rules/strict' { declare module.exports: any; } declare module 'eslint/lib/rules/switch-colon-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/symbol-description' { declare module.exports: any; } declare module 'eslint/lib/rules/template-curly-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/template-tag-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/unicode-bom' { declare module.exports: any; } declare module 'eslint/lib/rules/use-isnan' { declare module.exports: any; } declare module 'eslint/lib/rules/valid-jsdoc' { declare module.exports: any; } declare module 'eslint/lib/rules/valid-typeof' { declare module.exports: any; } declare module 'eslint/lib/rules/vars-on-top' { declare module.exports: any; } declare module 'eslint/lib/rules/wrap-iife' { declare module.exports: any; } declare module 'eslint/lib/rules/wrap-regex' { declare module.exports: any; } declare module 'eslint/lib/rules/yield-star-spacing' { declare module.exports: any; } declare module 'eslint/lib/rules/yoda' { declare module.exports: any; } declare module 'eslint/lib/testers/rule-tester' { declare module.exports: any; } declare module 'eslint/lib/token-store/backward-token-comment-cursor' { declare module.exports: any; } declare module 'eslint/lib/token-store/backward-token-cursor' { declare module.exports: any; } declare module 'eslint/lib/token-store/cursor' { declare module.exports: any; } declare module 'eslint/lib/token-store/cursors' { declare module.exports: any; } declare module 'eslint/lib/token-store/decorative-cursor' { declare module.exports: any; } declare module 'eslint/lib/token-store/filter-cursor' { declare module.exports: any; } declare module 'eslint/lib/token-store/forward-token-comment-cursor' { declare module.exports: any; } declare module 'eslint/lib/token-store/forward-token-cursor' { declare module.exports: any; } declare module 'eslint/lib/token-store/index' { declare module.exports: any; } declare module 'eslint/lib/token-store/limit-cursor' { declare module.exports: any; } declare module 'eslint/lib/token-store/padded-token-cursor' { declare module.exports: any; } declare module 'eslint/lib/token-store/skip-cursor' { declare module.exports: any; } declare module 'eslint/lib/token-store/utils' { declare module.exports: any; } declare module 'eslint/lib/util/ajv' { declare module.exports: any; } declare module 'eslint/lib/util/apply-disable-directives' { declare module.exports: any; } declare module 'eslint/lib/util/ast-utils' { declare module.exports: any; } declare module 'eslint/lib/util/config-comment-parser' { declare module.exports: any; } declare module 'eslint/lib/util/file-finder' { declare module.exports: any; } declare module 'eslint/lib/util/fix-tracker' { declare module.exports: any; } declare module 'eslint/lib/util/glob-utils' { declare module.exports: any; } declare module 'eslint/lib/util/glob' { declare module.exports: any; } declare module 'eslint/lib/util/hash' { declare module.exports: any; } declare module 'eslint/lib/util/ignored-paths' { declare module.exports: any; } declare module 'eslint/lib/util/interpolate' { declare module.exports: any; } declare module 'eslint/lib/util/keywords' { declare module.exports: any; } declare module 'eslint/lib/util/lint-result-cache' { declare module.exports: any; } declare module 'eslint/lib/util/logging' { declare module.exports: any; } declare module 'eslint/lib/util/module-resolver' { declare module.exports: any; } declare module 'eslint/lib/util/naming' { declare module.exports: any; } declare module 'eslint/lib/util/node-event-generator' { declare module.exports: any; } declare module 'eslint/lib/util/npm-utils' { declare module.exports: any; } declare module 'eslint/lib/util/path-utils' { declare module.exports: any; } declare module 'eslint/lib/util/patterns/letters' { declare module.exports: any; } declare module 'eslint/lib/util/report-translator' { declare module.exports: any; } declare module 'eslint/lib/util/rule-fixer' { declare module.exports: any; } declare module 'eslint/lib/util/safe-emitter' { declare module.exports: any; } declare module 'eslint/lib/util/source-code-fixer' { declare module.exports: any; } declare module 'eslint/lib/util/source-code-utils' { declare module.exports: any; } declare module 'eslint/lib/util/source-code' { declare module.exports: any; } declare module 'eslint/lib/util/timing' { declare module.exports: any; } declare module 'eslint/lib/util/traverser' { declare module.exports: any; } declare module 'eslint/lib/util/unicode/index' { declare module.exports: any; } declare module 'eslint/lib/util/unicode/is-combining-character' { declare module.exports: any; } declare module 'eslint/lib/util/unicode/is-emoji-modifier' { declare module.exports: any; } declare module 'eslint/lib/util/unicode/is-regional-indicator-symbol' { declare module.exports: any; } declare module 'eslint/lib/util/unicode/is-surrogate-pair' { declare module.exports: any; } declare module 'eslint/lib/util/xml-escape' { declare module.exports: any; } // Filename aliases declare module 'eslint/bin/eslint.js' { declare module.exports: $Exports<'eslint/bin/eslint'>; } declare module 'eslint/conf/config-schema.js' { declare module.exports: $Exports<'eslint/conf/config-schema'>; } declare module 'eslint/conf/default-cli-options.js' { declare module.exports: $Exports<'eslint/conf/default-cli-options'>; } declare module 'eslint/conf/environments.js' { declare module.exports: $Exports<'eslint/conf/environments'>; } declare module 'eslint/conf/eslint-all.js' { declare module.exports: $Exports<'eslint/conf/eslint-all'>; } declare module 'eslint/conf/eslint-recommended.js' { declare module.exports: $Exports<'eslint/conf/eslint-recommended'>; } declare module 'eslint/lib/api.js' { declare module.exports: $Exports<'eslint/lib/api'>; } declare module 'eslint/lib/built-in-rules-index.js' { declare module.exports: $Exports<'eslint/lib/built-in-rules-index'>; } declare module 'eslint/lib/cli-engine.js' { declare module.exports: $Exports<'eslint/lib/cli-engine'>; } declare module 'eslint/lib/cli.js' { declare module.exports: $Exports<'eslint/lib/cli'>; } declare module 'eslint/lib/code-path-analysis/code-path-analyzer.js' { declare module.exports: $Exports<'eslint/lib/code-path-analysis/code-path-analyzer'>; } declare module 'eslint/lib/code-path-analysis/code-path-segment.js' { declare module.exports: $Exports<'eslint/lib/code-path-analysis/code-path-segment'>; } declare module 'eslint/lib/code-path-analysis/code-path-state.js' { declare module.exports: $Exports<'eslint/lib/code-path-analysis/code-path-state'>; } declare module 'eslint/lib/code-path-analysis/code-path.js' { declare module.exports: $Exports<'eslint/lib/code-path-analysis/code-path'>; } declare module 'eslint/lib/code-path-analysis/debug-helpers.js' { declare module.exports: $Exports<'eslint/lib/code-path-analysis/debug-helpers'>; } declare module 'eslint/lib/code-path-analysis/fork-context.js' { declare module.exports: $Exports<'eslint/lib/code-path-analysis/fork-context'>; } declare module 'eslint/lib/code-path-analysis/id-generator.js' { declare module.exports: $Exports<'eslint/lib/code-path-analysis/id-generator'>; } declare module 'eslint/lib/config.js' { declare module.exports: $Exports<'eslint/lib/config'>; } declare module 'eslint/lib/config/autoconfig.js' { declare module.exports: $Exports<'eslint/lib/config/autoconfig'>; } declare module 'eslint/lib/config/config-cache.js' { declare module.exports: $Exports<'eslint/lib/config/config-cache'>; } declare module 'eslint/lib/config/config-file.js' { declare module.exports: $Exports<'eslint/lib/config/config-file'>; } declare module 'eslint/lib/config/config-initializer.js' { declare module.exports: $Exports<'eslint/lib/config/config-initializer'>; } declare module 'eslint/lib/config/config-ops.js' { declare module.exports: $Exports<'eslint/lib/config/config-ops'>; } declare module 'eslint/lib/config/config-rule.js' { declare module.exports: $Exports<'eslint/lib/config/config-rule'>; } declare module 'eslint/lib/config/config-validator.js' { declare module.exports: $Exports<'eslint/lib/config/config-validator'>; } declare module 'eslint/lib/config/environments.js' { declare module.exports: $Exports<'eslint/lib/config/environments'>; } declare module 'eslint/lib/config/plugins.js' { declare module.exports: $Exports<'eslint/lib/config/plugins'>; } declare module 'eslint/lib/formatters/checkstyle.js' { declare module.exports: $Exports<'eslint/lib/formatters/checkstyle'>; } declare module 'eslint/lib/formatters/codeframe.js' { declare module.exports: $Exports<'eslint/lib/formatters/codeframe'>; } declare module 'eslint/lib/formatters/compact.js' { declare module.exports: $Exports<'eslint/lib/formatters/compact'>; } declare module 'eslint/lib/formatters/html.js' { declare module.exports: $Exports<'eslint/lib/formatters/html'>; } declare module 'eslint/lib/formatters/jslint-xml.js' { declare module.exports: $Exports<'eslint/lib/formatters/jslint-xml'>; } declare module 'eslint/lib/formatters/json-with-metadata.js' { declare module.exports: $Exports<'eslint/lib/formatters/json-with-metadata'>; } declare module 'eslint/lib/formatters/json.js' { declare module.exports: $Exports<'eslint/lib/formatters/json'>; } declare module 'eslint/lib/formatters/junit.js' { declare module.exports: $Exports<'eslint/lib/formatters/junit'>; } declare module 'eslint/lib/formatters/stylish.js' { declare module.exports: $Exports<'eslint/lib/formatters/stylish'>; } declare module 'eslint/lib/formatters/table.js' { declare module.exports: $Exports<'eslint/lib/formatters/table'>; } declare module 'eslint/lib/formatters/tap.js' { declare module.exports: $Exports<'eslint/lib/formatters/tap'>; } declare module 'eslint/lib/formatters/unix.js' { declare module.exports: $Exports<'eslint/lib/formatters/unix'>; } declare module 'eslint/lib/formatters/visualstudio.js' { declare module.exports: $Exports<'eslint/lib/formatters/visualstudio'>; } declare module 'eslint/lib/linter.js' { declare module.exports: $Exports<'eslint/lib/linter'>; } declare module 'eslint/lib/load-rules.js' { declare module.exports: $Exports<'eslint/lib/load-rules'>; } declare module 'eslint/lib/options.js' { declare module.exports: $Exports<'eslint/lib/options'>; } declare module 'eslint/lib/rules.js' { declare module.exports: $Exports<'eslint/lib/rules'>; } declare module 'eslint/lib/rules/accessor-pairs.js' { declare module.exports: $Exports<'eslint/lib/rules/accessor-pairs'>; } declare module 'eslint/lib/rules/array-bracket-newline.js' { declare module.exports: $Exports<'eslint/lib/rules/array-bracket-newline'>; } declare module 'eslint/lib/rules/array-bracket-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/array-bracket-spacing'>; } declare module 'eslint/lib/rules/array-callback-return.js' { declare module.exports: $Exports<'eslint/lib/rules/array-callback-return'>; } declare module 'eslint/lib/rules/array-element-newline.js' { declare module.exports: $Exports<'eslint/lib/rules/array-element-newline'>; } declare module 'eslint/lib/rules/arrow-body-style.js' { declare module.exports: $Exports<'eslint/lib/rules/arrow-body-style'>; } declare module 'eslint/lib/rules/arrow-parens.js' { declare module.exports: $Exports<'eslint/lib/rules/arrow-parens'>; } declare module 'eslint/lib/rules/arrow-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/arrow-spacing'>; } declare module 'eslint/lib/rules/block-scoped-var.js' { declare module.exports: $Exports<'eslint/lib/rules/block-scoped-var'>; } declare module 'eslint/lib/rules/block-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/block-spacing'>; } declare module 'eslint/lib/rules/brace-style.js' { declare module.exports: $Exports<'eslint/lib/rules/brace-style'>; } declare module 'eslint/lib/rules/callback-return.js' { declare module.exports: $Exports<'eslint/lib/rules/callback-return'>; } declare module 'eslint/lib/rules/camelcase.js' { declare module.exports: $Exports<'eslint/lib/rules/camelcase'>; } declare module 'eslint/lib/rules/capitalized-comments.js' { declare module.exports: $Exports<'eslint/lib/rules/capitalized-comments'>; } declare module 'eslint/lib/rules/class-methods-use-this.js' { declare module.exports: $Exports<'eslint/lib/rules/class-methods-use-this'>; } declare module 'eslint/lib/rules/comma-dangle.js' { declare module.exports: $Exports<'eslint/lib/rules/comma-dangle'>; } declare module 'eslint/lib/rules/comma-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/comma-spacing'>; } declare module 'eslint/lib/rules/comma-style.js' { declare module.exports: $Exports<'eslint/lib/rules/comma-style'>; } declare module 'eslint/lib/rules/complexity.js' { declare module.exports: $Exports<'eslint/lib/rules/complexity'>; } declare module 'eslint/lib/rules/computed-property-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/computed-property-spacing'>; } declare module 'eslint/lib/rules/consistent-return.js' { declare module.exports: $Exports<'eslint/lib/rules/consistent-return'>; } declare module 'eslint/lib/rules/consistent-this.js' { declare module.exports: $Exports<'eslint/lib/rules/consistent-this'>; } declare module 'eslint/lib/rules/constructor-super.js' { declare module.exports: $Exports<'eslint/lib/rules/constructor-super'>; } declare module 'eslint/lib/rules/curly.js' { declare module.exports: $Exports<'eslint/lib/rules/curly'>; } declare module 'eslint/lib/rules/default-case.js' { declare module.exports: $Exports<'eslint/lib/rules/default-case'>; } declare module 'eslint/lib/rules/dot-location.js' { declare module.exports: $Exports<'eslint/lib/rules/dot-location'>; } declare module 'eslint/lib/rules/dot-notation.js' { declare module.exports: $Exports<'eslint/lib/rules/dot-notation'>; } declare module 'eslint/lib/rules/eol-last.js' { declare module.exports: $Exports<'eslint/lib/rules/eol-last'>; } declare module 'eslint/lib/rules/eqeqeq.js' { declare module.exports: $Exports<'eslint/lib/rules/eqeqeq'>; } declare module 'eslint/lib/rules/for-direction.js' { declare module.exports: $Exports<'eslint/lib/rules/for-direction'>; } declare module 'eslint/lib/rules/func-call-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/func-call-spacing'>; } declare module 'eslint/lib/rules/func-name-matching.js' { declare module.exports: $Exports<'eslint/lib/rules/func-name-matching'>; } declare module 'eslint/lib/rules/func-names.js' { declare module.exports: $Exports<'eslint/lib/rules/func-names'>; } declare module 'eslint/lib/rules/func-style.js' { declare module.exports: $Exports<'eslint/lib/rules/func-style'>; } declare module 'eslint/lib/rules/function-paren-newline.js' { declare module.exports: $Exports<'eslint/lib/rules/function-paren-newline'>; } declare module 'eslint/lib/rules/generator-star-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/generator-star-spacing'>; } declare module 'eslint/lib/rules/getter-return.js' { declare module.exports: $Exports<'eslint/lib/rules/getter-return'>; } declare module 'eslint/lib/rules/global-require.js' { declare module.exports: $Exports<'eslint/lib/rules/global-require'>; } declare module 'eslint/lib/rules/guard-for-in.js' { declare module.exports: $Exports<'eslint/lib/rules/guard-for-in'>; } declare module 'eslint/lib/rules/handle-callback-err.js' { declare module.exports: $Exports<'eslint/lib/rules/handle-callback-err'>; } declare module 'eslint/lib/rules/id-blacklist.js' { declare module.exports: $Exports<'eslint/lib/rules/id-blacklist'>; } declare module 'eslint/lib/rules/id-length.js' { declare module.exports: $Exports<'eslint/lib/rules/id-length'>; } declare module 'eslint/lib/rules/id-match.js' { declare module.exports: $Exports<'eslint/lib/rules/id-match'>; } declare module 'eslint/lib/rules/implicit-arrow-linebreak.js' { declare module.exports: $Exports<'eslint/lib/rules/implicit-arrow-linebreak'>; } declare module 'eslint/lib/rules/indent-legacy.js' { declare module.exports: $Exports<'eslint/lib/rules/indent-legacy'>; } declare module 'eslint/lib/rules/indent.js' { declare module.exports: $Exports<'eslint/lib/rules/indent'>; } declare module 'eslint/lib/rules/init-declarations.js' { declare module.exports: $Exports<'eslint/lib/rules/init-declarations'>; } declare module 'eslint/lib/rules/jsx-quotes.js' { declare module.exports: $Exports<'eslint/lib/rules/jsx-quotes'>; } declare module 'eslint/lib/rules/key-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/key-spacing'>; } declare module 'eslint/lib/rules/keyword-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/keyword-spacing'>; } declare module 'eslint/lib/rules/line-comment-position.js' { declare module.exports: $Exports<'eslint/lib/rules/line-comment-position'>; } declare module 'eslint/lib/rules/linebreak-style.js' { declare module.exports: $Exports<'eslint/lib/rules/linebreak-style'>; } declare module 'eslint/lib/rules/lines-around-comment.js' { declare module.exports: $Exports<'eslint/lib/rules/lines-around-comment'>; } declare module 'eslint/lib/rules/lines-around-directive.js' { declare module.exports: $Exports<'eslint/lib/rules/lines-around-directive'>; } declare module 'eslint/lib/rules/lines-between-class-members.js' { declare module.exports: $Exports<'eslint/lib/rules/lines-between-class-members'>; } declare module 'eslint/lib/rules/max-classes-per-file.js' { declare module.exports: $Exports<'eslint/lib/rules/max-classes-per-file'>; } declare module 'eslint/lib/rules/max-depth.js' { declare module.exports: $Exports<'eslint/lib/rules/max-depth'>; } declare module 'eslint/lib/rules/max-len.js' { declare module.exports: $Exports<'eslint/lib/rules/max-len'>; } declare module 'eslint/lib/rules/max-lines-per-function.js' { declare module.exports: $Exports<'eslint/lib/rules/max-lines-per-function'>; } declare module 'eslint/lib/rules/max-lines.js' { declare module.exports: $Exports<'eslint/lib/rules/max-lines'>; } declare module 'eslint/lib/rules/max-nested-callbacks.js' { declare module.exports: $Exports<'eslint/lib/rules/max-nested-callbacks'>; } declare module 'eslint/lib/rules/max-params.js' { declare module.exports: $Exports<'eslint/lib/rules/max-params'>; } declare module 'eslint/lib/rules/max-statements-per-line.js' { declare module.exports: $Exports<'eslint/lib/rules/max-statements-per-line'>; } declare module 'eslint/lib/rules/max-statements.js' { declare module.exports: $Exports<'eslint/lib/rules/max-statements'>; } declare module 'eslint/lib/rules/multiline-comment-style.js' { declare module.exports: $Exports<'eslint/lib/rules/multiline-comment-style'>; } declare module 'eslint/lib/rules/multiline-ternary.js' { declare module.exports: $Exports<'eslint/lib/rules/multiline-ternary'>; } declare module 'eslint/lib/rules/new-cap.js' { declare module.exports: $Exports<'eslint/lib/rules/new-cap'>; } declare module 'eslint/lib/rules/new-parens.js' { declare module.exports: $Exports<'eslint/lib/rules/new-parens'>; } declare module 'eslint/lib/rules/newline-after-var.js' { declare module.exports: $Exports<'eslint/lib/rules/newline-after-var'>; } declare module 'eslint/lib/rules/newline-before-return.js' { declare module.exports: $Exports<'eslint/lib/rules/newline-before-return'>; } declare module 'eslint/lib/rules/newline-per-chained-call.js' { declare module.exports: $Exports<'eslint/lib/rules/newline-per-chained-call'>; } declare module 'eslint/lib/rules/no-alert.js' { declare module.exports: $Exports<'eslint/lib/rules/no-alert'>; } declare module 'eslint/lib/rules/no-array-constructor.js' { declare module.exports: $Exports<'eslint/lib/rules/no-array-constructor'>; } declare module 'eslint/lib/rules/no-async-promise-executor.js' { declare module.exports: $Exports<'eslint/lib/rules/no-async-promise-executor'>; } declare module 'eslint/lib/rules/no-await-in-loop.js' { declare module.exports: $Exports<'eslint/lib/rules/no-await-in-loop'>; } declare module 'eslint/lib/rules/no-bitwise.js' { declare module.exports: $Exports<'eslint/lib/rules/no-bitwise'>; } declare module 'eslint/lib/rules/no-buffer-constructor.js' { declare module.exports: $Exports<'eslint/lib/rules/no-buffer-constructor'>; } declare module 'eslint/lib/rules/no-caller.js' { declare module.exports: $Exports<'eslint/lib/rules/no-caller'>; } declare module 'eslint/lib/rules/no-case-declarations.js' { declare module.exports: $Exports<'eslint/lib/rules/no-case-declarations'>; } declare module 'eslint/lib/rules/no-catch-shadow.js' { declare module.exports: $Exports<'eslint/lib/rules/no-catch-shadow'>; } declare module 'eslint/lib/rules/no-class-assign.js' { declare module.exports: $Exports<'eslint/lib/rules/no-class-assign'>; } declare module 'eslint/lib/rules/no-compare-neg-zero.js' { declare module.exports: $Exports<'eslint/lib/rules/no-compare-neg-zero'>; } declare module 'eslint/lib/rules/no-cond-assign.js' { declare module.exports: $Exports<'eslint/lib/rules/no-cond-assign'>; } declare module 'eslint/lib/rules/no-confusing-arrow.js' { declare module.exports: $Exports<'eslint/lib/rules/no-confusing-arrow'>; } declare module 'eslint/lib/rules/no-console.js' { declare module.exports: $Exports<'eslint/lib/rules/no-console'>; } declare module 'eslint/lib/rules/no-const-assign.js' { declare module.exports: $Exports<'eslint/lib/rules/no-const-assign'>; } declare module 'eslint/lib/rules/no-constant-condition.js' { declare module.exports: $Exports<'eslint/lib/rules/no-constant-condition'>; } declare module 'eslint/lib/rules/no-continue.js' { declare module.exports: $Exports<'eslint/lib/rules/no-continue'>; } declare module 'eslint/lib/rules/no-control-regex.js' { declare module.exports: $Exports<'eslint/lib/rules/no-control-regex'>; } declare module 'eslint/lib/rules/no-debugger.js' { declare module.exports: $Exports<'eslint/lib/rules/no-debugger'>; } declare module 'eslint/lib/rules/no-delete-var.js' { declare module.exports: $Exports<'eslint/lib/rules/no-delete-var'>; } declare module 'eslint/lib/rules/no-div-regex.js' { declare module.exports: $Exports<'eslint/lib/rules/no-div-regex'>; } declare module 'eslint/lib/rules/no-dupe-args.js' { declare module.exports: $Exports<'eslint/lib/rules/no-dupe-args'>; } declare module 'eslint/lib/rules/no-dupe-class-members.js' { declare module.exports: $Exports<'eslint/lib/rules/no-dupe-class-members'>; } declare module 'eslint/lib/rules/no-dupe-keys.js' { declare module.exports: $Exports<'eslint/lib/rules/no-dupe-keys'>; } declare module 'eslint/lib/rules/no-duplicate-case.js' { declare module.exports: $Exports<'eslint/lib/rules/no-duplicate-case'>; } declare module 'eslint/lib/rules/no-duplicate-imports.js' { declare module.exports: $Exports<'eslint/lib/rules/no-duplicate-imports'>; } declare module 'eslint/lib/rules/no-else-return.js' { declare module.exports: $Exports<'eslint/lib/rules/no-else-return'>; } declare module 'eslint/lib/rules/no-empty-character-class.js' { declare module.exports: $Exports<'eslint/lib/rules/no-empty-character-class'>; } declare module 'eslint/lib/rules/no-empty-function.js' { declare module.exports: $Exports<'eslint/lib/rules/no-empty-function'>; } declare module 'eslint/lib/rules/no-empty-pattern.js' { declare module.exports: $Exports<'eslint/lib/rules/no-empty-pattern'>; } declare module 'eslint/lib/rules/no-empty.js' { declare module.exports: $Exports<'eslint/lib/rules/no-empty'>; } declare module 'eslint/lib/rules/no-eq-null.js' { declare module.exports: $Exports<'eslint/lib/rules/no-eq-null'>; } declare module 'eslint/lib/rules/no-eval.js' { declare module.exports: $Exports<'eslint/lib/rules/no-eval'>; } declare module 'eslint/lib/rules/no-ex-assign.js' { declare module.exports: $Exports<'eslint/lib/rules/no-ex-assign'>; } declare module 'eslint/lib/rules/no-extend-native.js' { declare module.exports: $Exports<'eslint/lib/rules/no-extend-native'>; } declare module 'eslint/lib/rules/no-extra-bind.js' { declare module.exports: $Exports<'eslint/lib/rules/no-extra-bind'>; } declare module 'eslint/lib/rules/no-extra-boolean-cast.js' { declare module.exports: $Exports<'eslint/lib/rules/no-extra-boolean-cast'>; } declare module 'eslint/lib/rules/no-extra-label.js' { declare module.exports: $Exports<'eslint/lib/rules/no-extra-label'>; } declare module 'eslint/lib/rules/no-extra-parens.js' { declare module.exports: $Exports<'eslint/lib/rules/no-extra-parens'>; } declare module 'eslint/lib/rules/no-extra-semi.js' { declare module.exports: $Exports<'eslint/lib/rules/no-extra-semi'>; } declare module 'eslint/lib/rules/no-fallthrough.js' { declare module.exports: $Exports<'eslint/lib/rules/no-fallthrough'>; } declare module 'eslint/lib/rules/no-floating-decimal.js' { declare module.exports: $Exports<'eslint/lib/rules/no-floating-decimal'>; } declare module 'eslint/lib/rules/no-func-assign.js' { declare module.exports: $Exports<'eslint/lib/rules/no-func-assign'>; } declare module 'eslint/lib/rules/no-global-assign.js' { declare module.exports: $Exports<'eslint/lib/rules/no-global-assign'>; } declare module 'eslint/lib/rules/no-implicit-coercion.js' { declare module.exports: $Exports<'eslint/lib/rules/no-implicit-coercion'>; } declare module 'eslint/lib/rules/no-implicit-globals.js' { declare module.exports: $Exports<'eslint/lib/rules/no-implicit-globals'>; } declare module 'eslint/lib/rules/no-implied-eval.js' { declare module.exports: $Exports<'eslint/lib/rules/no-implied-eval'>; } declare module 'eslint/lib/rules/no-inline-comments.js' { declare module.exports: $Exports<'eslint/lib/rules/no-inline-comments'>; } declare module 'eslint/lib/rules/no-inner-declarations.js' { declare module.exports: $Exports<'eslint/lib/rules/no-inner-declarations'>; } declare module 'eslint/lib/rules/no-invalid-regexp.js' { declare module.exports: $Exports<'eslint/lib/rules/no-invalid-regexp'>; } declare module 'eslint/lib/rules/no-invalid-this.js' { declare module.exports: $Exports<'eslint/lib/rules/no-invalid-this'>; } declare module 'eslint/lib/rules/no-irregular-whitespace.js' { declare module.exports: $Exports<'eslint/lib/rules/no-irregular-whitespace'>; } declare module 'eslint/lib/rules/no-iterator.js' { declare module.exports: $Exports<'eslint/lib/rules/no-iterator'>; } declare module 'eslint/lib/rules/no-label-var.js' { declare module.exports: $Exports<'eslint/lib/rules/no-label-var'>; } declare module 'eslint/lib/rules/no-labels.js' { declare module.exports: $Exports<'eslint/lib/rules/no-labels'>; } declare module 'eslint/lib/rules/no-lone-blocks.js' { declare module.exports: $Exports<'eslint/lib/rules/no-lone-blocks'>; } declare module 'eslint/lib/rules/no-lonely-if.js' { declare module.exports: $Exports<'eslint/lib/rules/no-lonely-if'>; } declare module 'eslint/lib/rules/no-loop-func.js' { declare module.exports: $Exports<'eslint/lib/rules/no-loop-func'>; } declare module 'eslint/lib/rules/no-magic-numbers.js' { declare module.exports: $Exports<'eslint/lib/rules/no-magic-numbers'>; } declare module 'eslint/lib/rules/no-misleading-character-class.js' { declare module.exports: $Exports<'eslint/lib/rules/no-misleading-character-class'>; } declare module 'eslint/lib/rules/no-mixed-operators.js' { declare module.exports: $Exports<'eslint/lib/rules/no-mixed-operators'>; } declare module 'eslint/lib/rules/no-mixed-requires.js' { declare module.exports: $Exports<'eslint/lib/rules/no-mixed-requires'>; } declare module 'eslint/lib/rules/no-mixed-spaces-and-tabs.js' { declare module.exports: $Exports<'eslint/lib/rules/no-mixed-spaces-and-tabs'>; } declare module 'eslint/lib/rules/no-multi-assign.js' { declare module.exports: $Exports<'eslint/lib/rules/no-multi-assign'>; } declare module 'eslint/lib/rules/no-multi-spaces.js' { declare module.exports: $Exports<'eslint/lib/rules/no-multi-spaces'>; } declare module 'eslint/lib/rules/no-multi-str.js' { declare module.exports: $Exports<'eslint/lib/rules/no-multi-str'>; } declare module 'eslint/lib/rules/no-multiple-empty-lines.js' { declare module.exports: $Exports<'eslint/lib/rules/no-multiple-empty-lines'>; } declare module 'eslint/lib/rules/no-native-reassign.js' { declare module.exports: $Exports<'eslint/lib/rules/no-native-reassign'>; } declare module 'eslint/lib/rules/no-negated-condition.js' { declare module.exports: $Exports<'eslint/lib/rules/no-negated-condition'>; } declare module 'eslint/lib/rules/no-negated-in-lhs.js' { declare module.exports: $Exports<'eslint/lib/rules/no-negated-in-lhs'>; } declare module 'eslint/lib/rules/no-nested-ternary.js' { declare module.exports: $Exports<'eslint/lib/rules/no-nested-ternary'>; } declare module 'eslint/lib/rules/no-new-func.js' { declare module.exports: $Exports<'eslint/lib/rules/no-new-func'>; } declare module 'eslint/lib/rules/no-new-object.js' { declare module.exports: $Exports<'eslint/lib/rules/no-new-object'>; } declare module 'eslint/lib/rules/no-new-require.js' { declare module.exports: $Exports<'eslint/lib/rules/no-new-require'>; } declare module 'eslint/lib/rules/no-new-symbol.js' { declare module.exports: $Exports<'eslint/lib/rules/no-new-symbol'>; } declare module 'eslint/lib/rules/no-new-wrappers.js' { declare module.exports: $Exports<'eslint/lib/rules/no-new-wrappers'>; } declare module 'eslint/lib/rules/no-new.js' { declare module.exports: $Exports<'eslint/lib/rules/no-new'>; } declare module 'eslint/lib/rules/no-obj-calls.js' { declare module.exports: $Exports<'eslint/lib/rules/no-obj-calls'>; } declare module 'eslint/lib/rules/no-octal-escape.js' { declare module.exports: $Exports<'eslint/lib/rules/no-octal-escape'>; } declare module 'eslint/lib/rules/no-octal.js' { declare module.exports: $Exports<'eslint/lib/rules/no-octal'>; } declare module 'eslint/lib/rules/no-param-reassign.js' { declare module.exports: $Exports<'eslint/lib/rules/no-param-reassign'>; } declare module 'eslint/lib/rules/no-path-concat.js' { declare module.exports: $Exports<'eslint/lib/rules/no-path-concat'>; } declare module 'eslint/lib/rules/no-plusplus.js' { declare module.exports: $Exports<'eslint/lib/rules/no-plusplus'>; } declare module 'eslint/lib/rules/no-process-env.js' { declare module.exports: $Exports<'eslint/lib/rules/no-process-env'>; } declare module 'eslint/lib/rules/no-process-exit.js' { declare module.exports: $Exports<'eslint/lib/rules/no-process-exit'>; } declare module 'eslint/lib/rules/no-proto.js' { declare module.exports: $Exports<'eslint/lib/rules/no-proto'>; } declare module 'eslint/lib/rules/no-prototype-builtins.js' { declare module.exports: $Exports<'eslint/lib/rules/no-prototype-builtins'>; } declare module 'eslint/lib/rules/no-redeclare.js' { declare module.exports: $Exports<'eslint/lib/rules/no-redeclare'>; } declare module 'eslint/lib/rules/no-regex-spaces.js' { declare module.exports: $Exports<'eslint/lib/rules/no-regex-spaces'>; } declare module 'eslint/lib/rules/no-restricted-globals.js' { declare module.exports: $Exports<'eslint/lib/rules/no-restricted-globals'>; } declare module 'eslint/lib/rules/no-restricted-imports.js' { declare module.exports: $Exports<'eslint/lib/rules/no-restricted-imports'>; } declare module 'eslint/lib/rules/no-restricted-modules.js' { declare module.exports: $Exports<'eslint/lib/rules/no-restricted-modules'>; } declare module 'eslint/lib/rules/no-restricted-properties.js' { declare module.exports: $Exports<'eslint/lib/rules/no-restricted-properties'>; } declare module 'eslint/lib/rules/no-restricted-syntax.js' { declare module.exports: $Exports<'eslint/lib/rules/no-restricted-syntax'>; } declare module 'eslint/lib/rules/no-return-assign.js' { declare module.exports: $Exports<'eslint/lib/rules/no-return-assign'>; } declare module 'eslint/lib/rules/no-return-await.js' { declare module.exports: $Exports<'eslint/lib/rules/no-return-await'>; } declare module 'eslint/lib/rules/no-script-url.js' { declare module.exports: $Exports<'eslint/lib/rules/no-script-url'>; } declare module 'eslint/lib/rules/no-self-assign.js' { declare module.exports: $Exports<'eslint/lib/rules/no-self-assign'>; } declare module 'eslint/lib/rules/no-self-compare.js' { declare module.exports: $Exports<'eslint/lib/rules/no-self-compare'>; } declare module 'eslint/lib/rules/no-sequences.js' { declare module.exports: $Exports<'eslint/lib/rules/no-sequences'>; } declare module 'eslint/lib/rules/no-shadow-restricted-names.js' { declare module.exports: $Exports<'eslint/lib/rules/no-shadow-restricted-names'>; } declare module 'eslint/lib/rules/no-shadow.js' { declare module.exports: $Exports<'eslint/lib/rules/no-shadow'>; } declare module 'eslint/lib/rules/no-spaced-func.js' { declare module.exports: $Exports<'eslint/lib/rules/no-spaced-func'>; } declare module 'eslint/lib/rules/no-sparse-arrays.js' { declare module.exports: $Exports<'eslint/lib/rules/no-sparse-arrays'>; } declare module 'eslint/lib/rules/no-sync.js' { declare module.exports: $Exports<'eslint/lib/rules/no-sync'>; } declare module 'eslint/lib/rules/no-tabs.js' { declare module.exports: $Exports<'eslint/lib/rules/no-tabs'>; } declare module 'eslint/lib/rules/no-template-curly-in-string.js' { declare module.exports: $Exports<'eslint/lib/rules/no-template-curly-in-string'>; } declare module 'eslint/lib/rules/no-ternary.js' { declare module.exports: $Exports<'eslint/lib/rules/no-ternary'>; } declare module 'eslint/lib/rules/no-this-before-super.js' { declare module.exports: $Exports<'eslint/lib/rules/no-this-before-super'>; } declare module 'eslint/lib/rules/no-throw-literal.js' { declare module.exports: $Exports<'eslint/lib/rules/no-throw-literal'>; } declare module 'eslint/lib/rules/no-trailing-spaces.js' { declare module.exports: $Exports<'eslint/lib/rules/no-trailing-spaces'>; } declare module 'eslint/lib/rules/no-undef-init.js' { declare module.exports: $Exports<'eslint/lib/rules/no-undef-init'>; } declare module 'eslint/lib/rules/no-undef.js' { declare module.exports: $Exports<'eslint/lib/rules/no-undef'>; } declare module 'eslint/lib/rules/no-undefined.js' { declare module.exports: $Exports<'eslint/lib/rules/no-undefined'>; } declare module 'eslint/lib/rules/no-underscore-dangle.js' { declare module.exports: $Exports<'eslint/lib/rules/no-underscore-dangle'>; } declare module 'eslint/lib/rules/no-unexpected-multiline.js' { declare module.exports: $Exports<'eslint/lib/rules/no-unexpected-multiline'>; } declare module 'eslint/lib/rules/no-unmodified-loop-condition.js' { declare module.exports: $Exports<'eslint/lib/rules/no-unmodified-loop-condition'>; } declare module 'eslint/lib/rules/no-unneeded-ternary.js' { declare module.exports: $Exports<'eslint/lib/rules/no-unneeded-ternary'>; } declare module 'eslint/lib/rules/no-unreachable.js' { declare module.exports: $Exports<'eslint/lib/rules/no-unreachable'>; } declare module 'eslint/lib/rules/no-unsafe-finally.js' { declare module.exports: $Exports<'eslint/lib/rules/no-unsafe-finally'>; } declare module 'eslint/lib/rules/no-unsafe-negation.js' { declare module.exports: $Exports<'eslint/lib/rules/no-unsafe-negation'>; } declare module 'eslint/lib/rules/no-unused-expressions.js' { declare module.exports: $Exports<'eslint/lib/rules/no-unused-expressions'>; } declare module 'eslint/lib/rules/no-unused-labels.js' { declare module.exports: $Exports<'eslint/lib/rules/no-unused-labels'>; } declare module 'eslint/lib/rules/no-unused-vars.js' { declare module.exports: $Exports<'eslint/lib/rules/no-unused-vars'>; } declare module 'eslint/lib/rules/no-use-before-define.js' { declare module.exports: $Exports<'eslint/lib/rules/no-use-before-define'>; } declare module 'eslint/lib/rules/no-useless-call.js' { declare module.exports: $Exports<'eslint/lib/rules/no-useless-call'>; } declare module 'eslint/lib/rules/no-useless-catch.js' { declare module.exports: $Exports<'eslint/lib/rules/no-useless-catch'>; } declare module 'eslint/lib/rules/no-useless-computed-key.js' { declare module.exports: $Exports<'eslint/lib/rules/no-useless-computed-key'>; } declare module 'eslint/lib/rules/no-useless-concat.js' { declare module.exports: $Exports<'eslint/lib/rules/no-useless-concat'>; } declare module 'eslint/lib/rules/no-useless-constructor.js' { declare module.exports: $Exports<'eslint/lib/rules/no-useless-constructor'>; } declare module 'eslint/lib/rules/no-useless-escape.js' { declare module.exports: $Exports<'eslint/lib/rules/no-useless-escape'>; } declare module 'eslint/lib/rules/no-useless-rename.js' { declare module.exports: $Exports<'eslint/lib/rules/no-useless-rename'>; } declare module 'eslint/lib/rules/no-useless-return.js' { declare module.exports: $Exports<'eslint/lib/rules/no-useless-return'>; } declare module 'eslint/lib/rules/no-var.js' { declare module.exports: $Exports<'eslint/lib/rules/no-var'>; } declare module 'eslint/lib/rules/no-void.js' { declare module.exports: $Exports<'eslint/lib/rules/no-void'>; } declare module 'eslint/lib/rules/no-warning-comments.js' { declare module.exports: $Exports<'eslint/lib/rules/no-warning-comments'>; } declare module 'eslint/lib/rules/no-whitespace-before-property.js' { declare module.exports: $Exports<'eslint/lib/rules/no-whitespace-before-property'>; } declare module 'eslint/lib/rules/no-with.js' { declare module.exports: $Exports<'eslint/lib/rules/no-with'>; } declare module 'eslint/lib/rules/nonblock-statement-body-position.js' { declare module.exports: $Exports<'eslint/lib/rules/nonblock-statement-body-position'>; } declare module 'eslint/lib/rules/object-curly-newline.js' { declare module.exports: $Exports<'eslint/lib/rules/object-curly-newline'>; } declare module 'eslint/lib/rules/object-curly-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/object-curly-spacing'>; } declare module 'eslint/lib/rules/object-property-newline.js' { declare module.exports: $Exports<'eslint/lib/rules/object-property-newline'>; } declare module 'eslint/lib/rules/object-shorthand.js' { declare module.exports: $Exports<'eslint/lib/rules/object-shorthand'>; } declare module 'eslint/lib/rules/one-var-declaration-per-line.js' { declare module.exports: $Exports<'eslint/lib/rules/one-var-declaration-per-line'>; } declare module 'eslint/lib/rules/one-var.js' { declare module.exports: $Exports<'eslint/lib/rules/one-var'>; } declare module 'eslint/lib/rules/operator-assignment.js' { declare module.exports: $Exports<'eslint/lib/rules/operator-assignment'>; } declare module 'eslint/lib/rules/operator-linebreak.js' { declare module.exports: $Exports<'eslint/lib/rules/operator-linebreak'>; } declare module 'eslint/lib/rules/padded-blocks.js' { declare module.exports: $Exports<'eslint/lib/rules/padded-blocks'>; } declare module 'eslint/lib/rules/padding-line-between-statements.js' { declare module.exports: $Exports<'eslint/lib/rules/padding-line-between-statements'>; } declare module 'eslint/lib/rules/prefer-arrow-callback.js' { declare module.exports: $Exports<'eslint/lib/rules/prefer-arrow-callback'>; } declare module 'eslint/lib/rules/prefer-const.js' { declare module.exports: $Exports<'eslint/lib/rules/prefer-const'>; } declare module 'eslint/lib/rules/prefer-destructuring.js' { declare module.exports: $Exports<'eslint/lib/rules/prefer-destructuring'>; } declare module 'eslint/lib/rules/prefer-named-capture-group.js' { declare module.exports: $Exports<'eslint/lib/rules/prefer-named-capture-group'>; } declare module 'eslint/lib/rules/prefer-numeric-literals.js' { declare module.exports: $Exports<'eslint/lib/rules/prefer-numeric-literals'>; } declare module 'eslint/lib/rules/prefer-object-spread.js' { declare module.exports: $Exports<'eslint/lib/rules/prefer-object-spread'>; } declare module 'eslint/lib/rules/prefer-promise-reject-errors.js' { declare module.exports: $Exports<'eslint/lib/rules/prefer-promise-reject-errors'>; } declare module 'eslint/lib/rules/prefer-reflect.js' { declare module.exports: $Exports<'eslint/lib/rules/prefer-reflect'>; } declare module 'eslint/lib/rules/prefer-rest-params.js' { declare module.exports: $Exports<'eslint/lib/rules/prefer-rest-params'>; } declare module 'eslint/lib/rules/prefer-spread.js' { declare module.exports: $Exports<'eslint/lib/rules/prefer-spread'>; } declare module 'eslint/lib/rules/prefer-template.js' { declare module.exports: $Exports<'eslint/lib/rules/prefer-template'>; } declare module 'eslint/lib/rules/quote-props.js' { declare module.exports: $Exports<'eslint/lib/rules/quote-props'>; } declare module 'eslint/lib/rules/quotes.js' { declare module.exports: $Exports<'eslint/lib/rules/quotes'>; } declare module 'eslint/lib/rules/radix.js' { declare module.exports: $Exports<'eslint/lib/rules/radix'>; } declare module 'eslint/lib/rules/require-atomic-updates.js' { declare module.exports: $Exports<'eslint/lib/rules/require-atomic-updates'>; } declare module 'eslint/lib/rules/require-await.js' { declare module.exports: $Exports<'eslint/lib/rules/require-await'>; } declare module 'eslint/lib/rules/require-jsdoc.js' { declare module.exports: $Exports<'eslint/lib/rules/require-jsdoc'>; } declare module 'eslint/lib/rules/require-unicode-regexp.js' { declare module.exports: $Exports<'eslint/lib/rules/require-unicode-regexp'>; } declare module 'eslint/lib/rules/require-yield.js' { declare module.exports: $Exports<'eslint/lib/rules/require-yield'>; } declare module 'eslint/lib/rules/rest-spread-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/rest-spread-spacing'>; } declare module 'eslint/lib/rules/semi-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/semi-spacing'>; } declare module 'eslint/lib/rules/semi-style.js' { declare module.exports: $Exports<'eslint/lib/rules/semi-style'>; } declare module 'eslint/lib/rules/semi.js' { declare module.exports: $Exports<'eslint/lib/rules/semi'>; } declare module 'eslint/lib/rules/sort-imports.js' { declare module.exports: $Exports<'eslint/lib/rules/sort-imports'>; } declare module 'eslint/lib/rules/sort-keys.js' { declare module.exports: $Exports<'eslint/lib/rules/sort-keys'>; } declare module 'eslint/lib/rules/sort-vars.js' { declare module.exports: $Exports<'eslint/lib/rules/sort-vars'>; } declare module 'eslint/lib/rules/space-before-blocks.js' { declare module.exports: $Exports<'eslint/lib/rules/space-before-blocks'>; } declare module 'eslint/lib/rules/space-before-function-paren.js' { declare module.exports: $Exports<'eslint/lib/rules/space-before-function-paren'>; } declare module 'eslint/lib/rules/space-in-parens.js' { declare module.exports: $Exports<'eslint/lib/rules/space-in-parens'>; } declare module 'eslint/lib/rules/space-infix-ops.js' { declare module.exports: $Exports<'eslint/lib/rules/space-infix-ops'>; } declare module 'eslint/lib/rules/space-unary-ops.js' { declare module.exports: $Exports<'eslint/lib/rules/space-unary-ops'>; } declare module 'eslint/lib/rules/spaced-comment.js' { declare module.exports: $Exports<'eslint/lib/rules/spaced-comment'>; } declare module 'eslint/lib/rules/strict.js' { declare module.exports: $Exports<'eslint/lib/rules/strict'>; } declare module 'eslint/lib/rules/switch-colon-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/switch-colon-spacing'>; } declare module 'eslint/lib/rules/symbol-description.js' { declare module.exports: $Exports<'eslint/lib/rules/symbol-description'>; } declare module 'eslint/lib/rules/template-curly-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/template-curly-spacing'>; } declare module 'eslint/lib/rules/template-tag-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/template-tag-spacing'>; } declare module 'eslint/lib/rules/unicode-bom.js' { declare module.exports: $Exports<'eslint/lib/rules/unicode-bom'>; } declare module 'eslint/lib/rules/use-isnan.js' { declare module.exports: $Exports<'eslint/lib/rules/use-isnan'>; } declare module 'eslint/lib/rules/valid-jsdoc.js' { declare module.exports: $Exports<'eslint/lib/rules/valid-jsdoc'>; } declare module 'eslint/lib/rules/valid-typeof.js' { declare module.exports: $Exports<'eslint/lib/rules/valid-typeof'>; } declare module 'eslint/lib/rules/vars-on-top.js' { declare module.exports: $Exports<'eslint/lib/rules/vars-on-top'>; } declare module 'eslint/lib/rules/wrap-iife.js' { declare module.exports: $Exports<'eslint/lib/rules/wrap-iife'>; } declare module 'eslint/lib/rules/wrap-regex.js' { declare module.exports: $Exports<'eslint/lib/rules/wrap-regex'>; } declare module 'eslint/lib/rules/yield-star-spacing.js' { declare module.exports: $Exports<'eslint/lib/rules/yield-star-spacing'>; } declare module 'eslint/lib/rules/yoda.js' { declare module.exports: $Exports<'eslint/lib/rules/yoda'>; } declare module 'eslint/lib/testers/rule-tester.js' { declare module.exports: $Exports<'eslint/lib/testers/rule-tester'>; } declare module 'eslint/lib/token-store/backward-token-comment-cursor.js' { declare module.exports: $Exports<'eslint/lib/token-store/backward-token-comment-cursor'>; } declare module 'eslint/lib/token-store/backward-token-cursor.js' { declare module.exports: $Exports<'eslint/lib/token-store/backward-token-cursor'>; } declare module 'eslint/lib/token-store/cursor.js' { declare module.exports: $Exports<'eslint/lib/token-store/cursor'>; } declare module 'eslint/lib/token-store/cursors.js' { declare module.exports: $Exports<'eslint/lib/token-store/cursors'>; } declare module 'eslint/lib/token-store/decorative-cursor.js' { declare module.exports: $Exports<'eslint/lib/token-store/decorative-cursor'>; } declare module 'eslint/lib/token-store/filter-cursor.js' { declare module.exports: $Exports<'eslint/lib/token-store/filter-cursor'>; } declare module 'eslint/lib/token-store/forward-token-comment-cursor.js' { declare module.exports: $Exports<'eslint/lib/token-store/forward-token-comment-cursor'>; } declare module 'eslint/lib/token-store/forward-token-cursor.js' { declare module.exports: $Exports<'eslint/lib/token-store/forward-token-cursor'>; } declare module 'eslint/lib/token-store/index.js' { declare module.exports: $Exports<'eslint/lib/token-store/index'>; } declare module 'eslint/lib/token-store/limit-cursor.js' { declare module.exports: $Exports<'eslint/lib/token-store/limit-cursor'>; } declare module 'eslint/lib/token-store/padded-token-cursor.js' { declare module.exports: $Exports<'eslint/lib/token-store/padded-token-cursor'>; } declare module 'eslint/lib/token-store/skip-cursor.js' { declare module.exports: $Exports<'eslint/lib/token-store/skip-cursor'>; } declare module 'eslint/lib/token-store/utils.js' { declare module.exports: $Exports<'eslint/lib/token-store/utils'>; } declare module 'eslint/lib/util/ajv.js' { declare module.exports: $Exports<'eslint/lib/util/ajv'>; } declare module 'eslint/lib/util/apply-disable-directives.js' { declare module.exports: $Exports<'eslint/lib/util/apply-disable-directives'>; } declare module 'eslint/lib/util/ast-utils.js' { declare module.exports: $Exports<'eslint/lib/util/ast-utils'>; } declare module 'eslint/lib/util/config-comment-parser.js' { declare module.exports: $Exports<'eslint/lib/util/config-comment-parser'>; } declare module 'eslint/lib/util/file-finder.js' { declare module.exports: $Exports<'eslint/lib/util/file-finder'>; } declare module 'eslint/lib/util/fix-tracker.js' { declare module.exports: $Exports<'eslint/lib/util/fix-tracker'>; } declare module 'eslint/lib/util/glob-utils.js' { declare module.exports: $Exports<'eslint/lib/util/glob-utils'>; } declare module 'eslint/lib/util/glob.js' { declare module.exports: $Exports<'eslint/lib/util/glob'>; } declare module 'eslint/lib/util/hash.js' { declare module.exports: $Exports<'eslint/lib/util/hash'>; } declare module 'eslint/lib/util/ignored-paths.js' { declare module.exports: $Exports<'eslint/lib/util/ignored-paths'>; } declare module 'eslint/lib/util/interpolate.js' { declare module.exports: $Exports<'eslint/lib/util/interpolate'>; } declare module 'eslint/lib/util/keywords.js' { declare module.exports: $Exports<'eslint/lib/util/keywords'>; } declare module 'eslint/lib/util/lint-result-cache.js' { declare module.exports: $Exports<'eslint/lib/util/lint-result-cache'>; } declare module 'eslint/lib/util/logging.js' { declare module.exports: $Exports<'eslint/lib/util/logging'>; } declare module 'eslint/lib/util/module-resolver.js' { declare module.exports: $Exports<'eslint/lib/util/module-resolver'>; } declare module 'eslint/lib/util/naming.js' { declare module.exports: $Exports<'eslint/lib/util/naming'>; } declare module 'eslint/lib/util/node-event-generator.js' { declare module.exports: $Exports<'eslint/lib/util/node-event-generator'>; } declare module 'eslint/lib/util/npm-utils.js' { declare module.exports: $Exports<'eslint/lib/util/npm-utils'>; } declare module 'eslint/lib/util/path-utils.js' { declare module.exports: $Exports<'eslint/lib/util/path-utils'>; } declare module 'eslint/lib/util/patterns/letters.js' { declare module.exports: $Exports<'eslint/lib/util/patterns/letters'>; } declare module 'eslint/lib/util/report-translator.js' { declare module.exports: $Exports<'eslint/lib/util/report-translator'>; } declare module 'eslint/lib/util/rule-fixer.js' { declare module.exports: $Exports<'eslint/lib/util/rule-fixer'>; } declare module 'eslint/lib/util/safe-emitter.js' { declare module.exports: $Exports<'eslint/lib/util/safe-emitter'>; } declare module 'eslint/lib/util/source-code-fixer.js' { declare module.exports: $Exports<'eslint/lib/util/source-code-fixer'>; } declare module 'eslint/lib/util/source-code-utils.js' { declare module.exports: $Exports<'eslint/lib/util/source-code-utils'>; } declare module 'eslint/lib/util/source-code.js' { declare module.exports: $Exports<'eslint/lib/util/source-code'>; } declare module 'eslint/lib/util/timing.js' { declare module.exports: $Exports<'eslint/lib/util/timing'>; } declare module 'eslint/lib/util/traverser.js' { declare module.exports: $Exports<'eslint/lib/util/traverser'>; } declare module 'eslint/lib/util/unicode/index.js' { declare module.exports: $Exports<'eslint/lib/util/unicode/index'>; } declare module 'eslint/lib/util/unicode/is-combining-character.js' { declare module.exports: $Exports<'eslint/lib/util/unicode/is-combining-character'>; } declare module 'eslint/lib/util/unicode/is-emoji-modifier.js' { declare module.exports: $Exports<'eslint/lib/util/unicode/is-emoji-modifier'>; } declare module 'eslint/lib/util/unicode/is-regional-indicator-symbol.js' { declare module.exports: $Exports<'eslint/lib/util/unicode/is-regional-indicator-symbol'>; } declare module 'eslint/lib/util/unicode/is-surrogate-pair.js' { declare module.exports: $Exports<'eslint/lib/util/unicode/is-surrogate-pair'>; } declare module 'eslint/lib/util/xml-escape.js' { declare module.exports: $Exports<'eslint/lib/util/xml-escape'>; } ================================================ FILE: flow-typed/npm/flow-bin_v0.x.x.js ================================================ // flow-typed signature: 6a5610678d4b01e13bbfbbc62bdaf583 // flow-typed version: 3817bc6980/flow-bin_v0.x.x/flow_>=v0.25.x declare module "flow-bin" { declare module.exports: string; } ================================================ FILE: flow-typed/npm/flow-copy-source_vx.x.x.js ================================================ // flow-typed signature: 3ed47d59fef3e49b6acb421f160a6a92 // flow-typed version: <>/flow-copy-source_v^2.0.6/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'flow-copy-source' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'flow-copy-source' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'flow-copy-source/bin/flow-copy-source' { declare module.exports: any; } declare module 'flow-copy-source/src/index' { declare module.exports: any; } declare module 'flow-copy-source/src/kefir-copy-file' { declare module.exports: any; } declare module 'flow-copy-source/src/kefir-glob' { declare module.exports: any; } // Filename aliases declare module 'flow-copy-source/bin/flow-copy-source.js' { declare module.exports: $Exports<'flow-copy-source/bin/flow-copy-source'>; } declare module 'flow-copy-source/src/index.js' { declare module.exports: $Exports<'flow-copy-source/src/index'>; } declare module 'flow-copy-source/src/kefir-copy-file.js' { declare module.exports: $Exports<'flow-copy-source/src/kefir-copy-file'>; } declare module 'flow-copy-source/src/kefir-glob.js' { declare module.exports: $Exports<'flow-copy-source/src/kefir-glob'>; } ================================================ FILE: flow-typed/npm/flow-coverage-report_vx.x.x.js ================================================ // flow-typed signature: 943a561ea5590b391c40ebc47fe3e554 // flow-typed version: <>/flow-coverage-report_v^0.6.1/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'flow-coverage-report' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'flow-coverage-report' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'flow-coverage-report/assets/codemirror-annotatescrollbar-addon' { declare module.exports: any; } declare module 'flow-coverage-report/assets/codemirror-javascript-mode' { declare module.exports: any; } declare module 'flow-coverage-report/assets/codemirror-simplescrollbars-addon' { declare module.exports: any; } declare module 'flow-coverage-report/assets/codemirror' { declare module.exports: any; } declare module 'flow-coverage-report/assets/flow-highlight-source' { declare module.exports: any; } declare module 'flow-coverage-report/assets/index' { declare module.exports: any; } declare module 'flow-coverage-report/assets/jquery-3.1.0.min' { declare module.exports: any; } declare module 'flow-coverage-report/assets/semantic-tablesort' { declare module.exports: any; } declare module 'flow-coverage-report/assets/semantic.min' { declare module.exports: any; } declare module 'flow-coverage-report/bin/flow-coverage-report' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/cli/args' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/cli/config' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/cli/index' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/components/body-coverage-sourcefile' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/components/body-coverage-summary' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/components/coverage-file-table-head' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/components/coverage-file-table-row' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/components/coverage-meter-bar' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/components/coverage-summary-table' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/components/footer' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/components/head' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/components/html-report-page' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/flow' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/index' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/promisified' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/report-badge' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/report-html' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/report-json' { declare module.exports: any; } declare module 'flow-coverage-report/dist/lib/report-text' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/cli/args' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/cli/config' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/cli/index' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/components/body-coverage-sourcefile' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/components/body-coverage-summary' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/components/coverage-file-table-head' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/components/coverage-file-table-row' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/components/coverage-meter-bar' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/components/coverage-summary-table' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/components/footer' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/components/head' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/components/html-report-page' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/flow' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/index' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/promisified' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/report-badge' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/report-html' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/report-json' { declare module.exports: any; } declare module 'flow-coverage-report/src/lib/report-text' { declare module.exports: any; } // Filename aliases declare module 'flow-coverage-report/assets/codemirror-annotatescrollbar-addon.js' { declare module.exports: $Exports<'flow-coverage-report/assets/codemirror-annotatescrollbar-addon'>; } declare module 'flow-coverage-report/assets/codemirror-javascript-mode.js' { declare module.exports: $Exports<'flow-coverage-report/assets/codemirror-javascript-mode'>; } declare module 'flow-coverage-report/assets/codemirror-simplescrollbars-addon.js' { declare module.exports: $Exports<'flow-coverage-report/assets/codemirror-simplescrollbars-addon'>; } declare module 'flow-coverage-report/assets/codemirror.js' { declare module.exports: $Exports<'flow-coverage-report/assets/codemirror'>; } declare module 'flow-coverage-report/assets/flow-highlight-source.js' { declare module.exports: $Exports<'flow-coverage-report/assets/flow-highlight-source'>; } declare module 'flow-coverage-report/assets/index.js' { declare module.exports: $Exports<'flow-coverage-report/assets/index'>; } declare module 'flow-coverage-report/assets/jquery-3.1.0.min.js' { declare module.exports: $Exports<'flow-coverage-report/assets/jquery-3.1.0.min'>; } declare module 'flow-coverage-report/assets/semantic-tablesort.js' { declare module.exports: $Exports<'flow-coverage-report/assets/semantic-tablesort'>; } declare module 'flow-coverage-report/assets/semantic.min.js' { declare module.exports: $Exports<'flow-coverage-report/assets/semantic.min'>; } declare module 'flow-coverage-report/bin/flow-coverage-report.js' { declare module.exports: $Exports<'flow-coverage-report/bin/flow-coverage-report'>; } declare module 'flow-coverage-report/dist/lib/cli/args.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/cli/args'>; } declare module 'flow-coverage-report/dist/lib/cli/config.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/cli/config'>; } declare module 'flow-coverage-report/dist/lib/cli/index.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/cli/index'>; } declare module 'flow-coverage-report/dist/lib/components/body-coverage-sourcefile.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/components/body-coverage-sourcefile'>; } declare module 'flow-coverage-report/dist/lib/components/body-coverage-summary.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/components/body-coverage-summary'>; } declare module 'flow-coverage-report/dist/lib/components/coverage-file-table-head.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/components/coverage-file-table-head'>; } declare module 'flow-coverage-report/dist/lib/components/coverage-file-table-row.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/components/coverage-file-table-row'>; } declare module 'flow-coverage-report/dist/lib/components/coverage-meter-bar.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/components/coverage-meter-bar'>; } declare module 'flow-coverage-report/dist/lib/components/coverage-summary-table.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/components/coverage-summary-table'>; } declare module 'flow-coverage-report/dist/lib/components/footer.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/components/footer'>; } declare module 'flow-coverage-report/dist/lib/components/head.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/components/head'>; } declare module 'flow-coverage-report/dist/lib/components/html-report-page.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/components/html-report-page'>; } declare module 'flow-coverage-report/dist/lib/flow.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/flow'>; } declare module 'flow-coverage-report/dist/lib/index.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/index'>; } declare module 'flow-coverage-report/dist/lib/promisified.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/promisified'>; } declare module 'flow-coverage-report/dist/lib/report-badge.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/report-badge'>; } declare module 'flow-coverage-report/dist/lib/report-html.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/report-html'>; } declare module 'flow-coverage-report/dist/lib/report-json.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/report-json'>; } declare module 'flow-coverage-report/dist/lib/report-text.js' { declare module.exports: $Exports<'flow-coverage-report/dist/lib/report-text'>; } declare module 'flow-coverage-report/src/lib/cli/args.js' { declare module.exports: $Exports<'flow-coverage-report/src/lib/cli/args'>; } declare module 'flow-coverage-report/src/lib/cli/config.js' { declare module.exports: $Exports<'flow-coverage-report/src/lib/cli/config'>; } declare module 'flow-coverage-report/src/lib/cli/index.js' { declare module.exports: $Exports<'flow-coverage-report/src/lib/cli/index'>; } declare module 'flow-coverage-report/src/lib/components/body-coverage-sourcefile.jsx' { declare module.exports: $Exports<'flow-coverage-report/src/lib/components/body-coverage-sourcefile'>; } declare module 'flow-coverage-report/src/lib/components/body-coverage-summary.jsx' { declare module.exports: $Exports<'flow-coverage-report/src/lib/components/body-coverage-summary'>; } declare module 'flow-coverage-report/src/lib/components/coverage-file-table-head.jsx' { declare module.exports: $Exports<'flow-coverage-report/src/lib/components/coverage-file-table-head'>; } declare module 'flow-coverage-report/src/lib/components/coverage-file-table-row.jsx' { declare module.exports: $Exports<'flow-coverage-report/src/lib/components/coverage-file-table-row'>; } declare module 'flow-coverage-report/src/lib/components/coverage-meter-bar.jsx' { declare module.exports: $Exports<'flow-coverage-report/src/lib/components/coverage-meter-bar'>; } declare module 'flow-coverage-report/src/lib/components/coverage-summary-table.jsx' { declare module.exports: $Exports<'flow-coverage-report/src/lib/components/coverage-summary-table'>; } declare module 'flow-coverage-report/src/lib/components/footer.jsx' { declare module.exports: $Exports<'flow-coverage-report/src/lib/components/footer'>; } declare module 'flow-coverage-report/src/lib/components/head.jsx' { declare module.exports: $Exports<'flow-coverage-report/src/lib/components/head'>; } declare module 'flow-coverage-report/src/lib/components/html-report-page.jsx' { declare module.exports: $Exports<'flow-coverage-report/src/lib/components/html-report-page'>; } declare module 'flow-coverage-report/src/lib/flow.js' { declare module.exports: $Exports<'flow-coverage-report/src/lib/flow'>; } declare module 'flow-coverage-report/src/lib/index.js' { declare module.exports: $Exports<'flow-coverage-report/src/lib/index'>; } declare module 'flow-coverage-report/src/lib/promisified.js' { declare module.exports: $Exports<'flow-coverage-report/src/lib/promisified'>; } declare module 'flow-coverage-report/src/lib/report-badge.js' { declare module.exports: $Exports<'flow-coverage-report/src/lib/report-badge'>; } declare module 'flow-coverage-report/src/lib/report-html.js' { declare module.exports: $Exports<'flow-coverage-report/src/lib/report-html'>; } declare module 'flow-coverage-report/src/lib/report-json.js' { declare module.exports: $Exports<'flow-coverage-report/src/lib/report-json'>; } declare module 'flow-coverage-report/src/lib/report-text.js' { declare module.exports: $Exports<'flow-coverage-report/src/lib/report-text'>; } ================================================ FILE: flow-typed/npm/husky_vx.x.x.js ================================================ // flow-typed signature: 9b77f3d2feb0a32bbe6a148c6ad4ee8b // flow-typed version: <>/husky_v^2.4.1/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'husky' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'husky' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'husky/husky' { declare module.exports: any; } declare module 'husky/lib/getConf' { declare module.exports: any; } declare module 'husky/lib/installer/bin' { declare module.exports: any; } declare module 'husky/lib/installer/getScript' { declare module.exports: any; } declare module 'husky/lib/installer/index' { declare module.exports: any; } declare module 'husky/lib/installer/is' { declare module.exports: any; } declare module 'husky/lib/installer/resolveGitDir' { declare module.exports: any; } declare module 'husky/lib/runner/bin' { declare module.exports: any; } declare module 'husky/lib/runner/index' { declare module.exports: any; } declare module 'husky/lib/upgrader/bin' { declare module.exports: any; } declare module 'husky/lib/upgrader/index' { declare module.exports: any; } declare module 'husky/run' { declare module.exports: any; } // Filename aliases declare module 'husky/husky.js' { declare module.exports: $Exports<'husky/husky'>; } declare module 'husky/lib/getConf.js' { declare module.exports: $Exports<'husky/lib/getConf'>; } declare module 'husky/lib/installer/bin.js' { declare module.exports: $Exports<'husky/lib/installer/bin'>; } declare module 'husky/lib/installer/getScript.js' { declare module.exports: $Exports<'husky/lib/installer/getScript'>; } declare module 'husky/lib/installer/index.js' { declare module.exports: $Exports<'husky/lib/installer/index'>; } declare module 'husky/lib/installer/is.js' { declare module.exports: $Exports<'husky/lib/installer/is'>; } declare module 'husky/lib/installer/resolveGitDir.js' { declare module.exports: $Exports<'husky/lib/installer/resolveGitDir'>; } declare module 'husky/lib/runner/bin.js' { declare module.exports: $Exports<'husky/lib/runner/bin'>; } declare module 'husky/lib/runner/index.js' { declare module.exports: $Exports<'husky/lib/runner/index'>; } declare module 'husky/lib/upgrader/bin.js' { declare module.exports: $Exports<'husky/lib/upgrader/bin'>; } declare module 'husky/lib/upgrader/index.js' { declare module.exports: $Exports<'husky/lib/upgrader/index'>; } declare module 'husky/run.js' { declare module.exports: $Exports<'husky/run'>; } ================================================ FILE: flow-typed/npm/jest_v24.x.x.js ================================================ // flow-typed signature: f5997c5ee181aaeba6fc2d2a2158feb3 // flow-typed version: cefb07e7f4/jest_v24.x.x/flow_>=v0.39.x type JestMockFn, TReturn> = { (...args: TArguments): TReturn, /** * An object for introspecting mock calls */ mock: { /** * An array that represents all calls that have been made into this mock * function. Each call is represented by an array of arguments that were * passed during the call. */ calls: Array, /** * An array that contains all the object instances that have been * instantiated from this mock function. */ instances: Array, /** * An array that contains all the object results that have been * returned by this mock function call */ results: Array<{ isThrow: boolean, value: TReturn }>, }, /** * Resets all information stored in the mockFn.mock.calls and * mockFn.mock.instances arrays. Often this is useful when you want to clean * up a mock's usage data between two assertions. */ mockClear(): void, /** * Resets all information stored in the mock. This is useful when you want to * completely restore a mock back to its initial state. */ mockReset(): void, /** * Removes the mock and restores the initial implementation. This is useful * when you want to mock functions in certain test cases and restore the * original implementation in others. Beware that mockFn.mockRestore only * works when mock was created with jest.spyOn. Thus you have to take care of * restoration yourself when manually assigning jest.fn(). */ mockRestore(): void, /** * Accepts a function that should be used as the implementation of the mock. * The mock itself will still record all calls that go into and instances * that come from itself -- the only difference is that the implementation * will also be executed when the mock is called. */ mockImplementation( fn: (...args: TArguments) => TReturn ): JestMockFn, /** * Accepts a function that will be used as an implementation of the mock for * one call to the mocked function. Can be chained so that multiple function * calls produce different results. */ mockImplementationOnce( fn: (...args: TArguments) => TReturn ): JestMockFn, /** * Accepts a string to use in test result output in place of "jest.fn()" to * indicate which mock function is being referenced. */ mockName(name: string): JestMockFn, /** * Just a simple sugar function for returning `this` */ mockReturnThis(): void, /** * Accepts a value that will be returned whenever the mock function is called. */ mockReturnValue(value: TReturn): JestMockFn, /** * Sugar for only returning a value once inside your mock */ mockReturnValueOnce(value: TReturn): JestMockFn, /** * Sugar for jest.fn().mockImplementation(() => Promise.resolve(value)) */ mockResolvedValue(value: TReturn): JestMockFn>, /** * Sugar for jest.fn().mockImplementationOnce(() => Promise.resolve(value)) */ mockResolvedValueOnce( value: TReturn ): JestMockFn>, /** * Sugar for jest.fn().mockImplementation(() => Promise.reject(value)) */ mockRejectedValue(value: TReturn): JestMockFn>, /** * Sugar for jest.fn().mockImplementationOnce(() => Promise.reject(value)) */ mockRejectedValueOnce(value: TReturn): JestMockFn>, }; type JestAsymmetricEqualityType = { /** * A custom Jasmine equality tester */ asymmetricMatch(value: mixed): boolean, }; type JestCallsType = { allArgs(): mixed, all(): mixed, any(): boolean, count(): number, first(): mixed, mostRecent(): mixed, reset(): void, }; type JestClockType = { install(): void, mockDate(date: Date): void, tick(milliseconds?: number): void, uninstall(): void, }; type JestMatcherResult = { message?: string | (() => string), pass: boolean, }; type JestMatcher = ( received: any, ...actual: Array ) => JestMatcherResult | Promise; type JestPromiseType = { /** * Use rejects to unwrap the reason of a rejected promise so any other * matcher can be chained. If the promise is fulfilled the assertion fails. */ rejects: JestExpectType, /** * Use resolves to unwrap the value of a fulfilled promise so any other * matcher can be chained. If the promise is rejected the assertion fails. */ resolves: JestExpectType, }; /** * Jest allows functions and classes to be used as test names in test() and * describe() */ type JestTestName = string | Function; /** * Plugin: jest-styled-components */ type JestStyledComponentsMatcherValue = | string | JestAsymmetricEqualityType | RegExp | typeof undefined; type JestStyledComponentsMatcherOptions = { media?: string, modifier?: string, supports?: string, }; type JestStyledComponentsMatchersType = { toHaveStyleRule( property: string, value: JestStyledComponentsMatcherValue, options?: JestStyledComponentsMatcherOptions ): void, }; /** * Plugin: jest-enzyme */ type EnzymeMatchersType = { // 5.x toBeEmpty(): void, toBePresent(): void, // 6.x toBeChecked(): void, toBeDisabled(): void, toBeEmptyRender(): void, toContainMatchingElement(selector: string): void, toContainMatchingElements(n: number, selector: string): void, toContainExactlyOneMatchingElement(selector: string): void, toContainReact(element: React$Element): void, toExist(): void, toHaveClassName(className: string): void, toHaveHTML(html: string): void, toHaveProp: ((propKey: string, propValue?: any) => void) & ((props: {}) => void), toHaveRef(refName: string): void, toHaveState: ((stateKey: string, stateValue?: any) => void) & ((state: {}) => void), toHaveStyle: ((styleKey: string, styleValue?: any) => void) & ((style: {}) => void), toHaveTagName(tagName: string): void, toHaveText(text: string): void, toHaveValue(value: any): void, toIncludeText(text: string): void, toMatchElement( element: React$Element, options?: {| ignoreProps?: boolean, verbose?: boolean |} ): void, toMatchSelector(selector: string): void, // 7.x toHaveDisplayName(name: string): void, }; // DOM testing library extensions https://github.com/kentcdodds/dom-testing-library#custom-jest-matchers type DomTestingLibraryType = { toBeDisabled(): void, toBeEnabled(): void, toBeEmpty(): void, toBeInTheDocument(): void, toBeVisible(): void, toContainElement(element: HTMLElement | null): void, toContainHTML(htmlText: string): void, toHaveAttribute(name: string, expectedValue?: string): void, toHaveClass(...classNames: string[]): void, toHaveFocus(): void, toHaveFormValues(expectedValues: { [name: string]: any }): void, toHaveStyle(css: string): void, toHaveTextContent( content: string | RegExp, options?: { normalizeWhitespace: boolean } ): void, toBeInTheDOM(): void, }; // Jest JQuery Matchers: https://github.com/unindented/custom-jquery-matchers type JestJQueryMatchersType = { toExist(): void, toHaveLength(len: number): void, toHaveId(id: string): void, toHaveClass(className: string): void, toHaveTag(tag: string): void, toHaveAttr(key: string, val?: any): void, toHaveProp(key: string, val?: any): void, toHaveText(text: string | RegExp): void, toHaveData(key: string, val?: any): void, toHaveValue(val: any): void, toHaveCss(css: { [key: string]: any }): void, toBeChecked(): void, toBeDisabled(): void, toBeEmpty(): void, toBeHidden(): void, toBeSelected(): void, toBeVisible(): void, toBeFocused(): void, toBeInDom(): void, toBeMatchedBy(sel: string): void, toHaveDescendant(sel: string): void, toHaveDescendantWithText(sel: string, text: string | RegExp): void, }; // Jest Extended Matchers: https://github.com/jest-community/jest-extended type JestExtendedMatchersType = { /** * Note: Currently unimplemented * Passing assertion * * @param {String} message */ // pass(message: string): void; /** * Note: Currently unimplemented * Failing assertion * * @param {String} message */ // fail(message: string): void; /** * Use .toBeEmpty when checking if a String '', Array [] or Object {} is empty. */ toBeEmpty(): void, /** * Use .toBeOneOf when checking if a value is a member of a given Array. * @param {Array.<*>} members */ toBeOneOf(members: any[]): void, /** * Use `.toBeNil` when checking a value is `null` or `undefined`. */ toBeNil(): void, /** * Use `.toSatisfy` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean`. * @param {Function} predicate */ toSatisfy(predicate: (n: any) => boolean): void, /** * Use `.toBeArray` when checking if a value is an `Array`. */ toBeArray(): void, /** * Use `.toBeArrayOfSize` when checking if a value is an `Array` of size x. * @param {Number} x */ toBeArrayOfSize(x: number): void, /** * Use `.toIncludeAllMembers` when checking if an `Array` contains all of the same members of a given set. * @param {Array.<*>} members */ toIncludeAllMembers(members: any[]): void, /** * Use `.toIncludeAnyMembers` when checking if an `Array` contains any of the members of a given set. * @param {Array.<*>} members */ toIncludeAnyMembers(members: any[]): void, /** * Use `.toSatisfyAll` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean` for all values in an array. * @param {Function} predicate */ toSatisfyAll(predicate: (n: any) => boolean): void, /** * Use `.toBeBoolean` when checking if a value is a `Boolean`. */ toBeBoolean(): void, /** * Use `.toBeTrue` when checking a value is equal (===) to `true`. */ toBeTrue(): void, /** * Use `.toBeFalse` when checking a value is equal (===) to `false`. */ toBeFalse(): void, /** * Use .toBeDate when checking if a value is a Date. */ toBeDate(): void, /** * Use `.toBeFunction` when checking if a value is a `Function`. */ toBeFunction(): void, /** * Use `.toHaveBeenCalledBefore` when checking if a `Mock` was called before another `Mock`. * * Note: Required Jest version >22 * Note: Your mock functions will have to be asynchronous to cause the timestamps inside of Jest to occur in a differentJS event loop, otherwise the mock timestamps will all be the same * * @param {Mock} mock */ toHaveBeenCalledBefore(mock: JestMockFn): void, /** * Use `.toBeNumber` when checking if a value is a `Number`. */ toBeNumber(): void, /** * Use `.toBeNaN` when checking a value is `NaN`. */ toBeNaN(): void, /** * Use `.toBeFinite` when checking if a value is a `Number`, not `NaN` or `Infinity`. */ toBeFinite(): void, /** * Use `.toBePositive` when checking if a value is a positive `Number`. */ toBePositive(): void, /** * Use `.toBeNegative` when checking if a value is a negative `Number`. */ toBeNegative(): void, /** * Use `.toBeEven` when checking if a value is an even `Number`. */ toBeEven(): void, /** * Use `.toBeOdd` when checking if a value is an odd `Number`. */ toBeOdd(): void, /** * Use `.toBeWithin` when checking if a number is in between the given bounds of: start (inclusive) and end (exclusive). * * @param {Number} start * @param {Number} end */ toBeWithin(start: number, end: number): void, /** * Use `.toBeObject` when checking if a value is an `Object`. */ toBeObject(): void, /** * Use `.toContainKey` when checking if an object contains the provided key. * * @param {String} key */ toContainKey(key: string): void, /** * Use `.toContainKeys` when checking if an object has all of the provided keys. * * @param {Array.} keys */ toContainKeys(keys: string[]): void, /** * Use `.toContainAllKeys` when checking if an object only contains all of the provided keys. * * @param {Array.} keys */ toContainAllKeys(keys: string[]): void, /** * Use `.toContainAnyKeys` when checking if an object contains at least one of the provided keys. * * @param {Array.} keys */ toContainAnyKeys(keys: string[]): void, /** * Use `.toContainValue` when checking if an object contains the provided value. * * @param {*} value */ toContainValue(value: any): void, /** * Use `.toContainValues` when checking if an object contains all of the provided values. * * @param {Array.<*>} values */ toContainValues(values: any[]): void, /** * Use `.toContainAllValues` when checking if an object only contains all of the provided values. * * @param {Array.<*>} values */ toContainAllValues(values: any[]): void, /** * Use `.toContainAnyValues` when checking if an object contains at least one of the provided values. * * @param {Array.<*>} values */ toContainAnyValues(values: any[]): void, /** * Use `.toContainEntry` when checking if an object contains the provided entry. * * @param {Array.} entry */ toContainEntry(entry: [string, string]): void, /** * Use `.toContainEntries` when checking if an object contains all of the provided entries. * * @param {Array.>} entries */ toContainEntries(entries: [string, string][]): void, /** * Use `.toContainAllEntries` when checking if an object only contains all of the provided entries. * * @param {Array.>} entries */ toContainAllEntries(entries: [string, string][]): void, /** * Use `.toContainAnyEntries` when checking if an object contains at least one of the provided entries. * * @param {Array.>} entries */ toContainAnyEntries(entries: [string, string][]): void, /** * Use `.toBeExtensible` when checking if an object is extensible. */ toBeExtensible(): void, /** * Use `.toBeFrozen` when checking if an object is frozen. */ toBeFrozen(): void, /** * Use `.toBeSealed` when checking if an object is sealed. */ toBeSealed(): void, /** * Use `.toBeString` when checking if a value is a `String`. */ toBeString(): void, /** * Use `.toEqualCaseInsensitive` when checking if a string is equal (===) to another ignoring the casing of both strings. * * @param {String} string */ toEqualCaseInsensitive(string: string): void, /** * Use `.toStartWith` when checking if a `String` starts with a given `String` prefix. * * @param {String} prefix */ toStartWith(prefix: string): void, /** * Use `.toEndWith` when checking if a `String` ends with a given `String` suffix. * * @param {String} suffix */ toEndWith(suffix: string): void, /** * Use `.toInclude` when checking if a `String` includes the given `String` substring. * * @param {String} substring */ toInclude(substring: string): void, /** * Use `.toIncludeRepeated` when checking if a `String` includes the given `String` substring the correct number of times. * * @param {String} substring * @param {Number} times */ toIncludeRepeated(substring: string, times: number): void, /** * Use `.toIncludeMultiple` when checking if a `String` includes all of the given substrings. * * @param {Array.} substring */ toIncludeMultiple(substring: string[]): void, }; interface JestExpectType { not: JestExpectType & EnzymeMatchersType & DomTestingLibraryType & JestJQueryMatchersType & JestStyledComponentsMatchersType & JestExtendedMatchersType; /** * If you have a mock function, you can use .lastCalledWith to test what * arguments it was last called with. */ lastCalledWith(...args: Array): void; /** * toBe just checks that a value is what you expect. It uses === to check * strict equality. */ toBe(value: any): void; /** * Use .toBeCalledWith to ensure that a mock function was called with * specific arguments. */ toBeCalledWith(...args: Array): void; /** * Using exact equality with floating point numbers is a bad idea. Rounding * means that intuitive things fail. */ toBeCloseTo(num: number, delta: any): void; /** * Use .toBeDefined to check that a variable is not undefined. */ toBeDefined(): void; /** * Use .toBeFalsy when you don't care what a value is, you just want to * ensure a value is false in a boolean context. */ toBeFalsy(): void; /** * To compare floating point numbers, you can use toBeGreaterThan. */ toBeGreaterThan(number: number): void; /** * To compare floating point numbers, you can use toBeGreaterThanOrEqual. */ toBeGreaterThanOrEqual(number: number): void; /** * To compare floating point numbers, you can use toBeLessThan. */ toBeLessThan(number: number): void; /** * To compare floating point numbers, you can use toBeLessThanOrEqual. */ toBeLessThanOrEqual(number: number): void; /** * Use .toBeInstanceOf(Class) to check that an object is an instance of a * class. */ toBeInstanceOf(cls: Class<*>): void; /** * .toBeNull() is the same as .toBe(null) but the error messages are a bit * nicer. */ toBeNull(): void; /** * Use .toBeTruthy when you don't care what a value is, you just want to * ensure a value is true in a boolean context. */ toBeTruthy(): void; /** * Use .toBeUndefined to check that a variable is undefined. */ toBeUndefined(): void; /** * Use .toContain when you want to check that an item is in a list. For * testing the items in the list, this uses ===, a strict equality check. */ toContain(item: any): void; /** * Use .toContainEqual when you want to check that an item is in a list. For * testing the items in the list, this matcher recursively checks the * equality of all fields, rather than checking for object identity. */ toContainEqual(item: any): void; /** * Use .toEqual when you want to check that two objects have the same value. * This matcher recursively checks the equality of all fields, rather than * checking for object identity. */ toEqual(value: any): void; /** * Use .toHaveBeenCalled to ensure that a mock function got called. */ toHaveBeenCalled(): void; toBeCalled(): void; /** * Use .toHaveBeenCalledTimes to ensure that a mock function got called exact * number of times. */ toHaveBeenCalledTimes(number: number): void; toBeCalledTimes(number: number): void; /** * */ toHaveBeenNthCalledWith(nthCall: number, ...args: Array): void; nthCalledWith(nthCall: number, ...args: Array): void; /** * */ toHaveReturned(): void; toReturn(): void; /** * */ toHaveReturnedTimes(number: number): void; toReturnTimes(number: number): void; /** * */ toHaveReturnedWith(value: any): void; toReturnWith(value: any): void; /** * */ toHaveLastReturnedWith(value: any): void; lastReturnedWith(value: any): void; /** * */ toHaveNthReturnedWith(nthCall: number, value: any): void; nthReturnedWith(nthCall: number, value: any): void; /** * Use .toHaveBeenCalledWith to ensure that a mock function was called with * specific arguments. */ toHaveBeenCalledWith(...args: Array): void; toBeCalledWith(...args: Array): void; /** * Use .toHaveBeenLastCalledWith to ensure that a mock function was last called * with specific arguments. */ toHaveBeenLastCalledWith(...args: Array): void; lastCalledWith(...args: Array): void; /** * Check that an object has a .length property and it is set to a certain * numeric value. */ toHaveLength(number: number): void; /** * */ toHaveProperty(propPath: string, value?: any): void; /** * Use .toMatch to check that a string matches a regular expression or string. */ toMatch(regexpOrString: RegExp | string): void; /** * Use .toMatchObject to check that a javascript object matches a subset of the properties of an object. */ toMatchObject(object: Object | Array): void; /** * Use .toStrictEqual to check that a javascript object matches a subset of the properties of an object. */ toStrictEqual(value: any): void; /** * This ensures that an Object matches the most recent snapshot. */ toMatchSnapshot(propertyMatchers?: any, name?: string): void; /** * This ensures that an Object matches the most recent snapshot. */ toMatchSnapshot(name: string): void; toMatchInlineSnapshot(snapshot?: string): void; toMatchInlineSnapshot(propertyMatchers?: any, snapshot?: string): void; /** * Use .toThrow to test that a function throws when it is called. * If you want to test that a specific error gets thrown, you can provide an * argument to toThrow. The argument can be a string for the error message, * a class for the error, or a regex that should match the error. * * Alias: .toThrowError */ toThrow(message?: string | Error | Class | RegExp): void; toThrowError(message?: string | Error | Class | RegExp): void; /** * Use .toThrowErrorMatchingSnapshot to test that a function throws a error * matching the most recent snapshot when it is called. */ toThrowErrorMatchingSnapshot(): void; toThrowErrorMatchingInlineSnapshot(snapshot?: string): void; } type JestObjectType = { /** * Disables automatic mocking in the module loader. * * After this method is called, all `require()`s will return the real * versions of each module (rather than a mocked version). */ disableAutomock(): JestObjectType, /** * An un-hoisted version of disableAutomock */ autoMockOff(): JestObjectType, /** * Enables automatic mocking in the module loader. */ enableAutomock(): JestObjectType, /** * An un-hoisted version of enableAutomock */ autoMockOn(): JestObjectType, /** * Clears the mock.calls and mock.instances properties of all mocks. * Equivalent to calling .mockClear() on every mocked function. */ clearAllMocks(): JestObjectType, /** * Resets the state of all mocks. Equivalent to calling .mockReset() on every * mocked function. */ resetAllMocks(): JestObjectType, /** * Restores all mocks back to their original value. */ restoreAllMocks(): JestObjectType, /** * Removes any pending timers from the timer system. */ clearAllTimers(): void, /** * Returns the number of fake timers still left to run. */ getTimerCount(): number, /** * The same as `mock` but not moved to the top of the expectation by * babel-jest. */ doMock(moduleName: string, moduleFactory?: any): JestObjectType, /** * The same as `unmock` but not moved to the top of the expectation by * babel-jest. */ dontMock(moduleName: string): JestObjectType, /** * Returns a new, unused mock function. Optionally takes a mock * implementation. */ fn, TReturn>( implementation?: (...args: TArguments) => TReturn ): JestMockFn, /** * Determines if the given function is a mocked function. */ isMockFunction(fn: Function): boolean, /** * Given the name of a module, use the automatic mocking system to generate a * mocked version of the module for you. */ genMockFromModule(moduleName: string): any, /** * Mocks a module with an auto-mocked version when it is being required. * * The second argument can be used to specify an explicit module factory that * is being run instead of using Jest's automocking feature. * * The third argument can be used to create virtual mocks -- mocks of modules * that don't exist anywhere in the system. */ mock( moduleName: string, moduleFactory?: any, options?: Object ): JestObjectType, /** * Returns the actual module instead of a mock, bypassing all checks on * whether the module should receive a mock implementation or not. */ requireActual(moduleName: string): any, /** * Returns a mock module instead of the actual module, bypassing all checks * on whether the module should be required normally or not. */ requireMock(moduleName: string): any, /** * Resets the module registry - the cache of all required modules. This is * useful to isolate modules where local state might conflict between tests. */ resetModules(): JestObjectType, /** * Creates a sandbox registry for the modules that are loaded inside the * callback function. This is useful to isolate specific modules for every * test so that local module state doesn't conflict between tests. */ isolateModules(fn: () => void): JestObjectType, /** * Exhausts the micro-task queue (usually interfaced in node via * process.nextTick). */ runAllTicks(): void, /** * Exhausts the macro-task queue (i.e., all tasks queued by setTimeout(), * setInterval(), and setImmediate()). */ runAllTimers(): void, /** * Exhausts all tasks queued by setImmediate(). */ runAllImmediates(): void, /** * Executes only the macro task queue (i.e. all tasks queued by setTimeout() * or setInterval() and setImmediate()). */ advanceTimersByTime(msToRun: number): void, /** * Executes only the macro task queue (i.e. all tasks queued by setTimeout() * or setInterval() and setImmediate()). * * Renamed to `advanceTimersByTime`. */ runTimersToTime(msToRun: number): void, /** * Executes only the macro-tasks that are currently pending (i.e., only the * tasks that have been queued by setTimeout() or setInterval() up to this * point) */ runOnlyPendingTimers(): void, /** * Explicitly supplies the mock object that the module system should return * for the specified module. Note: It is recommended to use jest.mock() * instead. */ setMock(moduleName: string, moduleExports: any): JestObjectType, /** * Indicates that the module system should never return a mocked version of * the specified module from require() (e.g. that it should always return the * real module). */ unmock(moduleName: string): JestObjectType, /** * Instructs Jest to use fake versions of the standard timer functions * (setTimeout, setInterval, clearTimeout, clearInterval, nextTick, * setImmediate and clearImmediate). */ useFakeTimers(): JestObjectType, /** * Instructs Jest to use the real versions of the standard timer functions. */ useRealTimers(): JestObjectType, /** * Creates a mock function similar to jest.fn but also tracks calls to * object[methodName]. */ spyOn( object: Object, methodName: string, accessType?: 'get' | 'set' ): JestMockFn, /** * Set the default timeout interval for tests and before/after hooks in milliseconds. * Note: The default timeout interval is 5 seconds if this method is not called. */ setTimeout(timeout: number): JestObjectType, }; type JestSpyType = { calls: JestCallsType, }; /** Runs this function after every test inside this context */ declare function afterEach( fn: (done: () => void) => ?Promise, timeout?: number ): void; /** Runs this function before every test inside this context */ declare function beforeEach( fn: (done: () => void) => ?Promise, timeout?: number ): void; /** Runs this function after all tests have finished inside this context */ declare function afterAll( fn: (done: () => void) => ?Promise, timeout?: number ): void; /** Runs this function before any tests have started inside this context */ declare function beforeAll( fn: (done: () => void) => ?Promise, timeout?: number ): void; /** A context for grouping tests together */ declare var describe: { /** * Creates a block that groups together several related tests in one "test suite" */ (name: JestTestName, fn: () => void): void, /** * Only run this describe block */ only(name: JestTestName, fn: () => void): void, /** * Skip running this describe block */ skip(name: JestTestName, fn: () => void): void, /** * each runs this test against array of argument arrays per each run * * @param {table} table of Test */ each( ...table: Array | mixed> | [Array, string] ): ( name: JestTestName, fn?: (...args: Array) => ?Promise, timeout?: number ) => void, }; /** An individual test unit */ declare var it: { /** * An individual test unit * * @param {JestTestName} Name of Test * @param {Function} Test * @param {number} Timeout for the test, in milliseconds. */ ( name: JestTestName, fn?: (done: () => void) => ?Promise, timeout?: number ): void, /** * Only run this test * * @param {JestTestName} Name of Test * @param {Function} Test * @param {number} Timeout for the test, in milliseconds. */ only( name: JestTestName, fn?: (done: () => void) => ?Promise, timeout?: number ): { each( ...table: Array | mixed> | [Array, string] ): ( name: JestTestName, fn?: (...args: Array) => ?Promise, timeout?: number ) => void, }, /** * Skip running this test * * @param {JestTestName} Name of Test * @param {Function} Test * @param {number} Timeout for the test, in milliseconds. */ skip( name: JestTestName, fn?: (done: () => void) => ?Promise, timeout?: number ): void, /** * Highlight planned tests in the summary output * * @param {String} Name of Test to do */ todo(name: string): void, /** * Run the test concurrently * * @param {JestTestName} Name of Test * @param {Function} Test * @param {number} Timeout for the test, in milliseconds. */ concurrent( name: JestTestName, fn?: (done: () => void) => ?Promise, timeout?: number ): void, /** * each runs this test against array of argument arrays per each run * * @param {table} table of Test */ each( ...table: Array | mixed> | [Array, string] ): ( name: JestTestName, fn?: (...args: Array) => ?Promise, timeout?: number ) => void, }; declare function fit( name: JestTestName, fn: (done: () => void) => ?Promise, timeout?: number ): void; /** An individual test unit */ declare var test: typeof it; /** A disabled group of tests */ declare var xdescribe: typeof describe; /** A focused group of tests */ declare var fdescribe: typeof describe; /** A disabled individual test */ declare var xit: typeof it; /** A disabled individual test */ declare var xtest: typeof it; type JestPrettyFormatColors = { comment: { close: string, open: string }, content: { close: string, open: string }, prop: { close: string, open: string }, tag: { close: string, open: string }, value: { close: string, open: string }, }; type JestPrettyFormatIndent = string => string; type JestPrettyFormatRefs = Array; type JestPrettyFormatPrint = any => string; type JestPrettyFormatStringOrNull = string | null; type JestPrettyFormatOptions = {| callToJSON: boolean, edgeSpacing: string, escapeRegex: boolean, highlight: boolean, indent: number, maxDepth: number, min: boolean, plugins: JestPrettyFormatPlugins, printFunctionName: boolean, spacing: string, theme: {| comment: string, content: string, prop: string, tag: string, value: string, |}, |}; type JestPrettyFormatPlugin = { print: ( val: any, serialize: JestPrettyFormatPrint, indent: JestPrettyFormatIndent, opts: JestPrettyFormatOptions, colors: JestPrettyFormatColors ) => string, test: any => boolean, }; type JestPrettyFormatPlugins = Array; /** The expect function is used every time you want to test a value */ declare var expect: { /** The object that you want to make assertions against */ ( value: any ): JestExpectType & JestPromiseType & EnzymeMatchersType & DomTestingLibraryType & JestJQueryMatchersType & JestStyledComponentsMatchersType & JestExtendedMatchersType, /** Add additional Jasmine matchers to Jest's roster */ extend(matchers: { [name: string]: JestMatcher }): void, /** Add a module that formats application-specific data structures. */ addSnapshotSerializer(pluginModule: JestPrettyFormatPlugin): void, assertions(expectedAssertions: number): void, hasAssertions(): void, any(value: mixed): JestAsymmetricEqualityType, anything(): any, arrayContaining(value: Array): Array, objectContaining(value: Object): Object, /** Matches any received string that contains the exact expected string. */ stringContaining(value: string): string, stringMatching(value: string | RegExp): string, not: { arrayContaining: (value: $ReadOnlyArray) => Array, objectContaining: (value: {}) => Object, stringContaining: (value: string) => string, stringMatching: (value: string | RegExp) => string, }, }; // TODO handle return type // http://jasmine.github.io/2.4/introduction.html#section-Spies declare function spyOn(value: mixed, method: string): Object; /** Holds all functions related to manipulating test runner */ declare var jest: JestObjectType; /** * The global Jasmine object, this is generally not exposed as the public API, * using features inside here could break in later versions of Jest. */ declare var jasmine: { DEFAULT_TIMEOUT_INTERVAL: number, any(value: mixed): JestAsymmetricEqualityType, anything(): any, arrayContaining(value: Array): Array, clock(): JestClockType, createSpy(name: string): JestSpyType, createSpyObj( baseName: string, methodNames: Array ): { [methodName: string]: JestSpyType }, objectContaining(value: Object): Object, stringMatching(value: string): string, }; ================================================ FILE: flow-typed/npm/lint-staged_vx.x.x.js ================================================ // flow-typed signature: 5145dccfaba46d4f4b43782e70d8e9e3 // flow-typed version: <>/lint-staged_v^8.2.1/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'lint-staged' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'lint-staged' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'lint-staged/src/calcChunkSize' { declare module.exports: any; } declare module 'lint-staged/src/checkPkgScripts' { declare module.exports: any; } declare module 'lint-staged/src/execGit' { declare module.exports: any; } declare module 'lint-staged/src/findBin' { declare module.exports: any; } declare module 'lint-staged/src/generateTasks' { declare module.exports: any; } declare module 'lint-staged/src/getConfig' { declare module.exports: any; } declare module 'lint-staged/src/gitWorkflow' { declare module.exports: any; } declare module 'lint-staged/src/index' { declare module.exports: any; } declare module 'lint-staged/src/makeCmdTasks' { declare module.exports: any; } declare module 'lint-staged/src/printErrors' { declare module.exports: any; } declare module 'lint-staged/src/resolveGitDir' { declare module.exports: any; } declare module 'lint-staged/src/resolveTaskFn' { declare module.exports: any; } declare module 'lint-staged/src/runAll' { declare module.exports: any; } // Filename aliases declare module 'lint-staged/index' { declare module.exports: $Exports<'lint-staged'>; } declare module 'lint-staged/index.js' { declare module.exports: $Exports<'lint-staged'>; } declare module 'lint-staged/src/calcChunkSize.js' { declare module.exports: $Exports<'lint-staged/src/calcChunkSize'>; } declare module 'lint-staged/src/checkPkgScripts.js' { declare module.exports: $Exports<'lint-staged/src/checkPkgScripts'>; } declare module 'lint-staged/src/execGit.js' { declare module.exports: $Exports<'lint-staged/src/execGit'>; } declare module 'lint-staged/src/findBin.js' { declare module.exports: $Exports<'lint-staged/src/findBin'>; } declare module 'lint-staged/src/generateTasks.js' { declare module.exports: $Exports<'lint-staged/src/generateTasks'>; } declare module 'lint-staged/src/getConfig.js' { declare module.exports: $Exports<'lint-staged/src/getConfig'>; } declare module 'lint-staged/src/gitWorkflow.js' { declare module.exports: $Exports<'lint-staged/src/gitWorkflow'>; } declare module 'lint-staged/src/index.js' { declare module.exports: $Exports<'lint-staged/src/index'>; } declare module 'lint-staged/src/makeCmdTasks.js' { declare module.exports: $Exports<'lint-staged/src/makeCmdTasks'>; } declare module 'lint-staged/src/printErrors.js' { declare module.exports: $Exports<'lint-staged/src/printErrors'>; } declare module 'lint-staged/src/resolveGitDir.js' { declare module.exports: $Exports<'lint-staged/src/resolveGitDir'>; } declare module 'lint-staged/src/resolveTaskFn.js' { declare module.exports: $Exports<'lint-staged/src/resolveTaskFn'>; } declare module 'lint-staged/src/runAll.js' { declare module.exports: $Exports<'lint-staged/src/runAll'>; } ================================================ FILE: flow-typed/npm/lodash_v4.x.x.js ================================================ // flow-typed signature: 8b15b6ecab988d6153afcfcf2876bbed // flow-typed version: 07f4c5ae3d/lodash_v4.x.x/flow_>=v0.63.x declare module "lodash" { declare type Path = $ReadOnlyArray | string | number; declare type __CurriedFunction1 = (...r: [AA]) => R; declare type CurriedFunction1 = __CurriedFunction1; declare type __CurriedFunction2 = (( ...r: [AA] ) => CurriedFunction1) & ((...r: [AA, BB]) => R); declare type CurriedFunction2 = __CurriedFunction2; declare type __CurriedFunction3 = (( ...r: [AA] ) => CurriedFunction2) & ((...r: [AA, BB]) => CurriedFunction1) & ((...r: [AA, BB, CC]) => R); declare type CurriedFunction3 = __CurriedFunction3< A, B, C, R, *, *, * >; declare type __CurriedFunction4< A, B, C, D, R, AA: A, BB: B, CC: C, DD: D > = ((...r: [AA]) => CurriedFunction3) & ((...r: [AA, BB]) => CurriedFunction2) & ((...r: [AA, BB, CC]) => CurriedFunction1) & ((...r: [AA, BB, CC, DD]) => R); declare type CurriedFunction4 = __CurriedFunction4< A, B, C, D, R, *, *, *, * >; declare type __CurriedFunction5< A, B, C, D, E, R, AA: A, BB: B, CC: C, DD: D, EE: E > = ((...r: [AA]) => CurriedFunction4) & ((...r: [AA, BB]) => CurriedFunction3) & ((...r: [AA, BB, CC]) => CurriedFunction2) & ((...r: [AA, BB, CC, DD]) => CurriedFunction1) & ((...r: [AA, BB, CC, DD, EE]) => R); declare type CurriedFunction5 = __CurriedFunction5< A, B, C, D, E, R, *, *, *, *, * >; declare type __CurriedFunction6< A, B, C, D, E, F, R, AA: A, BB: B, CC: C, DD: D, EE: E, FF: F > = ((...r: [AA]) => CurriedFunction5) & ((...r: [AA, BB]) => CurriedFunction4) & ((...r: [AA, BB, CC]) => CurriedFunction3) & ((...r: [AA, BB, CC, DD]) => CurriedFunction2) & ((...r: [AA, BB, CC, DD, EE]) => CurriedFunction1) & ((...r: [AA, BB, CC, DD, EE, FF]) => R); declare type CurriedFunction6 = __CurriedFunction6< A, B, C, D, E, F, R, *, *, *, *, *, * >; declare type Curry = (((...r: [A]) => R) => CurriedFunction1) & (((...r: [A, B]) => R) => CurriedFunction2) & (((...r: [A, B, C]) => R) => CurriedFunction3) & (( (...r: [A, B, C, D]) => R ) => CurriedFunction4) & (( (...r: [A, B, C, D, E]) => R ) => CurriedFunction5) & (( (...r: [A, B, C, D, E, F]) => R ) => CurriedFunction6); declare type UnaryFn = (a: A) => R; declare type TemplateSettings = { escape?: RegExp, evaluate?: RegExp, imports?: Object, interpolate?: RegExp, variable?: string }; declare type TruncateOptions = { length?: number, omission?: string, separator?: RegExp | string }; declare type DebounceOptions = { leading?: boolean, maxWait?: number, trailing?: boolean }; declare type ThrottleOptions = { leading?: boolean, trailing?: boolean }; declare type NestedArray = Array>; declare type matchesIterateeShorthand = {[key: any]: any}; declare type matchesPropertyIterateeShorthand = [string, any]; declare type propertyIterateeShorthand = string; declare type OPredicate = | ((value: A, key: string, object: O) => any) | matchesIterateeShorthand | matchesPropertyIterateeShorthand | propertyIterateeShorthand; declare type OIterateeWithResult = | Object | string | ((value: V, key: string, object: O) => R); declare type OIteratee = OIterateeWithResult; declare type OFlatMapIteratee = OIterateeWithResult>; declare type Predicate = | ((value: T, index: number, array: Array) => any) | matchesIterateeShorthand | matchesPropertyIterateeShorthand | propertyIterateeShorthand; declare type _ValueOnlyIteratee = (value: T) => mixed; declare type ValueOnlyIteratee = _ValueOnlyIteratee | string; declare type _Iteratee = ( item: T, index: number, array: ?Array ) => mixed; declare type Iteratee = _Iteratee | Object | string; declare type FlatMapIteratee = | ((item: T, index: number, array: ?$ReadOnlyArray) => Array) | Object | string; declare type Comparator = (item: T, item2: T) => boolean; declare type MapIterator = | ((item: T, index: number, array: Array) => U) | propertyIterateeShorthand; declare type ReadOnlyMapIterator = | ((item: T, index: number, array: $ReadOnlyArray) => U) | propertyIterateeShorthand; declare type OMapIterator = | ((item: T, key: string, object: O) => U) | propertyIterateeShorthand; declare class Lodash { // Array chunk(array?: ?Array, size?: ?number): Array>; compact(array?: ?Array): Array; concat( base?: ?$ReadOnlyArray, ...elements: Array ): Array; difference( array?: ?$ReadOnlyArray, ...values: Array> ): Array; differenceBy( array?: ?$ReadOnlyArray, values?: ?$ReadOnlyArray, iteratee?: ?ValueOnlyIteratee ): T[]; differenceWith( array?: ?$ReadOnlyArray, values?: ?$ReadOnlyArray, comparator?: ?Comparator ): T[]; drop(array?: ?Array, n?: ?number): Array; dropRight(array?: ?Array, n?: ?number): Array; dropRightWhile(array?: ?Array, predicate?: ?Predicate): Array; dropWhile(array?: ?Array, predicate?: ?Predicate): Array; fill( array?: ?Array, value?: ?U, start?: ?number, end?: ?number ): Array; findIndex( array: $ReadOnlyArray, predicate?: ?Predicate, fromIndex?: ?number ): number; findIndex( array: void | null, predicate?: ?Predicate, fromIndex?: ?number ): -1; findLastIndex( array: $ReadOnlyArray, predicate?: ?Predicate, fromIndex?: ?number ): number; findLastIndex( array: void | null, predicate?: ?Predicate, fromIndex?: ?number ): -1; // alias of _.head first(array: ?$ReadOnlyArray): T; flatten(array?: ?$ReadOnlyArray<$ReadOnlyArray | X>): Array; flattenDeep(array?: ?(any[])): Array; flattenDepth(array?: ?(any[]), depth?: ?number): any[]; fromPairs(pairs?: ?Array<[A, B]>): { [key: A]: B }; head(array: ?$ReadOnlyArray): T; indexOf(array: Array, value: T, fromIndex?: number): number; indexOf(array: void | null, value?: ?T, fromIndex?: ?number): -1; initial(array: ?Array): Array; intersection(...arrays?: Array<$ReadOnlyArray>): Array; //Workaround until (...parameter: T, parameter2: U) works intersectionBy( a1?: ?$ReadOnlyArray, iteratee?: ?ValueOnlyIteratee ): Array; intersectionBy( a1?: ?$ReadOnlyArray, a2?: ?$ReadOnlyArray, iteratee?: ?ValueOnlyIteratee ): Array; intersectionBy( a1?: ?$ReadOnlyArray, a2?: ?$ReadOnlyArray, a3?: ?$ReadOnlyArray, iteratee?: ?ValueOnlyIteratee ): Array; intersectionBy( a1?: ?$ReadOnlyArray, a2?: ?$ReadOnlyArray, a3?: ?$ReadOnlyArray, a4?: ?$ReadOnlyArray, iteratee?: ?ValueOnlyIteratee ): Array; //Workaround until (...parameter: T, parameter2: U) works intersectionWith( a1?: ?$ReadOnlyArray, comparator?: ?Comparator ): Array; intersectionWith( a1?: ?$ReadOnlyArray, a2?: ?$ReadOnlyArray, comparator?: ?Comparator ): Array; intersectionWith( a1?: ?$ReadOnlyArray, a2?: ?$ReadOnlyArray, a3?: ?$ReadOnlyArray, comparator?: ?Comparator ): Array; intersectionWith( a1?: ?$ReadOnlyArray, a2?: ?$ReadOnlyArray, a3?: ?$ReadOnlyArray, a4?: ?$ReadOnlyArray, comparator?: ?Comparator ): Array; join(array: Array, separator?: ?string): string; join(array: void | null, separator?: ?string): ""; last(array: ?$ReadOnlyArray): T; lastIndexOf(array: Array, value?: ?T, fromIndex?: ?number): number; lastIndexOf(array: void | null, value?: ?T, fromIndex?: ?number): -1; nth(array: T[], n?: ?number): T; nth(array: void | null, n?: ?number): void; pull(array: Array, ...values?: Array): Array; pull(array: T, ...values?: Array): T; pullAll(array: Array, values?: ?Array): Array; pullAll(array: T, values?: ?Array): T; pullAllBy( array: Array, values?: ?Array, iteratee?: ?ValueOnlyIteratee ): Array; pullAllBy( array: T, values?: ?Array, iteratee?: ?ValueOnlyIteratee ): T; pullAllWith(array: T[], values?: ?(T[]), comparator?: ?Function): T[]; pullAllWith( array: T, values?: ?Array, comparator?: ?Function ): T; pullAt(array?: ?Array, ...indexed?: Array): Array; pullAt(array?: ?Array, indexed?: ?Array): Array; remove(array?: ?Array, predicate?: ?Predicate): Array; reverse(array: Array): Array; reverse(array: T): T; slice( array?: ?$ReadOnlyArray, start?: ?number, end?: ?number ): Array; sortedIndex(array: Array, value: T): number; sortedIndex(array: void | null, value: ?T): 0; sortedIndexBy( array: Array, value?: ?T, iteratee?: ?ValueOnlyIteratee ): number; sortedIndexBy( array: void | null, value?: ?T, iteratee?: ?ValueOnlyIteratee ): 0; sortedIndexOf(array: Array, value: T): number; sortedIndexOf(array: void | null, value?: ?T): -1; sortedLastIndex(array: Array, value: T): number; sortedLastIndex(array: void | null, value?: ?T): 0; sortedLastIndexBy( array: Array, value: T, iteratee?: ValueOnlyIteratee ): number; sortedLastIndexBy( array: void | null, value?: ?T, iteratee?: ?ValueOnlyIteratee ): 0; sortedLastIndexOf(array: Array, value: T): number; sortedLastIndexOf(array: void | null, value?: ?T): -1; sortedUniq(array?: ?Array): Array; sortedUniqBy( array?: ?Array, iteratee?: ?ValueOnlyIteratee ): Array; tail(array?: ?Array): Array; take(array?: ?$ReadOnlyArray, n?: ?number): Array; takeRight(array?: ?$ReadOnlyArray, n?: ?number): Array; takeRightWhile(array?: ?Array, predicate?: ?Predicate): Array; takeWhile(array?: ?Array, predicate?: ?Predicate): Array; union(...arrays?: Array<$ReadOnlyArray>): Array; //Workaround until (...parameter: T, parameter2: U) works unionBy( a1?: ?$ReadOnlyArray, iteratee?: ?ValueOnlyIteratee ): Array; unionBy( a1?: ?$ReadOnlyArray, a2: $ReadOnlyArray, iteratee?: ValueOnlyIteratee ): Array; unionBy( a1: $ReadOnlyArray, a2: $ReadOnlyArray, a3: $ReadOnlyArray, iteratee?: ValueOnlyIteratee ): Array; unionBy( a1: $ReadOnlyArray, a2: $ReadOnlyArray, a3: $ReadOnlyArray, a4: $ReadOnlyArray, iteratee?: ValueOnlyIteratee ): Array; //Workaround until (...parameter: T, parameter2: U) works unionWith(a1?: ?Array, comparator?: ?Comparator): Array; unionWith( a1: $ReadOnlyArray, a2: $ReadOnlyArray, comparator?: Comparator ): Array; unionWith( a1: $ReadOnlyArray, a2: $ReadOnlyArray, a3: $ReadOnlyArray, comparator?: Comparator ): Array; unionWith( a1: $ReadOnlyArray, a2: $ReadOnlyArray, a3: $ReadOnlyArray, a4: $ReadOnlyArray, comparator?: Comparator ): Array; uniq(array?: ?$ReadOnlyArray): Array; uniqBy(array?: ?$ReadOnlyArray, iteratee?: ?ValueOnlyIteratee): Array; uniqWith(array?: ?$ReadOnlyArray, comparator?: ?Comparator): Array; unzip(array?: ?Array): Array; unzipWith(array: ?Array, iteratee?: ?Iteratee): Array; without(array?: ?$ReadOnlyArray, ...values?: Array): Array; xor(...array: Array>): Array; //Workaround until (...parameter: T, parameter2: U) works xorBy(a1?: ?Array, iteratee?: ?ValueOnlyIteratee): Array; xorBy( a1: Array, a2: Array, iteratee?: ValueOnlyIteratee ): Array; xorBy( a1: Array, a2: Array, a3: Array, iteratee?: ValueOnlyIteratee ): Array; xorBy( a1: Array, a2: Array, a3: Array, a4: Array, iteratee?: ValueOnlyIteratee ): Array; //Workaround until (...parameter: T, parameter2: U) works xorWith(a1?: ?Array, comparator?: ?Comparator): Array; xorWith( a1: Array, a2: Array, comparator?: Comparator ): Array; xorWith( a1: Array, a2: Array, a3: Array, comparator?: Comparator ): Array; xorWith( a1: Array, a2: Array, a3: Array, a4: Array, comparator?: Comparator ): Array; zip(a1?: ?($ReadOnlyArray), a2?: ?($ReadOnlyArray)): Array<[A, B]>; zip(a1: $ReadOnlyArray, a2: $ReadOnlyArray, a3: $ReadOnlyArray): Array<[A, B, C]>; zip(a1: $ReadOnlyArray, a2: $ReadOnlyArray, a3: $ReadOnlyArray, a4: $ReadOnlyArray): Array<[A, B, C, D]>; zip( a1: $ReadOnlyArray, a2: $ReadOnlyArray, a3: $ReadOnlyArray, a4: $ReadOnlyArray, a5: $ReadOnlyArray ): Array<[A, B, C, D, E]>; zipObject(props: Array, values?: ?Array): { [key: K]: V }; zipObject(props: void | null, values?: ?Array): {}; zipObjectDeep(props: any[], values?: ?any): Object; zipObjectDeep(props: void | null, values?: ?any): {}; zipWith(a1?: ?Array): Array<[A]>; zipWith(a1: Array, iteratee: (A) => T): Array; zipWith(a1: Array, a2: Array): Array<[A, B]>; zipWith( a1: Array, a2: Array, iteratee: (A, B) => T ): Array; zipWith( a1: Array, a2: Array, a3: Array ): Array<[A, B, C]>; zipWith( a1: Array, a2: Array, a3: Array, iteratee: (A, B, C) => T ): Array; zipWith( a1: Array, a2: Array, a3: Array, a4: Array ): Array<[A, B, C, D]>; zipWith( a1: Array, a2: Array, a3: Array, a4: Array, iteratee: (A, B, C, D) => T ): Array; // Collection countBy(array: Array, iteratee?: ?ValueOnlyIteratee): Object; countBy(array: void | null, iteratee?: ?ValueOnlyIteratee): {}; countBy(object: T, iteratee?: ?ValueOnlyIteratee): Object; // alias of _.forEach each(array: $ReadOnlyArray, iteratee?: ?Iteratee): Array; each(array: T, iteratee?: ?Iteratee): T; each(object: T, iteratee?: ?OIteratee): T; // alias of _.forEachRight eachRight(array: $ReadOnlyArray, iteratee?: ?Iteratee): Array; eachRight(array: T, iteratee?: ?Iteratee): T; eachRight(object: T, iteratee?: OIteratee): T; every(array?: ?$ReadOnlyArray, iteratee?: ?Iteratee): boolean; every(object: T, iteratee?: OIteratee): boolean; filter(array?: ?$ReadOnlyArray, predicate?: ?Predicate): Array; filter( object: T, predicate?: OPredicate ): Array; find( array: $ReadOnlyArray, predicate?: ?Predicate, fromIndex?: ?number ): T | void; find( array: void | null, predicate?: ?Predicate, fromIndex?: ?number ): void; find( object: T, predicate?: OPredicate, fromIndex?: number ): V; findLast( array: ?$ReadOnlyArray, predicate?: ?Predicate, fromIndex?: ?number ): T | void; findLast( object: T, predicate?: ?OPredicate ): V; flatMap( array?: ?$ReadOnlyArray, iteratee?: ?FlatMapIteratee ): Array; flatMap( object: T, iteratee?: OFlatMapIteratee ): Array; flatMapDeep( array?: ?$ReadOnlyArray, iteratee?: ?FlatMapIteratee ): Array; flatMapDeep( object: T, iteratee?: ?OFlatMapIteratee ): Array; flatMapDepth( array?: ?Array, iteratee?: ?FlatMapIteratee, depth?: ?number ): Array; flatMapDepth( object: T, iteratee?: OFlatMapIteratee, depth?: number ): Array; forEach(array: $ReadOnlyArray, iteratee?: ?Iteratee): Array; forEach(array: T, iteratee?: ?Iteratee): T; forEach(object: T, iteratee?: ?OIteratee): T; forEachRight( array: $ReadOnlyArray, iteratee?: ?Iteratee ): Array; forEachRight(array: T, iteratee?: ?Iteratee): T; forEachRight(object: T, iteratee?: ?OIteratee): T; groupBy( array: $ReadOnlyArray, iteratee?: ?ValueOnlyIteratee ): { [key: V]: Array }; groupBy(array: void | null, iteratee?: ?ValueOnlyIteratee): {}; groupBy( object: T, iteratee?: ValueOnlyIteratee ): { [key: V]: Array }; includes( array: $ReadOnlyArray, value: T, fromIndex?: ?number ): boolean; includes(array: void | null, value?: ?T, fromIndex?: ?number): false; includes(object: T, value: any, fromIndex?: number): boolean; includes(str: string, value: string, fromIndex?: number): boolean; invokeMap( array?: ?$ReadOnlyArray, path?: ?((value: T) => Path) | Path, ...args?: Array ): Array; invokeMap( object: T, path: ((value: any) => Path) | Path, ...args?: Array ): Array; keyBy( array: $ReadOnlyArray, iteratee?: ?ValueOnlyIteratee ): { [key: V]: T }; keyBy(array: void | null, iteratee?: ?ValueOnlyIteratee<*>): {}; keyBy( object: T, iteratee?: ?ValueOnlyIteratee ): { [key: V]: A }; map(array?: ?Array, iteratee?: ?MapIterator): Array; map( array: ?$ReadOnlyArray, iteratee?: ReadOnlyMapIterator ): Array; map( object: ?T, iteratee?: OMapIterator ): Array; map( str: ?string, iteratee?: (char: string, index: number, str: string) => any ): string; orderBy( array: $ReadOnlyArray, iteratees?: ?$ReadOnlyArray> | ?string, orders?: ?$ReadOnlyArray<"asc" | "desc"> | ?string ): Array; orderBy( array: null | void, iteratees?: ?$ReadOnlyArray> | ?string, orders?: ?$ReadOnlyArray<"asc" | "desc"> | ?string ): Array; orderBy( object: T, iteratees?: $ReadOnlyArray> | string, orders?: $ReadOnlyArray<"asc" | "desc"> | string ): Array; partition( array?: ?$ReadOnlyArray, predicate?: ?Predicate ): [Array, Array]; partition( object: T, predicate?: OPredicate ): [Array, Array]; reduce( array: $ReadOnlyArray, iteratee?: ( accumulator: U, value: T, index: number, array: ?Array ) => U, accumulator?: U ): U; reduce( array: void | null, iteratee?: ?( accumulator: U, value: T, index: number, array: ?Array ) => U, accumulator?: ?U ): void | null; reduce( object: T, iteratee?: (accumulator: U, value: any, key: string, object: T) => U, accumulator?: U ): U; reduceRight( array: void | null, iteratee?: ?( accumulator: U, value: T, index: number, array: ?Array ) => U, accumulator?: ?U ): void | null; reduceRight( array: $ReadOnlyArray, iteratee?: ?( accumulator: U, value: T, index: number, array: ?Array ) => U, accumulator?: ?U ): U; reduceRight( object: T, iteratee?: ?(accumulator: U, value: any, key: string, object: T) => U, accumulator?: ?U ): U; reject(array: ?$ReadOnlyArray, predicate?: Predicate): Array; reject( object?: ?T, predicate?: ?OPredicate ): Array; sample(array: ?Array): T; sample(object: T): V; sampleSize(array?: ?Array, n?: ?number): Array; sampleSize(object: T, n?: number): Array; shuffle(array: ?Array): Array; shuffle(object: T): Array; size(collection: $ReadOnlyArray | Object | string): number; some(array: void | null, predicate?: ?Predicate): false; some(array: ?$ReadOnlyArray, predicate?: Predicate): boolean; some( object?: ?T, predicate?: OPredicate ): boolean; sortBy( array: ?$ReadOnlyArray, ...iteratees?: $ReadOnlyArray> ): Array; sortBy( array: ?$ReadOnlyArray, iteratees?: $ReadOnlyArray> ): Array; sortBy( object: T, ...iteratees?: Array> ): Array; sortBy( object: T, iteratees?: $ReadOnlyArray> ): Array; // Date now(): number; // Function after(n: number, fn: Function): Function; ary(func: Function, n?: number): Function; before(n: number, fn: Function): Function; bind any>(func: F, thisArg: any, ...partials: Array): F; bindKey(obj?: ?Object, key?: ?string, ...partials?: Array): Function; curry: Curry; curry(func: Function, arity?: number): Function; curryRight(func: Function, arity?: number): Function; debounce any>(func: F, wait?: number, options?: DebounceOptions): F; defer(func: (...any[]) => any, ...args?: Array): TimeoutID; delay(func: Function, wait: number, ...args?: Array): TimeoutID; flip(func: (...any[]) => R): (...any[]) => R; memoize(func: (...A) => R, resolver?: (...A) => any): (...A) => R; negate(predicate: (...A) => R): (...A) => boolean; once any>(func: F): F; overArgs(func?: ?Function, ...transforms?: Array): Function; overArgs(func?: ?Function, transforms?: ?Array): Function; partial(func: (...any[]) => R, ...partials: any[]): (...any[]) => R; partialRight(func: (...any[]) => R, ...partials: Array): (...any[]) => R; partialRight(func: (...any[]) => R, partials: Array): (...any[]) => R; rearg(func: Function, ...indexes: Array): Function; rearg(func: Function, indexes: Array): Function; rest(func: Function, start?: number): Function; spread(func: Function): Function; throttle any>( func: F, wait?: number, options?: ThrottleOptions ): F; unary any>(func: F): F; wrap(value?: any, wrapper?: ?Function): Function; // Lang castArray(value: *): any[]; clone(value: T): T; cloneDeep(value: T): T; cloneDeepWith( value: T, customizer?: ?(value: T, key: number | string, object: T, stack: any) => U ): U; cloneWith( value: T, customizer?: ?(value: T, key: number | string, object: T, stack: any) => U ): U; conformsTo( source: T, predicates: T & { [key: string]: (x: any) => boolean } ): boolean; eq(value: any, other: any): boolean; gt(value: any, other: any): boolean; gte(value: any, other: any): boolean; isArguments(value: void | null): false; isArguments(value: any): boolean; isArray(value: Array): true; isArray(value: any): false; isArrayBuffer(value: ArrayBuffer): true; isArrayBuffer(value: any): false; isArrayLike(value: Array | string | { length: number }): true; isArrayLike(value: any): false; isArrayLikeObject(value: { length: number } | Array): true; isArrayLikeObject(value: any): false; isBoolean(value: boolean): true; isBoolean(value: any): false; isBuffer(value: void | null): false; isBuffer(value: any): boolean; isDate(value: Date): true; isDate(value: any): false; isElement(value: Element): true; isElement(value: any): false; isEmpty(value: void | null | "" | {} | [] | number | boolean): true; isEmpty(value: any): boolean; isEqual(value: any, other: any): boolean; isEqualWith( value?: ?T, other?: ?U, customizer?: ?( objValue: any, otherValue: any, key: number | string, object: T, other: U, stack: any ) => boolean | void ): boolean; isError(value: Error): true; isError(value: any): false; isFinite(value: number): boolean; isFinite(value: any): false; isFunction(value: Function): true; isFunction(value: any): false; isInteger(value: number): boolean; isInteger(value: any): false; isLength(value: void | null): false; isLength(value: any): boolean; isMap(value: Map): true; isMap(value: any): false; isMatch(object?: ?Object, source?: ?Object): boolean; isMatchWith( object?: ?T, source?: ?U, customizer?: ?( objValue: any, srcValue: any, key: number | string, object: T, source: U ) => boolean | void ): boolean; isNaN(value: number): boolean; isNaN(value: any): false; isNative(value: number | string | void | null | Object): false; isNative(value: any): boolean; isNil(value: void | null): true; isNil(value: any): false; isNull(value: null): true; isNull(value: any): false; isNumber(value: number): true; isNumber(value: any): false; isObject(value: any): boolean; isObjectLike(value: void | null): false; isObjectLike(value: any): boolean; isPlainObject(value: any): boolean; isRegExp(value: RegExp): true; isRegExp(value: any): false; isSafeInteger(value: number): boolean; isSafeInteger(value: any): false; isSet(value: Set): true; isSet(value: any): false; isString(value: string): true; isString(value: any): false; isSymbol(value: Symbol): true; isSymbol(value: any): false; isTypedArray(value: $TypedArray): true; isTypedArray(value: any): false; isUndefined(value: void): true; isUndefined(value: any): false; isWeakMap(value: WeakMap): true; isWeakMap(value: any): false; isWeakSet(value: WeakSet): true; isWeakSet(value: any): false; lt(value: any, other: any): boolean; lte(value: any, other: any): boolean; toArray(value: any): Array; toFinite(value: void | null): 0; toFinite(value: any): number; toInteger(value: void | null): 0; toInteger(value: any): number; toLength(value: void | null): 0; toLength(value: any): number; toNumber(value: void | null): 0; toNumber(value: any): number; toPlainObject(value: any): Object; toSafeInteger(value: void | null): 0; toSafeInteger(value: any): number; toString(value: void | null): ""; toString(value: any): string; // Math add(augend: number, addend: number): number; ceil(number: number, precision?: number): number; divide(dividend: number, divisor: number): number; floor(number: number, precision?: number): number; max(array: ?Array): T; maxBy(array: ?$ReadOnlyArray, iteratee?: Iteratee): T; mean(array: Array<*>): number; meanBy(array: Array, iteratee?: Iteratee): number; min(array: ?Array): T; minBy(array: ?$ReadOnlyArray, iteratee?: Iteratee): T; multiply(multiplier: number, multiplicand: number): number; round(number: number, precision?: number): number; subtract(minuend: number, subtrahend: number): number; sum(array: Array<*>): number; sumBy(array: $ReadOnlyArray, iteratee?: Iteratee): number; // number clamp(number?: number, lower?: ?number, upper?: ?number): number; clamp(number: ?number, lower?: ?number, upper?: ?number): 0; inRange(number: number, start?: number, end: number): boolean; random(lower?: number, upper?: number, floating?: boolean): number; // Object assign(object?: ?Object, ...sources?: Array): Object; assignIn(): {}; assignIn(a: A, b: B): A & B; assignIn(a: A, b: B, c: C): A & B & C; assignIn(a: A, b: B, c: C, d: D): A & B & C & D; assignIn(a: A, b: B, c: C, d: D, e: E): A & B & C & D & E; assignInWith(): {}; assignInWith( object: T, s1: A, customizer?: ( objValue: any, srcValue: any, key: string, object: T, source: A ) => any | void ): Object; assignInWith( object: T, s1: A, s2: B, customizer?: ( objValue: any, srcValue: any, key: string, object: T, source: A | B ) => any | void ): Object; assignInWith( object: T, s1: A, s2: B, s3: C, customizer?: ( objValue: any, srcValue: any, key: string, object: T, source: A | B | C ) => any | void ): Object; assignInWith( object: T, s1: A, s2: B, s3: C, s4: D, customizer?: ( objValue: any, srcValue: any, key: string, object: T, source: A | B | C | D ) => any | void ): Object; assignWith(): {}; assignWith( object: T, s1: A, customizer?: ( objValue: any, srcValue: any, key: string, object: T, source: A ) => any | void ): Object; assignWith( object: T, s1: A, s2: B, customizer?: ( objValue: any, srcValue: any, key: string, object: T, source: A | B ) => any | void ): Object; assignWith( object: T, s1: A, s2: B, s3: C, customizer?: ( objValue: any, srcValue: any, key: string, object: T, source: A | B | C ) => any | void ): Object; assignWith( object: T, s1: A, s2: B, s3: C, s4: D, customizer?: ( objValue: any, srcValue: any, key: string, object: T, source: A | B | C | D ) => any | void ): Object; at(object?: ?Object, ...paths: Array): Array; at(object?: ?Object, paths: Array): Array; create(prototype: void | null, properties: void | null): {}; create(prototype: T, properties: Object): T; create(prototype: any, properties: void | null): {}; defaults(object?: ?Object, ...sources?: Array): Object; defaultsDeep(object?: ?Object, ...sources?: Array): Object; // alias for _.toPairs entries(object?: ?Object): Array<[string, any]>; // alias for _.toPairsIn entriesIn(object?: ?Object): Array<[string, any]>; // alias for _.assignIn extend(a?: ?A, b?: ?B): A & B; extend(a: A, b: B, c: C): A & B & C; extend(a: A, b: B, c: C, d: D): A & B & C & D; extend(a: A, b: B, c: C, d: D, e: E): A & B & C & D & E; // alias for _.assignInWith extendWith( object?: ?T, s1?: ?A, customizer?: ?( objValue: any, srcValue: any, key: string, object: T, source: A ) => any | void ): Object; extendWith( object: T, s1: A, s2: B, customizer?: ( objValue: any, srcValue: any, key: string, object: T, source: A | B ) => any | void ): Object; extendWith( object: T, s1: A, s2: B, s3: C, customizer?: ( objValue: any, srcValue: any, key: string, object: T, source: A | B | C ) => any | void ): Object; extendWith( object: T, s1: A, s2: B, s3: C, s4: D, customizer?: ( objValue: any, srcValue: any, key: string, object: T, source: A | B | C | D ) => any | void ): Object; findKey( object: T, predicate?: ?OPredicate ): string | void; findKey( object: void | null, predicate?: ?OPredicate ): void; findLastKey( object: T, predicate?: ?OPredicate ): string | void; findLastKey( object: void | null, predicate?: ?OPredicate ): void; forIn(object: Object, iteratee?: ?OIteratee<*>): Object; forIn(object: void | null, iteratee?: ?OIteratee<*>): null; forInRight(object: Object, iteratee?: ?OIteratee<*>): Object; forInRight(object: void | null, iteratee?: ?OIteratee<*>): null; forOwn(object: Object, iteratee?: ?OIteratee<*>): Object; forOwn(object: void | null, iteratee?: ?OIteratee<*>): null; forOwnRight(object: Object, iteratee?: ?OIteratee<*>): Object; forOwnRight(object: void | null, iteratee?: ?OIteratee<*>): null; functions(object?: ?Object): Array; functionsIn(object?: ?Object): Array; get( object?: ?Object | ?$ReadOnlyArray | void | null, path?: ?Path, defaultValue?: any ): any; has(object: Object, path: Path): boolean; has(object: Object, path: void | null): false; has(object: void | null, path?: ?Path): false; hasIn(object: Object, path: Path): boolean; hasIn(object: Object, path: void | null): false; hasIn(object: void | null, path?: ?Path): false; invert(object: Object, multiVal?: ?boolean): Object; invert(object: void | null, multiVal?: ?boolean): {}; invertBy(object: Object, iteratee?: ?Function): Object; invertBy(object: void | null, iteratee?: ?Function): {}; invoke( object?: ?Object, path?: ?Path, ...args?: Array ): any; keys(object?: ?{ [key: K]: any }): Array; keys(object?: ?Object): Array; keysIn(object?: ?Object): Array; mapKeys(object: Object, iteratee?: ?OIteratee<*>): Object; mapKeys(object: void | null, iteratee?: ?OIteratee<*>): {}; mapValues(object: Object, iteratee?: ?OIteratee<*>): Object; mapValues(object: void | null, iteratee?: ?OIteratee<*>): {}; merge(object?: ?Object, ...sources?: Array): Object; mergeWith(): {}; mergeWith( object: T, customizer?: ( objValue: any, srcValue: any, key: string, object: T, source: A ) => any | void ): Object; mergeWith( object: T, s1: A, s2: B, customizer?: ( objValue: any, srcValue: any, key: string, object: T, source: A | B ) => any | void ): Object; mergeWith( object: T, s1: A, s2: B, s3: C, customizer?: ( objValue: any, srcValue: any, key: string, object: T, source: A | B | C ) => any | void ): Object; mergeWith( object: T, s1: A, s2: B, s3: C, s4: D, customizer?: ( objValue: any, srcValue: any, key: string, object: T, source: A | B | C | D ) => any | void ): Object; omit(object?: ?Object, ...props: Array): Object; omit(object?: ?Object, props: Array): Object; omitBy( object: T, predicate?: ?OPredicate ): Object; omitBy(object: void | null, predicate?: ?OPredicate): {}; pick(object?: ?Object, ...props: Array): Object; pick(object?: ?Object, props: $ReadOnlyArray): Object; pickBy( object: T, predicate?: ?OPredicate ): Object; pickBy(object: void | null, predicate?: ?OPredicate): {}; result( object?: ?Object, path?: ?Path, defaultValue?: any ): any; set(object: Object, path?: ?Path, value: any): Object; set( object: T, path?: ?Path, value?: ?any ): T; setWith( object: T, path?: ?Path, value: any, customizer?: (nsValue: any, key: string, nsObject: T) => any ): Object; setWith( object: T, path?: ?Path, value?: ?any, customizer?: ?(nsValue: any, key: string, nsObject: T) => any ): T; toPairs(object?: ?Object | Array<*>): Array<[string, any]>; toPairsIn(object?: ?Object): Array<[string, any]>; transform( collection: Object | $ReadOnlyArray, iteratee?: ?OIteratee<*>, accumulator?: any ): any; transform( collection: void | null, iteratee?: ?OIteratee<*>, accumulator?: ?any ): {}; unset(object: void | null, path?: ?Path): true; unset(object: Object, path?: ?Path): boolean; update(object: Object, path: Path, updater: Function): Object; update( object: T, path?: ?Path, updater?: ?Function ): T; updateWith( object: Object, path?: ?Path, updater?: ?Function, customizer?: ?Function ): Object; updateWith( object: T, path?: ?Path, updater?: ?Function, customizer?: ?Function ): T; values(object?: ?Object): Array; valuesIn(object?: ?Object): Array; // Seq // harder to read, but this is _() (value: any): any; chain(value: T): any; tap(value: T, interceptor: (value: T) => any): T; thru(value: T1, interceptor: (value: T1) => T2): T2; // TODO: _.prototype.* // String camelCase(string: string): string; camelCase(string: void | null): ""; capitalize(string: string): string; capitalize(string: void | null): ""; deburr(string: string): string; deburr(string: void | null): ""; endsWith(string: string, target?: string, position?: ?number): boolean; endsWith(string: void | null, target?: ?string, position?: ?number): false; escape(string: string): string; escape(string: void | null): ""; escapeRegExp(string: string): string; escapeRegExp(string: void | null): ""; kebabCase(string: string): string; kebabCase(string: void | null): ""; lowerCase(string: string): string; lowerCase(string: void | null): ""; lowerFirst(string: string): string; lowerFirst(string: void | null): ""; pad(string?: ?string, length?: ?number, chars?: ?string): string; padEnd(string?: ?string, length?: ?number, chars?: ?string): string; padStart(string?: ?string, length?: ?number, chars?: ?string): string; parseInt(string: string, radix?: ?number): number; repeat(string: string, n?: ?number): string; repeat(string: void | null, n?: ?number): ""; replace( string: string, pattern: RegExp | string, replacement: ((string: string) => string) | string ): string; replace( string: void | null, pattern?: ?RegExp | ?string, replacement: ?((string: string) => string) | ?string ): ""; snakeCase(string: string): string; snakeCase(string: void | null): ""; split( string?: ?string, separator?: ?RegExp | ?string, limit?: ?number ): Array; startCase(string: string): string; startCase(string: void | null): ""; startsWith(string: string, target?: string, position?: number): boolean; startsWith( string: void | null, target?: ?string, position?: ?number ): false; template(string?: ?string, options?: ?TemplateSettings): Function; toLower(string: string): string; toLower(string: void | null): ""; toUpper(string: string): string; toUpper(string: void | null): ""; trim(string: string, chars?: string): string; trim(string: void | null, chars?: ?string): ""; trimEnd(string: string, chars?: ?string): string; trimEnd(string: void | null, chars?: ?string): ""; trimStart(string: string, chars?: ?string): string; trimStart(string: void | null, chars?: ?string): ""; truncate(string: string, options?: TruncateOptions): string; truncate(string: void | null, options?: ?TruncateOptions): ""; unescape(string: string): string; unescape(string: void | null): ""; upperCase(string: string): string; upperCase(string: void | null): ""; upperFirst(string: string): string; upperFirst(string: void | null): ""; words(string?: ?string, pattern?: ?RegExp | ?string): Array; // Util attempt(func: Function, ...args: Array): any; bindAll(object: Object, methodNames?: ?Array): Object; bindAll(object: T, methodNames?: ?Array): T; bindAll(object: Object, ...methodNames: Array): Object; cond(pairs?: ?NestedArray): Function; conforms(source?: ?Object): Function; constant(value: T): () => T; defaultTo(value: T1, defaultValue: T2): T2; defaultTo( value: T1, defaultValue: T2 ): T1; // NaN is a number instead of its own type, otherwise it would behave like null/void defaultTo(value: T1, defaultValue: T2): T1 | T2; flow: $ComposeReverse & ((funcs: Array) => Function); flowRight: $Compose & ((funcs: Array) => Function); identity(value: T): T; iteratee(func?: any): Function; matches(source?: ?Object): Function; matchesProperty(path?: ?Path, srcValue: any): Function; method(path?: ?Path, ...args?: Array): Function; methodOf(object?: ?Object, ...args?: Array): Function; mixin( object?: T, source: Object, options?: { chain: boolean } ): T; noConflict(): Lodash; noop(...args: Array): void; nthArg(n?: ?number): Function; over(...iteratees: Array): Function; over(iteratees: Array): Function; overEvery(...predicates: Array): Function; overEvery(predicates: Array): Function; overSome(...predicates: Array): Function; overSome(predicates: Array): Function; property(path?: ?Path): Function; propertyOf(object?: ?Object): Function; range(start: number, end: number, step?: number): Array; range(end: number, step?: number): Array; rangeRight(start?: ?number, end?: ?number, step?: ?number): Array; rangeRight(end?: ?number, step?: ?number): Array; runInContext(context?: ?Object): Function; stubArray(): Array<*>; stubFalse(): false; stubObject(): {}; stubString(): ""; stubTrue(): true; times(n?: ?number, ...rest?: Array): Array; times(n: number, iteratee: (i: number) => T): Array; toPath(value: any): Array; uniqueId(prefix?: ?string): string; // Properties VERSION: string; templateSettings: TemplateSettings; } declare module.exports: Lodash; } declare module "lodash/fp" { declare type Path = $ReadOnlyArray | string | number; declare type __CurriedFunction1 = (...r: [AA]) => R; declare type CurriedFunction1 = __CurriedFunction1; declare type __CurriedFunction2 = (( ...r: [AA] ) => CurriedFunction1) & ((...r: [AA, BB]) => R); declare type CurriedFunction2 = __CurriedFunction2; declare type __CurriedFunction3 = (( ...r: [AA] ) => CurriedFunction2) & ((...r: [AA, BB]) => CurriedFunction1) & ((...r: [AA, BB, CC]) => R); declare type CurriedFunction3 = __CurriedFunction3< A, B, C, R, *, *, * >; declare type __CurriedFunction4< A, B, C, D, R, AA: A, BB: B, CC: C, DD: D > = ((...r: [AA]) => CurriedFunction3) & ((...r: [AA, BB]) => CurriedFunction2) & ((...r: [AA, BB, CC]) => CurriedFunction1) & ((...r: [AA, BB, CC, DD]) => R); declare type CurriedFunction4 = __CurriedFunction4< A, B, C, D, R, *, *, *, * >; declare type __CurriedFunction5< A, B, C, D, E, R, AA: A, BB: B, CC: C, DD: D, EE: E > = ((...r: [AA]) => CurriedFunction4) & ((...r: [AA, BB]) => CurriedFunction3) & ((...r: [AA, BB, CC]) => CurriedFunction2) & ((...r: [AA, BB, CC, DD]) => CurriedFunction1) & ((...r: [AA, BB, CC, DD, EE]) => R); declare type CurriedFunction5 = __CurriedFunction5< A, B, C, D, E, R, *, *, *, *, * >; declare type __CurriedFunction6< A, B, C, D, E, F, R, AA: A, BB: B, CC: C, DD: D, EE: E, FF: F > = ((...r: [AA]) => CurriedFunction5) & ((...r: [AA, BB]) => CurriedFunction4) & ((...r: [AA, BB, CC]) => CurriedFunction3) & ((...r: [AA, BB, CC, DD]) => CurriedFunction2) & ((...r: [AA, BB, CC, DD, EE]) => CurriedFunction1) & ((...r: [AA, BB, CC, DD, EE, FF]) => R); declare type CurriedFunction6 = __CurriedFunction6< A, B, C, D, E, F, R, *, *, *, *, *, * >; declare type Curry = (((...r: [A]) => R) => CurriedFunction1) & (((...r: [A, B]) => R) => CurriedFunction2) & (((...r: [A, B, C]) => R) => CurriedFunction3) & (( (...r: [A, B, C, D]) => R ) => CurriedFunction4) & (( (...r: [A, B, C, D, E]) => R ) => CurriedFunction5) & (( (...r: [A, B, C, D, E, F]) => R ) => CurriedFunction6); declare type UnaryFn = (a: A) => R; declare type TemplateSettings = { escape?: RegExp, evaluate?: RegExp, imports?: Object, interpolate?: RegExp, variable?: string }; declare type TruncateOptions = { length?: number, omission?: string, separator?: RegExp | string }; declare type DebounceOptions = { leading?: boolean, maxWait?: number, trailing?: boolean }; declare type ThrottleOptions = { leading?: boolean, trailing?: boolean }; declare type NestedArray = Array>; declare type matchesIterateeShorthand = {[string | number]: any}; declare type matchesPropertyIterateeShorthand = [string, any]; declare type propertyIterateeShorthand = string; declare type OPredicate = | ((value: A) => any) | matchesIterateeShorthand | matchesPropertyIterateeShorthand | propertyIterateeShorthand; declare type OIterateeWithResult = Object | string | ((value: V) => R); declare type OIteratee = OIterateeWithResult; declare type OFlatMapIteratee = OIterateeWithResult>; declare type Predicate = | ((value: T) => any) | matchesIterateeShorthand | matchesPropertyIterateeShorthand | propertyIterateeShorthand; declare type _ValueOnlyIteratee = (value: T) => mixed; declare type ValueOnlyIteratee = _ValueOnlyIteratee | string; declare type _Iteratee = (item: T) => mixed; declare type Iteratee = _Iteratee | Object | string; declare type FlatMapIteratee = | ((item: T) => Array) | Object | string; declare type Comparator = (item: T, item2: T) => boolean; declare type MapIterator = ((item: T) => U) | propertyIterateeShorthand; declare type OMapIterator = | ((item: T) => U) | propertyIterateeShorthand; declare class Lodash { // Array chunk(size: number): (array: Array) => Array>; chunk(size: number, array: Array): Array>; compact(array?: ?$ReadOnlyArray): Array; concat | T, B: Array | U>( base: A ): (elements: B) => Array; concat | T, B: Array | U>( base: A, elements: B ): Array; difference(values: $ReadOnlyArray): (array: $ReadOnlyArray) => T[]; difference(values: $ReadOnlyArray, array: $ReadOnlyArray): T[]; differenceBy( iteratee: ValueOnlyIteratee ): ((values: $ReadOnlyArray) => (array: $ReadOnlyArray) => T[]) & ((values: $ReadOnlyArray, array: $ReadOnlyArray) => T[]); differenceBy( iteratee: ValueOnlyIteratee, values: $ReadOnlyArray ): (array: $ReadOnlyArray) => T[]; differenceBy( iteratee: ValueOnlyIteratee, values: $ReadOnlyArray, array: $ReadOnlyArray ): T[]; differenceWith( comparator: Comparator ): ((first: $ReadOnly) => (second: $ReadOnly) => T[]) & ((first: $ReadOnly, second: $ReadOnly) => T[]); differenceWith( comparator: Comparator, first: $ReadOnly ): (second: $ReadOnly) => T[]; differenceWith( comparator: Comparator, first: $ReadOnly, second: $ReadOnly ): T[]; drop(n: number): (array: Array) => Array; drop(n: number, array: Array): Array; dropLast(n: number): (array: Array) => Array; dropLast(n: number, array: Array): Array; dropRight(n: number): (array: Array) => Array; dropRight(n: number, array: Array): Array; dropRightWhile(predicate: Predicate): (array: Array) => Array; dropRightWhile(predicate: Predicate, array: Array): Array; dropWhile(predicate: Predicate): (array: Array) => Array; dropWhile(predicate: Predicate, array: Array): Array; dropLastWhile(predicate: Predicate): (array: Array) => Array; dropLastWhile(predicate: Predicate, array: Array): Array; fill( start: number ): (( end: number ) => ((value: U) => (array: Array) => Array) & ((value: U, array: Array) => Array)) & ((end: number, value: U) => (array: Array) => Array) & ((end: number, value: U, array: Array) => Array); fill( start: number, end: number ): ((value: U) => (array: Array) => Array) & ((value: U, array: Array) => Array); fill( start: number, end: number, value: U ): (array: Array) => Array; fill( start: number, end: number, value: U, array: Array ): Array; findIndex(predicate: Predicate): (array: $ReadOnlyArray) => number; findIndex(predicate: Predicate, array: $ReadOnlyArray): number; findIndexFrom( predicate: Predicate ): ((fromIndex: number) => (array: $ReadOnlyArray) => number) & ((fromIndex: number, array: $ReadOnlyArray) => number); findIndexFrom( predicate: Predicate, fromIndex: number ): (array: $ReadOnlyArray) => number; findIndexFrom( predicate: Predicate, fromIndex: number, array: $ReadOnlyArray ): number; findLastIndex( predicate: Predicate ): (array: $ReadOnlyArray) => number; findLastIndex(predicate: Predicate, array: $ReadOnlyArray): number; findLastIndexFrom( predicate: Predicate ): ((fromIndex: number) => (array: $ReadOnlyArray) => number) & ((fromIndex: number, array: $ReadOnlyArray) => number); findLastIndexFrom( predicate: Predicate, fromIndex: number ): (array: $ReadOnlyArray) => number; findLastIndexFrom( predicate: Predicate, fromIndex: number, array: $ReadOnlyArray ): number; // alias of _.head first(array: $ReadOnlyArray): T; flatten(array: Array | X>): Array; unnest(array: Array | X>): Array; flattenDeep(array: any[]): Array; flattenDepth(depth: number): (array: any[]) => any[]; flattenDepth(depth: number, array: any[]): any[]; fromPairs(pairs: Array<[A, B]>): { [key: A]: B }; head(array: $ReadOnlyArray): T; indexOf(value: T): (array: Array) => number; indexOf(value: T, array: Array): number; indexOfFrom( value: T ): ((fromIndex: number) => (array: Array) => number) & ((fromIndex: number, array: Array) => number); indexOfFrom(value: T, fromIndex: number): (array: Array) => number; indexOfFrom(value: T, fromIndex: number, array: Array): number; initial(array: Array): Array; init(array: Array): Array; intersection(a1: Array): (a2: Array) => Array; intersection(a1: Array, a2: Array): Array; intersectionBy( iteratee: ValueOnlyIteratee ): ((a1: Array) => (a2: Array) => Array) & ((a1: Array, a2: Array) => Array); intersectionBy( iteratee: ValueOnlyIteratee, a1: Array ): (a2: Array) => Array; intersectionBy( iteratee: ValueOnlyIteratee, a1: Array, a2: Array ): Array; intersectionWith( comparator: Comparator ): ((a1: Array) => (a2: Array) => Array) & ((a1: Array, a2: Array) => Array); intersectionWith( comparator: Comparator, a1: Array ): (a2: Array) => Array; intersectionWith( comparator: Comparator, a1: Array, a2: Array ): Array; join(separator: string): (array: Array) => string; join(separator: string, array: Array): string; last(array: Array): T; lastIndexOf(value: T): (array: Array) => number; lastIndexOf(value: T, array: Array): number; lastIndexOfFrom( value: T ): ((fromIndex: number) => (array: Array) => number) & ((fromIndex: number, array: Array) => number); lastIndexOfFrom( value: T, fromIndex: number ): (array: Array) => number; lastIndexOfFrom(value: T, fromIndex: number, array: Array): number; nth(n: number): (array: T[]) => T; nth(n: number, array: T[]): T; pull(value: T): (array: Array) => Array; pull(value: T, array: Array): Array; pullAll(values: Array): (array: Array) => Array; pullAll(values: Array, array: Array): Array; pullAllBy( iteratee: ValueOnlyIteratee ): ((values: Array) => (array: Array) => Array) & ((values: Array, array: Array) => Array); pullAllBy( iteratee: ValueOnlyIteratee, values: Array ): (array: Array) => Array; pullAllBy( iteratee: ValueOnlyIteratee, values: Array, array: Array ): Array; pullAllWith( comparator: Function ): ((values: T[]) => (array: T[]) => T[]) & ((values: T[], array: T[]) => T[]); pullAllWith(comparator: Function, values: T[]): (array: T[]) => T[]; pullAllWith(comparator: Function, values: T[], array: T[]): T[]; pullAt(indexed: Array): (array: Array) => Array; pullAt(indexed: Array, array: Array): Array; remove(predicate: Predicate): (array: Array) => Array; remove(predicate: Predicate, array: Array): Array; reverse(array: Array): Array; slice( start: number ): ((end: number) => (array: Array) => Array) & ((end: number, array: Array) => Array); slice(start: number, end: number): (array: Array) => Array; slice(start: number, end: number, array: Array): Array; sortedIndex(value: T): (array: Array) => number; sortedIndex(value: T, array: Array): number; sortedIndexBy( iteratee: ValueOnlyIteratee ): ((value: T) => (array: Array) => number) & ((value: T, array: Array) => number); sortedIndexBy( iteratee: ValueOnlyIteratee, value: T ): (array: Array) => number; sortedIndexBy( iteratee: ValueOnlyIteratee, value: T, array: Array ): number; sortedIndexOf(value: T): (array: Array) => number; sortedIndexOf(value: T, array: Array): number; sortedLastIndex(value: T): (array: Array) => number; sortedLastIndex(value: T, array: Array): number; sortedLastIndexBy( iteratee: ValueOnlyIteratee ): ((value: T) => (array: Array) => number) & ((value: T, array: Array) => number); sortedLastIndexBy( iteratee: ValueOnlyIteratee, value: T ): (array: Array) => number; sortedLastIndexBy( iteratee: ValueOnlyIteratee, value: T, array: Array ): number; sortedLastIndexOf(value: T): (array: Array) => number; sortedLastIndexOf(value: T, array: Array): number; sortedUniq(array: Array): Array; sortedUniqBy(iteratee: ValueOnlyIteratee, array: Array): Array; tail(array: Array): Array; take(n: number): (array: $ReadOnlyArray) => Array; take(n: number, array: $ReadOnlyArray): Array; takeRight(n: number): (array: $ReadOnlyArray) => Array; takeRight(n: number, array: $ReadOnlyArray): Array; takeLast(n: number): (array: Array) => Array; takeLast(n: number, array: Array): Array; takeRightWhile(predicate: Predicate): (array: Array) => Array; takeRightWhile(predicate: Predicate, array: Array): Array; takeLastWhile(predicate: Predicate): (array: Array) => Array; takeLastWhile(predicate: Predicate, array: Array): Array; takeWhile(predicate: Predicate): (array: Array) => Array; takeWhile(predicate: Predicate, array: Array): Array; union(a1: Array): (a2: Array) => Array; union(a1: Array, a2: Array): Array; unionBy( iteratee: ValueOnlyIteratee ): ((a1: Array) => (a2: Array) => Array) & ((a1: Array, a2: Array) => Array); unionBy( iteratee: ValueOnlyIteratee, a1: Array ): (a2: Array) => Array; unionBy( iteratee: ValueOnlyIteratee, a1: Array, a2: Array ): Array; unionWith( comparator: Comparator ): ((a1: Array) => (a2: Array) => Array) & ((a1: Array, a2: Array) => Array); unionWith( comparator: Comparator, a1: Array ): (a2: Array) => Array; unionWith( comparator: Comparator, a1: Array, a2: Array ): Array; uniq(array: Array): Array; uniqBy(iteratee: ValueOnlyIteratee): (array: Array) => Array; uniqBy(iteratee: ValueOnlyIteratee, array: Array): Array; uniqWith(comparator: Comparator): (array: Array) => Array; uniqWith(comparator: Comparator, array: Array): Array; unzip(array: Array): Array; unzipWith(iteratee: Iteratee): (array: Array) => Array; unzipWith(iteratee: Iteratee, array: Array): Array; without(values: Array): (array: Array) => Array; without(values: Array, array: Array): Array; xor(a1: Array): (a2: Array) => Array; xor(a1: Array, a2: Array): Array; symmetricDifference(a1: Array): (a2: Array) => Array; symmetricDifference(a1: Array, a2: Array): Array; xorBy( iteratee: ValueOnlyIteratee ): ((a1: Array) => (a2: Array) => Array) & ((a1: Array, a2: Array) => Array); xorBy( iteratee: ValueOnlyIteratee, a1: Array ): (a2: Array) => Array; xorBy( iteratee: ValueOnlyIteratee, a1: Array, a2: Array ): Array; symmetricDifferenceBy( iteratee: ValueOnlyIteratee ): ((a1: Array) => (a2: Array) => Array) & ((a1: Array, a2: Array) => Array); symmetricDifferenceBy( iteratee: ValueOnlyIteratee, a1: Array ): (a2: Array) => Array; symmetricDifferenceBy( iteratee: ValueOnlyIteratee, a1: Array, a2: Array ): Array; xorWith( comparator: Comparator ): ((a1: Array) => (a2: Array) => Array) & ((a1: Array, a2: Array) => Array); xorWith( comparator: Comparator, a1: Array ): (a2: Array) => Array; xorWith(comparator: Comparator, a1: Array, a2: Array): Array; symmetricDifferenceWith( comparator: Comparator ): ((a1: Array) => (a2: Array) => Array) & ((a1: Array, a2: Array) => Array); symmetricDifferenceWith( comparator: Comparator, a1: Array ): (a2: Array) => Array; symmetricDifferenceWith( comparator: Comparator, a1: Array, a2: Array ): Array; zip(a1: A[]): (a2: B[]) => Array<[A, B]>; zip(a1: A[], a2: B[]): Array<[A, B]>; zipAll(arrays: Array>): Array; zipObject(props?: Array): (values?: Array) => { [key: K]: V }; zipObject(props?: Array, values?: Array): { [key: K]: V }; zipObj(props: Array): (values: Array) => Object; zipObj(props: Array, values: Array): Object; zipObjectDeep(props: any[]): (values: any) => Object; zipObjectDeep(props: any[], values: any): Object; zipWith( iteratee: Iteratee ): ((a1: NestedArray) => (a2: NestedArray) => Array) & ((a1: NestedArray, a2: NestedArray) => Array); zipWith( iteratee: Iteratee, a1: NestedArray ): (a2: NestedArray) => Array; zipWith( iteratee: Iteratee, a1: NestedArray, a2: NestedArray ): Array; // Collection countBy( iteratee: ValueOnlyIteratee ): (collection: Array | { [id: any]: T }) => { [string]: number }; countBy( iteratee: ValueOnlyIteratee, collection: Array | { [id: any]: T } ): { [string]: number }; // alias of _.forEach each( iteratee: Iteratee | OIteratee ): (collection: $ReadOnlyArray | { [id: any]: T }) => Array; each( iteratee: Iteratee | OIteratee, collection: $ReadOnlyArray | { [id: any]: T } ): Array; // alias of _.forEachRight eachRight( iteratee: Iteratee | OIteratee ): (collection: $ReadOnlyArray | { [id: any]: T }) => Array; eachRight( iteratee: Iteratee | OIteratee, collection: $ReadOnlyArray | { [id: any]: T } ): Array; every( iteratee: Iteratee | OIteratee ): (collection: $ReadOnlyArray | { [id: any]: T }) => boolean; every( iteratee: Iteratee | OIteratee, collection: $ReadOnlyArray | { [id: any]: T } ): boolean; all( iteratee: Iteratee | OIteratee ): (collection: Array | { [id: any]: T }) => boolean; all( iteratee: Iteratee | OIteratee, collection: Array | { [id: any]: T } ): boolean; filter( predicate: Predicate | OPredicate ): (collection: $ReadOnlyArray | { [id: any]: T }) => Array; filter( predicate: Predicate | OPredicate, collection: $ReadOnlyArray | { [id: any]: T } ): Array; find( predicate: Predicate | OPredicate ): (collection: $ReadOnlyArray | { [id: any]: T }) => T | void; find( predicate: Predicate | OPredicate, collection: $ReadOnlyArray | { [id: any]: T } ): T | void; findFrom( predicate: Predicate | OPredicate ): (( fromIndex: number ) => (collection: $ReadOnlyArray | { [id: any]: T }) => T | void) & (( fromIndex: number, collection: $ReadOnlyArray | { [id: any]: T } ) => T | void); findFrom( predicate: Predicate | OPredicate, fromIndex: number ): (collection: Array | { [id: any]: T }) => T | void; findFrom( predicate: Predicate | OPredicate, fromIndex: number, collection: $ReadOnlyArray | { [id: any]: T } ): T | void; findLast( predicate: Predicate | OPredicate ): (collection: $ReadOnlyArray | { [id: any]: T }) => T | void; findLast( predicate: Predicate | OPredicate, collection: $ReadOnlyArray | { [id: any]: T } ): T | void; findLastFrom( predicate: Predicate | OPredicate ): (( fromIndex: number ) => (collection: $ReadOnlyArray | { [id: any]: T }) => T | void) & (( fromIndex: number, collection: $ReadOnlyArray | { [id: any]: T } ) => T | void); findLastFrom( predicate: Predicate | OPredicate, fromIndex: number ): (collection: $ReadOnlyArray | { [id: any]: T }) => T | void; findLastFrom( predicate: Predicate | OPredicate, fromIndex: number, collection: $ReadOnlyArray | { [id: any]: T } ): T | void; flatMap( iteratee: FlatMapIteratee | OFlatMapIteratee ): (collection: Array | { [id: any]: T }) => Array; flatMap( iteratee: FlatMapIteratee | OFlatMapIteratee, collection: Array | { [id: any]: T } ): Array; flatMapDeep( iteratee: FlatMapIteratee | OFlatMapIteratee ): (collection: Array | { [id: any]: T }) => Array; flatMapDeep( iteratee: FlatMapIteratee | OFlatMapIteratee, collection: Array | { [id: any]: T } ): Array; flatMapDepth( iteratee: FlatMapIteratee | OFlatMapIteratee ): (( depth: number ) => (collection: Array | { [id: any]: T }) => Array) & ((depth: number, collection: Array | { [id: any]: T }) => Array); flatMapDepth( iteratee: FlatMapIteratee | OFlatMapIteratee, depth: number ): (collection: Array | { [id: any]: T }) => Array; flatMapDepth( iteratee: FlatMapIteratee | OFlatMapIteratee, depth: number, collection: Array | { [id: any]: T } ): Array; forEach( iteratee: Iteratee | OIteratee ): (collection: $ReadOnlyArray | { [id: any]: T }) => Array; forEach( iteratee: Iteratee | OIteratee, collection: $ReadOnlyArray | { [id: any]: T } ): Array; forEachRight( iteratee: Iteratee | OIteratee ): (collection: $ReadOnlyArray | { [id: any]: T }) => Array; forEachRight( iteratee: Iteratee | OIteratee, collection: $ReadOnlyArray | { [id: any]: T } ): Array; groupBy( iteratee: ValueOnlyIteratee ): ( collection: $ReadOnlyArray | { [id: any]: T } ) => { [key: V]: Array }; groupBy( iteratee: ValueOnlyIteratee, collection: $ReadOnlyArray | { [id: any]: T } ): { [key: V]: Array }; includes(value: T): (collection: Array | { [id: any]: T }) => boolean; includes(value: T, collection: Array | { [id: any]: T }): boolean; includes(value: string): (str: string) => boolean; includes(value: string, str: string): boolean; contains(value: string): (str: string) => boolean; contains(value: string, str: string): boolean; contains(value: T): (collection: Array | { [id: any]: T }) => boolean; contains(value: T, collection: Array | { [id: any]: T }): boolean; includesFrom( value: string ): ((fromIndex: number) => (str: string) => boolean) & ((fromIndex: number, str: string) => boolean); includesFrom(value: string, fromIndex: number): (str: string) => boolean; includesFrom(value: string, fromIndex: number, str: string): boolean; includesFrom( value: T ): ((fromIndex: number) => (collection: Array) => boolean) & ((fromIndex: number, collection: Array) => boolean); includesFrom( value: T, fromIndex: number ): (collection: Array) => boolean; includesFrom(value: T, fromIndex: number, collection: Array): boolean; invokeMap( path: ((value: T) => Path) | Path ): (collection: Array | { [id: any]: T }) => Array; invokeMap( path: ((value: T) => Path) | Path, collection: Array | { [id: any]: T } ): Array; invokeArgsMap( path: ((value: T) => Path) | Path ): (( collection: Array | { [id: any]: T } ) => (args: Array) => Array) & (( collection: Array | { [id: any]: T }, args: Array ) => Array); invokeArgsMap( path: ((value: T) => Path) | Path, collection: Array | { [id: any]: T } ): (args: Array) => Array; invokeArgsMap( path: ((value: T) => Path) | Path, collection: Array | { [id: any]: T }, args: Array ): Array; keyBy( iteratee: ValueOnlyIteratee ): (collection: $ReadOnlyArray | { [id: any]: T }) => { [key: V]: T }; keyBy( iteratee: ValueOnlyIteratee, collection: $ReadOnlyArray | { [id: any]: T } ): { [key: V]: T }; indexBy( iteratee: ValueOnlyIteratee ): (collection: $ReadOnlyArray | { [id: any]: T }) => { [key: V]: T }; indexBy( iteratee: ValueOnlyIteratee, collection: $ReadOnlyArray | { [id: any]: T } ): { [key: V]: T }; map( iteratee: MapIterator | OMapIterator ): (collection: $ReadOnlyArray | { [id: any]: T }) => Array; map( iteratee: MapIterator | OMapIterator, collection: $ReadOnlyArray | { [id: any]: T } ): Array; map(iteratee: (char: string) => any): (str: string) => string; map(iteratee: (char: string) => any, str: string): string; pluck( iteratee: MapIterator | OMapIterator ): (collection: Array | { [id: any]: T }) => Array; pluck( iteratee: MapIterator | OMapIterator, collection: Array | { [id: any]: T } ): Array; pluck(iteratee: (char: string) => any): (str: string) => string; pluck(iteratee: (char: string) => any, str: string): string; orderBy( iteratees: $ReadOnlyArray | OIteratee<*>> | string ): (( orders: $ReadOnlyArray<"asc" | "desc"> | string ) => (collection: $ReadOnlyArray | { [id: any]: T }) => Array) & (( orders: $ReadOnlyArray<"asc" | "desc"> | string, collection: $ReadOnlyArray | { [id: any]: T } ) => Array); orderBy( iteratees: $ReadOnlyArray | OIteratee<*>> | string, orders: $ReadOnlyArray<"asc" | "desc"> | string ): (collection: $ReadOnlyArray | { [id: any]: T }) => Array; orderBy( iteratees: $ReadOnlyArray | OIteratee<*>> | string, orders: $ReadOnlyArray<"asc" | "desc"> | string, collection: $ReadOnlyArray | { [id: any]: T } ): Array; partition( predicate: Predicate | OPredicate ): (collection: Array | { [id: any]: T }) => [Array, Array]; partition( predicate: Predicate | OPredicate, collection: Array | { [id: any]: T } ): [Array, Array]; reduce( iteratee: (accumulator: U, value: T) => U ): ((accumulator: U) => (collection: Array | { [id: any]: T }) => U) & ((accumulator: U, collection: Array | { [id: any]: T }) => U); reduce( iteratee: (accumulator: U, value: T) => U, accumulator: U ): (collection: Array | { [id: any]: T }) => U; reduce( iteratee: (accumulator: U, value: T) => U, accumulator: U, collection: Array | { [id: any]: T } ): U; reduceRight( iteratee: (value: T, accumulator: U) => U ): ((accumulator: U) => (collection: Array | { [id: any]: T }) => U) & ((accumulator: U, collection: Array | { [id: any]: T }) => U); reduceRight( iteratee: (value: T, accumulator: U) => U, accumulator: U ): (collection: Array | { [id: any]: T }) => U; reduceRight( iteratee: (value: T, accumulator: U) => U, accumulator: U, collection: Array | { [id: any]: T } ): U; reject( predicate: Predicate | OPredicate ): (collection: Array | { [id: any]: T }) => Array; reject( predicate: Predicate | OPredicate, collection: Array | { [id: any]: T } ): Array; sample(collection: Array | { [id: any]: T }): T; sampleSize( n: number ): (collection: Array | { [id: any]: T }) => Array; sampleSize(n: number, collection: Array | { [id: any]: T }): Array; shuffle(collection: Array | { [id: any]: T }): Array; size(collection: $ReadOnlyArray | Object | string): number; some( predicate: Predicate | OPredicate ): (collection: $ReadOnlyArray | { [id: any]: T }) => boolean; some( predicate: Predicate | OPredicate, collection: $ReadOnlyArray | { [id: any]: T } ): boolean; any( predicate: Predicate | OPredicate ): (collection: $ReadOnlyArray | { [id: any]: T }) => boolean; any( predicate: Predicate | OPredicate, collection: $ReadOnlyArray | { [id: any]: T } ): boolean; sortBy( iteratees: | $ReadOnlyArray | OIteratee> | Iteratee | OIteratee ): (collection: $ReadOnlyArray | { [id: any]: T }) => Array; sortBy( iteratees: | $ReadOnlyArray | OIteratee> | Iteratee | OIteratee, collection: $ReadOnlyArray | { [id: any]: T } ): Array; // Date now(): number; // Function after(fn: Function): (n: number) => Function; after(fn: Function, n: number): Function; ary(func: Function): Function; nAry(n: number): (func: Function) => Function; nAry(n: number, func: Function): Function; before(fn: Function): (n: number) => Function; before(fn: Function, n: number): Function; bind(func: Function): (thisArg: any) => Function; bind(func: Function, thisArg: any): Function; bindKey(obj: Object): (key: string) => Function; bindKey(obj: Object, key: string): Function; curry: Curry; curryN(arity: number): (func: Function) => Function; curryN(arity: number, func: Function): Function; curryRight(func: Function): Function; curryRightN(arity: number): (func: Function) => Function; curryRightN(arity: number, func: Function): Function; debounce(wait: number): (func: (...A) => R) => (...A) => R; debounce(wait: number, func: (...A) => R): (...A) => R; defer(func: (...any[]) => any): TimeoutID; delay(wait: number): (func: Function) => TimeoutID; delay(wait: number, func: Function): TimeoutID; flip(func: Function): Function; memoize(func: F): F; negate(predicate: (...A) => R): (...A) => boolean; complement(predicate: Function): Function; once(func: Function): Function; overArgs(func: Function): (transforms: Array) => Function; overArgs(func: Function, transforms: Array): Function; useWith(func: Function): (transforms: Array) => Function; useWith(func: Function, transforms: Array): Function; partial(func: Function): (partials: any[]) => Function; partial(func: Function, partials: any[]): Function; partialRight(func: Function): (partials: Array) => Function; partialRight(func: Function, partials: Array): Function; rearg(indexes: Array): (func: Function) => Function; rearg(indexes: Array, func: Function): Function; rest(func: Function): Function; unapply(func: Function): Function; restFrom(start: number): (func: Function) => Function; restFrom(start: number, func: Function): Function; spread(func: Function): Function; apply(func: Function): Function; spreadFrom(start: number): (func: Function) => Function; spreadFrom(start: number, func: Function): Function; throttle(wait: number): (func: (...A) => R) => (...A) => R; throttle(wait: number, func: (...A) => R): (...A) => R; unary(func: (T, ...any[]) => R): (T) => R; wrap(wrapper: Function): (value: any) => Function; wrap(wrapper: Function, value: any): Function; // Lang castArray(value: *): any[]; clone(value: T): T; cloneDeep(value: T): T; cloneDeepWith( customizer: (value: T, key: number | string, object: T, stack: any) => U ): (value: T) => U; cloneDeepWith( customizer: (value: T, key: number | string, object: T, stack: any) => U, value: T ): U; cloneWith( customizer: (value: T, key: number | string, object: T, stack: any) => U ): (value: T) => U; cloneWith( customizer: (value: T, key: number | string, object: T, stack: any) => U, value: T ): U; conformsTo( predicates: T & { [key: string]: (x: any) => boolean } ): (source: T) => boolean; conformsTo( predicates: T & { [key: string]: (x: any) => boolean }, source: T ): boolean; where( predicates: T & { [key: string]: (x: any) => boolean } ): (source: T) => boolean; where( predicates: T & { [key: string]: (x: any) => boolean }, source: T ): boolean; conforms( predicates: T & { [key: string]: (x: any) => boolean } ): (source: T) => boolean; conforms( predicates: T & { [key: string]: (x: any) => boolean }, source: T ): boolean; eq(value: any): (other: any) => boolean; eq(value: any, other: any): boolean; identical(value: any): (other: any) => boolean; identical(value: any, other: any): boolean; gt(value: any): (other: any) => boolean; gt(value: any, other: any): boolean; gte(value: any): (other: any) => boolean; gte(value: any, other: any): boolean; isArguments(value: any): boolean; isArray(value: any): boolean; isArrayBuffer(value: any): boolean; isArrayLike(value: any): boolean; isArrayLikeObject(value: any): boolean; isBoolean(value: any): boolean; isBuffer(value: any): boolean; isDate(value: any): boolean; isElement(value: any): boolean; isEmpty(value: any): boolean; isEqual(value: any): (other: any) => boolean; isEqual(value: any, other: any): boolean; equals(value: any): (other: any) => boolean; equals(value: any, other: any): boolean; isEqualWith( customizer: ( objValue: any, otherValue: any, key: number | string, object: T, other: U, stack: any ) => boolean | void ): ((value: T) => (other: U) => boolean) & ((value: T, other: U) => boolean); isEqualWith( customizer: ( objValue: any, otherValue: any, key: number | string, object: T, other: U, stack: any ) => boolean | void, value: T ): (other: U) => boolean; isEqualWith( customizer: ( objValue: any, otherValue: any, key: number | string, object: T, other: U, stack: any ) => boolean | void, value: T, other: U ): boolean; isError(value: any): boolean; isFinite(value: any): boolean; isFunction(value: any): boolean; isInteger(value: any): boolean; isLength(value: any): boolean; isMap(value: any): boolean; isMatch(source: Object): (object: Object) => boolean; isMatch(source: Object, object: Object): boolean; whereEq(source: Object): (object: Object) => boolean; whereEq(source: Object, object: Object): boolean; isMatchWith( customizer: ( objValue: any, srcValue: any, key: number | string, object: T, source: U ) => boolean | void ): ((source: U) => (object: T) => boolean) & ((source: U, object: T) => boolean); isMatchWith( customizer: ( objValue: any, srcValue: any, key: number | string, object: T, source: U ) => boolean | void, source: U ): (object: T) => boolean; isMatchWith( customizer: ( objValue: any, srcValue: any, key: number | string, object: T, source: U ) => boolean | void, source: U, object: T ): boolean; isNaN(value: any): boolean; isNative(value: any): boolean; isNil(value: any): boolean; isNull(value: any): boolean; isNumber(value: any): boolean; isObject(value: any): boolean; isObjectLike(value: any): boolean; isPlainObject(value: any): boolean; isRegExp(value: any): boolean; isSafeInteger(value: any): boolean; isSet(value: any): boolean; isString(value: string): true; isString(value: any): false; isSymbol(value: any): boolean; isTypedArray(value: any): boolean; isUndefined(value: any): boolean; isWeakMap(value: any): boolean; isWeakSet(value: any): boolean; lt(value: any): (other: any) => boolean; lt(value: any, other: any): boolean; lte(value: any): (other: any) => boolean; lte(value: any, other: any): boolean; toArray(value: any): Array; toFinite(value: any): number; toInteger(value: any): number; toLength(value: any): number; toNumber(value: any): number; toPlainObject(value: any): Object; toSafeInteger(value: any): number; toString(value: any): string; // Math add(augend: number): (addend: number) => number; add(augend: number, addend: number): number; ceil(number: number): number; divide(dividend: number): (divisor: number) => number; divide(dividend: number, divisor: number): number; floor(number: number): number; max(array: Array): T; maxBy(iteratee: Iteratee): (array: Array) => T; maxBy(iteratee: Iteratee, array: Array): T; mean(array: Array<*>): number; meanBy(iteratee: Iteratee): (array: Array) => number; meanBy(iteratee: Iteratee, array: Array): number; min(array: Array): T; minBy(iteratee: Iteratee): (array: Array) => T; minBy(iteratee: Iteratee, array: Array): T; multiply(multiplier: number): (multiplicand: number) => number; multiply(multiplier: number, multiplicand: number): number; round(number: number): number; subtract(minuend: number): (subtrahend: number) => number; subtract(minuend: number, subtrahend: number): number; sum(array: Array<*>): number; sumBy(iteratee: Iteratee): (array: Array) => number; sumBy(iteratee: Iteratee, array: Array): number; // number clamp( lower: number ): ((upper: number) => (number: number) => number) & ((upper: number, number: number) => number); clamp(lower: number, upper: number): (number: number) => number; clamp(lower: number, upper: number, number: number): number; inRange( start: number ): ((end: number) => (number: number) => boolean) & ((end: number, number: number) => boolean); inRange(start: number, end: number): (number: number) => boolean; inRange(start: number, end: number, number: number): boolean; random(lower: number): (upper: number) => number; random(lower: number, upper: number): number; // Object assign(object: Object): (source: Object) => Object; assign(object: Object, source: Object): Object; assignAll(objects: Array): Object; assignInAll(objects: Array): Object; extendAll(objects: Array): Object; assignIn(a: A): (b: B) => A & B; assignIn(a: A, b: B): A & B; assignInWith( customizer: ( objValue: any, srcValue: any, key: string, object: T, source: A ) => any | void ): ((object: T) => (s1: A) => Object) & ((object: T, s1: A) => Object); assignInWith( customizer: ( objValue: any, srcValue: any, key: string, object: T, source: A ) => any | void, object: T ): (s1: A) => Object; assignInWith( customizer: ( objValue: any, srcValue: any, key: string, object: T, source: A ) => any | void, object: T, s1: A ): Object; assignWith( customizer: ( objValue: any, srcValue: any, key: string, object: T, source: A ) => any | void ): ((object: T) => (s1: A) => Object) & ((object: T, s1: A) => Object); assignWith( customizer: ( objValue: any, srcValue: any, key: string, object: T, source: A ) => any | void, object: T ): (s1: A) => Object; assignWith( customizer: ( objValue: any, srcValue: any, key: string, object: T, source: A ) => any | void, object: T, s1: A ): Object; assignInAllWith( customizer: ( objValue: any, srcValue: any, key: string, object: Object, source: Object ) => any | void ): (objects: Array) => Object; assignInAllWith( customizer: ( objValue: any, srcValue: any, key: string, object: Object, source: Object ) => any | void, objects: Array ): Object; extendAllWith( customizer: ( objValue: any, srcValue: any, key: string, object: Object, source: Object ) => any | void ): (objects: Array) => Object; extendAllWith( customizer: ( objValue: any, srcValue: any, key: string, object: Object, source: Object ) => any | void, objects: Array ): Object; assignAllWith( customizer: ( objValue: any, srcValue: any, key: string, object: Object, source: Object ) => any | void ): (objects: Array) => Object; assignAllWith( customizer: ( objValue: any, srcValue: any, key: string, object: Object, source: Object ) => any | void, objects: Array ): Object; at(paths: Array): (object: Object) => Array; at(paths: Array, object: Object): Array; props(paths: Array): (object: Object) => Array; props(paths: Array, object: Object): Array; paths(paths: Array): (object: Object) => Array; paths(paths: Array, object: Object): Array; create(prototype: T): T; defaults(source: Object): (object: Object) => Object; defaults(source: Object, object: Object): Object; defaultsAll(objects: Array): Object; defaultsDeep(source: Object): (object: Object) => Object; defaultsDeep(source: Object, object: Object): Object; defaultsDeepAll(objects: Array): Object; // alias for _.toPairs entries(object: Object): Array<[string, any]>; // alias for _.toPairsIn entriesIn(object: Object): Array<[string, any]>; // alias for _.assignIn extend(a: A): (b: B) => A & B; extend(a: A, b: B): A & B; // alias for _.assignInWith extendWith( customizer: ( objValue: any, srcValue: any, key: string, object: T, source: A ) => any | void ): ((object: T) => (s1: A) => Object) & ((object: T, s1: A) => Object); extendWith( customizer: ( objValue: any, srcValue: any, key: string, object: T, source: A ) => any | void, object: T ): (s1: A) => Object; extendWith( customizer: ( objValue: any, srcValue: any, key: string, object: T, source: A ) => any | void, object: T, s1: A ): Object; findKey( predicate: OPredicate ): (object: T) => string | void; findKey( predicate: OPredicate, object: T ): string | void; findLastKey( predicate: OPredicate ): (object: T) => string | void; findLastKey( predicate: OPredicate, object: T ): string | void; forIn(iteratee: OIteratee<*>): (object: Object) => Object; forIn(iteratee: OIteratee<*>, object: Object): Object; forInRight(iteratee: OIteratee<*>): (object: Object) => Object; forInRight(iteratee: OIteratee<*>, object: Object): Object; forOwn(iteratee: OIteratee<*>): (object: Object) => Object; forOwn(iteratee: OIteratee<*>, object: Object): Object; forOwnRight(iteratee: OIteratee<*>): (object: Object) => Object; forOwnRight(iteratee: OIteratee<*>, object: Object): Object; functions(object: Object): Array; functionsIn(object: Object): Array; get( path: Path ): (object: Object | $ReadOnlyArray | void | null) => any; get( path: Path, object: Object | $ReadOnlyArray | void | null ): any; prop(path: Path): (object: Object | Array) => any; prop(path: Path, object: Object | Array): any; path(path: Path): (object: Object | Array) => any; path(path: Path, object: Object | Array): any; getOr( defaultValue: any ): (( path: Path ) => (object: Object | Array) => any) & (( path: Path, object: Object | $ReadOnlyArray | void | null ) => any); getOr( defaultValue: any, path: Path ): (object: Object | $ReadOnlyArray | void | null) => any; getOr( defaultValue: any, path: Path, object: Object | $ReadOnlyArray | void | null ): any; propOr( defaultValue: any ): (( path: Path ) => (object: Object | Array) => any) & ((path: Path, object: Object | Array) => any); propOr( defaultValue: any, path: Path ): (object: Object | Array) => any; propOr( defaultValue: any, path: Path, object: Object | Array ): any; pathOr( defaultValue: any ): (( path: Path ) => (object: Object | Array) => any) & ((path: Path, object: Object | Array) => any); pathOr( defaultValue: any, path: Path ): (object: Object | Array) => any; pathOr( defaultValue: any, path: Path, object: Object | Array ): any; has(path: Path): (object: Object) => boolean; has(path: Path, object: Object): boolean; hasIn(path: Path): (object: Object) => boolean; hasIn(path: Path, object: Object): boolean; invert(object: Object): Object; invertObj(object: Object): Object; invertBy(iteratee: Function): (object: Object) => Object; invertBy(iteratee: Function, object: Object): Object; invoke(path: Path): (object: Object) => any; invoke(path: Path, object: Object): any; invokeArgs( path: Path ): ((object: Object) => (args: Array) => any) & ((object: Object, args: Array) => any); invokeArgs( path: Path, object: Object ): (args: Array) => any; invokeArgs( path: Path, object: Object, args: Array ): any; keys(object: { [key: K]: any }): Array; keys(object: Object): Array; keysIn(object: Object): Array; mapKeys(iteratee: OIteratee<*>): (object: Object) => Object; mapKeys(iteratee: OIteratee<*>, object: Object): Object; mapValues(iteratee: OIteratee<*>): (object: Object) => Object; mapValues(iteratee: OIteratee<*>, object: Object): Object; merge(object: Object): (source: Object) => Object; merge(object: Object, source: Object): Object; mergeAll(objects: Array): Object; mergeWith( customizer: ( objValue: any, srcValue: any, key: string, object: T, source: A | B ) => any | void ): ((object: T) => (s1: A) => Object) & ((object: T, s1: A) => Object); mergeWith( customizer: ( objValue: any, srcValue: any, key: string, object: T, source: A | B ) => any | void, object: T ): (s1: A) => Object; mergeWith( customizer: ( objValue: any, srcValue: any, key: string, object: T, source: A | B ) => any | void, object: T, s1: A ): Object; mergeAllWith( customizer: ( objValue: any, srcValue: any, key: string, object: Object, source: Object ) => any | void ): (objects: Array) => Object; mergeAllWith( customizer: ( objValue: any, srcValue: any, key: string, object: Object, source: Object ) => any | void, objects: Array ): Object; omit(props: Array): (object: Object) => Object; omit(props: Array, object: Object): Object; omitAll(props: Array): (object: Object) => Object; omitAll(props: Array, object: Object): Object; omitBy( predicate: OPredicate ): (object: T) => Object; omitBy(predicate: OPredicate, object: T): Object; pick(...props: Array): Object; pick(props: $ReadOnlyArray, object: Object): Object; pick(...props: Array): (object: Object) => Object; pick(props: $ReadOnlyArray): (object: Object) => Object; pickAll(props: Array): (object: Object) => Object; pickAll(props: Array, object: Object): Object; pickBy( predicate: OPredicate ): (object: T) => Object; pickBy(predicate: OPredicate, object: T): Object; result(path: Path): (object: Object) => any; result(path: Path, object: Object): any; set( path: Path ): ((value: any) => (object: Object) => Object) & ((value: any, object: Object) => Object); set(path: Path, value: any): (object: Object) => Object; set(path: Path, value: any, object: Object): Object; assoc( path: Path ): ((value: any) => (object: Object) => Object) & ((value: any, object: Object) => Object); assoc(path: Path, value: any): (object: Object) => Object; assoc(path: Path, value: any, object: Object): Object; assocPath( path: Path ): ((value: any) => (object: Object) => Object) & ((value: any, object: Object) => Object); assocPath( path: Path, value: any ): (object: Object) => Object; assocPath(path: Path, value: any, object: Object): Object; setWith( customizer: (nsValue: any, key: string, nsObject: T) => any ): (( path: Path ) => ((value: any) => (object: T) => Object) & ((value: any, object: T) => Object)) & ((path: Path, value: any) => (object: T) => Object) & ((path: Path, value: any, object: T) => Object); setWith( customizer: (nsValue: any, key: string, nsObject: T) => any, path: Path ): ((value: any) => (object: T) => Object) & ((value: any, object: T) => Object); setWith( customizer: (nsValue: any, key: string, nsObject: T) => any, path: Path, value: any ): (object: T) => Object; setWith( customizer: (nsValue: any, key: string, nsObject: T) => any, path: Path, value: any, object: T ): Object; toPairs(object: Object | Array<*>): Array<[string, any]>; toPairsIn(object: Object): Array<[string, any]>; transform( iteratee: OIteratee<*> ): (( accumulator: any ) => (collection: Object | $ReadOnlyArray) => any) & ((accumulator: any, collection: Object | $ReadOnlyArray) => any); transform( iteratee: OIteratee<*>, accumulator: any ): (collection: Object | $ReadOnlyArray) => any; transform( iteratee: OIteratee<*>, accumulator: any, collection: Object | $ReadOnlyArray ): any; unset(path: Path): (object: Object) => Object; unset(path: Path, object: Object): Object; dissoc(path: Path): (object: Object) => Object; dissoc(path: Path, object: Object): Object; dissocPath(path: Path): (object: Object) => Object; dissocPath(path: Path, object: Object): Object; update( path: Path ): ((updater: Function) => (object: Object) => Object) & ((updater: Function, object: Object) => Object); update( path: Path, updater: Function ): (object: Object) => Object; update(path: Path, updater: Function, object: Object): Object; updateWith( customizer: Function ): (( path: Path ) => ((updater: Function) => (object: Object) => Object) & ((updater: Function, object: Object) => Object)) & (( path: Path, updater: Function ) => (object: Object) => Object) & ((path: Path, updater: Function, object: Object) => Object); updateWith( customizer: Function, path: Path ): ((updater: Function) => (object: Object) => Object) & ((updater: Function, object: Object) => Object); updateWith( customizer: Function, path: Path, updater: Function ): (object: Object) => Object; updateWith( customizer: Function, path: Path, updater: Function, object: Object ): Object; values(object: Object): Array; valuesIn(object: Object): Array; tap(interceptor: (value: T) => any): (value: T) => T; tap(interceptor: (value: T) => any, value: T): T; thru(interceptor: (value: T1) => T2): (value: T1) => T2; thru(interceptor: (value: T1) => T2, value: T1): T2; // String camelCase(string: string): string; capitalize(string: string): string; deburr(string: string): string; endsWith(target: string): (string: string) => boolean; endsWith(target: string, string: string): boolean; escape(string: string): string; escapeRegExp(string: string): string; kebabCase(string: string): string; lowerCase(string: string): string; lowerFirst(string: string): string; pad(length: number): (string: string) => string; pad(length: number, string: string): string; padChars( chars: string ): ((length: number) => (string: string) => string) & ((length: number, string: string) => string); padChars(chars: string, length: number): (string: string) => string; padChars(chars: string, length: number, string: string): string; padEnd(length: number): (string: string) => string; padEnd(length: number, string: string): string; padCharsEnd( chars: string ): ((length: number) => (string: string) => string) & ((length: number, string: string) => string); padCharsEnd(chars: string, length: number): (string: string) => string; padCharsEnd(chars: string, length: number, string: string): string; padStart(length: number): (string: string) => string; padStart(length: number, string: string): string; padCharsStart( chars: string ): ((length: number) => (string: string) => string) & ((length: number, string: string) => string); padCharsStart(chars: string, length: number): (string: string) => string; padCharsStart(chars: string, length: number, string: string): string; parseInt(radix: number): (string: string) => number; parseInt(radix: number, string: string): number; repeat(n: number): (string: string) => string; repeat(n: number, string: string): string; replace( pattern: RegExp | string ): (( replacement: ((string: string) => string) | string ) => (string: string) => string) & (( replacement: ((string: string) => string) | string, string: string ) => string); replace( pattern: RegExp | string, replacement: ((string: string) => string) | string ): (string: string) => string; replace( pattern: RegExp | string, replacement: ((string: string) => string) | string, string: string ): string; snakeCase(string: string): string; split(separator: RegExp | string): (string: string) => Array; split(separator: RegExp | string, string: string): Array; startCase(string: string): string; startsWith(target: string): (string: string) => boolean; startsWith(target: string, string: string): boolean; template(string: string): Function; toLower(string: string): string; toUpper(string: string): string; trim(string: string): string; trimChars(chars: string): (string: string) => string; trimChars(chars: string, string: string): string; trimEnd(string: string): string; trimCharsEnd(chars: string): (string: string) => string; trimCharsEnd(chars: string, string: string): string; trimStart(string: string): string; trimCharsStart(chars: string): (string: string) => string; trimCharsStart(chars: string, string: string): string; truncate(options: TruncateOptions): (string: string) => string; truncate(options: TruncateOptions, string: string): string; unescape(string: string): string; upperCase(string: string): string; upperFirst(string: string): string; words(string: string): Array; // Util attempt(func: Function): any; bindAll(methodNames: Array): (object: Object) => Object; bindAll(methodNames: Array, object: Object): Object; cond(pairs: NestedArray): Function; constant(value: T): () => T; always(value: T): () => T; defaultTo(defaultValue: T2): (value: T1) => T2; defaultTo(defaultValue: T2, value: T1): T2; defaultTo( defaultValue: T2 ): (value: T1) => T1; defaultTo( defaultValue: T2, value: T1 ): T1; // NaN is a number instead of its own type, otherwise it would behave like null/void defaultTo(defaultValue: T2): (value: T1) => T1 | T2; defaultTo(defaultValue: T2, value: T1): T1 | T2; flow: $ComposeReverse & ((funcs: Array) => Function); pipe: $ComposeReverse & ((funcs: Array) => Function); flowRight: $Compose & ((funcs: Array) => Function); compose: $Compose & ((funcs: Array) => Function); compose(funcs: Array): Function; identity(value: T): T; iteratee(func: any): Function; matches(source: Object): (object: Object) => boolean; matches(source: Object, object: Object): boolean; matchesProperty(path: Path): (srcValue: any) => Function; matchesProperty(path: Path, srcValue: any): Function; propEq(path: Path): (srcValue: any) => Function; propEq(path: Path, srcValue: any): Function; pathEq(path: Path): (srcValue: any) => Function; pathEq(path: Path, srcValue: any): Function; method(path: Path): Function; methodOf(object: Object): Function; mixin( object: T ): ((source: Object) => (options: { chain: boolean }) => T) & ((source: Object, options: { chain: boolean }) => T); mixin( object: T, source: Object ): (options: { chain: boolean }) => T; mixin( object: T, source: Object, options: { chain: boolean } ): T; noConflict(): Lodash; noop(...args: Array): void; nthArg(n: number): Function; over(iteratees: Array): Function; juxt(iteratees: Array): Function; overEvery(predicates: Array): Function; allPass(predicates: Array): Function; overSome(predicates: Array): Function; anyPass(predicates: Array): Function; property( path: Path ): (object: Object | Array) => any; property(path: Path, object: Object | Array): any; propertyOf(object: Object): (path: Path) => Function; propertyOf(object: Object, path: Path): Function; range(start: number): (end: number) => Array; range(start: number, end: number): Array; rangeStep( step: number ): ((start: number) => (end: number) => Array) & ((start: number, end: number) => Array); rangeStep(step: number, start: number): (end: number) => Array; rangeStep(step: number, start: number, end: number): Array; rangeRight(start: number): (end: number) => Array; rangeRight(start: number, end: number): Array; rangeStepRight( step: number ): ((start: number) => (end: number) => Array) & ((start: number, end: number) => Array); rangeStepRight(step: number, start: number): (end: number) => Array; rangeStepRight(step: number, start: number, end: number): Array; runInContext(context: Object): Function; stubArray(): Array<*>; stubFalse(): false; F(): false; stubObject(): {}; stubString(): ""; stubTrue(): true; T(): true; times(iteratee: (i: number) => T): (n: number) => Array; times(iteratee: (i: number) => T, n: number): Array; toPath(value: any): Array; uniqueId(prefix: string): string; __: any; placeholder: any; convert(options: { cap?: boolean, curry?: boolean, fixed?: boolean, immutable?: boolean, rearg?: boolean }): void; // Properties VERSION: string; templateSettings: TemplateSettings; } declare module.exports: Lodash; } declare module "lodash/chunk" { declare module.exports: $PropertyType<$Exports<"lodash">, "chunk">; } declare module "lodash/compact" { declare module.exports: $PropertyType<$Exports<"lodash">, "compact">; } declare module "lodash/concat" { declare module.exports: $PropertyType<$Exports<"lodash">, "concat">; } declare module "lodash/difference" { declare module.exports: $PropertyType<$Exports<"lodash">, "difference">; } declare module "lodash/differenceBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "differenceBy">; } declare module "lodash/differenceWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "differenceWith">; } declare module "lodash/drop" { declare module.exports: $PropertyType<$Exports<"lodash">, "drop">; } declare module "lodash/dropRight" { declare module.exports: $PropertyType<$Exports<"lodash">, "dropRight">; } declare module "lodash/dropRightWhile" { declare module.exports: $PropertyType<$Exports<"lodash">, "dropRightWhile">; } declare module "lodash/dropWhile" { declare module.exports: $PropertyType<$Exports<"lodash">, "dropWhile">; } declare module "lodash/fill" { declare module.exports: $PropertyType<$Exports<"lodash">, "fill">; } declare module "lodash/findIndex" { declare module.exports: $PropertyType<$Exports<"lodash">, "findIndex">; } declare module "lodash/findLastIndex" { declare module.exports: $PropertyType<$Exports<"lodash">, "findLastIndex">; } declare module "lodash/first" { declare module.exports: $PropertyType<$Exports<"lodash">, "first">; } declare module "lodash/flatten" { declare module.exports: $PropertyType<$Exports<"lodash">, "flatten">; } declare module "lodash/flattenDeep" { declare module.exports: $PropertyType<$Exports<"lodash">, "flattenDeep">; } declare module "lodash/flattenDepth" { declare module.exports: $PropertyType<$Exports<"lodash">, "flattenDepth">; } declare module "lodash/fromPairs" { declare module.exports: $PropertyType<$Exports<"lodash">, "fromPairs">; } declare module "lodash/head" { declare module.exports: $PropertyType<$Exports<"lodash">, "head">; } declare module "lodash/indexOf" { declare module.exports: $PropertyType<$Exports<"lodash">, "indexOf">; } declare module "lodash/initial" { declare module.exports: $PropertyType<$Exports<"lodash">, "initial">; } declare module "lodash/intersection" { declare module.exports: $PropertyType<$Exports<"lodash">, "intersection">; } declare module "lodash/intersectionBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "intersectionBy">; } declare module "lodash/intersectionWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "intersectionWith">; } declare module "lodash/join" { declare module.exports: $PropertyType<$Exports<"lodash">, "join">; } declare module "lodash/last" { declare module.exports: $PropertyType<$Exports<"lodash">, "last">; } declare module "lodash/lastIndexOf" { declare module.exports: $PropertyType<$Exports<"lodash">, "lastIndexOf">; } declare module "lodash/nth" { declare module.exports: $PropertyType<$Exports<"lodash">, "nth">; } declare module "lodash/pull" { declare module.exports: $PropertyType<$Exports<"lodash">, "pull">; } declare module "lodash/pullAll" { declare module.exports: $PropertyType<$Exports<"lodash">, "pullAll">; } declare module "lodash/pullAllBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "pullAllBy">; } declare module "lodash/pullAllWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "pullAllWith">; } declare module "lodash/pullAt" { declare module.exports: $PropertyType<$Exports<"lodash">, "pullAt">; } declare module "lodash/remove" { declare module.exports: $PropertyType<$Exports<"lodash">, "remove">; } declare module "lodash/reverse" { declare module.exports: $PropertyType<$Exports<"lodash">, "reverse">; } declare module "lodash/slice" { declare module.exports: $PropertyType<$Exports<"lodash">, "slice">; } declare module "lodash/sortedIndex" { declare module.exports: $PropertyType<$Exports<"lodash">, "sortedIndex">; } declare module "lodash/sortedIndexBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "sortedIndexBy">; } declare module "lodash/sortedIndexOf" { declare module.exports: $PropertyType<$Exports<"lodash">, "sortedIndexOf">; } declare module "lodash/sortedLastIndex" { declare module.exports: $PropertyType<$Exports<"lodash">, "sortedLastIndex">; } declare module "lodash/sortedLastIndexBy" { declare module.exports: $PropertyType< $Exports<"lodash">, "sortedLastIndexBy" >; } declare module "lodash/sortedLastIndexOf" { declare module.exports: $PropertyType< $Exports<"lodash">, "sortedLastIndexOf" >; } declare module "lodash/sortedUniq" { declare module.exports: $PropertyType<$Exports<"lodash">, "sortedUniq">; } declare module "lodash/sortedUniqBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "sortedUniqBy">; } declare module "lodash/tail" { declare module.exports: $PropertyType<$Exports<"lodash">, "tail">; } declare module "lodash/take" { declare module.exports: $PropertyType<$Exports<"lodash">, "take">; } declare module "lodash/takeRight" { declare module.exports: $PropertyType<$Exports<"lodash">, "takeRight">; } declare module "lodash/takeRightWhile" { declare module.exports: $PropertyType<$Exports<"lodash">, "takeRightWhile">; } declare module "lodash/takeWhile" { declare module.exports: $PropertyType<$Exports<"lodash">, "takeWhile">; } declare module "lodash/union" { declare module.exports: $PropertyType<$Exports<"lodash">, "union">; } declare module "lodash/unionBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "unionBy">; } declare module "lodash/unionWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "unionWith">; } declare module "lodash/uniq" { declare module.exports: $PropertyType<$Exports<"lodash">, "uniq">; } declare module "lodash/uniqBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "uniqBy">; } declare module "lodash/uniqWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "uniqWith">; } declare module "lodash/unzip" { declare module.exports: $PropertyType<$Exports<"lodash">, "unzip">; } declare module "lodash/unzipWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "unzipWith">; } declare module "lodash/without" { declare module.exports: $PropertyType<$Exports<"lodash">, "without">; } declare module "lodash/xor" { declare module.exports: $PropertyType<$Exports<"lodash">, "xor">; } declare module "lodash/xorBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "xorBy">; } declare module "lodash/xorWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "xorWith">; } declare module "lodash/zip" { declare module.exports: $PropertyType<$Exports<"lodash">, "zip">; } declare module "lodash/zipObject" { declare module.exports: $PropertyType<$Exports<"lodash">, "zipObject">; } declare module "lodash/zipObjectDeep" { declare module.exports: $PropertyType<$Exports<"lodash">, "zipObjectDeep">; } declare module "lodash/zipWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "zipWith">; } declare module "lodash/countBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "countBy">; } declare module "lodash/each" { declare module.exports: $PropertyType<$Exports<"lodash">, "each">; } declare module "lodash/eachRight" { declare module.exports: $PropertyType<$Exports<"lodash">, "eachRight">; } declare module "lodash/every" { declare module.exports: $PropertyType<$Exports<"lodash">, "every">; } declare module "lodash/filter" { declare module.exports: $PropertyType<$Exports<"lodash">, "filter">; } declare module "lodash/find" { declare module.exports: $PropertyType<$Exports<"lodash">, "find">; } declare module "lodash/findLast" { declare module.exports: $PropertyType<$Exports<"lodash">, "findLast">; } declare module "lodash/flatMap" { declare module.exports: $PropertyType<$Exports<"lodash">, "flatMap">; } declare module "lodash/flatMapDeep" { declare module.exports: $PropertyType<$Exports<"lodash">, "flatMapDeep">; } declare module "lodash/flatMapDepth" { declare module.exports: $PropertyType<$Exports<"lodash">, "flatMapDepth">; } declare module "lodash/forEach" { declare module.exports: $PropertyType<$Exports<"lodash">, "forEach">; } declare module "lodash/forEachRight" { declare module.exports: $PropertyType<$Exports<"lodash">, "forEachRight">; } declare module "lodash/groupBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "groupBy">; } declare module "lodash/includes" { declare module.exports: $PropertyType<$Exports<"lodash">, "includes">; } declare module "lodash/invokeMap" { declare module.exports: $PropertyType<$Exports<"lodash">, "invokeMap">; } declare module "lodash/keyBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "keyBy">; } declare module "lodash/map" { declare module.exports: $PropertyType<$Exports<"lodash">, "map">; } declare module "lodash/orderBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "orderBy">; } declare module "lodash/partition" { declare module.exports: $PropertyType<$Exports<"lodash">, "partition">; } declare module "lodash/reduce" { declare module.exports: $PropertyType<$Exports<"lodash">, "reduce">; } declare module "lodash/reduceRight" { declare module.exports: $PropertyType<$Exports<"lodash">, "reduceRight">; } declare module "lodash/reject" { declare module.exports: $PropertyType<$Exports<"lodash">, "reject">; } declare module "lodash/sample" { declare module.exports: $PropertyType<$Exports<"lodash">, "sample">; } declare module "lodash/sampleSize" { declare module.exports: $PropertyType<$Exports<"lodash">, "sampleSize">; } declare module "lodash/shuffle" { declare module.exports: $PropertyType<$Exports<"lodash">, "shuffle">; } declare module "lodash/size" { declare module.exports: $PropertyType<$Exports<"lodash">, "size">; } declare module "lodash/some" { declare module.exports: $PropertyType<$Exports<"lodash">, "some">; } declare module "lodash/sortBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "sortBy">; } declare module "lodash/now" { declare module.exports: $PropertyType<$Exports<"lodash">, "now">; } declare module "lodash/after" { declare module.exports: $PropertyType<$Exports<"lodash">, "after">; } declare module "lodash/ary" { declare module.exports: $PropertyType<$Exports<"lodash">, "ary">; } declare module "lodash/before" { declare module.exports: $PropertyType<$Exports<"lodash">, "before">; } declare module "lodash/bind" { declare module.exports: $PropertyType<$Exports<"lodash">, "bind">; } declare module "lodash/bindKey" { declare module.exports: $PropertyType<$Exports<"lodash">, "bindKey">; } declare module "lodash/curry" { declare module.exports: $PropertyType<$Exports<"lodash">, "curry">; } declare module "lodash/curryRight" { declare module.exports: $PropertyType<$Exports<"lodash">, "curryRight">; } declare module "lodash/debounce" { declare module.exports: $PropertyType<$Exports<"lodash">, "debounce">; } declare module "lodash/defer" { declare module.exports: $PropertyType<$Exports<"lodash">, "defer">; } declare module "lodash/delay" { declare module.exports: $PropertyType<$Exports<"lodash">, "delay">; } declare module "lodash/flip" { declare module.exports: $PropertyType<$Exports<"lodash">, "flip">; } declare module "lodash/memoize" { declare module.exports: $PropertyType<$Exports<"lodash">, "memoize">; } declare module "lodash/negate" { declare module.exports: $PropertyType<$Exports<"lodash">, "negate">; } declare module "lodash/once" { declare module.exports: $PropertyType<$Exports<"lodash">, "once">; } declare module "lodash/overArgs" { declare module.exports: $PropertyType<$Exports<"lodash">, "overArgs">; } declare module "lodash/partial" { declare module.exports: $PropertyType<$Exports<"lodash">, "partial">; } declare module "lodash/partialRight" { declare module.exports: $PropertyType<$Exports<"lodash">, "partialRight">; } declare module "lodash/rearg" { declare module.exports: $PropertyType<$Exports<"lodash">, "rearg">; } declare module "lodash/rest" { declare module.exports: $PropertyType<$Exports<"lodash">, "rest">; } declare module "lodash/spread" { declare module.exports: $PropertyType<$Exports<"lodash">, "spread">; } declare module "lodash/throttle" { declare module.exports: $PropertyType<$Exports<"lodash">, "throttle">; } declare module "lodash/unary" { declare module.exports: $PropertyType<$Exports<"lodash">, "unary">; } declare module "lodash/wrap" { declare module.exports: $PropertyType<$Exports<"lodash">, "wrap">; } declare module "lodash/castArray" { declare module.exports: $PropertyType<$Exports<"lodash">, "castArray">; } declare module "lodash/clone" { declare module.exports: $PropertyType<$Exports<"lodash">, "clone">; } declare module "lodash/cloneDeep" { declare module.exports: $PropertyType<$Exports<"lodash">, "cloneDeep">; } declare module "lodash/cloneDeepWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "cloneDeepWith">; } declare module "lodash/cloneWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "cloneWith">; } declare module "lodash/conformsTo" { declare module.exports: $PropertyType<$Exports<"lodash">, "conformsTo">; } declare module "lodash/eq" { declare module.exports: $PropertyType<$Exports<"lodash">, "eq">; } declare module "lodash/gt" { declare module.exports: $PropertyType<$Exports<"lodash">, "gt">; } declare module "lodash/gte" { declare module.exports: $PropertyType<$Exports<"lodash">, "gte">; } declare module "lodash/isArguments" { declare module.exports: $PropertyType<$Exports<"lodash">, "isArguments">; } declare module "lodash/isArray" { declare module.exports: $PropertyType<$Exports<"lodash">, "isArray">; } declare module "lodash/isArrayBuffer" { declare module.exports: $PropertyType<$Exports<"lodash">, "isArrayBuffer">; } declare module "lodash/isArrayLike" { declare module.exports: $PropertyType<$Exports<"lodash">, "isArrayLike">; } declare module "lodash/isArrayLikeObject" { declare module.exports: $PropertyType< $Exports<"lodash">, "isArrayLikeObject" >; } declare module "lodash/isBoolean" { declare module.exports: $PropertyType<$Exports<"lodash">, "isBoolean">; } declare module "lodash/isBuffer" { declare module.exports: $PropertyType<$Exports<"lodash">, "isBuffer">; } declare module "lodash/isDate" { declare module.exports: $PropertyType<$Exports<"lodash">, "isDate">; } declare module "lodash/isElement" { declare module.exports: $PropertyType<$Exports<"lodash">, "isElement">; } declare module "lodash/isEmpty" { declare module.exports: $PropertyType<$Exports<"lodash">, "isEmpty">; } declare module "lodash/isEqual" { declare module.exports: $PropertyType<$Exports<"lodash">, "isEqual">; } declare module "lodash/isEqualWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "isEqualWith">; } declare module "lodash/isError" { declare module.exports: $PropertyType<$Exports<"lodash">, "isError">; } declare module "lodash/isFinite" { declare module.exports: $PropertyType<$Exports<"lodash">, "isFinite">; } declare module "lodash/isFunction" { declare module.exports: $PropertyType<$Exports<"lodash">, "isFunction">; } declare module "lodash/isInteger" { declare module.exports: $PropertyType<$Exports<"lodash">, "isInteger">; } declare module "lodash/isLength" { declare module.exports: $PropertyType<$Exports<"lodash">, "isLength">; } declare module "lodash/isMap" { declare module.exports: $PropertyType<$Exports<"lodash">, "isMap">; } declare module "lodash/isMatch" { declare module.exports: $PropertyType<$Exports<"lodash">, "isMatch">; } declare module "lodash/isMatchWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "isMatchWith">; } declare module "lodash/isNaN" { declare module.exports: $PropertyType<$Exports<"lodash">, "isNaN">; } declare module "lodash/isNative" { declare module.exports: $PropertyType<$Exports<"lodash">, "isNative">; } declare module "lodash/isNil" { declare module.exports: $PropertyType<$Exports<"lodash">, "isNil">; } declare module "lodash/isNull" { declare module.exports: $PropertyType<$Exports<"lodash">, "isNull">; } declare module "lodash/isNumber" { declare module.exports: $PropertyType<$Exports<"lodash">, "isNumber">; } declare module "lodash/isObject" { declare module.exports: $PropertyType<$Exports<"lodash">, "isObject">; } declare module "lodash/isObjectLike" { declare module.exports: $PropertyType<$Exports<"lodash">, "isObjectLike">; } declare module "lodash/isPlainObject" { declare module.exports: $PropertyType<$Exports<"lodash">, "isPlainObject">; } declare module "lodash/isRegExp" { declare module.exports: $PropertyType<$Exports<"lodash">, "isRegExp">; } declare module "lodash/isSafeInteger" { declare module.exports: $PropertyType<$Exports<"lodash">, "isSafeInteger">; } declare module "lodash/isSet" { declare module.exports: $PropertyType<$Exports<"lodash">, "isSet">; } declare module "lodash/isString" { declare module.exports: $PropertyType<$Exports<"lodash">, "isString">; } declare module "lodash/isSymbol" { declare module.exports: $PropertyType<$Exports<"lodash">, "isSymbol">; } declare module "lodash/isTypedArray" { declare module.exports: $PropertyType<$Exports<"lodash">, "isTypedArray">; } declare module "lodash/isUndefined" { declare module.exports: $PropertyType<$Exports<"lodash">, "isUndefined">; } declare module "lodash/isWeakMap" { declare module.exports: $PropertyType<$Exports<"lodash">, "isWeakMap">; } declare module "lodash/isWeakSet" { declare module.exports: $PropertyType<$Exports<"lodash">, "isWeakSet">; } declare module "lodash/lt" { declare module.exports: $PropertyType<$Exports<"lodash">, "lt">; } declare module "lodash/lte" { declare module.exports: $PropertyType<$Exports<"lodash">, "lte">; } declare module "lodash/toArray" { declare module.exports: $PropertyType<$Exports<"lodash">, "toArray">; } declare module "lodash/toFinite" { declare module.exports: $PropertyType<$Exports<"lodash">, "toFinite">; } declare module "lodash/toInteger" { declare module.exports: $PropertyType<$Exports<"lodash">, "toInteger">; } declare module "lodash/toLength" { declare module.exports: $PropertyType<$Exports<"lodash">, "toLength">; } declare module "lodash/toNumber" { declare module.exports: $PropertyType<$Exports<"lodash">, "toNumber">; } declare module "lodash/toPlainObject" { declare module.exports: $PropertyType<$Exports<"lodash">, "toPlainObject">; } declare module "lodash/toSafeInteger" { declare module.exports: $PropertyType<$Exports<"lodash">, "toSafeInteger">; } declare module "lodash/toString" { declare module.exports: $PropertyType<$Exports<"lodash">, "toString">; } declare module "lodash/add" { declare module.exports: $PropertyType<$Exports<"lodash">, "add">; } declare module "lodash/ceil" { declare module.exports: $PropertyType<$Exports<"lodash">, "ceil">; } declare module "lodash/divide" { declare module.exports: $PropertyType<$Exports<"lodash">, "divide">; } declare module "lodash/floor" { declare module.exports: $PropertyType<$Exports<"lodash">, "floor">; } declare module "lodash/max" { declare module.exports: $PropertyType<$Exports<"lodash">, "max">; } declare module "lodash/maxBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "maxBy">; } declare module "lodash/mean" { declare module.exports: $PropertyType<$Exports<"lodash">, "mean">; } declare module "lodash/meanBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "meanBy">; } declare module "lodash/min" { declare module.exports: $PropertyType<$Exports<"lodash">, "min">; } declare module "lodash/minBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "minBy">; } declare module "lodash/multiply" { declare module.exports: $PropertyType<$Exports<"lodash">, "multiply">; } declare module "lodash/round" { declare module.exports: $PropertyType<$Exports<"lodash">, "round">; } declare module "lodash/subtract" { declare module.exports: $PropertyType<$Exports<"lodash">, "subtract">; } declare module "lodash/sum" { declare module.exports: $PropertyType<$Exports<"lodash">, "sum">; } declare module "lodash/sumBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "sumBy">; } declare module "lodash/clamp" { declare module.exports: $PropertyType<$Exports<"lodash">, "clamp">; } declare module "lodash/inRange" { declare module.exports: $PropertyType<$Exports<"lodash">, "inRange">; } declare module "lodash/random" { declare module.exports: $PropertyType<$Exports<"lodash">, "random">; } declare module "lodash/assign" { declare module.exports: $PropertyType<$Exports<"lodash">, "assign">; } declare module "lodash/assignIn" { declare module.exports: $PropertyType<$Exports<"lodash">, "assignIn">; } declare module "lodash/assignInWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "assignInWith">; } declare module "lodash/assignWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "assignWith">; } declare module "lodash/at" { declare module.exports: $PropertyType<$Exports<"lodash">, "at">; } declare module "lodash/create" { declare module.exports: $PropertyType<$Exports<"lodash">, "create">; } declare module "lodash/defaults" { declare module.exports: $PropertyType<$Exports<"lodash">, "defaults">; } declare module "lodash/defaultsDeep" { declare module.exports: $PropertyType<$Exports<"lodash">, "defaultsDeep">; } declare module "lodash/entries" { declare module.exports: $PropertyType<$Exports<"lodash">, "entries">; } declare module "lodash/entriesIn" { declare module.exports: $PropertyType<$Exports<"lodash">, "entriesIn">; } declare module "lodash/extend" { declare module.exports: $PropertyType<$Exports<"lodash">, "extend">; } declare module "lodash/extendWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "extendWith">; } declare module "lodash/findKey" { declare module.exports: $PropertyType<$Exports<"lodash">, "findKey">; } declare module "lodash/findLastKey" { declare module.exports: $PropertyType<$Exports<"lodash">, "findLastKey">; } declare module "lodash/forIn" { declare module.exports: $PropertyType<$Exports<"lodash">, "forIn">; } declare module "lodash/forInRight" { declare module.exports: $PropertyType<$Exports<"lodash">, "forInRight">; } declare module "lodash/forOwn" { declare module.exports: $PropertyType<$Exports<"lodash">, "forOwn">; } declare module "lodash/forOwnRight" { declare module.exports: $PropertyType<$Exports<"lodash">, "forOwnRight">; } declare module "lodash/functions" { declare module.exports: $PropertyType<$Exports<"lodash">, "functions">; } declare module "lodash/functionsIn" { declare module.exports: $PropertyType<$Exports<"lodash">, "functionsIn">; } declare module "lodash/get" { declare module.exports: $PropertyType<$Exports<"lodash">, "get">; } declare module "lodash/has" { declare module.exports: $PropertyType<$Exports<"lodash">, "has">; } declare module "lodash/hasIn" { declare module.exports: $PropertyType<$Exports<"lodash">, "hasIn">; } declare module "lodash/invert" { declare module.exports: $PropertyType<$Exports<"lodash">, "invert">; } declare module "lodash/invertBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "invertBy">; } declare module "lodash/invoke" { declare module.exports: $PropertyType<$Exports<"lodash">, "invoke">; } declare module "lodash/keys" { declare module.exports: $PropertyType<$Exports<"lodash">, "keys">; } declare module "lodash/keysIn" { declare module.exports: $PropertyType<$Exports<"lodash">, "keysIn">; } declare module "lodash/mapKeys" { declare module.exports: $PropertyType<$Exports<"lodash">, "mapKeys">; } declare module "lodash/mapValues" { declare module.exports: $PropertyType<$Exports<"lodash">, "mapValues">; } declare module "lodash/merge" { declare module.exports: $PropertyType<$Exports<"lodash">, "merge">; } declare module "lodash/mergeWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "mergeWith">; } declare module "lodash/omit" { declare module.exports: $PropertyType<$Exports<"lodash">, "omit">; } declare module "lodash/omitBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "omitBy">; } declare module "lodash/pick" { declare module.exports: $PropertyType<$Exports<"lodash">, "pick">; } declare module "lodash/pickBy" { declare module.exports: $PropertyType<$Exports<"lodash">, "pickBy">; } declare module "lodash/result" { declare module.exports: $PropertyType<$Exports<"lodash">, "result">; } declare module "lodash/set" { declare module.exports: $PropertyType<$Exports<"lodash">, "set">; } declare module "lodash/setWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "setWith">; } declare module "lodash/toPairs" { declare module.exports: $PropertyType<$Exports<"lodash">, "toPairs">; } declare module "lodash/toPairsIn" { declare module.exports: $PropertyType<$Exports<"lodash">, "toPairsIn">; } declare module "lodash/transform" { declare module.exports: $PropertyType<$Exports<"lodash">, "transform">; } declare module "lodash/unset" { declare module.exports: $PropertyType<$Exports<"lodash">, "unset">; } declare module "lodash/update" { declare module.exports: $PropertyType<$Exports<"lodash">, "update">; } declare module "lodash/updateWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "updateWith">; } declare module "lodash/values" { declare module.exports: $PropertyType<$Exports<"lodash">, "values">; } declare module "lodash/valuesIn" { declare module.exports: $PropertyType<$Exports<"lodash">, "valuesIn">; } declare module "lodash/chain" { declare module.exports: $PropertyType<$Exports<"lodash">, "chain">; } declare module "lodash/tap" { declare module.exports: $PropertyType<$Exports<"lodash">, "tap">; } declare module "lodash/thru" { declare module.exports: $PropertyType<$Exports<"lodash">, "thru">; } declare module "lodash/camelCase" { declare module.exports: $PropertyType<$Exports<"lodash">, "camelCase">; } declare module "lodash/capitalize" { declare module.exports: $PropertyType<$Exports<"lodash">, "capitalize">; } declare module "lodash/deburr" { declare module.exports: $PropertyType<$Exports<"lodash">, "deburr">; } declare module "lodash/endsWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "endsWith">; } declare module "lodash/escape" { declare module.exports: $PropertyType<$Exports<"lodash">, "escape">; } declare module "lodash/escapeRegExp" { declare module.exports: $PropertyType<$Exports<"lodash">, "escapeRegExp">; } declare module "lodash/kebabCase" { declare module.exports: $PropertyType<$Exports<"lodash">, "kebabCase">; } declare module "lodash/lowerCase" { declare module.exports: $PropertyType<$Exports<"lodash">, "lowerCase">; } declare module "lodash/lowerFirst" { declare module.exports: $PropertyType<$Exports<"lodash">, "lowerFirst">; } declare module "lodash/pad" { declare module.exports: $PropertyType<$Exports<"lodash">, "pad">; } declare module "lodash/padEnd" { declare module.exports: $PropertyType<$Exports<"lodash">, "padEnd">; } declare module "lodash/padStart" { declare module.exports: $PropertyType<$Exports<"lodash">, "padStart">; } declare module "lodash/parseInt" { declare module.exports: $PropertyType<$Exports<"lodash">, "parseInt">; } declare module "lodash/repeat" { declare module.exports: $PropertyType<$Exports<"lodash">, "repeat">; } declare module "lodash/replace" { declare module.exports: $PropertyType<$Exports<"lodash">, "replace">; } declare module "lodash/snakeCase" { declare module.exports: $PropertyType<$Exports<"lodash">, "snakeCase">; } declare module "lodash/split" { declare module.exports: $PropertyType<$Exports<"lodash">, "split">; } declare module "lodash/startCase" { declare module.exports: $PropertyType<$Exports<"lodash">, "startCase">; } declare module "lodash/startsWith" { declare module.exports: $PropertyType<$Exports<"lodash">, "startsWith">; } declare module "lodash/template" { declare module.exports: $PropertyType<$Exports<"lodash">, "template">; } declare module "lodash/toLower" { declare module.exports: $PropertyType<$Exports<"lodash">, "toLower">; } declare module "lodash/toUpper" { declare module.exports: $PropertyType<$Exports<"lodash">, "toUpper">; } declare module "lodash/trim" { declare module.exports: $PropertyType<$Exports<"lodash">, "trim">; } declare module "lodash/trimEnd" { declare module.exports: $PropertyType<$Exports<"lodash">, "trimEnd">; } declare module "lodash/trimStart" { declare module.exports: $PropertyType<$Exports<"lodash">, "trimStart">; } declare module "lodash/truncate" { declare module.exports: $PropertyType<$Exports<"lodash">, "truncate">; } declare module "lodash/unescape" { declare module.exports: $PropertyType<$Exports<"lodash">, "unescape">; } declare module "lodash/upperCase" { declare module.exports: $PropertyType<$Exports<"lodash">, "upperCase">; } declare module "lodash/upperFirst" { declare module.exports: $PropertyType<$Exports<"lodash">, "upperFirst">; } declare module "lodash/words" { declare module.exports: $PropertyType<$Exports<"lodash">, "words">; } declare module "lodash/attempt" { declare module.exports: $PropertyType<$Exports<"lodash">, "attempt">; } declare module "lodash/bindAll" { declare module.exports: $PropertyType<$Exports<"lodash">, "bindAll">; } declare module "lodash/cond" { declare module.exports: $PropertyType<$Exports<"lodash">, "cond">; } declare module "lodash/conforms" { declare module.exports: $PropertyType<$Exports<"lodash">, "conforms">; } declare module "lodash/constant" { declare module.exports: $PropertyType<$Exports<"lodash">, "constant">; } declare module "lodash/defaultTo" { declare module.exports: $PropertyType<$Exports<"lodash">, "defaultTo">; } declare module "lodash/flow" { declare module.exports: $PropertyType<$Exports<"lodash">, "flow">; } declare module "lodash/flowRight" { declare module.exports: $PropertyType<$Exports<"lodash">, "flowRight">; } declare module "lodash/identity" { declare module.exports: $PropertyType<$Exports<"lodash">, "identity">; } declare module "lodash/iteratee" { declare module.exports: $PropertyType<$Exports<"lodash">, "iteratee">; } declare module "lodash/matches" { declare module.exports: $PropertyType<$Exports<"lodash">, "matches">; } declare module "lodash/matchesProperty" { declare module.exports: $PropertyType<$Exports<"lodash">, "matchesProperty">; } declare module "lodash/method" { declare module.exports: $PropertyType<$Exports<"lodash">, "method">; } declare module "lodash/methodOf" { declare module.exports: $PropertyType<$Exports<"lodash">, "methodOf">; } declare module "lodash/mixin" { declare module.exports: $PropertyType<$Exports<"lodash">, "mixin">; } declare module "lodash/noConflict" { declare module.exports: $PropertyType<$Exports<"lodash">, "noConflict">; } declare module "lodash/noop" { declare module.exports: $PropertyType<$Exports<"lodash">, "noop">; } declare module "lodash/nthArg" { declare module.exports: $PropertyType<$Exports<"lodash">, "nthArg">; } declare module "lodash/over" { declare module.exports: $PropertyType<$Exports<"lodash">, "over">; } declare module "lodash/overEvery" { declare module.exports: $PropertyType<$Exports<"lodash">, "overEvery">; } declare module "lodash/overSome" { declare module.exports: $PropertyType<$Exports<"lodash">, "overSome">; } declare module "lodash/property" { declare module.exports: $PropertyType<$Exports<"lodash">, "property">; } declare module "lodash/propertyOf" { declare module.exports: $PropertyType<$Exports<"lodash">, "propertyOf">; } declare module "lodash/range" { declare module.exports: $PropertyType<$Exports<"lodash">, "range">; } declare module "lodash/rangeRight" { declare module.exports: $PropertyType<$Exports<"lodash">, "rangeRight">; } declare module "lodash/runInContext" { declare module.exports: $PropertyType<$Exports<"lodash">, "runInContext">; } declare module "lodash/stubArray" { declare module.exports: $PropertyType<$Exports<"lodash">, "stubArray">; } declare module "lodash/stubFalse" { declare module.exports: $PropertyType<$Exports<"lodash">, "stubFalse">; } declare module "lodash/stubObject" { declare module.exports: $PropertyType<$Exports<"lodash">, "stubObject">; } declare module "lodash/stubString" { declare module.exports: $PropertyType<$Exports<"lodash">, "stubString">; } declare module "lodash/stubTrue" { declare module.exports: $PropertyType<$Exports<"lodash">, "stubTrue">; } declare module "lodash/times" { declare module.exports: $PropertyType<$Exports<"lodash">, "times">; } declare module "lodash/toPath" { declare module.exports: $PropertyType<$Exports<"lodash">, "toPath">; } declare module "lodash/uniqueId" { declare module.exports: $PropertyType<$Exports<"lodash">, "uniqueId">; } declare module "lodash/fp/chunk" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "chunk">; } declare module "lodash/fp/compact" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "compact">; } declare module "lodash/fp/concat" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "concat">; } declare module "lodash/fp/difference" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "difference">; } declare module "lodash/fp/differenceBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "differenceBy">; } declare module "lodash/fp/differenceWith" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "differenceWith" >; } declare module "lodash/fp/drop" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "drop">; } declare module "lodash/fp/dropLast" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "dropLast">; } declare module "lodash/fp/dropRight" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "dropRight">; } declare module "lodash/fp/dropRightWhile" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "dropRightWhile" >; } declare module "lodash/fp/dropWhile" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "dropWhile">; } declare module "lodash/fp/dropLastWhile" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "dropLastWhile">; } declare module "lodash/fp/fill" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "fill">; } declare module "lodash/fp/findIndex" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findIndex">; } declare module "lodash/fp/findIndexFrom" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findIndexFrom">; } declare module "lodash/fp/findLastIndex" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findLastIndex">; } declare module "lodash/fp/findLastIndexFrom" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "findLastIndexFrom" >; } declare module "lodash/fp/first" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "first">; } declare module "lodash/fp/flatten" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flatten">; } declare module "lodash/fp/unnest" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unnest">; } declare module "lodash/fp/flattenDeep" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flattenDeep">; } declare module "lodash/fp/flattenDepth" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flattenDepth">; } declare module "lodash/fp/fromPairs" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "fromPairs">; } declare module "lodash/fp/head" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "head">; } declare module "lodash/fp/indexOf" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "indexOf">; } declare module "lodash/fp/indexOfFrom" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "indexOfFrom">; } declare module "lodash/fp/initial" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "initial">; } declare module "lodash/fp/init" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "init">; } declare module "lodash/fp/intersection" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "intersection">; } declare module "lodash/fp/intersectionBy" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "intersectionBy" >; } declare module "lodash/fp/intersectionWith" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "intersectionWith" >; } declare module "lodash/fp/join" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "join">; } declare module "lodash/fp/last" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "last">; } declare module "lodash/fp/lastIndexOf" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "lastIndexOf">; } declare module "lodash/fp/lastIndexOfFrom" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "lastIndexOfFrom" >; } declare module "lodash/fp/nth" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "nth">; } declare module "lodash/fp/pull" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pull">; } declare module "lodash/fp/pullAll" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pullAll">; } declare module "lodash/fp/pullAllBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pullAllBy">; } declare module "lodash/fp/pullAllWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pullAllWith">; } declare module "lodash/fp/pullAt" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pullAt">; } declare module "lodash/fp/remove" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "remove">; } declare module "lodash/fp/reverse" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "reverse">; } declare module "lodash/fp/slice" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "slice">; } declare module "lodash/fp/sortedIndex" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sortedIndex">; } declare module "lodash/fp/sortedIndexBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sortedIndexBy">; } declare module "lodash/fp/sortedIndexOf" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sortedIndexOf">; } declare module "lodash/fp/sortedLastIndex" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "sortedLastIndex" >; } declare module "lodash/fp/sortedLastIndexBy" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "sortedLastIndexBy" >; } declare module "lodash/fp/sortedLastIndexOf" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "sortedLastIndexOf" >; } declare module "lodash/fp/sortedUniq" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sortedUniq">; } declare module "lodash/fp/sortedUniqBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sortedUniqBy">; } declare module "lodash/fp/tail" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "tail">; } declare module "lodash/fp/take" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "take">; } declare module "lodash/fp/takeRight" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "takeRight">; } declare module "lodash/fp/takeLast" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "takeLast">; } declare module "lodash/fp/takeRightWhile" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "takeRightWhile" >; } declare module "lodash/fp/takeLastWhile" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "takeLastWhile">; } declare module "lodash/fp/takeWhile" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "takeWhile">; } declare module "lodash/fp/union" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "union">; } declare module "lodash/fp/unionBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unionBy">; } declare module "lodash/fp/unionWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unionWith">; } declare module "lodash/fp/uniq" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "uniq">; } declare module "lodash/fp/uniqBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "uniqBy">; } declare module "lodash/fp/uniqWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "uniqWith">; } declare module "lodash/fp/unzip" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unzip">; } declare module "lodash/fp/unzipWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unzipWith">; } declare module "lodash/fp/without" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "without">; } declare module "lodash/fp/xor" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "xor">; } declare module "lodash/fp/symmetricDifference" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "symmetricDifference" >; } declare module "lodash/fp/xorBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "xorBy">; } declare module "lodash/fp/symmetricDifferenceBy" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "symmetricDifferenceBy" >; } declare module "lodash/fp/xorWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "xorWith">; } declare module "lodash/fp/symmetricDifferenceWith" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "symmetricDifferenceWith" >; } declare module "lodash/fp/zip" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "zip">; } declare module "lodash/fp/zipAll" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "zipAll">; } declare module "lodash/fp/zipObject" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "zipObject">; } declare module "lodash/fp/zipObj" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "zipObj">; } declare module "lodash/fp/zipObjectDeep" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "zipObjectDeep">; } declare module "lodash/fp/zipWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "zipWith">; } declare module "lodash/fp/countBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "countBy">; } declare module "lodash/fp/each" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "each">; } declare module "lodash/fp/eachRight" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "eachRight">; } declare module "lodash/fp/every" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "every">; } declare module "lodash/fp/all" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "all">; } declare module "lodash/fp/filter" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "filter">; } declare module "lodash/fp/find" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "find">; } declare module "lodash/fp/findFrom" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findFrom">; } declare module "lodash/fp/findLast" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findLast">; } declare module "lodash/fp/findLastFrom" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findLastFrom">; } declare module "lodash/fp/flatMap" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flatMap">; } declare module "lodash/fp/flatMapDeep" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flatMapDeep">; } declare module "lodash/fp/flatMapDepth" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flatMapDepth">; } declare module "lodash/fp/forEach" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "forEach">; } declare module "lodash/fp/forEachRight" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "forEachRight">; } declare module "lodash/fp/groupBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "groupBy">; } declare module "lodash/fp/includes" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "includes">; } declare module "lodash/fp/contains" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "contains">; } declare module "lodash/fp/includesFrom" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "includesFrom">; } declare module "lodash/fp/invokeMap" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "invokeMap">; } declare module "lodash/fp/invokeArgsMap" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "invokeArgsMap">; } declare module "lodash/fp/keyBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "keyBy">; } declare module "lodash/fp/indexBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "indexBy">; } declare module "lodash/fp/map" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "map">; } declare module "lodash/fp/pluck" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pluck">; } declare module "lodash/fp/orderBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "orderBy">; } declare module "lodash/fp/partition" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "partition">; } declare module "lodash/fp/reduce" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "reduce">; } declare module "lodash/fp/reduceRight" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "reduceRight">; } declare module "lodash/fp/reject" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "reject">; } declare module "lodash/fp/sample" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sample">; } declare module "lodash/fp/sampleSize" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sampleSize">; } declare module "lodash/fp/shuffle" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "shuffle">; } declare module "lodash/fp/size" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "size">; } declare module "lodash/fp/some" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "some">; } declare module "lodash/fp/any" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "any">; } declare module "lodash/fp/sortBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sortBy">; } declare module "lodash/fp/now" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "now">; } declare module "lodash/fp/after" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "after">; } declare module "lodash/fp/ary" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "ary">; } declare module "lodash/fp/nAry" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "nAry">; } declare module "lodash/fp/before" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "before">; } declare module "lodash/fp/bind" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "bind">; } declare module "lodash/fp/bindKey" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "bindKey">; } declare module "lodash/fp/curry" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "curry">; } declare module "lodash/fp/curryN" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "curryN">; } declare module "lodash/fp/curryRight" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "curryRight">; } declare module "lodash/fp/curryRightN" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "curryRightN">; } declare module "lodash/fp/debounce" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "debounce">; } declare module "lodash/fp/defer" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "defer">; } declare module "lodash/fp/delay" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "delay">; } declare module "lodash/fp/flip" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flip">; } declare module "lodash/fp/memoize" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "memoize">; } declare module "lodash/fp/negate" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "negate">; } declare module "lodash/fp/complement" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "complement">; } declare module "lodash/fp/once" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "once">; } declare module "lodash/fp/overArgs" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "overArgs">; } declare module "lodash/fp/useWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "useWith">; } declare module "lodash/fp/partial" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "partial">; } declare module "lodash/fp/partialRight" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "partialRight">; } declare module "lodash/fp/rearg" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "rearg">; } declare module "lodash/fp/rest" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "rest">; } declare module "lodash/fp/unapply" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unapply">; } declare module "lodash/fp/restFrom" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "restFrom">; } declare module "lodash/fp/spread" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "spread">; } declare module "lodash/fp/apply" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "apply">; } declare module "lodash/fp/spreadFrom" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "spreadFrom">; } declare module "lodash/fp/throttle" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "throttle">; } declare module "lodash/fp/unary" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unary">; } declare module "lodash/fp/wrap" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "wrap">; } declare module "lodash/fp/castArray" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "castArray">; } declare module "lodash/fp/clone" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "clone">; } declare module "lodash/fp/cloneDeep" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "cloneDeep">; } declare module "lodash/fp/cloneDeepWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "cloneDeepWith">; } declare module "lodash/fp/cloneWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "cloneWith">; } declare module "lodash/fp/conformsTo" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "conformsTo">; } declare module "lodash/fp/where" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "where">; } declare module "lodash/fp/conforms" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "conforms">; } declare module "lodash/fp/eq" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "eq">; } declare module "lodash/fp/identical" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "identical">; } declare module "lodash/fp/gt" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "gt">; } declare module "lodash/fp/gte" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "gte">; } declare module "lodash/fp/isArguments" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isArguments">; } declare module "lodash/fp/isArray" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isArray">; } declare module "lodash/fp/isArrayBuffer" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isArrayBuffer">; } declare module "lodash/fp/isArrayLike" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isArrayLike">; } declare module "lodash/fp/isArrayLikeObject" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "isArrayLikeObject" >; } declare module "lodash/fp/isBoolean" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isBoolean">; } declare module "lodash/fp/isBuffer" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isBuffer">; } declare module "lodash/fp/isDate" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isDate">; } declare module "lodash/fp/isElement" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isElement">; } declare module "lodash/fp/isEmpty" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isEmpty">; } declare module "lodash/fp/isEqual" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isEqual">; } declare module "lodash/fp/equals" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "equals">; } declare module "lodash/fp/isEqualWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isEqualWith">; } declare module "lodash/fp/isError" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isError">; } declare module "lodash/fp/isFinite" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isFinite">; } declare module "lodash/fp/isFunction" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isFunction">; } declare module "lodash/fp/isInteger" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isInteger">; } declare module "lodash/fp/isLength" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isLength">; } declare module "lodash/fp/isMap" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isMap">; } declare module "lodash/fp/isMatch" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isMatch">; } declare module "lodash/fp/whereEq" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "whereEq">; } declare module "lodash/fp/isMatchWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isMatchWith">; } declare module "lodash/fp/isNaN" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isNaN">; } declare module "lodash/fp/isNative" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isNative">; } declare module "lodash/fp/isNil" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isNil">; } declare module "lodash/fp/isNull" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isNull">; } declare module "lodash/fp/isNumber" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isNumber">; } declare module "lodash/fp/isObject" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isObject">; } declare module "lodash/fp/isObjectLike" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isObjectLike">; } declare module "lodash/fp/isPlainObject" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isPlainObject">; } declare module "lodash/fp/isRegExp" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isRegExp">; } declare module "lodash/fp/isSafeInteger" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isSafeInteger">; } declare module "lodash/fp/isSet" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isSet">; } declare module "lodash/fp/isString" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isString">; } declare module "lodash/fp/isSymbol" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isSymbol">; } declare module "lodash/fp/isTypedArray" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isTypedArray">; } declare module "lodash/fp/isUndefined" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isUndefined">; } declare module "lodash/fp/isWeakMap" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isWeakMap">; } declare module "lodash/fp/isWeakSet" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "isWeakSet">; } declare module "lodash/fp/lt" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "lt">; } declare module "lodash/fp/lte" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "lte">; } declare module "lodash/fp/toArray" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toArray">; } declare module "lodash/fp/toFinite" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toFinite">; } declare module "lodash/fp/toInteger" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toInteger">; } declare module "lodash/fp/toLength" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toLength">; } declare module "lodash/fp/toNumber" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toNumber">; } declare module "lodash/fp/toPlainObject" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toPlainObject">; } declare module "lodash/fp/toSafeInteger" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toSafeInteger">; } declare module "lodash/fp/toString" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toString">; } declare module "lodash/fp/add" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "add">; } declare module "lodash/fp/ceil" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "ceil">; } declare module "lodash/fp/divide" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "divide">; } declare module "lodash/fp/floor" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "floor">; } declare module "lodash/fp/max" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "max">; } declare module "lodash/fp/maxBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "maxBy">; } declare module "lodash/fp/mean" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "mean">; } declare module "lodash/fp/meanBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "meanBy">; } declare module "lodash/fp/min" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "min">; } declare module "lodash/fp/minBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "minBy">; } declare module "lodash/fp/multiply" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "multiply">; } declare module "lodash/fp/round" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "round">; } declare module "lodash/fp/subtract" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "subtract">; } declare module "lodash/fp/sum" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sum">; } declare module "lodash/fp/sumBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "sumBy">; } declare module "lodash/fp/clamp" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "clamp">; } declare module "lodash/fp/inRange" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "inRange">; } declare module "lodash/fp/random" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "random">; } declare module "lodash/fp/assign" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assign">; } declare module "lodash/fp/assignAll" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assignAll">; } declare module "lodash/fp/assignInAll" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assignInAll">; } declare module "lodash/fp/extendAll" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "extendAll">; } declare module "lodash/fp/assignIn" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assignIn">; } declare module "lodash/fp/assignInWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assignInWith">; } declare module "lodash/fp/assignWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assignWith">; } declare module "lodash/fp/assignInAllWith" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "assignInAllWith" >; } declare module "lodash/fp/extendAllWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "extendAllWith">; } declare module "lodash/fp/assignAllWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assignAllWith">; } declare module "lodash/fp/at" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "at">; } declare module "lodash/fp/props" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "props">; } declare module "lodash/fp/paths" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "paths">; } declare module "lodash/fp/create" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "create">; } declare module "lodash/fp/defaults" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "defaults">; } declare module "lodash/fp/defaultsAll" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "defaultsAll">; } declare module "lodash/fp/defaultsDeep" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "defaultsDeep">; } declare module "lodash/fp/defaultsDeepAll" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "defaultsDeepAll" >; } declare module "lodash/fp/entries" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "entries">; } declare module "lodash/fp/entriesIn" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "entriesIn">; } declare module "lodash/fp/extend" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "extend">; } declare module "lodash/fp/extendWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "extendWith">; } declare module "lodash/fp/findKey" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findKey">; } declare module "lodash/fp/findLastKey" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "findLastKey">; } declare module "lodash/fp/forIn" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "forIn">; } declare module "lodash/fp/forInRight" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "forInRight">; } declare module "lodash/fp/forOwn" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "forOwn">; } declare module "lodash/fp/forOwnRight" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "forOwnRight">; } declare module "lodash/fp/functions" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "functions">; } declare module "lodash/fp/functionsIn" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "functionsIn">; } declare module "lodash/fp/get" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "get">; } declare module "lodash/fp/prop" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "prop">; } declare module "lodash/fp/path" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "path">; } declare module "lodash/fp/getOr" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "getOr">; } declare module "lodash/fp/propOr" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "propOr">; } declare module "lodash/fp/pathOr" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pathOr">; } declare module "lodash/fp/has" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "has">; } declare module "lodash/fp/hasIn" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "hasIn">; } declare module "lodash/fp/invert" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "invert">; } declare module "lodash/fp/invertObj" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "invertObj">; } declare module "lodash/fp/invertBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "invertBy">; } declare module "lodash/fp/invoke" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "invoke">; } declare module "lodash/fp/invokeArgs" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "invokeArgs">; } declare module "lodash/fp/keys" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "keys">; } declare module "lodash/fp/keysIn" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "keysIn">; } declare module "lodash/fp/mapKeys" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "mapKeys">; } declare module "lodash/fp/mapValues" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "mapValues">; } declare module "lodash/fp/merge" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "merge">; } declare module "lodash/fp/mergeAll" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "mergeAll">; } declare module "lodash/fp/mergeWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "mergeWith">; } declare module "lodash/fp/mergeAllWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "mergeAllWith">; } declare module "lodash/fp/omit" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "omit">; } declare module "lodash/fp/omitAll" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "omitAll">; } declare module "lodash/fp/omitBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "omitBy">; } declare module "lodash/fp/pick" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pick">; } declare module "lodash/fp/pickAll" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pickAll">; } declare module "lodash/fp/pickBy" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pickBy">; } declare module "lodash/fp/result" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "result">; } declare module "lodash/fp/set" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "set">; } declare module "lodash/fp/assoc" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assoc">; } declare module "lodash/fp/assocPath" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "assocPath">; } declare module "lodash/fp/setWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "setWith">; } declare module "lodash/fp/toPairs" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toPairs">; } declare module "lodash/fp/toPairsIn" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toPairsIn">; } declare module "lodash/fp/transform" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "transform">; } declare module "lodash/fp/unset" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unset">; } declare module "lodash/fp/dissoc" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "dissoc">; } declare module "lodash/fp/dissocPath" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "dissocPath">; } declare module "lodash/fp/update" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "update">; } declare module "lodash/fp/updateWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "updateWith">; } declare module "lodash/fp/values" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "values">; } declare module "lodash/fp/valuesIn" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "valuesIn">; } declare module "lodash/fp/tap" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "tap">; } declare module "lodash/fp/thru" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "thru">; } declare module "lodash/fp/camelCase" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "camelCase">; } declare module "lodash/fp/capitalize" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "capitalize">; } declare module "lodash/fp/deburr" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "deburr">; } declare module "lodash/fp/endsWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "endsWith">; } declare module "lodash/fp/escape" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "escape">; } declare module "lodash/fp/escapeRegExp" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "escapeRegExp">; } declare module "lodash/fp/kebabCase" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "kebabCase">; } declare module "lodash/fp/lowerCase" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "lowerCase">; } declare module "lodash/fp/lowerFirst" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "lowerFirst">; } declare module "lodash/fp/pad" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pad">; } declare module "lodash/fp/padChars" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "padChars">; } declare module "lodash/fp/padEnd" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "padEnd">; } declare module "lodash/fp/padCharsEnd" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "padCharsEnd">; } declare module "lodash/fp/padStart" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "padStart">; } declare module "lodash/fp/padCharsStart" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "padCharsStart">; } declare module "lodash/fp/parseInt" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "parseInt">; } declare module "lodash/fp/repeat" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "repeat">; } declare module "lodash/fp/replace" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "replace">; } declare module "lodash/fp/snakeCase" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "snakeCase">; } declare module "lodash/fp/split" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "split">; } declare module "lodash/fp/startCase" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "startCase">; } declare module "lodash/fp/startsWith" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "startsWith">; } declare module "lodash/fp/template" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "template">; } declare module "lodash/fp/toLower" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toLower">; } declare module "lodash/fp/toUpper" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toUpper">; } declare module "lodash/fp/trim" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "trim">; } declare module "lodash/fp/trimChars" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "trimChars">; } declare module "lodash/fp/trimEnd" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "trimEnd">; } declare module "lodash/fp/trimCharsEnd" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "trimCharsEnd">; } declare module "lodash/fp/trimStart" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "trimStart">; } declare module "lodash/fp/trimCharsStart" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "trimCharsStart" >; } declare module "lodash/fp/truncate" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "truncate">; } declare module "lodash/fp/unescape" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "unescape">; } declare module "lodash/fp/upperCase" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "upperCase">; } declare module "lodash/fp/upperFirst" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "upperFirst">; } declare module "lodash/fp/words" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "words">; } declare module "lodash/fp/attempt" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "attempt">; } declare module "lodash/fp/bindAll" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "bindAll">; } declare module "lodash/fp/cond" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "cond">; } declare module "lodash/fp/constant" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "constant">; } declare module "lodash/fp/always" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "always">; } declare module "lodash/fp/defaultTo" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "defaultTo">; } declare module "lodash/fp/flow" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flow">; } declare module "lodash/fp/pipe" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pipe">; } declare module "lodash/fp/flowRight" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "flowRight">; } declare module "lodash/fp/compose" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "compose">; } declare module "lodash/fp/identity" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "identity">; } declare module "lodash/fp/iteratee" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "iteratee">; } declare module "lodash/fp/matches" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "matches">; } declare module "lodash/fp/matchesProperty" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "matchesProperty" >; } declare module "lodash/fp/propEq" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "propEq">; } declare module "lodash/fp/pathEq" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "pathEq">; } declare module "lodash/fp/method" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "method">; } declare module "lodash/fp/methodOf" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "methodOf">; } declare module "lodash/fp/mixin" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "mixin">; } declare module "lodash/fp/noConflict" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "noConflict">; } declare module "lodash/fp/noop" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "noop">; } declare module "lodash/fp/nthArg" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "nthArg">; } declare module "lodash/fp/over" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "over">; } declare module "lodash/fp/juxt" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "juxt">; } declare module "lodash/fp/overEvery" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "overEvery">; } declare module "lodash/fp/allPass" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "allPass">; } declare module "lodash/fp/overSome" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "overSome">; } declare module "lodash/fp/anyPass" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "anyPass">; } declare module "lodash/fp/property" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "property">; } declare module "lodash/fp/propertyOf" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "propertyOf">; } declare module "lodash/fp/range" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "range">; } declare module "lodash/fp/rangeStep" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "rangeStep">; } declare module "lodash/fp/rangeRight" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "rangeRight">; } declare module "lodash/fp/rangeStepRight" { declare module.exports: $PropertyType< $Exports<"lodash/fp">, "rangeStepRight" >; } declare module "lodash/fp/runInContext" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "runInContext">; } declare module "lodash/fp/stubArray" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "stubArray">; } declare module "lodash/fp/stubFalse" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "stubFalse">; } declare module "lodash/fp/F" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "F">; } declare module "lodash/fp/stubObject" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "stubObject">; } declare module "lodash/fp/stubString" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "stubString">; } declare module "lodash/fp/stubTrue" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "stubTrue">; } declare module "lodash/fp/T" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "T">; } declare module "lodash/fp/times" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "times">; } declare module "lodash/fp/toPath" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "toPath">; } declare module "lodash/fp/uniqueId" { declare module.exports: $PropertyType<$Exports<"lodash/fp">, "uniqueId">; } ================================================ FILE: flow-typed/npm/npm-watch_vx.x.x.js ================================================ // flow-typed signature: edfb19e18a02a5bf93c05c62cb4808da // flow-typed version: <>/npm-watch_v^0.6.0/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'npm-watch' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'npm-watch' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'npm-watch/cli' { declare module.exports: any; } declare module 'npm-watch/watch-package' { declare module.exports: any; } // Filename aliases declare module 'npm-watch/cli.js' { declare module.exports: $Exports<'npm-watch/cli'>; } declare module 'npm-watch/watch-package.js' { declare module.exports: $Exports<'npm-watch/watch-package'>; } ================================================ FILE: flow-typed/npm/prettier_v1.x.x.js ================================================ // flow-typed signature: 066c92e9ccb5f0711df8d73cbca837d6 // flow-typed version: 9e32affdbd/prettier_v1.x.x/flow_>=v0.56.x declare module "prettier" { declare export type AST = Object; declare export type Doc = Object; declare export type FastPath = Object; declare export type PrettierParserName = | "babylon" | "flow" | "typescript" | "postcss" | "css" | "less" | "scss" | "json" | "graphql" | "markdown" | "vue"; declare export type PrettierParser = { [name: PrettierParserName]: (text: string, options?: Object) => AST }; declare export type CustomParser = ( text: string, parsers: PrettierParser, options: Options ) => AST; declare export type Options = {| printWidth?: number, tabWidth?: number, useTabs?: boolean, semi?: boolean, singleQuote?: boolean, trailingComma?: "none" | "es5" | "all", bracketSpacing?: boolean, jsxBracketSameLine?: boolean, arrowParens?: "avoid" | "always", rangeStart?: number, rangeEnd?: number, parser?: PrettierParserName | CustomParser, filepath?: string, requirePragma?: boolean, insertPragma?: boolean, proseWrap?: "always" | "never" | "preserve", plugins?: Array |}; declare export type Plugin = { languages: SupportLanguage, parsers: { [parserName: string]: Parser }, printers: { [astFormat: string]: Printer } }; declare export type Parser = { parse: ( text: string, parsers: { [parserName: string]: Parser }, options: Object ) => AST, astFormat: string }; declare export type Printer = { print: ( path: FastPath, options: Object, print: (path: FastPath) => Doc ) => Doc, embed: ( path: FastPath, print: (path: FastPath) => Doc, textToDoc: (text: string, options: Object) => Doc, options: Object ) => ?Doc }; declare export type CursorOptions = {| cursorOffset: number, printWidth?: $PropertyType, tabWidth?: $PropertyType, useTabs?: $PropertyType, semi?: $PropertyType, singleQuote?: $PropertyType, trailingComma?: $PropertyType, bracketSpacing?: $PropertyType, jsxBracketSameLine?: $PropertyType, arrowParens?: $PropertyType, parser?: $PropertyType, filepath?: $PropertyType, requirePragma?: $PropertyType, insertPragma?: $PropertyType, proseWrap?: $PropertyType, plugins?: $PropertyType |}; declare export type CursorResult = {| formatted: string, cursorOffset: number |}; declare export type ResolveConfigOptions = {| useCache?: boolean, config?: string, editorconfig?: boolean |}; declare export type SupportLanguage = { name: string, since: string, parsers: Array, group?: string, tmScope: string, aceMode: string, codemirrorMode: string, codemirrorMimeType: string, aliases?: Array, extensions: Array, filenames?: Array, linguistLanguageId: number, vscodeLanguageIds: Array }; declare export type SupportOption = {| since: string, type: "int" | "boolean" | "choice" | "path", deprecated?: string, redirect?: SupportOptionRedirect, description: string, oppositeDescription?: string, default: SupportOptionValue, range?: SupportOptionRange, choices?: SupportOptionChoice |}; declare export type SupportOptionRedirect = {| options: string, value: SupportOptionValue |}; declare export type SupportOptionRange = {| start: number, end: number, step: number |}; declare export type SupportOptionChoice = {| value: boolean | string, description?: string, since?: string, deprecated?: string, redirect?: SupportOptionValue |}; declare export type SupportOptionValue = number | boolean | string; declare export type SupportInfo = {| languages: Array, options: Array |}; declare export type Prettier = {| format: (source: string, options?: Options) => string, check: (source: string, options?: Options) => boolean, formatWithCursor: (source: string, options: CursorOptions) => CursorResult, resolveConfig: { (filePath: string, options?: ResolveConfigOptions): Promise, sync(filePath: string, options?: ResolveConfigOptions): ?Options }, clearConfigCache: () => void, getSupportInfo: (version?: string) => SupportInfo |}; declare export default Prettier; } ================================================ FILE: flow-typed/npm/pushstate-server_vx.x.x.js ================================================ // flow-typed signature: cc7350a5386143457c59c38772c2525b // flow-typed version: <>/pushstate-server_v3.1.0/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'pushstate-server' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'pushstate-server' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'pushstate-server/test/fixtures/cat' { declare module.exports: any; } declare module 'pushstate-server/test/index' { declare module.exports: any; } // Filename aliases declare module 'pushstate-server/index' { declare module.exports: $Exports<'pushstate-server'>; } declare module 'pushstate-server/index.js' { declare module.exports: $Exports<'pushstate-server'>; } declare module 'pushstate-server/test/fixtures/cat.js' { declare module.exports: $Exports<'pushstate-server/test/fixtures/cat'>; } declare module 'pushstate-server/test/index.js' { declare module.exports: $Exports<'pushstate-server/test/index'>; } ================================================ FILE: flow-typed/npm/ramda_v0.26.x.js ================================================ // flow-typed signature: 3f660ab2306fb89be2a41b2dd3edc047 // flow-typed version: 96b2a111f3/ramda_v0.26.x/flow_>=v0.76.x /* eslint-disable no-unused-vars, no-redeclare */ type Transformer = { "@@transducer/step": (r: A, a: *) => R, "@@transducer/init": () => A, "@@transducer/result": (result: *) => B }; declare type $npm$ramda$Placeholder = { "@@functional/placeholder": true }; declare opaque type $npm$ramda$Reduced; declare module ramda { declare type UnaryFn = (a: A) => R; declare type UnaryPromiseFn = UnaryFn>; declare type BinaryFn = ((a: A, b: B) => R) & ((a: A) => (b: B) => R); declare type UnarySameTypeFn = UnaryFn; declare type BinarySameTypeFn = BinaryFn; declare type NestedObject = { [k: string]: T | NestedObject }; declare type UnaryPredicateFn = (x: T) => boolean; declare type MapUnaryPredicateFn = (V) => V => boolean; declare type BinaryPredicateFn = (x: T, y: T) => boolean; declare type BinaryPredicateFn2 = (x: T, y: S) => boolean; declare interface ObjPredicate { (value: any, key: string): boolean; } declare type __CurriedFunction1 = (...r: [AA]) => R; declare type CurriedFunction1 = __CurriedFunction1; declare type __CurriedFunction2 = (( ...r: [AA] ) => CurriedFunction1) & ((...r: [AA, BB]) => R); declare type CurriedFunction2 = __CurriedFunction2; declare type __CurriedFunction3 = (( ...r: [AA] ) => CurriedFunction2) & ((...r: [AA, BB]) => CurriedFunction1) & ((...r: [AA, BB, CC]) => R); declare type CurriedFunction3 = __CurriedFunction3< A, B, C, R, *, *, * >; declare type __CurriedFunction4< A, B, C, D, R, AA: A, BB: B, CC: C, DD: D > = ((...r: [AA]) => CurriedFunction3) & ((...r: [AA, BB]) => CurriedFunction2) & ((...r: [AA, BB, CC]) => CurriedFunction1) & ((...r: [AA, BB, CC, DD]) => R); declare type CurriedFunction4 = __CurriedFunction4< A, B, C, D, R, *, *, *, * >; declare type __CurriedFunction5< A, B, C, D, E, R, AA: A, BB: B, CC: C, DD: D, EE: E > = ((...r: [AA]) => CurriedFunction4) & ((...r: [AA, BB]) => CurriedFunction3) & ((...r: [AA, BB, CC]) => CurriedFunction2) & ((...r: [AA, BB, CC, DD]) => CurriedFunction1) & ((...r: [AA, BB, CC, DD, EE]) => R); declare type CurriedFunction5 = __CurriedFunction5< A, B, C, D, E, R, *, *, *, *, * >; declare type __CurriedFunction6< A, B, C, D, E, F, R, AA: A, BB: B, CC: C, DD: D, EE: E, FF: F > = ((...r: [AA]) => CurriedFunction5) & ((...r: [AA, BB]) => CurriedFunction4) & ((...r: [AA, BB, CC]) => CurriedFunction3) & ((...r: [AA, BB, CC, DD]) => CurriedFunction2) & ((...r: [AA, BB, CC, DD, EE]) => CurriedFunction1) & ((...r: [AA, BB, CC, DD, EE, FF]) => R); declare type CurriedFunction6 = __CurriedFunction6< A, B, C, D, E, F, R, *, *, *, *, *, * >; declare type Curry = (((...r: [A]) => R) => CurriedFunction1) & (((...r: [A, B]) => R) => CurriedFunction2) & (((...r: [A, B, C]) => R) => CurriedFunction3) & (( (...r: [A, B, C, D]) => R ) => CurriedFunction4) & (( (...r: [A, B, C, D, E]) => R ) => CurriedFunction5) & (( (...r: [A, B, C, D, E, F]) => R ) => CurriedFunction6); declare type Partial = (((...r: [A]) => R, args: [A]) => () => R) & (((...r: [A, B]) => R, args: [A]) => B => R) & (((...r: [A, B]) => R, args: [A, B]) => () => R) & (((...r: [A, B, C]) => R, args: [A]) => (B, C) => R) & (((...r: [A, B, C]) => R, args: [A, B]) => C => R) & (((...r: [A, B, C]) => R, args: [A, B, C]) => () => R) & (((...r: [A, B, C, D]) => R, args: [A]) => (B, C, D) => R) & (((...r: [A, B, C, D]) => R, args: [A, B]) => (C, D) => R) & (((...r: [A, B, C, D]) => R, args: [A, B, C]) => D => R) & (( (...r: [A, B, C, D]) => R, args: [A, B, C, D] ) => () => R) & (( (...r: [A, B, C, D, E]) => R, args: [A] ) => (B, C, D, E) => R) & (( (...r: [A, B, C, D, E]) => R, args: [A, B] ) => (C, D, E) => R) & (( (...r: [A, B, C, D, E]) => R, args: [A, B, C] ) => (D, E) => R) & (( (...r: [A, B, C, D, E]) => R, args: [A, B, C, D] ) => E => R) & (( (...r: [A, B, C, D, E]) => R, args: [A, B, C, D, E] ) => () => R) & (( (...r: [A, B, C, D, E, F]) => R, args: [A] ) => (B, C, D, E, F) => R) & (( (...r: [A, B, C, D, E, F]) => R, args: [A, B] ) => (C, D, E, F) => R) & (( (...r: [A, B, C, D, E, F]) => R, args: [A, B, C] ) => (D, E, F) => R) & (( (...r: [A, B, C, D, E, F]) => R, args: [A, B, C, D] ) => (E, F) => R) & (( (...r: [A, B, C, D, E, F]) => R, args: [A, B, C, D, E] ) => F => R) & (( (...r: [A, B, C, D, E, F]) => R, args: [A, B, C, D, E, F] ) => () => R) & (( (...r: [A, B, C, D, E, F, G]) => R, args: [A] ) => (B, C, D, E, F, G) => R) & (( (...r: [A, B, C, D, E, F, G]) => R, args: [A, B] ) => (C, D, E, F, G) => R) & (( (...r: [A, B, C, D, E, F, G]) => R, args: [A, B, C] ) => (D, E, F, G) => R) & (( (...r: [A, B, C, D, E, F, G]) => R, args: [A, B, C, D] ) => (E, F, G) => R) & (( (...r: [A, B, C, D, E, F, G]) => R, args: [A, B, C, D, E] ) => (F, G) => R) & (( (...r: [A, B, C, D, E, F, G]) => R, args: [A, B, C, D, E, F] ) => G => R) & (( (...r: [A, B, C, D, E, F, G]) => R, args: [A, B, C, D, E, F, G] ) => () => R) & (( (...r: [A, B, C, D, E, F, G, H]) => R, args: [A] ) => (B, C, D, E, F, G, H) => R) & (( (...r: [A, B, C, D, E, F, G, H]) => R, args: [A, B] ) => (C, D, E, F, G, H) => R) & (( (...r: [A, B, C, D, E, F, G, H]) => R, args: [A, B, C] ) => (D, E, F, G, H) => R) & (( (...r: [A, B, C, D, E, F, G, H]) => R, args: [A, B, C, D] ) => (E, F, G, H) => R) & (( (...r: [A, B, C, D, E, F, G, H]) => R, args: [A, B, C, D, E] ) => (F, G, H) => R) & (( (...r: [A, B, C, D, E, F, G, H]) => R, args: [A, B, C, D, E, F] ) => (G, H) => R) & (( (...r: [A, B, C, D, E, F, G, H]) => R, args: [A, B, C, D, E, F, G] ) => H => R) & (( (...r: [A, B, C, D, E, F, G, H]) => R, args: [A, B, C, D, E, F, G, H] ) => () => R) & (( (...r: [A, B, C, D, E, F, G, H, I]) => R, args: [A] ) => (B, C, D, E, F, G, H, I) => R) & (( (...r: [A, B, C, D, E, F, G, H, I]) => R, args: [A, B] ) => (C, D, E, F, G, H, I) => R) & (( (...r: [A, B, C, D, E, F, G, H, I]) => R, args: [A, B, C] ) => (D, E, F, G, H, I) => R) & (( (...r: [A, B, C, D, E, F, G, H, I]) => R, args: [A, B, C, D] ) => (E, F, G, H, I) => R) & (( (...r: [A, B, C, D, E, F, G, H, I]) => R, args: [A, B, C, D, E] ) => (F, G, H, I) => R) & (( (...r: [A, B, C, D, E, F, G, H, I]) => R, args: [A, B, C, D, E, F] ) => (G, H, I) => R) & (( (...r: [A, B, C, D, E, F, G, H, I]) => R, args: [A, B, C, D, E, F, G] ) => (H, I) => R) & (( (...r: [A, B, C, D, E, F, G, H, I]) => R, args: [A, B, C, D, E, F, G, H] ) => I => R) & (( (...r: [A, B, C, D, E, F, G, H, I]) => R, args: [A, B, C, D, E, F, G, H, I] ) => () => R); declare var pipe: { ( ab: (...a: Args) => B, bc: UnaryFn, cd: UnaryFn, de: UnaryFn, ef: UnaryFn, fg: UnaryFn, ): (...a: Args) => Return, ( ab: (...a: Args) => B, bc: UnaryFn, cd: UnaryFn, de: UnaryFn, ef: UnaryFn, ): (...a: Args) => Return, ( ab: (...a: Args) => B, bc: UnaryFn, cd: UnaryFn, de: UnaryFn, ): (...a: Args) => Return, ( ab: (...a: Args) => B, bc: UnaryFn, cd: UnaryFn, ): (...a: Args) => Return, ( ab: (...a: Args) => B, bc: UnaryFn, ): (...a: Args) => Return, (ab: UnaryFn): UnaryFn, }; declare type Pipe = typeof pipe; declare type PipeP = (( ab: UnaryPromiseFn, bc: UnaryPromiseFn, cd: UnaryPromiseFn, de: UnaryPromiseFn, ef: UnaryPromiseFn, fg: UnaryPromiseFn, ) => UnaryPromiseFn) & (( ab: UnaryPromiseFn, bc: UnaryPromiseFn, cd: UnaryPromiseFn, de: UnaryPromiseFn, ef: UnaryPromiseFn, ) => UnaryPromiseFn) & (( ab: UnaryPromiseFn, bc: UnaryPromiseFn, cd: UnaryPromiseFn, de: UnaryPromiseFn, ) => UnaryPromiseFn) & (( ab: UnaryPromiseFn, bc: UnaryPromiseFn, cd: UnaryPromiseFn, ) => UnaryPromiseFn) & (( ab: UnaryPromiseFn, bc: UnaryPromiseFn, ) => UnaryPromiseFn) & (( ab: UnaryPromiseFn, ) => UnaryPromiseFn); declare type Compose = (( fg: UnaryFn, ef: UnaryFn, de: UnaryFn, cd: UnaryFn, bc: UnaryFn, ab: UnaryFn, ) => UnaryFn) & (( ef: UnaryFn, de: UnaryFn, cd: UnaryFn, bc: UnaryFn, ab: UnaryFn, ) => UnaryFn) & (( de: UnaryFn, cd: UnaryFn, bc: UnaryFn, ab: UnaryFn, ) => UnaryFn) & (( cd: UnaryFn, bc: UnaryFn, ab: UnaryFn, ) => UnaryFn) & (( bc: UnaryFn, ab: UnaryFn, ) => UnaryFn) & ((ab: UnaryFn) => UnaryFn); // This kind of filter allows us to do type refinement on the result, but we // still need Filter so that non-refining predicates still pass a type check. declare type RefineFilter = & (, T: Array | $ReadOnlyArray> (fn: P, xs: T) => Array<$Refine>) & (, T: Array | $ReadOnlyArray> (fn: P) => (xs: T) => Array<$Refine>); declare type Filter = & ( | { +[key: K]: V }> (fn: UnaryPredicateFn, xs: T) => T) & (> (fn: UnaryPredicateFn, xs: T) => T) & ( | { +[key: K]: V }> (fn: UnaryPredicateFn) =>(xs: T) => T) & ( | { [key: K]: V }> (fn: UnaryPredicateFn) =>(xs: T) => T) declare interface Monad { chain(f: A => Monad): Monad; } declare class Semigroup {} declare class Chain { chain | Array>(fn: (a: T) => V, x: V): V; chain | Array>(fn: (a: T) => V): (x: V) => V; } declare class GenericContructor { constructor(x: T): GenericContructor; } declare class GenericContructorMulti { constructor(...args: Array): GenericContructor; } /** * DONE: * Function* * List* * Logic * Math * Object* * Relation * String * Type */ declare var compose: Compose; declare var pipeK: PipeK; declare var pipeP: PipeP; declare var curry: Curry; declare function curryN( length: number, fn: (...args: Array) => any ): Function; // *Math declare var add: CurriedFunction2; declare var inc: UnaryFn; declare var dec: UnaryFn; declare var mean: UnaryFn, number>; declare var divide: CurriedFunction2; declare var mathMod: CurriedFunction2; declare var median: UnaryFn, number>; declare var modulo: CurriedFunction2; declare var multiply: CurriedFunction2; declare var negate: UnaryFn; declare var product: UnaryFn, number>; declare var subtract: & CurriedFunction2 & CurriedFunction2 & CurriedFunction2 & CurriedFunction2; declare var sum: UnaryFn, number>; // Filter // To refine with filter, be sure to import the RefineFilter type, and cast // filter to a RefineFilter. // ex: // import { type RefineFilter, filter } from 'ramda' // const notNull = (x): bool %checks => x != null // const ns: Array = (filter: RefineFilter)(notNull, [1, 2, null]) declare var filter: RefineFilter & Filter; // reject doesn't get RefineFilter since it performs the opposite work of // filter, and we don't have a kind of $NotPred type. declare var reject: Filter; // *String declare var match: CurriedFunction2>; declare var replace: CurriedFunction3< RegExp | string, string | ((substring: string, ...args: Array) => string), string, string >; declare var split: CurriedFunction2>; declare var test: CurriedFunction2; // startsWith and endsWith use the same signature: declare type EdgeWith = & ( & ((Array) => (Array) => boolean) & (Array, Array) => boolean ) & ( & ((string) => (string) => boolean) & (string, string) => boolean ) ; declare var startsWith: EdgeWith<*>; declare var endsWith: EdgeWith<*>; declare function toLower(a: string): string; declare function toString(x: any): string; declare function toUpper(a: string): string; declare function trim(a: string): string; // *Type declare function is(t: T): (v: any) => boolean; declare function is(t: T, v: any): boolean; declare var propIs: CurriedFunction3; declare function type(x: ?any): string; declare function isNil(x: mixed): boolean %checks(x === undefined || x === null); // *List declare function adjust( index: number, ): (fn: (a: T) => T) => (src: Array) => Array; declare function adjust( index: number, fn: (a: T) => T, ): (src: Array) => Array; declare function adjust( index: number, fn: (a: T) => T, src: Array ): Array; declare function all(fn: UnaryPredicateFn, xs: Array): boolean; declare function all( fn: UnaryPredicateFn, ): (xs: Array) => boolean; declare function any(fn: UnaryPredicateFn, xs: Array): boolean; declare function any( fn: UnaryPredicateFn, ): (xs: Array) => boolean; declare function aperture(n: number, xs: Array): Array>; declare function aperture( n: number, ): (xs: Array) => Array>; declare function append(x: E, xs: Array): Array; declare function append( x: E, ): (xs: Array) => Array; declare function prepend(x: E, xs: Array): Array; declare function prepend( x: E, ): (xs: Array) => Array; declare function chain(f: (x: A) => B[], xs: A[]): B[] declare function chain(f: (x: A) => B[]): (xs: A[]) => B[] declare function concat>(x: T, y: T): T; declare function concat>(x: T): (y: T) => T; declare function concat(x: string, y: string): string; declare function concat(x: string): (y: string) => string; declare type Includes = ( | string>(a: A) => (b: T) => boolean) & ( | string>(a: A, b: T) => boolean); declare var contains: Includes; declare var includes: Includes; declare function drop | string>( n: number, ): (xs: T) => T; declare function drop | string>(n: number, xs: T): T; declare function dropLast | string>( n: number, ): (xs: T) => T; declare function dropLast | string>(n: number, xs: T): T; declare function dropLastWhile>( fn: UnaryPredicateFn, ): (xs: T) => T; declare function dropLastWhile>( fn: UnaryPredicateFn, xs: T ): T; declare function dropWhile>( fn: UnaryPredicateFn, ): (xs: T) => T; declare function dropWhile>(fn: UnaryPredicateFn, xs: T): T; declare function dropRepeats>(xs: T): T; declare function dropRepeatsWith>( fn: BinaryPredicateFn, ): (xs: T) => T; declare function dropRepeatsWith>( fn: BinaryPredicateFn, xs: T ): T; declare function groupBy( fn: (x: T) => string, xs: Array ): { [key: string]: Array }; declare function groupBy( fn: (x: T) => string, ): (xs: Array) => { [key: string]: Array }; declare function groupWith | string>( fn: BinaryPredicateFn, xs: V ): Array; declare function groupWith | string>( fn: BinaryPredicateFn, ): (xs: V) => Array; declare function head>(xs: V): $ElementType; declare function head(xs: V): V; declare function into, R: Array<*> | string | Object>( accum: R, xf: (a: A) => I, input: A ): R; declare function into, R>( accum: Transformer, xf: (a: A) => R, input: A ): R; declare function indexOf(x: ?E, xs: Array): number; declare function indexOf( x: ?E, ): (xs: Array) => number; declare function indexBy( fn: (x: T) => string, ): (xs: Array) => { [key: string]: T }; declare function indexBy( fn: (x: T) => string, xs: Array ): { [key: string]: T }; declare function insert( index: number, ): (elem: T) => (src: Array) => Array; declare function insert( index: number, elem: T, ): (src: Array) => Array; declare function insert(index: number, elem: T, src: Array): Array; declare function insertAll( index: number, ): (elem: Array) => (src: Array) => Array; declare function insertAll( index: number, elems: Array, ): (src: Array) => Array; declare function insertAll( index: number, elems: Array, src: Array ): Array; declare function join(x: string, xs: Array): string; declare function join( x: string, ): (xs: Array) => string; declare function last>(xs: V): ?T; declare function last(xs: V): V; declare function none(fn: UnaryPredicateFn, xs: Array): boolean; declare function none( fn: UnaryPredicateFn, ): (xs: Array) => boolean; declare function nth>(i: number, xs: T): ?V; declare function nth | string>( i: number, ): ((xs: string) => string) & ((xs: T) => ?V); declare function nth(i: number, xs: T): T; declare type Find = (>( fn: UnaryPredicateFn ) => (xs: T) => ?V) & (>(fn: UnaryPredicateFn, xs: T) => ?V); declare var find: Find; declare function findLast | O>( fn: UnaryPredicateFn, ): (xs: T | O) => ?V | O; declare function findLast | O>( fn: UnaryPredicateFn, xs: T | O ): ?V | O; declare function findIndex | { [key: K]: V }>( fn: UnaryPredicateFn, ): (xs: T) => number; declare function findIndex | { [key: K]: V }>( fn: UnaryPredicateFn, xs: T ): number; declare function findLastIndex | { [key: K]: V }>( fn: UnaryPredicateFn, ): (xs: T) => number; declare function findLastIndex | { [key: K]: V }>( fn: UnaryPredicateFn, xs: T ): number; declare function forEach(fn: (x: T) => ?V, xs: Array): Array; declare function forEach( fn: (x: T) => ?V, ): (xs: Array) => Array; declare function forEachObjIndexed( fn: (val: A, key: string, o: O) => B, o: { [key: string]: A } ): O; declare function forEachObjIndexed( fn: (val: A, key: string, o: O) => B, ...args: Array ): (o: { [key: string]: A }) => O; declare function lastIndexOf(x: E, xs: Array): number; declare function lastIndexOf( x: E, ): (xs: Array) => number; declare var map: { R, SR, S: { +map: FN => SR }>(fn: FN, xs: S): SR, R>(fn: FN): ( SR }>(xs: S) => SR) & ((xs: { [key: string]: T }) => { [key: string]: R }) & ((xs: { +[key: string]: T }) => { +[key: string]: R }) & ((xs: Array) => Array) & ((xs: $ReadOnlyArray) => $ReadOnlyArray), (fn: (x: T) => R, xs: Array): Array, (fn: (x: T) => R, xs: $ReadOnlyArray): $ReadOnlyArray, (fn: (x: T) => R, xs: { [key: string]: T }): { [key: string]: R }, (fn: (x: T) => R, xs: { +[key: string]: T }): { +[key: string]: R } }; declare type AccumIterator = (acc: R, x: A) => [R, B]; declare function mapAccum( fn: AccumIterator, acc: R, xs: Array ): [R, Array]; declare function mapAccum( fn: AccumIterator, ): (acc: R, xs: Array) => [R, Array]; declare function mapAccumRight( fn: AccumIterator, acc: R, xs: Array ): [R, Array]; declare function mapAccumRight( fn: AccumIterator, ): (acc: R, xs: Array) => [R, Array]; declare function intersperse(x: E, xs: Array): Array; declare function intersperse( x: E, ): (xs: Array) => Array; declare function pair(a: A, b: B): [A, B]; declare function pair(a: A): (b: B) => [A, B]; declare function partition | { [key: K]: V }>( fn: UnaryPredicateFn, xs: T ): [T, T]; declare function partition | { [key: K]: V }>( fn: UnaryPredicateFn, ): (xs: T) => [T, T]; declare function pluck< V, K: $Keys, >(key: K, list: V[]): Array<$ElementType>; declare function pluck< V, K: $Keys, >(key: K): (list: V[]) => Array<$ElementType>; declare function pluck< T, V: T[], >(key: number, list: V[]): Array<$ElementType>; declare function pluck< T, V: T[], >(key: number): (list: V[]) => Array<$ElementType>; declare var range: CurriedFunction2>; declare function reduced(x: T | $npm$ramda$Reduced): $npm$ramda$Reduced; declare function remove( from: number, ): ((to: number) => (src: Array) => Array) & ((to: number, src: Array) => Array); declare function remove( from: number, to: number, ): (src: Array) => Array; declare function remove(from: number, to: number, src: Array): Array; declare function repeat(x: T, times: number): Array; declare function repeat(x: T): (times: number) => Array; declare function slice | string>( from: number, ): ((to: number) => (src: T) => T) & ((to: number, src: T) => T); declare function slice | string>( from: number, to: number, ): (src: T) => T; declare function slice | string>( from: number, to: number, src: T ): T; declare function sort>(fn: (a: V, b: V) => number, xs: T): T; declare function sort>( fn: (a: V, b: V) => number, ): (xs: T) => T; declare function sortWith>( fns: Array<(a: V, b: V) => number>, xs: T ): T; declare function sortWith>( fns: Array<(a: V, b: V) => number>, ): (xs: T) => T; declare function descend(A => B): (A => A) => number declare function ascend(A => B): (A => A) => number declare function times(fn: (i: number) => T, n: number): Array; declare function times( fn: (i: number) => T, ): (n: number) => Array; declare function take | string>(n: number, xs: T): T; declare function take | string>(n: number): (xs: T) => T; declare function takeLast | string>(n: number, xs: T): T; declare function takeLast | string>(n: number): (xs: T) => T; declare function takeLastWhile>( fn: UnaryPredicateFn, xs: T ): T; declare function takeLastWhile>( fn: UnaryPredicateFn ): (xs: T) => T; declare function takeWhile>(fn: UnaryPredicateFn, xs: T): T; declare function takeWhile>( fn: UnaryPredicateFn ): (xs: T) => T; declare function unfold( fn: (seed: T) => [R, T] | boolean, ): (seed: T) => Array; declare function unfold( fn: (seed: T) => [R, T] | boolean, seed: T ): Array; declare function uniqBy( fn: (x: T) => V, ): (xs: Array) => Array; declare function uniqBy(fn: (x: T) => V, xs: Array): Array; declare function uniqWith( fn: BinaryPredicateFn, ): (xs: Array) => Array; declare function uniqWith( fn: BinaryPredicateFn, xs: Array ): Array; declare function update( index: number, ): ((elem: T) => (src: Array) => Array) & ((elem: T, src: Array) => Array); declare function update( index: number, elem: T, ): (src: Array) => Array; declare function update(index: number, elem: T, src: Array): Array; // TODO `without` as a transducer declare function without(xs: Array, src: Array): Array; declare function without( xs: Array, ): (src: Array) => Array; declare function xprod(xs: Array, ys: Array): Array<[T, S]>; declare function xprod( xs: Array, ): (ys: Array) => Array<[T, S]>; declare function zip(xs: Array, ys: Array): Array<[T, S]>; declare function zip( xs: Array, ): (ys: Array) => Array<[T, S]>; declare function zipObj( xs: Array, ys: Array ): { [key: T]: S }; declare function zipObj( xs: Array, ): (ys: Array) => { [key: T]: S }; declare type NestedArray = Array>; declare function flatten(xs: NestedArray): Array; declare function fromPairs(pair: Array<[T, V]>): { [key: string]: V }; declare function init | string>(xs: V): V; declare function length(xs: Array | string | {length: number}): number; declare function reverse | string>(xs: V): V; declare type Reduce = (( fn: (acc: A, elm: B) => $npm$ramda$Reduced | A ) => ((init: A) => (xs: Array | $ReadOnlyArray) => A) & ((init: A, xs: Array | $ReadOnlyArray) => A)) & (( fn: (acc: A, elm: B) => $npm$ramda$Reduced | A, init: A ) => (xs: Array | $ReadOnlyArray) => A) & (( fn: (acc: A, elm: B) => $npm$ramda$Reduced | A, init: A, xs: Array | $ReadOnlyArray ) => A); declare var reduce: Reduce; declare function reduceBy( fn: (acc: B, elem: A) => B, ): ((acc: B) => (( keyFn: (elem: A) => string, ) => (xs: Array) => { [key: string]: B }) & ((keyFn: (elem: A) => string, xs: Array) => { [key: string]: B })) & (( acc: B, keyFn: (elem: A) => string, ) => (xs: Array) => { [key: string]: B }) & (( acc: B, keyFn: (elem: A) => string, xs: Array ) => { [key: string]: B }); declare function reduceBy( fn: (acc: B, elem: A) => B, acc: B, ): (( keyFn: (elem: A) => string, ) => (xs: Array) => { [key: string]: B }) & ((keyFn: (elem: A) => string, xs: Array) => { [key: string]: B }); declare function reduceBy( fn: (acc: B, elem: A) => B, acc: B, keyFn: (elem: A) => string ): (xs: Array) => { [key: string]: B }; declare function reduceBy( fn: (acc: B, elem: A) => B, acc: B, keyFn: (elem: A) => string, xs: Array ): { [key: string]: B }; declare function reduceRight( fn: (elem: B, acc: A) => A, ): ((init: A, xs: Array) => A) & ((init: A) => (xs: Array) => A); declare function reduceRight( fn: (elem: B, acc: A) => A, init: A, ): (xs: Array) => A; declare function reduceRight( fn: (elem: B, acc: A) => A, init: A, xs: Array ): A; declare function reduceWhile(pred: (acc: A, curr: B) => boolean): (( fn: (a: A, b: B) => A, ) => (init: A) => ( xs: Array ) => A & (( fn: (a: A, b: B) => A, ) => (init: A, xs: Array) => A)) & (( fn: (a: A, b: B) => A, init: A, ) => (xs: Array) => A) & ((fn: (a: A, b: B) => A, init: A, xs: Array) => A); declare function reduceWhile( pred: (acc: A, curr: B) => boolean, fn: (a: A, b: B) => A, ): ((init: A) => (xs: Array) => A) & ((init: A, xs: Array) => A); declare function reduceWhile( fn: (acc: A, curr: B) => boolean, fn: (a: A, b: B) => A, init: A, xs: Array ): A; declare function scan( fn: (acc: A, elem: B) => A, ): ((init: A, xs: Array) => Array) & ((init: A) => (xs: Array) => Array); declare function scan( fn: (acc: A, elem: B) => A, init: A, ): (xs: Array) => Array; declare function scan( fn: (acc: A, elem: B) => A, init: A, xs: Array ): Array; declare function splitAt | string>(i: number, xs: T): [T, T]; declare function splitAt | string>( i: number ): (xs: T) => [T, T]; declare function splitEvery | string>( i: number, xs: T ): Array; declare function splitEvery | string>( i: number ): (xs: T) => Array; declare function splitWhen>( fn: UnaryPredicateFn, xs: T ): [T, T]; declare function splitWhen>( fn: UnaryPredicateFn ): (xs: T) => [T, T]; declare function tail | string>(xs: V): V; declare function transpose(xs: Array>): Array>; declare function uniq(xs: Array): Array; declare function unnest(xs: NestedArray): NestedArray; declare function zipWith( fn: (a: T, b: S) => R, ): ((xs: Array, ys: Array) => Array) & ((xs: Array) => (ys: Array) => Array); declare function zipWith( fn: (a: T, b: S) => R, xs: Array, ): (ys: Array) => Array; declare function zipWith( fn: (a: T, b: S) => R, xs: Array, ys: Array ): Array; // *Relation declare function equals(x: T): (y: T) => boolean; declare function equals(x: T, y: T): boolean; declare function eqBy( fn: (x: A) => B, ): ((x: A, y: A) => boolean) & ((x: A) => (y: A) => boolean); declare function eqBy( fn: (x: A) => B, x: A, ): (y: A) => boolean; declare function eqBy(fn: (x: A) => B, x: A, y: A): boolean; // Flow cares about the order in which these appear. Generally function // siguatures should go from smallest arity to largest arity. declare type PropEq = (( prop: $Keys ) => ((val: mixed) => (obj: T) => boolean) & ((val: mixed, obj: T) => boolean)) & ((prop: $Keys, val: mixed) => (obj: T) => boolean) & ((prop: $Keys, val: mixed, obj: T) => boolean) & // Array variants. (( prop: number ) => ((val: mixed) => (obj: Array<*>) => boolean) & ((val: mixed, obj: Array<*>) => boolean)) & ((prop: number, val: mixed) => (obj: Array<*>) => boolean) & ((prop: number, val: mixed, obj: Array<*>) => boolean); declare var propEq: PropEq; declare function pathEq( path: Array, ): ((val: mixed) => (o: Object) => boolean) & ((val: mixed, o: Object) => boolean); declare function pathEq( path: Array, val: mixed, ): (o: Object) => boolean; declare function pathEq(path: Array, val: mixed, o: Object): boolean; declare function clamp( min: T, ): ((max: T) => (v: T) => T) & ((max: T, v: T) => T); declare function clamp( min: T, max: T, ): (v: T) => T; declare function clamp(min: T, max: T, v: T): T; declare function countBy( fn: (x: T) => string, ): (list: Array) => { [key: string]: number }; declare function countBy( fn: (x: T) => string, list: Array ): { [key: string]: number }; declare function difference( xs1: Array, ): (xs2: Array) => Array; declare function difference(xs1: Array, xs2: Array): Array; declare function differenceWith( fn: BinaryPredicateFn, ): ((xs1: Array) => (xs2: Array) => Array) & ((xs1: Array, xs2: Array) => Array); declare function differenceWith( fn: BinaryPredicateFn, xs1: Array, ): (xs2: Array) => Array; declare function differenceWith( fn: BinaryPredicateFn, xs1: Array, xs2: Array ): Array; declare function eqBy(fn: (x: T) => T, x: T, y: T): boolean; declare function eqBy(fn: (x: T) => T): (x: T, y: T) => boolean; declare function eqBy(fn: (x: T) => T, x: T): (y: T) => boolean; declare function eqBy(fn: (x: T) => T): (x: T) => (y: T) => boolean; declare type RelationCompare = & ((x: number) => (y: number) => bool) & ((x: number, y: number) => bool) & ((x: string) => (y: string) => bool) & ((x: string, y: string) => bool) declare var gt: RelationCompare declare var gte: RelationCompare declare var lt: RelationCompare declare var lte: RelationCompare declare function identical(x: T): (y: T) => boolean; declare function identical(x: T, y: T): boolean; declare function innerJoin( pred: (a: A, b: B) => boolean, ): ( a: Array, ) => (b: Array) => Array & ((a: Array, b: Array) => Array); declare function innerJoin( pred: (a: A, b: B) => boolean, a: Array, ): (b: Array) => Array; declare function innerJoin( pred: (a: A, b: B) => boolean, a: Array, b: Array ): Array; declare function intersection(x: Array, y: Array): Array; declare function intersection(x: Array): (y: Array) => Array; declare function max(x: T): (y: T) => T; declare function max(x: T, y: T): T; declare function maxBy( fn: (x: T) => V, ): ((x: T, y: T) => T) & ((x: T) => (y: T) => T); declare function maxBy( fn: (x: T) => V, x: T, ): (y: T) => T; declare function maxBy(fn: (x: T) => V, x: T, y: T): T; declare function min(x: T): (y: T) => T; declare function min(x: T, y: T): T; declare function minBy( fn: (x: T) => V, ): ((x: T, y: T) => T) & ((x: T) => (y: T) => T); declare function minBy(fn: (x: T) => V, x: T): (y: T) => T; declare function minBy(fn: (x: T) => V, x: T, y: T): T; declare function sortBy( fn: (x: T) => V, ): (x: Array) => Array; declare function sortBy(fn: (x: T) => V, x: Array): Array; declare function symmetricDifference( x: Array, ): (y: Array) => Array; declare function symmetricDifference(x: Array, y: Array): Array; declare function symmetricDifferenceWith( fn: BinaryPredicateFn, ): ((x: Array) => (y: Array) => Array) & ((x: Array, y: Array) => Array); declare function symmetricDifferenceWith( fn: BinaryPredicateFn, x: Array, ): (y: Array) => Array; declare function symmetricDifferenceWith( fn: BinaryPredicateFn, x: Array, y: Array ): Array; declare function union( x: Array, ): (y: Array) => Array; declare function union(x: Array, y: Array): Array; declare function unionWith( fn: BinaryPredicateFn, ): ((x: Array) => (y: Array) => Array) & ((x: Array, y: Array) => Array); declare function unionWith( fn: BinaryPredicateFn, x: Array, ): (y: Array) => Array; declare function unionWith( fn: BinaryPredicateFn, x: Array, y: Array ): Array; // *Object declare var assoc: { ( key: string, ...args: Array ): & ((val: T) => (src: S) => ({ [k: string]: T })) & ((val: T, src: S) => ({ [k: string]: T } & S)), ( key: string, val: T, ...args: Array ): (src: S) => ({ [k: string]: T } & S), > (key: K, val: T, src: S): ({ [k: string]: T } & S), (key: string, val: T, src: S): ({ [k: string]: T, ...$Exact }) }; declare function assocPath( key: Array, ...args: Array ): ((val: V) => (src: S) => { [k: string]: V }) & ((val: V) => (src: S) => { [k: string]: V } & S); declare function assocPath( key: Array, val: V, ...args: Array ): (src: S) => { [k: string]: V } & S; declare function assocPath( key: Array, val: V, src: S ): { [k: string]: V } & S; declare function clone(src: T): $Shape; declare function dissoc( key: string, ...args: Array ): (src: { [k: string]: T }) => { [k: string]: T }; declare function dissoc( key: string, src: { [k: string]: T } ): { [k: string]: T }; declare function dissocPath( key: Array, ...args: Array ): (src: { [k: string]: U }) => { [k: string]: U }; declare function dissocPath( key: Array, src: { [k: string]: U } ): { [k: string]: U }; declare function evolve(NestedObject): A => A; declare function evolve(NestedObject, A): A; declare function eqProps( key: string, ...args: Array ): ((o1: Object) => (o2: Object) => boolean) & ((o1: Object, o2: Object) => boolean); declare function eqProps( key: string, o1: Object, ...args: Array ): (o2: Object) => boolean; declare function eqProps(key: string, o1: Object, o2: Object): boolean; declare function has(key: string): (o: Object) => boolean; declare function has(key: string, o: Object): boolean; declare function hasPath(path: Array): (o: Object) => boolean; declare function hasPath(path: Array, o: Object): boolean; declare function hasIn(key: string, o: Object): boolean; declare function hasIn(key: string): (o: Object) => boolean; declare function invert(o: Object): { [k: string]: Array }; declare function invertObj(o: Object): { [k: string]: string }; declare function keys(o: ?Object): Array; declare type Lens = (x: T) => V; declare function lens( getter: (s: T) => U, setter: (a: U, s: T) => V ): Lens; declare function lens( getter: (s: T) => U ): (setter: (a: U, s: T) => V) => Lens; declare function lensIndex(n: number): Lens; declare function lensPath(a: Array): Lens; declare function lensProp(str: string): Lens; declare function mapObjIndexed( fn: (val: A, key: string, o: Object) => B, o: { [key: string]: A } ): { [key: string]: B }; declare function mapObjIndexed( fn: (val: A, key: string, o: Object) => B, ...args: Array ): (o: { [key: string]: A }) => { [key: string]: B }; declare type Merge = ((a: A) => (b: B) => A & B) & ((a: A, b: B) => A & B); declare var merge: Merge; declare var mergeLeft: Merge; declare var mergeDeepLeft: Merge; declare var mergeRight: Merge; declare function mergeAll( os: Array<{ [k: string]: T }> ): { [k: string]: T }; declare var mergeDeepRight: ((a: A, b: B) => B & A) & ((a: A) => (b: B) => B & A); declare type MergeWith = ( & $Values>( fn: (a: T, b: T) => T, a: A, b: B ) => A & B) & (( fn: (a: T, b: T) => T, ) => (a: A) => (b: B) => A & B) & (( fn: (a: T, b: T) => T, ) => (a: A, b: B) => A & B) & (( fn: (a: T, b: T) => T, a: A, ) => (b: B) => A & B); declare type MergeWithKey = (< A, B, S: $Keys & $Keys, T: $ElementType> & $ElementType>, >( fn: (s: S, a: T, b: T) => T, a: A, b: B ) => A & B) & (( fn: (s: S, a: T, b: T) => T, ) => (a: A, b: B) => A & B) & (( fn: (s: S, a: T, b: T) => T, ) => (a: A) => (b: B) => A & B) & (( fn: (s: S, a: T, b: T) => T, a: A, ) => (b: B) => A & B); declare var mergeDeepWith: MergeWith; declare var mergeDeepWithKey: MergeWithKey; declare var mergeWith: MergeWith; declare var mergeWithKey: MergeWithKey; declare function objOf( key: string, ): (val: T) => { [key: string]: T }; declare function objOf(key: string, val: T): { [key: string]: T }; declare function omit( keys: Array, ): (val: T) => Object; declare function omit(keys: Array, val: T): Object; declare function over(lens: Lens, x: (any) => mixed, val: V): U; declare function over( lens: Lens, ): ((x: (any) => mixed) => (val: V) => U) & ((x: (any) => mixed, val: V) => U); declare function path( p: Array, ): (o: NestedObject) => V; declare function path( p: Array, ): (o: null | void) => void; declare function path( p: Array, ): (o: mixed) => ?V; declare function path>(p: Array, o: A): V; declare function path(p: Array, o: A): void; declare function path(p: Array, o: A): ?V; declare function path( p: Array, ): (o: NestedObject) => V; declare function path( p: Array, ): (o: null | void) => void; declare function path( p: Array, ): (o: mixed) => ?V; declare function path>(p: Array, o: A): V; declare function path(p: Array, o: A): void; declare function path(p: Array, o: A): ?V; declare function pathOr>( or: T, ): ((p: Array) => (o: ?A) => V | T) & ((p: Array, o: ?A) => V | T); declare function pathOr>( or: T, p: Array, ): (o: ?A) => V | T; declare function pathOr>( or: T, p: Array, o: ?A ): V | T; declare function pick>>( keys: K, ): (val: O) => O; declare function pick>>( keys: K, val: O ): O; declare function pickAll( keys: Array, ): (val: { [key: string]: A }) => { [key: string]: ?A }; declare function pickAll( keys: Array, val: { [key: string]: A } ): { [key: string]: ?A }; declare function pickBy( fn: BinaryPredicateFn2, ): (val: { [key: string]: A }) => { [key: string]: A }; declare function pickBy( fn: BinaryPredicateFn2, val: { [key: string]: A } ): { [key: string]: A }; declare function project( keys: Array, ): (val: Array<{ [key: string]: T }>) => Array<{ [key: string]: T }>; declare function project( keys: Array, val: Array<{ [key: string]: T }> ): Array<{ [key: string]: T }>; declare function prop( key: T, ): (o: O) => $ElementType; declare function prop( __: $npm$ramda$Placeholder, o: O ): (key: T) => $ElementType; declare function prop(key: T, o: O): $ElementType; declare function propOr( or: T, ): ((p: string) => (o: A) => V | T) & ((p: string, o: A) => V | T); declare function propOr( or: T, p: string, ): (o: A) => V | T; declare function propOr( or: T, p: string, o: A ): V | T; declare function keysIn(o: Object): Array; declare function props( keys: Array, ): (o: O) => Array<$ElementType>; declare function props( keys: Array, o: O ): Array<$ElementType>; declare function set(lens: Lens, x: T, val: V): U; declare function set( lens: Lens, ): ((x: (any) => mixed) => (val: V) => U) & ((x: (any) => mixed, val: V) => U); declare function toPairs( o: O ): Array<[$Keys, T]>; declare function toPairsIn( o: O ): Array<[string, T]>; declare function values(o: T): Array<$Values>; declare function valuesIn(o: O): Array; declare function where( predObj: $ObjMap, o: O ): boolean; declare function where( predObj: $ObjMap ): O => boolean; declare function whereEq( predObj: O, ): (o: $Shape) => boolean; declare function whereEq( predObj: O, o: $Shape ): boolean; declare function view(lens: Lens, val: T): V; declare function view(lens: Lens): (val: T) => V; // *Function declare var __: $npm$ramda$Placeholder; declare var T: (_: any) => true; declare var F: (_: any) => false; declare function addIndex( iterFn: (fn: (x: A) => B, xs: Array) => Array ): (fn: (x: A, idx: number, xs: Array) => B, xs: Array) => Array; declare function always(x: T): (x: any) => T; declare function ap( fns: Array<(x: T) => V>, ): (xs: Array) => Array; declare function ap(fns: Array<(x: T) => V>, xs: Array): Array; declare function apply( fn: (...args: Array) => V, ): (xs: Array) => V; declare function apply(fn: (...args: Array) => V, xs: Array): V; declare function applySpec< V, S, A: Array, T: NestedObject<(...args: A) => S> >( spec: T ): (...args: A) => NestedObject; declare function applyTo(a: A): (fn: (x: A) => B) => B; declare function applyTo(a: A, fn: (x: A) => B): B; declare function binary( fn: (...args: Array) => T ): (x: any, y: any) => T; declare function bind( fn: (...args: Array) => any, thisObj: T ): (...args: Array) => any; declare function call( fn: (...args: Array) => T, ...args: Array ): T; declare function comparator( fn: BinaryPredicateFn ): (x: T, y: T) => number; // TODO add tests declare function construct( ctor: Class> ): (x: T) => GenericContructor; // TODO add tests declare function constructN( n: number, ctor: Class> ): (...args: any) => GenericContructorMulti; // TODO make less generic declare function converge(after: Function, fns: Array): Function; declare function empty(x: T): T; declare function flip( fn: (arg0: A, arg1: B) => TResult ): CurriedFunction2; declare function flip( fn: (arg0: A, arg1: B, arg2: C) => TResult ): ((arg0: B, arg1: A) => (arg2: C) => TResult) & ((arg0: B, arg1: A, arg2: C) => TResult); declare function flip( fn: (arg0: A, arg1: B, arg2: C, arg3: D) => TResult ): (( arg1: B, arg0: A, ) => (arg2: C, arg3: D) => TResult) & ((arg1: B, arg0: A, arg2: C, arg3: D) => TResult); declare function flip( fn: (arg0: A, arg1: B, arg2: C, arg3: D, arg4: E) => TResult ): (( arg1: B, arg0: A, ) => (arg2: C, arg3: D, arg4: E) => TResult) & ((arg1: B, arg0: A, arg2: C, arg3: D, arg4: E) => TResult); declare function identity(x: T): T; declare function invoker( arity: number, name: $Keys ): CurriedFunction2 & CurriedFunction3 & CurriedFunction4; declare function juxt( fns: Array<(...args: Array) => T> ): (...args: Array) => Array; // TODO lift // TODO liftN declare function memoizeWith( keyFn: (...args: Array) => C ): (...args: Array) => (...args: Array) => B; declare function memoizeWith( keyFn: (...args: Array) => C, fn: (...args: Array) => B ): (...args: Array) => B; declare function nAry( arity: number, fn: (...args: Array) => T ): (...args: Array) => T; declare function nthArg(n: number): (...args: Array) => T; declare var o: (( fn1: (b: B) => C, ...rest: void[] ) => ((fn2: (a: A) => B, ...rest: void[]) => (x: A) => C) & ((fn2: (a: A) => B, x: A) => C)) & (( fn1: (b: B) => C, fn2: (a: A) => B, ...rest: void[] ) => (x: A) => C) & ((fn1: (b: B) => C, fn2: (a: A) => B, x: A) => C); declare function of(x: T): Array; declare function once) => B>(fn: T): T; declare var partial: Partial; // TODO partialRight declare type UnaryMonadFn = UnaryFn>; declare type PipeK = (>( ab: UnaryMonadFn, bc: UnaryMonadFn, cd: UnaryMonadFn, de: UnaryMonadFn, ef: UnaryMonadFn, fg: UnaryMonadFn, gh: UnaryMonadFn, hi: UnaryMonadFn, ij: UnaryMonadFn, jk: J => L, ) => A => L) & (>( ab: UnaryMonadFn, bc: UnaryMonadFn, cd: UnaryMonadFn, de: UnaryMonadFn, ef: UnaryMonadFn, fg: UnaryMonadFn, gh: UnaryMonadFn, hi: UnaryMonadFn, ij: I => K, ) => A => K) & (>( ab: UnaryMonadFn, bc: UnaryMonadFn, cd: UnaryMonadFn, de: UnaryMonadFn, ef: UnaryMonadFn, fg: UnaryMonadFn, gh: UnaryMonadFn, hi: H => J, ) => A => J) & (>( ab: UnaryMonadFn, bc: UnaryMonadFn, cd: UnaryMonadFn, de: UnaryMonadFn, ef: UnaryMonadFn, fg: UnaryMonadFn, gh: G => I, ) => A => I) & (>( ab: UnaryMonadFn, bc: UnaryMonadFn, cd: UnaryMonadFn, de: UnaryMonadFn, ef: UnaryMonadFn, fg: F => H, ) => A => H) & (>( ab: UnaryMonadFn, bc: UnaryMonadFn, cd: UnaryMonadFn, de: UnaryMonadFn, ef: E => G, ) => A => G) & (>( ab: UnaryMonadFn, bc: UnaryMonadFn, cd: UnaryMonadFn, de: D => F, ) => A => F) & (>( ab: UnaryMonadFn, bc: UnaryMonadFn, cd: C => E, ) => A => E) & (>( ab: UnaryMonadFn, bc: B => D, ) => A => D) & (>( ab: A => C ) => A => C); declare function tap(fn: (x: T) => any): (x: T) => T; declare function tap(fn: (x: T) => any, x: T): T; declare function tryCatch( tryer: (a: A) => B ): ((catcher: (e: E, a: A) => B) => (a: A) => B) & ((catcher: (e: E, a: A) => B, a: A) => B); declare function tryCatch( tryer: (a: A) => B, catcher: (e: E, a: A) => B ): (a: A) => B; declare function tryCatch( tryer: (a: A) => B, catcher: (e: E, a: A) => B, a: A ): B; declare function unapply( fn: (xs: Array) => V ): (...args: Array) => V; declare function unary(fn: (...args: Array) => T): (x: any) => T; declare var uncurryN: ((2, (A) => B => C) => (A, B) => C) & ((3, (A) => B => C => D) => (A, B, C) => D) & ((4, (A) => B => C => D => E) => (A, B, C, D) => E) & (( 5, (A) => B => C => D => E => F ) => (A, B, C, D, E) => F) & (( 6, (A) => B => C => D => E => F => G ) => (A, B, C, D, E, F) => G) & (( 7, (A) => B => C => D => E => F => G => H ) => (A, B, C, D, E, F, G) => H) & (( 8, (A) => B => C => D => E => F => G => H => I ) => (A, B, C, D, E, F, G, H) => I); //TODO useWith // *Logic declare function allPass( fns: Array<(...args: Array) => boolean> ): (...args: Array) => boolean; declare function and(x: X): (y: Y) => X | Y; declare function and(x: X, y: Y): X | Y; declare function anyPass( fns: Array<(...args: Array) => boolean> ): (...args: Array) => boolean; declare function both( x: (...args: Array) => boolean, ): (y: (...args: Array) => boolean) => (...args: Array) => boolean; declare function both( x: (...args: Array) => boolean, y: (...args: Array) => boolean ): (...args: Array) => boolean; declare function complement( x: (...args: Array) => boolean ): (...args: Array) => boolean; declare function cond( fns: Array<[(...args: Array) => boolean, (...args: Array) => B]> ): (...args: Array) => B; declare function defaultTo(d: T): (x: ?V) => V | T; declare function defaultTo(d: T, x: ?V): V | T; declare function either( x: (...args: Array) => *, ): (y: (...args: Array) => *) => (...args: Array) => *; declare function either( x: (...args: Array) => *, y: (...args: Array) => * ): (...args: Array) => *; declare function ifElse( cond: (...args: Args) => boolean ): (( f1: (...args: Args) => B ) => (f2: (...args: Args) => C) => (...args: Args) => B | C) & (( f1: (...args: Args) => B, f2: (...args: Args) => C ) => (...args: Args) => B | C); declare function ifElse( cond: (...args: Args) => boolean, f1: (...args: Args) => B, f2: (...args: Args) => C ): (...args: Args) => B | C; declare function isEmpty(x: ?Array | Object | string): boolean; declare function not(x: boolean): boolean; declare function or(x: X): (y: Y) => X | Y; declare function or(x: X, y: Y): X | Y; declare var pathSatisfies: CurriedFunction3< UnaryPredicateFn, Array, Object, boolean >; declare function propSatisfies( cond: (x: $Values) => boolean, prop: $Keys, o: T ): boolean; declare function propSatisfies( cond: (x: $Values) => boolean, prop: $Keys, ): (o: T) => boolean; declare function propSatisfies( cond: (x: $Values) => boolean, ): ((prop: $Keys) => (o: T) => boolean) & ((prop: $Keys, o: T) => boolean); declare function unless( pred: UnaryPredicateFn, ): ((fn: (x: S) => V) => (x: T | S) => T | V) & ((fn: (x: S) => V, x: T | S) => T | V); declare function unless( pred: UnaryPredicateFn, fn: (x: S) => V, ): (x: T | S) => V | T; declare function unless( pred: UnaryPredicateFn, fn: (x: S) => V, x: T | S ): T | V; declare function until( pred: UnaryPredicateFn, ): ((fn: (x: T) => T) => (x: T) => T) & ((fn: (x: T) => T, x: T) => T); declare function until( pred: UnaryPredicateFn, fn: (x: T) => T, ): (x: T) => T; declare function until( pred: UnaryPredicateFn, fn: (x: T) => T, x: T ): T; declare function when( pred: UnaryPredicateFn, ): ((fn: (x: S) => V) => (x: T | S) => T | V) & ((fn: (x: S) => V, x: T | S) => T | V); declare function when( pred: UnaryPredicateFn, fn: (x: S) => V, ): (x: T | S) => V | T; declare function when( pred: UnaryPredicateFn, fn: (x: S) => V, x: T | S ): T | V; } ================================================ FILE: flow-typed/npm/rollup-plugin-babel_vx.x.x.js ================================================ // flow-typed signature: 8c942c5a02f19dd12efd8e6c24a0866c // flow-typed version: <>/rollup-plugin-babel_v^4.3.2/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'rollup-plugin-babel' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'rollup-plugin-babel' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'rollup-plugin-babel/dist/rollup-plugin-babel.cjs' { declare module.exports: any; } declare module 'rollup-plugin-babel/dist/rollup-plugin-babel.esm' { declare module.exports: any; } declare module 'rollup-plugin-babel/src/constants' { declare module.exports: any; } declare module 'rollup-plugin-babel/src/helperPlugin' { declare module.exports: any; } declare module 'rollup-plugin-babel/src/index' { declare module.exports: any; } declare module 'rollup-plugin-babel/src/preflightCheck' { declare module.exports: any; } declare module 'rollup-plugin-babel/src/utils' { declare module.exports: any; } // Filename aliases declare module 'rollup-plugin-babel/dist/rollup-plugin-babel.cjs.js' { declare module.exports: $Exports<'rollup-plugin-babel/dist/rollup-plugin-babel.cjs'>; } declare module 'rollup-plugin-babel/dist/rollup-plugin-babel.esm.js' { declare module.exports: $Exports<'rollup-plugin-babel/dist/rollup-plugin-babel.esm'>; } declare module 'rollup-plugin-babel/src/constants.js' { declare module.exports: $Exports<'rollup-plugin-babel/src/constants'>; } declare module 'rollup-plugin-babel/src/helperPlugin.js' { declare module.exports: $Exports<'rollup-plugin-babel/src/helperPlugin'>; } declare module 'rollup-plugin-babel/src/index.js' { declare module.exports: $Exports<'rollup-plugin-babel/src/index'>; } declare module 'rollup-plugin-babel/src/preflightCheck.js' { declare module.exports: $Exports<'rollup-plugin-babel/src/preflightCheck'>; } declare module 'rollup-plugin-babel/src/utils.js' { declare module.exports: $Exports<'rollup-plugin-babel/src/utils'>; } ================================================ FILE: flow-typed/npm/rollup-plugin-node-resolve_vx.x.x.js ================================================ // flow-typed signature: ac0c85f69e306141eaf59d3c72cbdb62 // flow-typed version: <>/rollup-plugin-node-resolve_v^5.0.2/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'rollup-plugin-node-resolve' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'rollup-plugin-node-resolve' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs' { declare module.exports: any; } declare module 'rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.es' { declare module.exports: any; } declare module 'rollup-plugin-node-resolve/src/empty' { declare module.exports: any; } declare module 'rollup-plugin-node-resolve/src/index' { declare module.exports: any; } // Filename aliases declare module 'rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs.js' { declare module.exports: $Exports<'rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs'>; } declare module 'rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.es.js' { declare module.exports: $Exports<'rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.es'>; } declare module 'rollup-plugin-node-resolve/src/empty.js' { declare module.exports: $Exports<'rollup-plugin-node-resolve/src/empty'>; } declare module 'rollup-plugin-node-resolve/src/index.js' { declare module.exports: $Exports<'rollup-plugin-node-resolve/src/index'>; } ================================================ FILE: flow-typed/npm/rollup-plugin-replace_vx.x.x.js ================================================ // flow-typed signature: 906d0bc57885dd19e3f07b7c71ccade6 // flow-typed version: <>/rollup-plugin-replace_v^2.2.0/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'rollup-plugin-replace' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'rollup-plugin-replace' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'rollup-plugin-replace/dist/rollup-plugin-replace.cjs' { declare module.exports: any; } declare module 'rollup-plugin-replace/dist/rollup-plugin-replace.es' { declare module.exports: any; } declare module 'rollup-plugin-replace/src/index' { declare module.exports: any; } // Filename aliases declare module 'rollup-plugin-replace/dist/rollup-plugin-replace.cjs.js' { declare module.exports: $Exports<'rollup-plugin-replace/dist/rollup-plugin-replace.cjs'>; } declare module 'rollup-plugin-replace/dist/rollup-plugin-replace.es.js' { declare module.exports: $Exports<'rollup-plugin-replace/dist/rollup-plugin-replace.es'>; } declare module 'rollup-plugin-replace/src/index.js' { declare module.exports: $Exports<'rollup-plugin-replace/src/index'>; } ================================================ FILE: flow-typed/npm/rollup-plugin-uglify_vx.x.x.js ================================================ // flow-typed signature: 1ffa1103bea3cb537cbb3bd3826c3107 // flow-typed version: <>/rollup-plugin-uglify_v^6.0.2/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'rollup-plugin-uglify' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'rollup-plugin-uglify' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'rollup-plugin-uglify/transform' { declare module.exports: any; } // Filename aliases declare module 'rollup-plugin-uglify/index' { declare module.exports: $Exports<'rollup-plugin-uglify'>; } declare module 'rollup-plugin-uglify/index.js' { declare module.exports: $Exports<'rollup-plugin-uglify'>; } declare module 'rollup-plugin-uglify/transform.js' { declare module.exports: $Exports<'rollup-plugin-uglify/transform'>; } ================================================ FILE: flow-typed/npm/rollup_vx.x.x.js ================================================ // flow-typed signature: acf41fbc16a69f037ded92e622069f8b // flow-typed version: <>/rollup_v^1.15.5/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'rollup' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'rollup' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'rollup/dist/rollup.browser.es' { declare module.exports: any; } declare module 'rollup/dist/rollup.browser' { declare module.exports: any; } declare module 'rollup/dist/rollup.es' { declare module.exports: any; } declare module 'rollup/dist/rollup' { declare module.exports: any; } // Filename aliases declare module 'rollup/dist/rollup.browser.es.js' { declare module.exports: $Exports<'rollup/dist/rollup.browser.es'>; } declare module 'rollup/dist/rollup.browser.js' { declare module.exports: $Exports<'rollup/dist/rollup.browser'>; } declare module 'rollup/dist/rollup.es.js' { declare module.exports: $Exports<'rollup/dist/rollup.es'>; } declare module 'rollup/dist/rollup.js' { declare module.exports: $Exports<'rollup/dist/rollup'>; } ================================================ FILE: flow-typed/npm/semantic-release_vx.x.x.js ================================================ // flow-typed signature: b1a0c4515f99586d90968e6dff37d3ba // flow-typed version: <>/semantic-release_v^15.13.16/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'semantic-release' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'semantic-release' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'semantic-release/bin/semantic-release' { declare module.exports: any; } declare module 'semantic-release/cli' { declare module.exports: any; } declare module 'semantic-release/lib/definitions/constants' { declare module.exports: any; } declare module 'semantic-release/lib/definitions/errors' { declare module.exports: any; } declare module 'semantic-release/lib/definitions/plugins' { declare module.exports: any; } declare module 'semantic-release/lib/get-commits' { declare module.exports: any; } declare module 'semantic-release/lib/get-config' { declare module.exports: any; } declare module 'semantic-release/lib/get-error' { declare module.exports: any; } declare module 'semantic-release/lib/get-git-auth-url' { declare module.exports: any; } declare module 'semantic-release/lib/get-last-release' { declare module.exports: any; } declare module 'semantic-release/lib/get-logger' { declare module.exports: any; } declare module 'semantic-release/lib/get-next-version' { declare module.exports: any; } declare module 'semantic-release/lib/git' { declare module.exports: any; } declare module 'semantic-release/lib/hide-sensitive' { declare module.exports: any; } declare module 'semantic-release/lib/plugins/index' { declare module.exports: any; } declare module 'semantic-release/lib/plugins/normalize' { declare module.exports: any; } declare module 'semantic-release/lib/plugins/pipeline' { declare module.exports: any; } declare module 'semantic-release/lib/plugins/utils' { declare module.exports: any; } declare module 'semantic-release/lib/utils' { declare module.exports: any; } declare module 'semantic-release/lib/verify' { declare module.exports: any; } // Filename aliases declare module 'semantic-release/bin/semantic-release.js' { declare module.exports: $Exports<'semantic-release/bin/semantic-release'>; } declare module 'semantic-release/cli.js' { declare module.exports: $Exports<'semantic-release/cli'>; } declare module 'semantic-release/index' { declare module.exports: $Exports<'semantic-release'>; } declare module 'semantic-release/index.js' { declare module.exports: $Exports<'semantic-release'>; } declare module 'semantic-release/lib/definitions/constants.js' { declare module.exports: $Exports<'semantic-release/lib/definitions/constants'>; } declare module 'semantic-release/lib/definitions/errors.js' { declare module.exports: $Exports<'semantic-release/lib/definitions/errors'>; } declare module 'semantic-release/lib/definitions/plugins.js' { declare module.exports: $Exports<'semantic-release/lib/definitions/plugins'>; } declare module 'semantic-release/lib/get-commits.js' { declare module.exports: $Exports<'semantic-release/lib/get-commits'>; } declare module 'semantic-release/lib/get-config.js' { declare module.exports: $Exports<'semantic-release/lib/get-config'>; } declare module 'semantic-release/lib/get-error.js' { declare module.exports: $Exports<'semantic-release/lib/get-error'>; } declare module 'semantic-release/lib/get-git-auth-url.js' { declare module.exports: $Exports<'semantic-release/lib/get-git-auth-url'>; } declare module 'semantic-release/lib/get-last-release.js' { declare module.exports: $Exports<'semantic-release/lib/get-last-release'>; } declare module 'semantic-release/lib/get-logger.js' { declare module.exports: $Exports<'semantic-release/lib/get-logger'>; } declare module 'semantic-release/lib/get-next-version.js' { declare module.exports: $Exports<'semantic-release/lib/get-next-version'>; } declare module 'semantic-release/lib/git.js' { declare module.exports: $Exports<'semantic-release/lib/git'>; } declare module 'semantic-release/lib/hide-sensitive.js' { declare module.exports: $Exports<'semantic-release/lib/hide-sensitive'>; } declare module 'semantic-release/lib/plugins/index.js' { declare module.exports: $Exports<'semantic-release/lib/plugins/index'>; } declare module 'semantic-release/lib/plugins/normalize.js' { declare module.exports: $Exports<'semantic-release/lib/plugins/normalize'>; } declare module 'semantic-release/lib/plugins/pipeline.js' { declare module.exports: $Exports<'semantic-release/lib/plugins/pipeline'>; } declare module 'semantic-release/lib/plugins/utils.js' { declare module.exports: $Exports<'semantic-release/lib/plugins/utils'>; } declare module 'semantic-release/lib/utils.js' { declare module.exports: $Exports<'semantic-release/lib/utils'>; } declare module 'semantic-release/lib/verify.js' { declare module.exports: $Exports<'semantic-release/lib/verify'>; } ================================================ FILE: flow-typed/npm/shx_vx.x.x.js ================================================ // flow-typed signature: dcd344b5c4dbbce7262dbd22fc511565 // flow-typed version: <>/shx_v^0.3.2/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'shx' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'shx' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'shx/lib/cli' { declare module.exports: any; } declare module 'shx/lib/config' { declare module.exports: any; } declare module 'shx/lib/help' { declare module.exports: any; } declare module 'shx/lib/plugin-true-false' { declare module.exports: any; } declare module 'shx/lib/printCmdRet' { declare module.exports: any; } declare module 'shx/lib/shx' { declare module.exports: any; } // Filename aliases declare module 'shx/lib/cli.js' { declare module.exports: $Exports<'shx/lib/cli'>; } declare module 'shx/lib/config.js' { declare module.exports: $Exports<'shx/lib/config'>; } declare module 'shx/lib/help.js' { declare module.exports: $Exports<'shx/lib/help'>; } declare module 'shx/lib/plugin-true-false.js' { declare module.exports: $Exports<'shx/lib/plugin-true-false'>; } declare module 'shx/lib/printCmdRet.js' { declare module.exports: $Exports<'shx/lib/printCmdRet'>; } declare module 'shx/lib/shx.js' { declare module.exports: $Exports<'shx/lib/shx'>; } ================================================ FILE: flow-typed/npm/tsgen_vx.x.x.js ================================================ // flow-typed signature: f07c1744ef4451ec50749b239692d187 // flow-typed version: <>/tsgen_v1.3.0/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'tsgen' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'tsgen' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'tsgen/lib/__test__/any-type.test' { declare module.exports: any; } declare module 'tsgen/lib/__test__/common-js-default-export.test' { declare module.exports: any; } declare module 'tsgen/lib/__test__/index.test' { declare module.exports: any; } declare module 'tsgen/lib/__test__/jest-types.test' { declare module.exports: any; } declare module 'tsgen/lib/__test__/optional.test' { declare module.exports: any; } declare module 'tsgen/lib/__test__/tuples.test' { declare module.exports: any; } declare module 'tsgen/lib/build' { declare module.exports: any; } declare module 'tsgen/lib/cli' { declare module.exports: any; } declare module 'tsgen/lib/Context' { declare module.exports: any; } declare module 'tsgen/lib/index' { declare module.exports: any; } declare module 'tsgen/lib/printers/AnyTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/ArrayTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/ArrowFunctionExpression' { declare module.exports: any; } declare module 'tsgen/lib/printers/BinaryExpression' { declare module.exports: any; } declare module 'tsgen/lib/printers/BooleanLiteral' { declare module.exports: any; } declare module 'tsgen/lib/printers/BooleanTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/CallExpression' { declare module.exports: any; } declare module 'tsgen/lib/printers/ConditionalExpression' { declare module.exports: any; } declare module 'tsgen/lib/printers/DeclareClass' { declare module.exports: any; } declare module 'tsgen/lib/printers/DeclareFunction' { declare module.exports: any; } declare module 'tsgen/lib/printers/ExistentialTypeParam' { declare module.exports: any; } declare module 'tsgen/lib/printers/ExportSpecifier' { declare module.exports: any; } declare module 'tsgen/lib/printers/FunctionDeclaration' { declare module.exports: any; } declare module 'tsgen/lib/printers/FunctionExpression' { declare module.exports: any; } declare module 'tsgen/lib/printers/FunctionTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/GenericTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/Identifier' { declare module.exports: any; } declare module 'tsgen/lib/printers/ImportDefaultSpecifier' { declare module.exports: any; } declare module 'tsgen/lib/printers/ImportSpecifier' { declare module.exports: any; } declare module 'tsgen/lib/printers/index' { declare module.exports: any; } declare module 'tsgen/lib/printers/InterfaceDeclaration' { declare module.exports: any; } declare module 'tsgen/lib/printers/IntersectionTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/LogicalExpression' { declare module.exports: any; } declare module 'tsgen/lib/printers/MemberExpression' { declare module.exports: any; } declare module 'tsgen/lib/printers/MixedTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/NullableTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/NullLiteralTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/NumberTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/NumericLiteral' { declare module.exports: any; } declare module 'tsgen/lib/printers/NumericLiteralTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/ObjectExpression' { declare module.exports: any; } declare module 'tsgen/lib/printers/ObjectProperty' { declare module.exports: any; } declare module 'tsgen/lib/printers/ObjectTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/ObjectTypeCallProperty' { declare module.exports: any; } declare module 'tsgen/lib/printers/ObjectTypeIndexer' { declare module.exports: any; } declare module 'tsgen/lib/printers/ObjectTypeProperty' { declare module.exports: any; } declare module 'tsgen/lib/printers/SingleImportDeclaration' { declare module.exports: any; } declare module 'tsgen/lib/printers/SingleVariableDeclaration' { declare module.exports: any; } declare module 'tsgen/lib/printers/StringLiteral' { declare module.exports: any; } declare module 'tsgen/lib/printers/StringLiteralTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/StringTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/TemplateLiteral' { declare module.exports: any; } declare module 'tsgen/lib/printers/TupleTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/TypeAlias' { declare module.exports: any; } declare module 'tsgen/lib/printers/TypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/TypeCastExpression' { declare module.exports: any; } declare module 'tsgen/lib/printers/TypeofTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/TypeParameterInstantiation' { declare module.exports: any; } declare module 'tsgen/lib/printers/UnionTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/printers/VoidTypeAnnotation' { declare module.exports: any; } declare module 'tsgen/lib/walkers/ClassDeclaration' { declare module.exports: any; } declare module 'tsgen/lib/walkers/DeclareClass' { declare module.exports: any; } declare module 'tsgen/lib/walkers/DeclareFunction' { declare module.exports: any; } declare module 'tsgen/lib/walkers/DeclareVariable' { declare module.exports: any; } declare module 'tsgen/lib/walkers/ExportDefaultDeclaration' { declare module.exports: any; } declare module 'tsgen/lib/walkers/ExportNamedDeclaration' { declare module.exports: any; } declare module 'tsgen/lib/walkers/ExpressionStatement' { declare module.exports: any; } declare module 'tsgen/lib/walkers/FunctionDeclaration' { declare module.exports: any; } declare module 'tsgen/lib/walkers/IfStatement' { declare module.exports: any; } declare module 'tsgen/lib/walkers/ImportDeclaration' { declare module.exports: any; } declare module 'tsgen/lib/walkers/index' { declare module.exports: any; } declare module 'tsgen/lib/walkers/InterfaceDeclaration' { declare module.exports: any; } declare module 'tsgen/lib/walkers/TryStatement' { declare module.exports: any; } declare module 'tsgen/lib/walkers/TypeAlias' { declare module.exports: any; } declare module 'tsgen/lib/walkers/VariableDeclaration' { declare module.exports: any; } // Filename aliases declare module 'tsgen/lib/__test__/any-type.test.js' { declare module.exports: $Exports<'tsgen/lib/__test__/any-type.test'>; } declare module 'tsgen/lib/__test__/common-js-default-export.test.js' { declare module.exports: $Exports<'tsgen/lib/__test__/common-js-default-export.test'>; } declare module 'tsgen/lib/__test__/index.test.js' { declare module.exports: $Exports<'tsgen/lib/__test__/index.test'>; } declare module 'tsgen/lib/__test__/jest-types.test.js' { declare module.exports: $Exports<'tsgen/lib/__test__/jest-types.test'>; } declare module 'tsgen/lib/__test__/optional.test.js' { declare module.exports: $Exports<'tsgen/lib/__test__/optional.test'>; } declare module 'tsgen/lib/__test__/tuples.test.js' { declare module.exports: $Exports<'tsgen/lib/__test__/tuples.test'>; } declare module 'tsgen/lib/build.js' { declare module.exports: $Exports<'tsgen/lib/build'>; } declare module 'tsgen/lib/cli.js' { declare module.exports: $Exports<'tsgen/lib/cli'>; } declare module 'tsgen/lib/Context.js' { declare module.exports: $Exports<'tsgen/lib/Context'>; } declare module 'tsgen/lib/index.js' { declare module.exports: $Exports<'tsgen/lib/index'>; } declare module 'tsgen/lib/printers/AnyTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/AnyTypeAnnotation'>; } declare module 'tsgen/lib/printers/ArrayTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/ArrayTypeAnnotation'>; } declare module 'tsgen/lib/printers/ArrowFunctionExpression.js' { declare module.exports: $Exports<'tsgen/lib/printers/ArrowFunctionExpression'>; } declare module 'tsgen/lib/printers/BinaryExpression.js' { declare module.exports: $Exports<'tsgen/lib/printers/BinaryExpression'>; } declare module 'tsgen/lib/printers/BooleanLiteral.js' { declare module.exports: $Exports<'tsgen/lib/printers/BooleanLiteral'>; } declare module 'tsgen/lib/printers/BooleanTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/BooleanTypeAnnotation'>; } declare module 'tsgen/lib/printers/CallExpression.js' { declare module.exports: $Exports<'tsgen/lib/printers/CallExpression'>; } declare module 'tsgen/lib/printers/ConditionalExpression.js' { declare module.exports: $Exports<'tsgen/lib/printers/ConditionalExpression'>; } declare module 'tsgen/lib/printers/DeclareClass.js' { declare module.exports: $Exports<'tsgen/lib/printers/DeclareClass'>; } declare module 'tsgen/lib/printers/DeclareFunction.js' { declare module.exports: $Exports<'tsgen/lib/printers/DeclareFunction'>; } declare module 'tsgen/lib/printers/ExistentialTypeParam.js' { declare module.exports: $Exports<'tsgen/lib/printers/ExistentialTypeParam'>; } declare module 'tsgen/lib/printers/ExportSpecifier.js' { declare module.exports: $Exports<'tsgen/lib/printers/ExportSpecifier'>; } declare module 'tsgen/lib/printers/FunctionDeclaration.js' { declare module.exports: $Exports<'tsgen/lib/printers/FunctionDeclaration'>; } declare module 'tsgen/lib/printers/FunctionExpression.js' { declare module.exports: $Exports<'tsgen/lib/printers/FunctionExpression'>; } declare module 'tsgen/lib/printers/FunctionTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/FunctionTypeAnnotation'>; } declare module 'tsgen/lib/printers/GenericTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/GenericTypeAnnotation'>; } declare module 'tsgen/lib/printers/Identifier.js' { declare module.exports: $Exports<'tsgen/lib/printers/Identifier'>; } declare module 'tsgen/lib/printers/ImportDefaultSpecifier.js' { declare module.exports: $Exports<'tsgen/lib/printers/ImportDefaultSpecifier'>; } declare module 'tsgen/lib/printers/ImportSpecifier.js' { declare module.exports: $Exports<'tsgen/lib/printers/ImportSpecifier'>; } declare module 'tsgen/lib/printers/index.js' { declare module.exports: $Exports<'tsgen/lib/printers/index'>; } declare module 'tsgen/lib/printers/InterfaceDeclaration.js' { declare module.exports: $Exports<'tsgen/lib/printers/InterfaceDeclaration'>; } declare module 'tsgen/lib/printers/IntersectionTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/IntersectionTypeAnnotation'>; } declare module 'tsgen/lib/printers/LogicalExpression.js' { declare module.exports: $Exports<'tsgen/lib/printers/LogicalExpression'>; } declare module 'tsgen/lib/printers/MemberExpression.js' { declare module.exports: $Exports<'tsgen/lib/printers/MemberExpression'>; } declare module 'tsgen/lib/printers/MixedTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/MixedTypeAnnotation'>; } declare module 'tsgen/lib/printers/NullableTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/NullableTypeAnnotation'>; } declare module 'tsgen/lib/printers/NullLiteralTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/NullLiteralTypeAnnotation'>; } declare module 'tsgen/lib/printers/NumberTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/NumberTypeAnnotation'>; } declare module 'tsgen/lib/printers/NumericLiteral.js' { declare module.exports: $Exports<'tsgen/lib/printers/NumericLiteral'>; } declare module 'tsgen/lib/printers/NumericLiteralTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/NumericLiteralTypeAnnotation'>; } declare module 'tsgen/lib/printers/ObjectExpression.js' { declare module.exports: $Exports<'tsgen/lib/printers/ObjectExpression'>; } declare module 'tsgen/lib/printers/ObjectProperty.js' { declare module.exports: $Exports<'tsgen/lib/printers/ObjectProperty'>; } declare module 'tsgen/lib/printers/ObjectTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/ObjectTypeAnnotation'>; } declare module 'tsgen/lib/printers/ObjectTypeCallProperty.js' { declare module.exports: $Exports<'tsgen/lib/printers/ObjectTypeCallProperty'>; } declare module 'tsgen/lib/printers/ObjectTypeIndexer.js' { declare module.exports: $Exports<'tsgen/lib/printers/ObjectTypeIndexer'>; } declare module 'tsgen/lib/printers/ObjectTypeProperty.js' { declare module.exports: $Exports<'tsgen/lib/printers/ObjectTypeProperty'>; } declare module 'tsgen/lib/printers/SingleImportDeclaration.js' { declare module.exports: $Exports<'tsgen/lib/printers/SingleImportDeclaration'>; } declare module 'tsgen/lib/printers/SingleVariableDeclaration.js' { declare module.exports: $Exports<'tsgen/lib/printers/SingleVariableDeclaration'>; } declare module 'tsgen/lib/printers/StringLiteral.js' { declare module.exports: $Exports<'tsgen/lib/printers/StringLiteral'>; } declare module 'tsgen/lib/printers/StringLiteralTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/StringLiteralTypeAnnotation'>; } declare module 'tsgen/lib/printers/StringTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/StringTypeAnnotation'>; } declare module 'tsgen/lib/printers/TemplateLiteral.js' { declare module.exports: $Exports<'tsgen/lib/printers/TemplateLiteral'>; } declare module 'tsgen/lib/printers/TupleTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/TupleTypeAnnotation'>; } declare module 'tsgen/lib/printers/TypeAlias.js' { declare module.exports: $Exports<'tsgen/lib/printers/TypeAlias'>; } declare module 'tsgen/lib/printers/TypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/TypeAnnotation'>; } declare module 'tsgen/lib/printers/TypeCastExpression.js' { declare module.exports: $Exports<'tsgen/lib/printers/TypeCastExpression'>; } declare module 'tsgen/lib/printers/TypeofTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/TypeofTypeAnnotation'>; } declare module 'tsgen/lib/printers/TypeParameterInstantiation.js' { declare module.exports: $Exports<'tsgen/lib/printers/TypeParameterInstantiation'>; } declare module 'tsgen/lib/printers/UnionTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/UnionTypeAnnotation'>; } declare module 'tsgen/lib/printers/VoidTypeAnnotation.js' { declare module.exports: $Exports<'tsgen/lib/printers/VoidTypeAnnotation'>; } declare module 'tsgen/lib/walkers/ClassDeclaration.js' { declare module.exports: $Exports<'tsgen/lib/walkers/ClassDeclaration'>; } declare module 'tsgen/lib/walkers/DeclareClass.js' { declare module.exports: $Exports<'tsgen/lib/walkers/DeclareClass'>; } declare module 'tsgen/lib/walkers/DeclareFunction.js' { declare module.exports: $Exports<'tsgen/lib/walkers/DeclareFunction'>; } declare module 'tsgen/lib/walkers/DeclareVariable.js' { declare module.exports: $Exports<'tsgen/lib/walkers/DeclareVariable'>; } declare module 'tsgen/lib/walkers/ExportDefaultDeclaration.js' { declare module.exports: $Exports<'tsgen/lib/walkers/ExportDefaultDeclaration'>; } declare module 'tsgen/lib/walkers/ExportNamedDeclaration.js' { declare module.exports: $Exports<'tsgen/lib/walkers/ExportNamedDeclaration'>; } declare module 'tsgen/lib/walkers/ExpressionStatement.js' { declare module.exports: $Exports<'tsgen/lib/walkers/ExpressionStatement'>; } declare module 'tsgen/lib/walkers/FunctionDeclaration.js' { declare module.exports: $Exports<'tsgen/lib/walkers/FunctionDeclaration'>; } declare module 'tsgen/lib/walkers/IfStatement.js' { declare module.exports: $Exports<'tsgen/lib/walkers/IfStatement'>; } declare module 'tsgen/lib/walkers/ImportDeclaration.js' { declare module.exports: $Exports<'tsgen/lib/walkers/ImportDeclaration'>; } declare module 'tsgen/lib/walkers/index.js' { declare module.exports: $Exports<'tsgen/lib/walkers/index'>; } declare module 'tsgen/lib/walkers/InterfaceDeclaration.js' { declare module.exports: $Exports<'tsgen/lib/walkers/InterfaceDeclaration'>; } declare module 'tsgen/lib/walkers/TryStatement.js' { declare module.exports: $Exports<'tsgen/lib/walkers/TryStatement'>; } declare module 'tsgen/lib/walkers/TypeAlias.js' { declare module.exports: $Exports<'tsgen/lib/walkers/TypeAlias'>; } declare module 'tsgen/lib/walkers/VariableDeclaration.js' { declare module.exports: $Exports<'tsgen/lib/walkers/VariableDeclaration'>; } ================================================ FILE: flow-typed/npm/typescript_v3.3.x.js ================================================ // flow-typed signature: c76c624ba956befc8600f3a037a7c0a9 // flow-typed version: 257092c42c/typescript_v3.3.x/flow_>=v0.42.x declare module "typescript" { declare var versionMajorMinor: "3.3"; // "3.3"; declare var version: string; declare type MapLike = { [index: string]: T }; declare class SortedReadonlyArray extends $ReadOnlyArray { __sortedArrayBrand: any } declare class SortedArray extends Array { __sortedArrayBrand: any } declare class ReadonlyMap { get(key: string): T | void, has(key: string): boolean, forEach(action: (value: T, key: string) => void): void, +size: number, keys(): Iterator, values(): Iterator, entries(): Iterator<[string, T]> } declare class Map extends ReadonlyMap { set(key: string, value: T): this, delete(key: string): boolean, clear(): void } declare type Iterator = { next(): | { value: T, done: false } | { value: empty, done: true } }; declare type Push = { push(...values: T[]): void }; declare type Path = string & { __pathBrand: any }; declare type TextRange = { pos: number, end: number }; declare type JsDocSyntaxKind = | typeof SyntaxKind.EndOfFileToken | typeof SyntaxKind.WhitespaceTrivia | typeof SyntaxKind.AtToken | typeof SyntaxKind.NewLineTrivia | typeof SyntaxKind.AsteriskToken | typeof SyntaxKind.OpenBraceToken | typeof SyntaxKind.CloseBraceToken | typeof SyntaxKind.LessThanToken | typeof SyntaxKind.OpenBracketToken | typeof SyntaxKind.CloseBracketToken | typeof SyntaxKind.EqualsToken | typeof SyntaxKind.CommaToken | typeof SyntaxKind.DotToken | typeof SyntaxKind.Identifier | typeof SyntaxKind.NoSubstitutionTemplateLiteral | typeof SyntaxKind.Unknown | KeywordSyntaxKind; declare type KeywordSyntaxKind = | typeof SyntaxKind.AbstractKeyword | typeof SyntaxKind.AnyKeyword | typeof SyntaxKind.AsKeyword | typeof SyntaxKind.BigIntKeyword | typeof SyntaxKind.BooleanKeyword | typeof SyntaxKind.BreakKeyword | typeof SyntaxKind.CaseKeyword | typeof SyntaxKind.CatchKeyword | typeof SyntaxKind.ClassKeyword | typeof SyntaxKind.ContinueKeyword | typeof SyntaxKind.ConstKeyword | typeof SyntaxKind.ConstructorKeyword | typeof SyntaxKind.DebuggerKeyword | typeof SyntaxKind.DeclareKeyword | typeof SyntaxKind.DefaultKeyword | typeof SyntaxKind.DeleteKeyword | typeof SyntaxKind.DoKeyword | typeof SyntaxKind.ElseKeyword | typeof SyntaxKind.EnumKeyword | typeof SyntaxKind.ExportKeyword | typeof SyntaxKind.ExtendsKeyword | typeof SyntaxKind.FalseKeyword | typeof SyntaxKind.FinallyKeyword | typeof SyntaxKind.ForKeyword | typeof SyntaxKind.FromKeyword | typeof SyntaxKind.FunctionKeyword | typeof SyntaxKind.GetKeyword | typeof SyntaxKind.IfKeyword | typeof SyntaxKind.ImplementsKeyword | typeof SyntaxKind.ImportKeyword | typeof SyntaxKind.InKeyword | typeof SyntaxKind.InferKeyword | typeof SyntaxKind.InstanceOfKeyword | typeof SyntaxKind.InterfaceKeyword | typeof SyntaxKind.IsKeyword | typeof SyntaxKind.KeyOfKeyword | typeof SyntaxKind.LetKeyword | typeof SyntaxKind.ModuleKeyword | typeof SyntaxKind.NamespaceKeyword | typeof SyntaxKind.NeverKeyword | typeof SyntaxKind.NewKeyword | typeof SyntaxKind.NullKeyword | typeof SyntaxKind.NumberKeyword | typeof SyntaxKind.ObjectKeyword | typeof SyntaxKind.PackageKeyword | typeof SyntaxKind.PrivateKeyword | typeof SyntaxKind.ProtectedKeyword | typeof SyntaxKind.PublicKeyword | typeof SyntaxKind.ReadonlyKeyword | typeof SyntaxKind.RequireKeyword | typeof SyntaxKind.GlobalKeyword | typeof SyntaxKind.ReturnKeyword | typeof SyntaxKind.SetKeyword | typeof SyntaxKind.StaticKeyword | typeof SyntaxKind.StringKeyword | typeof SyntaxKind.SuperKeyword | typeof SyntaxKind.SwitchKeyword | typeof SyntaxKind.SymbolKeyword | typeof SyntaxKind.ThisKeyword | typeof SyntaxKind.ThrowKeyword | typeof SyntaxKind.TrueKeyword | typeof SyntaxKind.TryKeyword | typeof SyntaxKind.TypeKeyword | typeof SyntaxKind.TypeOfKeyword | typeof SyntaxKind.UndefinedKeyword | typeof SyntaxKind.UniqueKeyword | typeof SyntaxKind.UnknownKeyword | typeof SyntaxKind.VarKeyword | typeof SyntaxKind.VoidKeyword | typeof SyntaxKind.WhileKeyword | typeof SyntaxKind.WithKeyword | typeof SyntaxKind.YieldKeyword | typeof SyntaxKind.AsyncKeyword | typeof SyntaxKind.AwaitKeyword | typeof SyntaxKind.OfKeyword; declare type JsxTokenSyntaxKind = | typeof SyntaxKind.LessThanSlashToken | typeof SyntaxKind.EndOfFileToken | typeof SyntaxKind.ConflictMarkerTrivia | typeof SyntaxKind.JsxText | typeof SyntaxKind.JsxTextAllWhiteSpaces | typeof SyntaxKind.OpenBraceToken | typeof SyntaxKind.LessThanToken; declare var SyntaxKind: { +Unknown: 0, // 0 +EndOfFileToken: 1, // 1 +SingleLineCommentTrivia: 2, // 2 +MultiLineCommentTrivia: 3, // 3 +NewLineTrivia: 4, // 4 +WhitespaceTrivia: 5, // 5 +ShebangTrivia: 6, // 6 +ConflictMarkerTrivia: 7, // 7 +NumericLiteral: 8, // 8 +BigIntLiteral: 9, // 9 +StringLiteral: 10, // 10 +JsxText: 11, // 11 +JsxTextAllWhiteSpaces: 12, // 12 +RegularExpressionLiteral: 13, // 13 +NoSubstitutionTemplateLiteral: 14, // 14 +TemplateHead: 15, // 15 +TemplateMiddle: 16, // 16 +TemplateTail: 17, // 17 +OpenBraceToken: 18, // 18 +CloseBraceToken: 19, // 19 +OpenParenToken: 20, // 20 +CloseParenToken: 21, // 21 +OpenBracketToken: 22, // 22 +CloseBracketToken: 23, // 23 +DotToken: 24, // 24 +DotDotDotToken: 25, // 25 +SemicolonToken: 26, // 26 +CommaToken: 27, // 27 +LessThanToken: 28, // 28 +LessThanSlashToken: 29, // 29 +GreaterThanToken: 30, // 30 +LessThanEqualsToken: 31, // 31 +GreaterThanEqualsToken: 32, // 32 +EqualsEqualsToken: 33, // 33 +ExclamationEqualsToken: 34, // 34 +EqualsEqualsEqualsToken: 35, // 35 +ExclamationEqualsEqualsToken: 36, // 36 +EqualsGreaterThanToken: 37, // 37 +PlusToken: 38, // 38 +MinusToken: 39, // 39 +AsteriskToken: 40, // 40 +AsteriskAsteriskToken: 41, // 41 +SlashToken: 42, // 42 +PercentToken: 43, // 43 +PlusPlusToken: 44, // 44 +MinusMinusToken: 45, // 45 +LessThanLessThanToken: 46, // 46 +GreaterThanGreaterThanToken: 47, // 47 +GreaterThanGreaterThanGreaterThanToken: 48, // 48 +AmpersandToken: 49, // 49 +BarToken: 50, // 50 +CaretToken: 51, // 51 +ExclamationToken: 52, // 52 +TildeToken: 53, // 53 +AmpersandAmpersandToken: 54, // 54 +BarBarToken: 55, // 55 +QuestionToken: 56, // 56 +ColonToken: 57, // 57 +AtToken: 58, // 58 +EqualsToken: 59, // 59 +PlusEqualsToken: 60, // 60 +MinusEqualsToken: 61, // 61 +AsteriskEqualsToken: 62, // 62 +AsteriskAsteriskEqualsToken: 63, // 63 +SlashEqualsToken: 64, // 64 +PercentEqualsToken: 65, // 65 +LessThanLessThanEqualsToken: 66, // 66 +GreaterThanGreaterThanEqualsToken: 67, // 67 +GreaterThanGreaterThanGreaterThanEqualsToken: 68, // 68 +AmpersandEqualsToken: 69, // 69 +BarEqualsToken: 70, // 70 +CaretEqualsToken: 71, // 71 +Identifier: 72, // 72 +BreakKeyword: 73, // 73 +CaseKeyword: 74, // 74 +CatchKeyword: 75, // 75 +ClassKeyword: 76, // 76 +ConstKeyword: 77, // 77 +ContinueKeyword: 78, // 78 +DebuggerKeyword: 79, // 79 +DefaultKeyword: 80, // 80 +DeleteKeyword: 81, // 81 +DoKeyword: 82, // 82 +ElseKeyword: 83, // 83 +EnumKeyword: 84, // 84 +ExportKeyword: 85, // 85 +ExtendsKeyword: 86, // 86 +FalseKeyword: 87, // 87 +FinallyKeyword: 88, // 88 +ForKeyword: 89, // 89 +FunctionKeyword: 90, // 90 +IfKeyword: 91, // 91 +ImportKeyword: 92, // 92 +InKeyword: 93, // 93 +InstanceOfKeyword: 94, // 94 +NewKeyword: 95, // 95 +NullKeyword: 96, // 96 +ReturnKeyword: 97, // 97 +SuperKeyword: 98, // 98 +SwitchKeyword: 99, // 99 +ThisKeyword: 100, // 100 +ThrowKeyword: 101, // 101 +TrueKeyword: 102, // 102 +TryKeyword: 103, // 103 +TypeOfKeyword: 104, // 104 +VarKeyword: 105, // 105 +VoidKeyword: 106, // 106 +WhileKeyword: 107, // 107 +WithKeyword: 108, // 108 +ImplementsKeyword: 109, // 109 +InterfaceKeyword: 110, // 110 +LetKeyword: 111, // 111 +PackageKeyword: 112, // 112 +PrivateKeyword: 113, // 113 +ProtectedKeyword: 114, // 114 +PublicKeyword: 115, // 115 +StaticKeyword: 116, // 116 +YieldKeyword: 117, // 117 +AbstractKeyword: 118, // 118 +AsKeyword: 119, // 119 +AnyKeyword: 120, // 120 +AsyncKeyword: 121, // 121 +AwaitKeyword: 122, // 122 +BooleanKeyword: 123, // 123 +ConstructorKeyword: 124, // 124 +DeclareKeyword: 125, // 125 +GetKeyword: 126, // 126 +InferKeyword: 127, // 127 +IsKeyword: 128, // 128 +KeyOfKeyword: 129, // 129 +ModuleKeyword: 130, // 130 +NamespaceKeyword: 131, // 131 +NeverKeyword: 132, // 132 +ReadonlyKeyword: 133, // 133 +RequireKeyword: 134, // 134 +NumberKeyword: 135, // 135 +ObjectKeyword: 136, // 136 +SetKeyword: 137, // 137 +StringKeyword: 138, // 138 +SymbolKeyword: 139, // 139 +TypeKeyword: 140, // 140 +UndefinedKeyword: 141, // 141 +UniqueKeyword: 142, // 142 +UnknownKeyword: 143, // 143 +FromKeyword: 144, // 144 +GlobalKeyword: 145, // 145 +BigIntKeyword: 146, // 146 +OfKeyword: 147, // 147 +QualifiedName: 148, // 148 +ComputedPropertyName: 149, // 149 +TypeParameter: 150, // 150 +Parameter: 151, // 151 +Decorator: 152, // 152 +PropertySignature: 153, // 153 +PropertyDeclaration: 154, // 154 +MethodSignature: 155, // 155 +MethodDeclaration: 156, // 156 +Constructor: 157, // 157 +GetAccessor: 158, // 158 +SetAccessor: 159, // 159 +CallSignature: 160, // 160 +ConstructSignature: 161, // 161 +IndexSignature: 162, // 162 +TypePredicate: 163, // 163 +TypeReference: 164, // 164 +FunctionType: 165, // 165 +ConstructorType: 166, // 166 +TypeQuery: 167, // 167 +TypeLiteral: 168, // 168 +ArrayType: 169, // 169 +TupleType: 170, // 170 +OptionalType: 171, // 171 +RestType: 172, // 172 +UnionType: 173, // 173 +IntersectionType: 174, // 174 +ConditionalType: 175, // 175 +InferType: 176, // 176 +ParenthesizedType: 177, // 177 +ThisType: 178, // 178 +TypeOperator: 179, // 179 +IndexedAccessType: 180, // 180 +MappedType: 181, // 181 +LiteralType: 182, // 182 +ImportType: 183, // 183 +ObjectBindingPattern: 184, // 184 +ArrayBindingPattern: 185, // 185 +BindingElement: 186, // 186 +ArrayLiteralExpression: 187, // 187 +ObjectLiteralExpression: 188, // 188 +PropertyAccessExpression: 189, // 189 +ElementAccessExpression: 190, // 190 +CallExpression: 191, // 191 +NewExpression: 192, // 192 +TaggedTemplateExpression: 193, // 193 +TypeAssertionExpression: 194, // 194 +ParenthesizedExpression: 195, // 195 +FunctionExpression: 196, // 196 +ArrowFunction: 197, // 197 +DeleteExpression: 198, // 198 +TypeOfExpression: 199, // 199 +VoidExpression: 200, // 200 +AwaitExpression: 201, // 201 +PrefixUnaryExpression: 202, // 202 +PostfixUnaryExpression: 203, // 203 +BinaryExpression: 204, // 204 +ConditionalExpression: 205, // 205 +TemplateExpression: 206, // 206 +YieldExpression: 207, // 207 +SpreadElement: 208, // 208 +ClassExpression: 209, // 209 +OmittedExpression: 210, // 210 +ExpressionWithTypeArguments: 211, // 211 +AsExpression: 212, // 212 +NonNullExpression: 213, // 213 +MetaProperty: 214, // 214 +SyntheticExpression: 215, // 215 +TemplateSpan: 216, // 216 +SemicolonClassElement: 217, // 217 +Block: 218, // 218 +VariableStatement: 219, // 219 +EmptyStatement: 220, // 220 +ExpressionStatement: 221, // 221 +IfStatement: 222, // 222 +DoStatement: 223, // 223 +WhileStatement: 224, // 224 +ForStatement: 225, // 225 +ForInStatement: 226, // 226 +ForOfStatement: 227, // 227 +ContinueStatement: 228, // 228 +BreakStatement: 229, // 229 +ReturnStatement: 230, // 230 +WithStatement: 231, // 231 +SwitchStatement: 232, // 232 +LabeledStatement: 233, // 233 +ThrowStatement: 234, // 234 +TryStatement: 235, // 235 +DebuggerStatement: 236, // 236 +VariableDeclaration: 237, // 237 +VariableDeclarationList: 238, // 238 +FunctionDeclaration: 239, // 239 +ClassDeclaration: 240, // 240 +InterfaceDeclaration: 241, // 241 +TypeAliasDeclaration: 242, // 242 +EnumDeclaration: 243, // 243 +ModuleDeclaration: 244, // 244 +ModuleBlock: 245, // 245 +CaseBlock: 246, // 246 +NamespaceExportDeclaration: 247, // 247 +ImportEqualsDeclaration: 248, // 248 +ImportDeclaration: 249, // 249 +ImportClause: 250, // 250 +NamespaceImport: 251, // 251 +NamedImports: 252, // 252 +ImportSpecifier: 253, // 253 +ExportAssignment: 254, // 254 +ExportDeclaration: 255, // 255 +NamedExports: 256, // 256 +ExportSpecifier: 257, // 257 +MissingDeclaration: 258, // 258 +ExternalModuleReference: 259, // 259 +JsxElement: 260, // 260 +JsxSelfClosingElement: 261, // 261 +JsxOpeningElement: 262, // 262 +JsxClosingElement: 263, // 263 +JsxFragment: 264, // 264 +JsxOpeningFragment: 265, // 265 +JsxClosingFragment: 266, // 266 +JsxAttribute: 267, // 267 +JsxAttributes: 268, // 268 +JsxSpreadAttribute: 269, // 269 +JsxExpression: 270, // 270 +CaseClause: 271, // 271 +DefaultClause: 272, // 272 +HeritageClause: 273, // 273 +CatchClause: 274, // 274 +PropertyAssignment: 275, // 275 +ShorthandPropertyAssignment: 276, // 276 +SpreadAssignment: 277, // 277 +EnumMember: 278, // 278 +SourceFile: 279, // 279 +Bundle: 280, // 280 +UnparsedSource: 281, // 281 +InputFiles: 282, // 282 +JSDocTypeExpression: 283, // 283 +JSDocAllType: 284, // 284 +JSDocUnknownType: 285, // 285 +JSDocNullableType: 286, // 286 +JSDocNonNullableType: 287, // 287 +JSDocOptionalType: 288, // 288 +JSDocFunctionType: 289, // 289 +JSDocVariadicType: 290, // 290 +JSDocComment: 291, // 291 +JSDocTypeLiteral: 292, // 292 +JSDocSignature: 293, // 293 +JSDocTag: 294, // 294 +JSDocAugmentsTag: 295, // 295 +JSDocClassTag: 296, // 296 +JSDocCallbackTag: 297, // 297 +JSDocEnumTag: 298, // 298 +JSDocParameterTag: 299, // 299 +JSDocReturnTag: 300, // 300 +JSDocThisTag: 301, // 301 +JSDocTypeTag: 302, // 302 +JSDocTemplateTag: 303, // 303 +JSDocTypedefTag: 304, // 304 +JSDocPropertyTag: 305, // 305 +SyntaxList: 306, // 306 +NotEmittedStatement: 307, // 307 +PartiallyEmittedExpression: 308, // 308 +CommaListExpression: 309, // 309 +MergeDeclarationMarker: 310, // 310 +EndOfDeclarationMarker: 311, // 311 +Count: 312, // 312 +FirstAssignment: 59, // 59 +LastAssignment: 71, // 71 +FirstCompoundAssignment: 60, // 60 +LastCompoundAssignment: 71, // 71 +FirstReservedWord: 73, // 73 +LastReservedWord: 108, // 108 +FirstKeyword: 73, // 73 +LastKeyword: 147, // 147 +FirstFutureReservedWord: 109, // 109 +LastFutureReservedWord: 117, // 117 +FirstTypeNode: 163, // 163 +LastTypeNode: 183, // 183 +FirstPunctuation: 18, // 18 +LastPunctuation: 71, // 71 +FirstToken: 0, // 0 +LastToken: 147, // 147 +FirstTriviaToken: 2, // 2 +LastTriviaToken: 7, // 7 +FirstLiteralToken: 8, // 8 +LastLiteralToken: 14, // 14 +FirstTemplateToken: 14, // 14 +LastTemplateToken: 17, // 17 +FirstBinaryOperator: 28, // 28 +LastBinaryOperator: 71, // 71 +FirstNode: 148, // 148 +FirstJSDocNode: 283, // 283 +LastJSDocNode: 305, // 305 +FirstJSDocTagNode: 294, // 294 +LastJSDocTagNode: 305 // 305 }; declare var NodeFlags: { +None: 0, // 0 +Let: 1, // 1 +Const: 2, // 2 +NestedNamespace: 4, // 4 +Synthesized: 8, // 8 +Namespace: 16, // 16 +ExportContext: 32, // 32 +ContainsThis: 64, // 64 +HasImplicitReturn: 128, // 128 +HasExplicitReturn: 256, // 256 +GlobalAugmentation: 512, // 512 +HasAsyncFunctions: 1024, // 1024 +DisallowInContext: 2048, // 2048 +YieldContext: 4096, // 4096 +DecoratorContext: 8192, // 8192 +AwaitContext: 16384, // 16384 +ThisNodeHasError: 32768, // 32768 +JavaScriptFile: 65536, // 65536 +ThisNodeOrAnySubNodesHasError: 131072, // 131072 +HasAggregatedChildData: 262144, // 262144 +JSDoc: 2097152, // 2097152 +JsonFile: 16777216, // 16777216 +BlockScoped: 3, // 3 +ReachabilityCheckFlags: 384, // 384 +ReachabilityAndEmitFlags: 1408, // 1408 +ContextFlags: 12679168, // 12679168 +TypeExcludesFlags: 20480 // 20480 }; declare var ModifierFlags: { +None: 0, // 0 +Export: 1, // 1 +Ambient: 2, // 2 +Public: 4, // 4 +Private: 8, // 8 +Protected: 16, // 16 +Static: 32, // 32 +Readonly: 64, // 64 +Abstract: 128, // 128 +Async: 256, // 256 +Default: 512, // 512 +Const: 2048, // 2048 +HasComputedFlags: 536870912, // 536870912 +AccessibilityModifier: 28, // 28 +ParameterPropertyModifier: 92, // 92 +NonPublicAccessibilityModifier: 24, // 24 +TypeScriptModifier: 2270, // 2270 +ExportDefault: 513, // 513 +All: 3071 // 3071 }; declare var JsxFlags: { +None: 0, // 0 +IntrinsicNamedElement: 1, // 1 +IntrinsicIndexedElement: 2, // 2 +IntrinsicElement: 3 // 3 }; declare type Node = { ...$Exact, kind: $Values, flags: $Values, decorators?: NodeArray, modifiers?: ModifiersArray, parent: any, getSourceFile(): SourceFile, getChildCount(sourceFile?: SourceFile): number, getChildAt(index: number, sourceFile?: SourceFile): Node, getChildren(sourceFile?: SourceFile): Node[], getStart(sourceFile?: SourceFile, includeJsDocComment?: boolean): number, getFullStart(): number, getEnd(): number, getWidth(sourceFile?: SourceFileLike): number, getFullWidth(): number, getLeadingTriviaWidth(sourceFile?: SourceFile): number, getFullText(sourceFile?: SourceFile): string, getText(sourceFile?: SourceFile): string, getFirstToken(sourceFile?: SourceFile): Node | void, getLastToken(sourceFile?: SourceFile): Node | void, forEachChild( cbNode: (node: Node) => T | void, cbNodeArray?: (nodes: NodeArray) => T | void ): T | void }; declare type JSDocContainer = {}; declare type HasJSDoc = | ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | ExportDeclaration | EndOfFileToken; declare type HasType = | SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType; declare type HasInitializer = | HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute; declare type HasExpressionInitializer = | VariableDeclaration | ParameterDeclaration | BindingElement | PropertySignature | PropertyDeclaration | PropertyAssignment | EnumMember; declare type NodeArray> = { ...$Exact, hasTrailingComma?: boolean } & $ReadOnlyArray; declare type Token> = { ...$Exact, kind: TKind }; declare type DotDotDotToken = Token; declare type QuestionToken = Token; declare type ExclamationToken = Token; declare type ColonToken = Token; declare type EqualsToken = Token; declare type AsteriskToken = Token; declare type EqualsGreaterThanToken = Token< typeof SyntaxKind.EqualsGreaterThanToken >; declare type EndOfFileToken = Token & JSDocContainer; declare type ReadonlyToken = Token; declare type AwaitKeywordToken = Token; declare type PlusToken = Token; declare type MinusToken = Token; declare type Modifier = | Token | Token | Token | Token | Token | Token | Token | Token | Token | Token | Token; declare type ModifiersArray = NodeArray; declare type Identifier = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.Identifier, escapedText: __String, originalKeywordKind?: $Values, isInJSDocNamespace?: boolean, +text: string }; declare type TransientIdentifier = { ...$Exact, resolvedSymbol: Symbol }; declare type QualifiedName = { ...$Exact, kind: typeof SyntaxKind.QualifiedName, left: EntityName, right: Identifier }; declare type EntityName = Identifier | QualifiedName; declare type PropertyName = | Identifier | StringLiteral | NumericLiteral | ComputedPropertyName; declare type DeclarationName = | Identifier | StringLiteralLike | NumericLiteral | ComputedPropertyName | BindingPattern; declare type Declaration = { ...$Exact, _declarationBrand: any }; declare type NamedDeclaration = { ...$Exact, name?: DeclarationName }; declare type DeclarationStatement = { ...$Exact, ...$Exact, name?: Identifier | StringLiteral | NumericLiteral }; declare type ComputedPropertyName = { ...$Exact, parent: Declaration, kind: typeof SyntaxKind.ComputedPropertyName, expression: Expression }; declare type Decorator = { ...$Exact, kind: typeof SyntaxKind.Decorator, parent: NamedDeclaration, expression: LeftHandSideExpression }; declare type TypeParameterDeclaration = { ...$Exact, kind: typeof SyntaxKind.TypeParameter, parent: DeclarationWithTypeParameterChildren | InferTypeNode, name: Identifier, constraint?: TypeNode, default?: TypeNode, expression?: Expression }; declare type SignatureDeclarationBase = { ...$Exact, ...$Exact, kind: $ElementType, name?: PropertyName, typeParameters?: NodeArray, parameters: NodeArray, type?: TypeNode }; declare type SignatureDeclaration = | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | AccessorDeclaration | FunctionExpression | ArrowFunction; declare type CallSignatureDeclaration = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.CallSignature }; declare type ConstructSignatureDeclaration = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.ConstructSignature }; declare type BindingName = Identifier | BindingPattern; declare type VariableDeclaration = { ...$Exact, kind: typeof SyntaxKind.VariableDeclaration, parent: VariableDeclarationList | CatchClause, name: BindingName, exclamationToken?: ExclamationToken, type?: TypeNode, initializer?: Expression }; declare type VariableDeclarationList = { ...$Exact, kind: typeof SyntaxKind.VariableDeclarationList, parent: VariableStatement | ForStatement | ForOfStatement | ForInStatement, declarations: NodeArray }; declare type ParameterDeclaration = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.Parameter, parent: SignatureDeclaration, dotDotDotToken?: DotDotDotToken, name: BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression }; declare type BindingElement = { ...$Exact, kind: typeof SyntaxKind.BindingElement, parent: BindingPattern, propertyName?: PropertyName, dotDotDotToken?: DotDotDotToken, name: BindingName, initializer?: Expression }; declare type PropertySignature = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.PropertySignature, name: PropertyName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression }; declare type PropertyDeclaration = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.PropertyDeclaration, parent: ClassLikeDeclaration, name: PropertyName, questionToken?: QuestionToken, exclamationToken?: ExclamationToken, type?: TypeNode, initializer?: Expression }; declare type ObjectLiteralElement = { ...$Exact, _objectLiteralBrandBrand: any, name?: PropertyName }; declare type ObjectLiteralElementLike = | PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | MethodDeclaration | AccessorDeclaration; declare type PropertyAssignment = { ...$Exact, ...$Exact, parent: ObjectLiteralExpression, kind: typeof SyntaxKind.PropertyAssignment, name: PropertyName, questionToken?: QuestionToken, initializer: Expression }; declare type ShorthandPropertyAssignment = { ...$Exact, ...$Exact, parent: ObjectLiteralExpression, kind: typeof SyntaxKind.ShorthandPropertyAssignment, name: Identifier, questionToken?: QuestionToken, exclamationToken?: ExclamationToken, equalsToken?: Token, objectAssignmentInitializer?: Expression }; declare type SpreadAssignment = { ...$Exact, ...$Exact, parent: ObjectLiteralExpression, kind: typeof SyntaxKind.SpreadAssignment, expression: Expression }; declare type VariableLikeDeclaration = | VariableDeclaration | ParameterDeclaration | BindingElement | PropertyDeclaration | PropertyAssignment | PropertySignature | JsxAttribute | ShorthandPropertyAssignment | EnumMember | JSDocPropertyTag | JSDocParameterTag; declare type PropertyLikeDeclaration = { ...$Exact, name: PropertyName }; declare type ObjectBindingPattern = { ...$Exact, kind: typeof SyntaxKind.ObjectBindingPattern, parent: VariableDeclaration | ParameterDeclaration | BindingElement, elements: NodeArray }; declare type ArrayBindingPattern = { ...$Exact, kind: typeof SyntaxKind.ArrayBindingPattern, parent: VariableDeclaration | ParameterDeclaration | BindingElement, elements: NodeArray }; declare type BindingPattern = ObjectBindingPattern | ArrayBindingPattern; declare type ArrayBindingElement = BindingElement | OmittedExpression; declare type FunctionLikeDeclarationBase = { ...$Exact, _functionLikeDeclarationBrand: any, asteriskToken?: AsteriskToken, questionToken?: QuestionToken, exclamationToken?: ExclamationToken, body?: Block | Expression }; declare type FunctionLikeDeclaration = | FunctionDeclaration | MethodDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | ConstructorDeclaration | FunctionExpression | ArrowFunction; declare type FunctionLike = SignatureDeclaration; declare type FunctionDeclaration = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.FunctionDeclaration, name?: Identifier, body?: FunctionBody }; declare type MethodSignature = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.MethodSignature, parent: ObjectTypeDeclaration, name: PropertyName }; declare type MethodDeclaration = { ...$Exact, ...$Exact, ...$Exact, ...$Exact, kind: typeof SyntaxKind.MethodDeclaration, parent: ClassLikeDeclaration | ObjectLiteralExpression, name: PropertyName, body?: FunctionBody }; declare type ConstructorDeclaration = { ...$Exact, ...$Exact, ...$Exact, kind: typeof SyntaxKind.Constructor, parent: ClassLikeDeclaration, body?: FunctionBody }; declare type SemicolonClassElement = { ...$Exact, kind: typeof SyntaxKind.SemicolonClassElement, parent: ClassLikeDeclaration }; declare type GetAccessorDeclaration = { ...$Exact, ...$Exact, ...$Exact, ...$Exact, kind: typeof SyntaxKind.GetAccessor, parent: ClassLikeDeclaration | ObjectLiteralExpression, name: PropertyName, body?: FunctionBody }; declare type SetAccessorDeclaration = { ...$Exact, ...$Exact, ...$Exact, ...$Exact, kind: typeof SyntaxKind.SetAccessor, parent: ClassLikeDeclaration | ObjectLiteralExpression, name: PropertyName, body?: FunctionBody }; declare type AccessorDeclaration = | GetAccessorDeclaration | SetAccessorDeclaration; declare type IndexSignatureDeclaration = { ...$Exact, ...$Exact, ...$Exact, kind: typeof SyntaxKind.IndexSignature, parent: ObjectTypeDeclaration }; declare type TypeNode = { ...$Exact, _typeNodeBrand: any }; declare type KeywordTypeNode = { ...$Exact, kind: | typeof SyntaxKind.AnyKeyword | typeof SyntaxKind.UnknownKeyword | typeof SyntaxKind.NumberKeyword | typeof SyntaxKind.BigIntKeyword | typeof SyntaxKind.ObjectKeyword | typeof SyntaxKind.BooleanKeyword | typeof SyntaxKind.StringKeyword | typeof SyntaxKind.SymbolKeyword | typeof SyntaxKind.ThisKeyword | typeof SyntaxKind.VoidKeyword | typeof SyntaxKind.UndefinedKeyword | typeof SyntaxKind.NullKeyword | typeof SyntaxKind.NeverKeyword }; declare type ImportTypeNode = { ...$Exact, kind: typeof SyntaxKind.ImportType, isTypeOf?: boolean, argument: TypeNode, qualifier?: EntityName }; declare type ThisTypeNode = { ...$Exact, kind: typeof SyntaxKind.ThisType }; declare type FunctionOrConstructorTypeNode = | FunctionTypeNode | ConstructorTypeNode; declare type FunctionOrConstructorTypeNodeBase = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.FunctionType | typeof SyntaxKind.ConstructorType, type: TypeNode }; declare type FunctionTypeNode = { ...$Exact, kind: typeof SyntaxKind.FunctionType }; declare type ConstructorTypeNode = { ...$Exact, kind: typeof SyntaxKind.ConstructorType }; declare type NodeWithTypeArguments = { ...$Exact, typeArguments?: NodeArray }; declare type TypeReferenceType = | TypeReferenceNode | ExpressionWithTypeArguments; declare type TypeReferenceNode = { ...$Exact, kind: typeof SyntaxKind.TypeReference, typeName: EntityName }; declare type TypePredicateNode = { ...$Exact, kind: typeof SyntaxKind.TypePredicate, parent: SignatureDeclaration | JSDocTypeExpression, parameterName: Identifier | ThisTypeNode, type: TypeNode }; declare type TypeQueryNode = { ...$Exact, kind: typeof SyntaxKind.TypeQuery, exprName: EntityName }; declare type TypeLiteralNode = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.TypeLiteral, members: NodeArray }; declare type ArrayTypeNode = { ...$Exact, kind: typeof SyntaxKind.ArrayType, elementType: TypeNode }; declare type TupleTypeNode = { ...$Exact, kind: typeof SyntaxKind.TupleType, elementTypes: NodeArray }; declare type OptionalTypeNode = { ...$Exact, kind: typeof SyntaxKind.OptionalType, type: TypeNode }; declare type RestTypeNode = { ...$Exact, kind: typeof SyntaxKind.RestType, type: TypeNode }; declare type UnionOrIntersectionTypeNode = | UnionTypeNode | IntersectionTypeNode; declare type UnionTypeNode = { ...$Exact, kind: typeof SyntaxKind.UnionType, types: NodeArray }; declare type IntersectionTypeNode = { ...$Exact, kind: typeof SyntaxKind.IntersectionType, types: NodeArray }; declare type ConditionalTypeNode = { ...$Exact, kind: typeof SyntaxKind.ConditionalType, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode }; declare type InferTypeNode = { ...$Exact, kind: typeof SyntaxKind.InferType, typeParameter: TypeParameterDeclaration }; declare type ParenthesizedTypeNode = { ...$Exact, kind: typeof SyntaxKind.ParenthesizedType, type: TypeNode }; declare type TypeOperatorNode = { ...$Exact, kind: typeof SyntaxKind.TypeOperator, operator: typeof SyntaxKind.KeyOfKeyword | typeof SyntaxKind.UniqueKeyword, type: TypeNode }; declare type IndexedAccessTypeNode = { ...$Exact, kind: typeof SyntaxKind.IndexedAccessType, objectType: TypeNode, indexType: TypeNode }; declare type MappedTypeNode = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.MappedType, readonlyToken?: ReadonlyToken | PlusToken | MinusToken, typeParameter: TypeParameterDeclaration, questionToken?: QuestionToken | PlusToken | MinusToken, type?: TypeNode }; declare type LiteralTypeNode = { ...$Exact, kind: typeof SyntaxKind.LiteralType, literal: BooleanLiteral | LiteralExpression | PrefixUnaryExpression }; declare type StringLiteral = { ...$Exact, kind: typeof SyntaxKind.StringLiteral }; declare type StringLiteralLike = | StringLiteral | NoSubstitutionTemplateLiteral; declare type Expression = { ...$Exact, _expressionBrand: any }; declare type OmittedExpression = { ...$Exact, kind: typeof SyntaxKind.OmittedExpression }; declare type PartiallyEmittedExpression = { ...$Exact, kind: typeof SyntaxKind.PartiallyEmittedExpression, expression: Expression }; declare type UnaryExpression = { ...$Exact, _unaryExpressionBrand: any }; declare type IncrementExpression = UpdateExpression; declare type UpdateExpression = { ...$Exact, _updateExpressionBrand: any }; declare type PrefixUnaryOperator = | typeof SyntaxKind.PlusPlusToken | typeof SyntaxKind.MinusMinusToken | typeof SyntaxKind.PlusToken | typeof SyntaxKind.MinusToken | typeof SyntaxKind.TildeToken | typeof SyntaxKind.ExclamationToken; declare type PrefixUnaryExpression = { ...$Exact, kind: typeof SyntaxKind.PrefixUnaryExpression, operator: PrefixUnaryOperator, operand: UnaryExpression }; declare type PostfixUnaryOperator = | typeof SyntaxKind.PlusPlusToken | typeof SyntaxKind.MinusMinusToken; declare type PostfixUnaryExpression = { ...$Exact, kind: typeof SyntaxKind.PostfixUnaryExpression, operand: LeftHandSideExpression, operator: PostfixUnaryOperator }; declare type LeftHandSideExpression = { ...$Exact, _leftHandSideExpressionBrand: any }; declare type MemberExpression = { ...$Exact, _memberExpressionBrand: any }; declare type PrimaryExpression = { ...$Exact, _primaryExpressionBrand: any }; declare type NullLiteral = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.NullKeyword }; declare type BooleanLiteral = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.TrueKeyword | typeof SyntaxKind.FalseKeyword }; declare type ThisExpression = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.ThisKeyword }; declare type SuperExpression = { ...$Exact, kind: typeof SyntaxKind.SuperKeyword }; declare type ImportExpression = { ...$Exact, kind: typeof SyntaxKind.ImportKeyword }; declare type DeleteExpression = { ...$Exact, kind: typeof SyntaxKind.DeleteExpression, expression: UnaryExpression }; declare type TypeOfExpression = { ...$Exact, kind: typeof SyntaxKind.TypeOfExpression, expression: UnaryExpression }; declare type VoidExpression = { ...$Exact, kind: typeof SyntaxKind.VoidExpression, expression: UnaryExpression }; declare type AwaitExpression = { ...$Exact, kind: typeof SyntaxKind.AwaitExpression, expression: UnaryExpression }; declare type YieldExpression = { ...$Exact, kind: typeof SyntaxKind.YieldExpression, asteriskToken?: AsteriskToken, expression?: Expression }; declare type SyntheticExpression = { ...$Exact, kind: typeof SyntaxKind.SyntheticExpression, isSpread: boolean, type: Type }; declare type ExponentiationOperator = typeof SyntaxKind.AsteriskAsteriskToken; declare type MultiplicativeOperator = | typeof SyntaxKind.AsteriskToken | typeof SyntaxKind.SlashToken | typeof SyntaxKind.PercentToken; declare type MultiplicativeOperatorOrHigher = | ExponentiationOperator | MultiplicativeOperator; declare type AdditiveOperator = | typeof SyntaxKind.PlusToken | typeof SyntaxKind.MinusToken; declare type AdditiveOperatorOrHigher = | MultiplicativeOperatorOrHigher | AdditiveOperator; declare type ShiftOperator = | typeof SyntaxKind.LessThanLessThanToken | typeof SyntaxKind.GreaterThanGreaterThanToken | typeof SyntaxKind.GreaterThanGreaterThanGreaterThanToken; declare type ShiftOperatorOrHigher = AdditiveOperatorOrHigher | ShiftOperator; declare type RelationalOperator = | typeof SyntaxKind.LessThanToken | typeof SyntaxKind.LessThanEqualsToken | typeof SyntaxKind.GreaterThanToken | typeof SyntaxKind.GreaterThanEqualsToken | typeof SyntaxKind.InstanceOfKeyword | typeof SyntaxKind.InKeyword; declare type RelationalOperatorOrHigher = | ShiftOperatorOrHigher | RelationalOperator; declare type EqualityOperator = | typeof SyntaxKind.EqualsEqualsToken | typeof SyntaxKind.EqualsEqualsEqualsToken | typeof SyntaxKind.ExclamationEqualsEqualsToken | typeof SyntaxKind.ExclamationEqualsToken; declare type EqualityOperatorOrHigher = | RelationalOperatorOrHigher | EqualityOperator; declare type BitwiseOperator = | typeof SyntaxKind.AmpersandToken | typeof SyntaxKind.BarToken | typeof SyntaxKind.CaretToken; declare type BitwiseOperatorOrHigher = | EqualityOperatorOrHigher | BitwiseOperator; declare type LogicalOperator = | typeof SyntaxKind.AmpersandAmpersandToken | typeof SyntaxKind.BarBarToken; declare type LogicalOperatorOrHigher = | BitwiseOperatorOrHigher | LogicalOperator; declare type CompoundAssignmentOperator = | typeof SyntaxKind.PlusEqualsToken | typeof SyntaxKind.MinusEqualsToken | typeof SyntaxKind.AsteriskAsteriskEqualsToken | typeof SyntaxKind.AsteriskEqualsToken | typeof SyntaxKind.SlashEqualsToken | typeof SyntaxKind.PercentEqualsToken | typeof SyntaxKind.AmpersandEqualsToken | typeof SyntaxKind.BarEqualsToken | typeof SyntaxKind.CaretEqualsToken | typeof SyntaxKind.LessThanLessThanEqualsToken | typeof SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken | typeof SyntaxKind.GreaterThanGreaterThanEqualsToken; declare type AssignmentOperator = | typeof SyntaxKind.EqualsToken | CompoundAssignmentOperator; declare type AssignmentOperatorOrHigher = | LogicalOperatorOrHigher | AssignmentOperator; declare type BinaryOperator = | AssignmentOperatorOrHigher | typeof SyntaxKind.CommaToken; declare type BinaryOperatorToken = Token; declare type BinaryExpression = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.BinaryExpression, left: Expression, operatorToken: BinaryOperatorToken, right: Expression }; declare type AssignmentOperatorToken = Token; declare type AssignmentExpression = { ...$Exact, left: LeftHandSideExpression, operatorToken: TOperator }; declare type ObjectDestructuringAssignment = { ...$Exact>, left: ObjectLiteralExpression }; declare type ArrayDestructuringAssignment = { ...$Exact>, left: ArrayLiteralExpression }; declare type DestructuringAssignment = | ObjectDestructuringAssignment | ArrayDestructuringAssignment; declare type BindingOrAssignmentElement = | VariableDeclaration | ParameterDeclaration | BindingElement | PropertyAssignment | ShorthandPropertyAssignment | SpreadAssignment | OmittedExpression | SpreadElement | ArrayLiteralExpression | ObjectLiteralExpression | AssignmentExpression | Identifier | PropertyAccessExpression | ElementAccessExpression; declare type BindingOrAssignmentElementRestIndicator = | DotDotDotToken | SpreadElement | SpreadAssignment; declare type BindingOrAssignmentElementTarget = | BindingOrAssignmentPattern | Identifier | PropertyAccessExpression | ElementAccessExpression | OmittedExpression; declare type ObjectBindingOrAssignmentPattern = | ObjectBindingPattern | ObjectLiteralExpression; declare type ArrayBindingOrAssignmentPattern = | ArrayBindingPattern | ArrayLiteralExpression; declare type AssignmentPattern = | ObjectLiteralExpression | ArrayLiteralExpression; declare type BindingOrAssignmentPattern = | ObjectBindingOrAssignmentPattern | ArrayBindingOrAssignmentPattern; declare type ConditionalExpression = { ...$Exact, kind: typeof SyntaxKind.ConditionalExpression, condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression }; declare type FunctionBody = Block; declare type ConciseBody = FunctionBody | Expression; declare type FunctionExpression = { ...$Exact, ...$Exact, ...$Exact, kind: typeof SyntaxKind.FunctionExpression, name?: Identifier, body: FunctionBody }; declare type ArrowFunction = { ...$Exact, ...$Exact, ...$Exact, kind: typeof SyntaxKind.ArrowFunction, equalsGreaterThanToken: EqualsGreaterThanToken, body: ConciseBody, name: empty }; declare type LiteralLikeNode = { ...$Exact, text: string, isUnterminated?: boolean, hasExtendedUnicodeEscape?: boolean }; declare type LiteralExpression = { ...$Exact, ...$Exact, _literalExpressionBrand: any }; declare type RegularExpressionLiteral = { ...$Exact, kind: typeof SyntaxKind.RegularExpressionLiteral }; declare type NoSubstitutionTemplateLiteral = { ...$Exact, kind: typeof SyntaxKind.NoSubstitutionTemplateLiteral }; declare type NumericLiteral = { ...$Exact, kind: typeof SyntaxKind.NumericLiteral }; declare type BigIntLiteral = { ...$Exact, kind: typeof SyntaxKind.BigIntLiteral }; declare type TemplateHead = { ...$Exact, kind: typeof SyntaxKind.TemplateHead, parent: TemplateExpression }; declare type TemplateMiddle = { ...$Exact, kind: typeof SyntaxKind.TemplateMiddle, parent: TemplateSpan }; declare type TemplateTail = { ...$Exact, kind: typeof SyntaxKind.TemplateTail, parent: TemplateSpan }; declare type TemplateLiteral = | TemplateExpression | NoSubstitutionTemplateLiteral; declare type TemplateExpression = { ...$Exact, kind: typeof SyntaxKind.TemplateExpression, head: TemplateHead, templateSpans: NodeArray }; declare type TemplateSpan = { ...$Exact, kind: typeof SyntaxKind.TemplateSpan, parent: TemplateExpression, expression: Expression, literal: TemplateMiddle | TemplateTail }; declare type ParenthesizedExpression = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.ParenthesizedExpression, expression: Expression }; declare type ArrayLiteralExpression = { ...$Exact, kind: typeof SyntaxKind.ArrayLiteralExpression, elements: NodeArray }; declare type SpreadElement = { ...$Exact, kind: typeof SyntaxKind.SpreadElement, parent: ArrayLiteralExpression | CallExpression | NewExpression, expression: Expression }; declare type ObjectLiteralExpressionBase = { ...$Exact, ...$Exact, properties: NodeArray }; declare type ObjectLiteralExpression = { ...$Exact>, kind: typeof SyntaxKind.ObjectLiteralExpression }; declare type EntityNameExpression = | Identifier | PropertyAccessEntityNameExpression; declare type EntityNameOrEntityNameExpression = | EntityName | EntityNameExpression; declare type PropertyAccessExpression = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.PropertyAccessExpression, expression: LeftHandSideExpression, name: Identifier }; declare type SuperPropertyAccessExpression = { ...$Exact, expression: SuperExpression }; declare type PropertyAccessEntityNameExpression = { ...$Exact, _propertyAccessExpressionLikeQualifiedNameBrand?: any, expression: EntityNameExpression }; declare type ElementAccessExpression = { ...$Exact, kind: typeof SyntaxKind.ElementAccessExpression, expression: LeftHandSideExpression, argumentExpression: Expression }; declare type SuperElementAccessExpression = { ...$Exact, expression: SuperExpression }; declare type SuperProperty = | SuperPropertyAccessExpression | SuperElementAccessExpression; declare type CallExpression = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.CallExpression, expression: LeftHandSideExpression, typeArguments?: NodeArray, arguments: NodeArray }; declare type SuperCall = { ...$Exact, expression: SuperExpression }; declare type ImportCall = { ...$Exact, expression: ImportExpression }; declare type ExpressionWithTypeArguments = { ...$Exact, kind: typeof SyntaxKind.ExpressionWithTypeArguments, parent: HeritageClause | JSDocAugmentsTag, expression: LeftHandSideExpression }; declare type NewExpression = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.NewExpression, expression: LeftHandSideExpression, typeArguments?: NodeArray, arguments?: NodeArray }; declare type TaggedTemplateExpression = { ...$Exact, kind: typeof SyntaxKind.TaggedTemplateExpression, tag: LeftHandSideExpression, typeArguments?: NodeArray, template: TemplateLiteral }; declare type CallLikeExpression = | CallExpression | NewExpression | TaggedTemplateExpression | Decorator | JsxOpeningLikeElement; declare type AsExpression = { ...$Exact, kind: typeof SyntaxKind.AsExpression, expression: Expression, type: TypeNode }; declare type TypeAssertion = { ...$Exact, kind: typeof SyntaxKind.TypeAssertionExpression, type: TypeNode, expression: UnaryExpression }; declare type AssertionExpression = TypeAssertion | AsExpression; declare type NonNullExpression = { ...$Exact, kind: typeof SyntaxKind.NonNullExpression, expression: Expression }; declare type MetaProperty = { ...$Exact, kind: typeof SyntaxKind.MetaProperty, keywordToken: | typeof SyntaxKind.NewKeyword | typeof SyntaxKind.ImportKeyword, name: Identifier }; declare type JsxElement = { ...$Exact, kind: typeof SyntaxKind.JsxElement, openingElement: JsxOpeningElement, children: NodeArray, closingElement: JsxClosingElement }; declare type JsxOpeningLikeElement = | JsxSelfClosingElement | JsxOpeningElement; declare type JsxAttributeLike = JsxAttribute | JsxSpreadAttribute; declare type JsxTagNameExpression = | Identifier | ThisExpression | JsxTagNamePropertyAccess; declare type JsxTagNamePropertyAccess = { ...$Exact, expression: JsxTagNameExpression }; declare type JsxAttributes = { ...$Exact>, parent: JsxOpeningLikeElement }; declare type JsxOpeningElement = { ...$Exact, kind: typeof SyntaxKind.JsxOpeningElement, parent: JsxElement, tagName: JsxTagNameExpression, typeArguments?: NodeArray, attributes: JsxAttributes }; declare type JsxSelfClosingElement = { ...$Exact, kind: typeof SyntaxKind.JsxSelfClosingElement, tagName: JsxTagNameExpression, typeArguments?: NodeArray, attributes: JsxAttributes }; declare type JsxFragment = { ...$Exact, kind: typeof SyntaxKind.JsxFragment, openingFragment: JsxOpeningFragment, children: NodeArray, closingFragment: JsxClosingFragment }; declare type JsxOpeningFragment = { ...$Exact, kind: typeof SyntaxKind.JsxOpeningFragment, parent: JsxFragment }; declare type JsxClosingFragment = { ...$Exact, kind: typeof SyntaxKind.JsxClosingFragment, parent: JsxFragment }; declare type JsxAttribute = { ...$Exact, kind: typeof SyntaxKind.JsxAttribute, parent: JsxAttributes, name: Identifier, initializer?: StringLiteral | JsxExpression }; declare type JsxSpreadAttribute = { ...$Exact, kind: typeof SyntaxKind.JsxSpreadAttribute, parent: JsxAttributes, expression: Expression }; declare type JsxClosingElement = { ...$Exact, kind: typeof SyntaxKind.JsxClosingElement, parent: JsxElement, tagName: JsxTagNameExpression }; declare type JsxExpression = { ...$Exact, kind: typeof SyntaxKind.JsxExpression, parent: JsxElement | JsxAttributeLike, dotDotDotToken?: Token, expression?: Expression }; declare type JsxText = { ...$Exact, kind: typeof SyntaxKind.JsxText, containsOnlyWhiteSpaces: boolean, parent: JsxElement }; declare type JsxChild = | JsxText | JsxExpression | JsxElement | JsxSelfClosingElement | JsxFragment; declare type Statement = { ...$Exact, _statementBrand: any }; declare type NotEmittedStatement = { ...$Exact, kind: typeof SyntaxKind.NotEmittedStatement }; declare type CommaListExpression = { ...$Exact, kind: typeof SyntaxKind.CommaListExpression, elements: NodeArray }; declare type EmptyStatement = { ...$Exact, kind: typeof SyntaxKind.EmptyStatement }; declare type DebuggerStatement = { ...$Exact, kind: typeof SyntaxKind.DebuggerStatement }; declare type MissingDeclaration = { ...$Exact, kind: typeof SyntaxKind.MissingDeclaration, name?: Identifier }; declare type BlockLike = | SourceFile | Block | ModuleBlock | CaseOrDefaultClause; declare type Block = { ...$Exact, kind: typeof SyntaxKind.Block, statements: NodeArray }; declare type VariableStatement = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.VariableStatement, declarationList: VariableDeclarationList }; declare type ExpressionStatement = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.ExpressionStatement, expression: Expression }; declare type IfStatement = { ...$Exact, kind: typeof SyntaxKind.IfStatement, expression: Expression, thenStatement: Statement, elseStatement?: Statement }; declare type IterationStatement = { ...$Exact, statement: Statement }; declare type DoStatement = { ...$Exact, kind: typeof SyntaxKind.DoStatement, expression: Expression }; declare type WhileStatement = { ...$Exact, kind: typeof SyntaxKind.WhileStatement, expression: Expression }; declare type ForInitializer = VariableDeclarationList | Expression; declare type ForStatement = { ...$Exact, kind: typeof SyntaxKind.ForStatement, initializer?: ForInitializer, condition?: Expression, incrementor?: Expression }; declare type ForInOrOfStatement = ForInStatement | ForOfStatement; declare type ForInStatement = { ...$Exact, kind: typeof SyntaxKind.ForInStatement, initializer: ForInitializer, expression: Expression }; declare type ForOfStatement = { ...$Exact, kind: typeof SyntaxKind.ForOfStatement, awaitModifier?: AwaitKeywordToken, initializer: ForInitializer, expression: Expression }; declare type BreakStatement = { ...$Exact, kind: typeof SyntaxKind.BreakStatement, label?: Identifier }; declare type ContinueStatement = { ...$Exact, kind: typeof SyntaxKind.ContinueStatement, label?: Identifier }; declare type BreakOrContinueStatement = BreakStatement | ContinueStatement; declare type ReturnStatement = { ...$Exact, kind: typeof SyntaxKind.ReturnStatement, expression?: Expression }; declare type WithStatement = { ...$Exact, kind: typeof SyntaxKind.WithStatement, expression: Expression, statement: Statement }; declare type SwitchStatement = { ...$Exact, kind: typeof SyntaxKind.SwitchStatement, expression: Expression, caseBlock: CaseBlock, possiblyExhaustive?: boolean }; declare type CaseBlock = { ...$Exact, kind: typeof SyntaxKind.CaseBlock, parent: SwitchStatement, clauses: NodeArray }; declare type CaseClause = { ...$Exact, kind: typeof SyntaxKind.CaseClause, parent: CaseBlock, expression: Expression, statements: NodeArray }; declare type DefaultClause = { ...$Exact, kind: typeof SyntaxKind.DefaultClause, parent: CaseBlock, statements: NodeArray }; declare type CaseOrDefaultClause = CaseClause | DefaultClause; declare type LabeledStatement = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.LabeledStatement, label: Identifier, statement: Statement }; declare type ThrowStatement = { ...$Exact, kind: typeof SyntaxKind.ThrowStatement, expression?: Expression }; declare type TryStatement = { ...$Exact, kind: typeof SyntaxKind.TryStatement, tryBlock: Block, catchClause?: CatchClause, finallyBlock?: Block }; declare type CatchClause = { ...$Exact, kind: typeof SyntaxKind.CatchClause, parent: TryStatement, variableDeclaration?: VariableDeclaration, block: Block }; declare type ObjectTypeDeclaration = | ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode; declare type DeclarationWithTypeParameters = | DeclarationWithTypeParameterChildren | JSDocTypedefTag | JSDocCallbackTag | JSDocSignature; declare type DeclarationWithTypeParameterChildren = | SignatureDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | JSDocTemplateTag; declare type ClassLikeDeclarationBase = { ...$Exact, ...$Exact, kind: | typeof SyntaxKind.ClassDeclaration | typeof SyntaxKind.ClassExpression, name?: Identifier, typeParameters?: NodeArray, heritageClauses?: NodeArray, members: NodeArray }; declare type ClassDeclaration = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.ClassDeclaration, name?: Identifier }; declare type ClassExpression = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.ClassExpression }; declare type ClassLikeDeclaration = ClassDeclaration | ClassExpression; declare type ClassElement = { ...$Exact, _classElementBrand: any, name?: PropertyName }; declare type TypeElement = { ...$Exact, _typeElementBrand: any, name?: PropertyName, questionToken?: QuestionToken }; declare type InterfaceDeclaration = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.InterfaceDeclaration, name: Identifier, typeParameters?: NodeArray, heritageClauses?: NodeArray, members: NodeArray }; declare type HeritageClause = { ...$Exact, kind: typeof SyntaxKind.HeritageClause, parent: InterfaceDeclaration | ClassLikeDeclaration, token: | typeof SyntaxKind.ExtendsKeyword | typeof SyntaxKind.ImplementsKeyword, types: NodeArray }; declare type TypeAliasDeclaration = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.TypeAliasDeclaration, name: Identifier, typeParameters?: NodeArray, type: TypeNode }; declare type EnumMember = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.EnumMember, parent: EnumDeclaration, name: PropertyName, initializer?: Expression }; declare type EnumDeclaration = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.EnumDeclaration, name: Identifier, members: NodeArray }; declare type ModuleName = Identifier | StringLiteral; declare type ModuleBody = NamespaceBody | JSDocNamespaceBody; declare type ModuleDeclaration = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.ModuleDeclaration, parent: ModuleBody | SourceFile, name: ModuleName, body?: ModuleBody | JSDocNamespaceDeclaration }; declare type NamespaceBody = ModuleBlock | NamespaceDeclaration; declare type NamespaceDeclaration = { ...$Exact, name: Identifier, body: NamespaceBody }; declare type JSDocNamespaceBody = Identifier | JSDocNamespaceDeclaration; declare type JSDocNamespaceDeclaration = { ...$Exact, name: Identifier, body?: JSDocNamespaceBody }; declare type ModuleBlock = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.ModuleBlock, parent: ModuleDeclaration, statements: NodeArray }; declare type ModuleReference = EntityName | ExternalModuleReference; declare type ImportEqualsDeclaration = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.ImportEqualsDeclaration, parent: SourceFile | ModuleBlock, name: Identifier, moduleReference: ModuleReference }; declare type ExternalModuleReference = { ...$Exact, kind: typeof SyntaxKind.ExternalModuleReference, parent: ImportEqualsDeclaration, expression: Expression }; declare type ImportDeclaration = { ...$Exact, kind: typeof SyntaxKind.ImportDeclaration, parent: SourceFile | ModuleBlock, importClause?: ImportClause, moduleSpecifier: Expression }; declare type NamedImportBindings = NamespaceImport | NamedImports; declare type ImportClause = { ...$Exact, kind: typeof SyntaxKind.ImportClause, parent: ImportDeclaration, name?: Identifier, namedBindings?: NamedImportBindings }; declare type NamespaceImport = { ...$Exact, kind: typeof SyntaxKind.NamespaceImport, parent: ImportClause, name: Identifier }; declare type NamespaceExportDeclaration = { ...$Exact, kind: typeof SyntaxKind.NamespaceExportDeclaration, name: Identifier }; declare type ExportDeclaration = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.ExportDeclaration, parent: SourceFile | ModuleBlock, exportClause?: NamedExports, moduleSpecifier?: Expression }; declare type NamedImports = { ...$Exact, kind: typeof SyntaxKind.NamedImports, parent: ImportClause, elements: NodeArray }; declare type NamedExports = { ...$Exact, kind: typeof SyntaxKind.NamedExports, parent: ExportDeclaration, elements: NodeArray }; declare type NamedImportsOrExports = NamedImports | NamedExports; declare type ImportSpecifier = { ...$Exact, kind: typeof SyntaxKind.ImportSpecifier, parent: NamedImports, propertyName?: Identifier, name: Identifier }; declare type ExportSpecifier = { ...$Exact, kind: typeof SyntaxKind.ExportSpecifier, parent: NamedExports, propertyName?: Identifier, name: Identifier }; declare type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; declare type ExportAssignment = { ...$Exact, kind: typeof SyntaxKind.ExportAssignment, parent: SourceFile, isExportEquals?: boolean, expression: Expression }; declare type FileReference = { ...$Exact, fileName: string }; declare type CheckJsDirective = { ...$Exact, enabled: boolean }; declare type CommentKind = | typeof SyntaxKind.SingleLineCommentTrivia | typeof SyntaxKind.MultiLineCommentTrivia; declare type CommentRange = { ...$Exact, hasTrailingNewLine?: boolean, kind: CommentKind }; declare type SynthesizedComment = { ...$Exact, text: string, pos: -1, end: -1 }; declare type JSDocTypeExpression = { ...$Exact, kind: typeof SyntaxKind.JSDocTypeExpression, type: TypeNode }; declare type JSDocType = { ...$Exact, _jsDocTypeBrand: any }; declare type JSDocAllType = { ...$Exact, kind: typeof SyntaxKind.JSDocAllType }; declare type JSDocUnknownType = { ...$Exact, kind: typeof SyntaxKind.JSDocUnknownType }; declare type JSDocNonNullableType = { ...$Exact, kind: typeof SyntaxKind.JSDocNonNullableType, type: TypeNode }; declare type JSDocNullableType = { ...$Exact, kind: typeof SyntaxKind.JSDocNullableType, type: TypeNode }; declare type JSDocOptionalType = { ...$Exact, kind: typeof SyntaxKind.JSDocOptionalType, type: TypeNode }; declare type JSDocFunctionType = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.JSDocFunctionType }; declare type JSDocVariadicType = { ...$Exact, kind: typeof SyntaxKind.JSDocVariadicType, type: TypeNode }; declare type JSDocTypeReferencingNode = | JSDocVariadicType | JSDocOptionalType | JSDocNullableType | JSDocNonNullableType; declare type JSDoc = { ...$Exact, kind: typeof SyntaxKind.JSDocComment, parent: HasJSDoc, tags?: NodeArray, comment?: string }; declare type JSDocTag = { ...$Exact, parent: JSDoc | JSDocTypeLiteral, tagName: Identifier, comment?: string }; declare type JSDocUnknownTag = { ...$Exact, kind: typeof SyntaxKind.JSDocTag }; declare type JSDocAugmentsTag = { ...$Exact, kind: typeof SyntaxKind.JSDocAugmentsTag, class: ExpressionWithTypeArguments & { expression: Identifier | PropertyAccessEntityNameExpression } }; declare type JSDocClassTag = { ...$Exact, kind: typeof SyntaxKind.JSDocClassTag }; declare type JSDocEnumTag = { ...$Exact, kind: typeof SyntaxKind.JSDocEnumTag, typeExpression?: JSDocTypeExpression }; declare type JSDocThisTag = { ...$Exact, kind: typeof SyntaxKind.JSDocThisTag, typeExpression?: JSDocTypeExpression }; declare type JSDocTemplateTag = { ...$Exact, kind: typeof SyntaxKind.JSDocTemplateTag, constraint: JSDocTypeExpression | void, typeParameters: NodeArray }; declare type JSDocReturnTag = { ...$Exact, kind: typeof SyntaxKind.JSDocReturnTag, typeExpression?: JSDocTypeExpression }; declare type JSDocTypeTag = { ...$Exact, kind: typeof SyntaxKind.JSDocTypeTag, typeExpression?: JSDocTypeExpression }; declare type JSDocTypedefTag = { ...$Exact, ...$Exact, parent: JSDoc, kind: typeof SyntaxKind.JSDocTypedefTag, fullName?: JSDocNamespaceDeclaration | Identifier, name?: Identifier, typeExpression?: JSDocTypeExpression | JSDocTypeLiteral }; declare type JSDocCallbackTag = { ...$Exact, ...$Exact, parent: JSDoc, kind: typeof SyntaxKind.JSDocCallbackTag, fullName?: JSDocNamespaceDeclaration | Identifier, name?: Identifier, typeExpression: JSDocSignature }; declare type JSDocSignature = { ...$Exact, ...$Exact, kind: typeof SyntaxKind.JSDocSignature, typeParameters?: $ReadOnlyArray, parameters: $ReadOnlyArray, type: JSDocReturnTag | void }; declare type JSDocPropertyLikeTag = { ...$Exact, ...$Exact, parent: JSDoc, name: EntityName, typeExpression?: JSDocTypeExpression, isNameFirst: boolean, isBracketed: boolean }; declare type JSDocPropertyTag = { ...$Exact, kind: typeof SyntaxKind.JSDocPropertyTag }; declare type JSDocParameterTag = { ...$Exact, kind: typeof SyntaxKind.JSDocParameterTag }; declare type JSDocTypeLiteral = { ...$Exact, kind: typeof SyntaxKind.JSDocTypeLiteral, jsDocPropertyTags?: $ReadOnlyArray, isArrayType?: boolean }; declare var FlowFlags: { +Unreachable: 1, // 1 +Start: 2, // 2 +BranchLabel: 4, // 4 +LoopLabel: 8, // 8 +Assignment: 16, // 16 +TrueCondition: 32, // 32 +FalseCondition: 64, // 64 +SwitchClause: 128, // 128 +ArrayMutation: 256, // 256 +Referenced: 512, // 512 +Shared: 1024, // 1024 +PreFinally: 2048, // 2048 +AfterFinally: 4096, // 4096 +Label: 12, // 12 +Condition: 96 // 96 }; declare type FlowLock = { locked?: boolean }; declare type AfterFinallyFlow = { ...$Exact, ...$Exact, antecedent: FlowNode }; declare type PreFinallyFlow = { ...$Exact, antecedent: FlowNode, lock: FlowLock }; declare type FlowNode = | AfterFinallyFlow | PreFinallyFlow | FlowStart | FlowLabel | FlowAssignment | FlowCondition | FlowSwitchClause | FlowArrayMutation; declare type FlowNodeBase = { flags: $Values, id?: number }; declare type FlowStart = { ...$Exact, container?: FunctionExpression | ArrowFunction | MethodDeclaration }; declare type FlowLabel = { ...$Exact, antecedents: FlowNode[] | void }; declare type FlowAssignment = { ...$Exact, node: Expression | VariableDeclaration | BindingElement, antecedent: FlowNode }; declare type FlowCondition = { ...$Exact, expression: Expression, antecedent: FlowNode }; declare type FlowSwitchClause = { ...$Exact, switchStatement: SwitchStatement, clauseStart: number, clauseEnd: number, antecedent: FlowNode }; declare type FlowArrayMutation = { ...$Exact, node: CallExpression | BinaryExpression, antecedent: FlowNode }; declare type FlowType = Type | IncompleteType; declare type IncompleteType = { flags: $Values, type: Type }; declare type AmdDependency = { path: string, name?: string }; declare type SourceFile = { ...$Exact, kind: typeof SyntaxKind.SourceFile, statements: NodeArray, endOfFileToken: Token, fileName: string, text: string, amdDependencies: $ReadOnlyArray, moduleName?: string, referencedFiles: $ReadOnlyArray, typeReferenceDirectives: $ReadOnlyArray, libReferenceDirectives: $ReadOnlyArray, languageVariant: $Values, isDeclarationFile: boolean, hasNoDefaultLib: boolean, languageVersion: $Values, getLineAndCharacterOfPosition(pos: number): LineAndCharacter, getLineEndOfPosition(pos: number): number, getLineStarts(): $ReadOnlyArray, getPositionOfLineAndCharacter(line: number, character: number): number, update(newText: string, textChangeRange: TextChangeRange): SourceFile }; declare type Bundle = { ...$Exact, kind: typeof SyntaxKind.Bundle, prepends: $ReadOnlyArray, sourceFiles: $ReadOnlyArray }; declare type InputFiles = { ...$Exact, kind: typeof SyntaxKind.InputFiles, javascriptPath?: string, javascriptText: string, javascriptMapPath?: string, javascriptMapText?: string, declarationPath?: string, declarationText: string, declarationMapPath?: string, declarationMapText?: string }; declare type UnparsedSource = { ...$Exact, kind: typeof SyntaxKind.UnparsedSource, fileName?: string, text: string, sourceMapPath?: string, sourceMapText?: string }; declare type JsonSourceFile = { ...$Exact, statements: NodeArray }; declare type TsConfigSourceFile = { ...$Exact, extendedSourceFiles?: string[] }; declare type JsonMinusNumericLiteral = { ...$Exact, kind: typeof SyntaxKind.PrefixUnaryExpression, operator: typeof SyntaxKind.MinusToken, operand: NumericLiteral }; declare type JsonObjectExpressionStatement = { ...$Exact, expression: | ObjectLiteralExpression | ArrayLiteralExpression | JsonMinusNumericLiteral | NumericLiteral | StringLiteral | BooleanLiteral | NullLiteral }; declare type ScriptReferenceHost = { getCompilerOptions(): CompilerOptions, getSourceFile(fileName: string): SourceFile | void, getSourceFileByPath(path: Path): SourceFile | void, getCurrentDirectory(): string }; declare type ParseConfigHost = { useCaseSensitiveFileNames: boolean, readDirectory( rootDir: string, extensions: $ReadOnlyArray, excludes: $ReadOnlyArray | void, includes: $ReadOnlyArray, depth?: number ): $ReadOnlyArray, fileExists(path: string): boolean, readFile(path: string): string | void, trace?: (s: string) => void }; declare type ResolvedConfigFileName = string & { _isResolvedConfigFileName: empty }; declare type WriteFileCallback = ( fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: $ReadOnlyArray ) => void; declare class OperationCanceledException {} declare type CancellationToken = { isCancellationRequested(): boolean, throwIfCancellationRequested(): void }; declare type Program = { ...$Exact, getRootFileNames(): $ReadOnlyArray, getSourceFiles(): $ReadOnlyArray, emit( targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers ): EmitResult, getOptionsDiagnostics( cancellationToken?: CancellationToken ): $ReadOnlyArray, getGlobalDiagnostics( cancellationToken?: CancellationToken ): $ReadOnlyArray, getSyntacticDiagnostics( sourceFile?: SourceFile, cancellationToken?: CancellationToken ): $ReadOnlyArray, getSemanticDiagnostics( sourceFile?: SourceFile, cancellationToken?: CancellationToken ): $ReadOnlyArray, getDeclarationDiagnostics( sourceFile?: SourceFile, cancellationToken?: CancellationToken ): $ReadOnlyArray, getConfigFileParsingDiagnostics(): $ReadOnlyArray, getTypeChecker(): TypeChecker, isSourceFileFromExternalLibrary(file: SourceFile): boolean, isSourceFileDefaultLibrary(file: SourceFile): boolean, getProjectReferences(): $ReadOnlyArray | void, getResolvedProjectReferences(): $ReadOnlyArray | void }; declare type ResolvedProjectReference = { commandLine: ParsedCommandLine, sourceFile: SourceFile, references?: $ReadOnlyArray }; declare type CustomTransformers = { before?: TransformerFactory[], after?: TransformerFactory[], afterDeclarations?: TransformerFactory[] }; declare type SourceMapSpan = { emittedLine: number, emittedColumn: number, sourceLine: number, sourceColumn: number, nameIndex?: number, sourceIndex: number }; declare var ExitStatus: { +Success: 0, // 0 +DiagnosticsPresent_OutputsSkipped: 1, // 1 +DiagnosticsPresent_OutputsGenerated: 2 // 2 }; declare type EmitResult = { emitSkipped: boolean, diagnostics: $ReadOnlyArray, emittedFiles?: string[] }; declare type TypeChecker = { getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type, getDeclaredTypeOfSymbol(symbol: Symbol): Type, getPropertiesOfType(type: Type): Symbol[], getPropertyOfType(type: Type, propertyName: string): Symbol | void, getIndexInfoOfType( type: Type, kind: $Values ): IndexInfo | void, getSignaturesOfType( type: Type, kind: $Values ): $ReadOnlyArray, getIndexTypeOfType( type: Type, kind: $Values ): Type | void, getBaseTypes(type: InterfaceType): BaseType[], getBaseTypeOfLiteralType(type: Type): Type, getWidenedType(type: Type): Type, getReturnTypeOfSignature(signature: Signature): Type, getNullableType(type: Type, flags: $Values): Type, getNonNullableType(type: Type): Type, typeToTypeNode( type: Type, enclosingDeclaration?: Node, flags?: $Values ): TypeNode | void, signatureToSignatureDeclaration( signature: Signature, kind: $Values, enclosingDeclaration?: Node, flags?: $Values ): | (SignatureDeclaration & { typeArguments?: NodeArray }) | void, indexInfoToIndexSignatureDeclaration( indexInfo: IndexInfo, kind: $Values, enclosingDeclaration?: Node, flags?: $Values ): IndexSignatureDeclaration | void, symbolToEntityName( symbol: Symbol, meaning: $Values, enclosingDeclaration?: Node, flags?: $Values ): EntityName | void, symbolToExpression( symbol: Symbol, meaning: $Values, enclosingDeclaration?: Node, flags?: $Values ): Expression | void, symbolToTypeParameterDeclarations( symbol: Symbol, enclosingDeclaration?: Node, flags?: $Values ): NodeArray | void, symbolToParameterDeclaration( symbol: Symbol, enclosingDeclaration?: Node, flags?: $Values ): ParameterDeclaration | void, typeParameterToDeclaration( parameter: TypeParameter, enclosingDeclaration?: Node, flags?: $Values ): TypeParameterDeclaration | void, getSymbolsInScope( location: Node, meaning: $Values ): Symbol[], getSymbolAtLocation(node: Node): Symbol | void, getSymbolsOfParameterPropertyDeclaration( parameter: ParameterDeclaration, parameterName: string ): Symbol[], getShorthandAssignmentValueSymbol(location: Node): Symbol | void, getExportSpecifierLocalTargetSymbol( location: ExportSpecifier ): Symbol | void, getExportSymbolOfSymbol(symbol: Symbol): Symbol, getPropertySymbolOfDestructuringAssignment( location: Identifier ): Symbol | void, getTypeAtLocation(node: Node): Type, getTypeFromTypeNode(node: TypeNode): Type, signatureToString( signature: Signature, enclosingDeclaration?: Node, flags?: $Values, kind?: $Values ): string, typeToString( type: Type, enclosingDeclaration?: Node, flags?: $Values ): string, symbolToString( symbol: Symbol, enclosingDeclaration?: Node, meaning?: $Values, flags?: $Values ): string, typePredicateToString( predicate: TypePredicate, enclosingDeclaration?: Node, flags?: $Values ): string, getFullyQualifiedName(symbol: Symbol): string, getAugmentedPropertiesOfType(type: Type): Symbol[], getRootSymbols(symbol: Symbol): $ReadOnlyArray, getContextualType(node: Expression): Type | void, getResolvedSignature( node: CallLikeExpression, candidatesOutArray?: Signature[], argumentCount?: number ): Signature | void, getSignatureFromDeclaration( declaration: SignatureDeclaration ): Signature | void, isImplementationOfOverload(node: SignatureDeclaration): boolean | void, isUndefinedSymbol(symbol: Symbol): boolean, isArgumentsSymbol(symbol: Symbol): boolean, isUnknownSymbol(symbol: Symbol): boolean, getConstantValue( node: EnumMember | PropertyAccessExpression | ElementAccessExpression ): string | number | void, isValidPropertyAccess( node: PropertyAccessExpression | QualifiedName | ImportTypeNode, propertyName: string ): boolean, getAliasedSymbol(symbol: Symbol): Symbol, getExportsOfModule(moduleSymbol: Symbol): Symbol[], getJsxIntrinsicTagNamesAt(location: Node): Symbol[], isOptionalParameter(node: ParameterDeclaration): boolean, getAmbientModules(): Symbol[], tryGetMemberInModuleExports( memberName: string, moduleSymbol: Symbol ): Symbol | void, getApparentType(type: Type): Type, getBaseConstraintOfType(type: Type): Type | void, getDefaultFromTypeParameter(type: Type): Type | void, runWithCancellationToken( token: CancellationToken, cb: (checker: TypeChecker) => T ): T }; declare var NodeBuilderFlags: { +None: 0, // 0 +NoTruncation: 1, // 1 +WriteArrayAsGenericType: 2, // 2 +GenerateNamesForShadowedTypeParams: 4, // 4 +UseStructuralFallback: 8, // 8 +ForbidIndexedAccessSymbolReferences: 16, // 16 +WriteTypeArgumentsOfSignature: 32, // 32 +UseFullyQualifiedType: 64, // 64 +UseOnlyExternalAliasing: 128, // 128 +SuppressAnyReturnType: 256, // 256 +WriteTypeParametersInQualifiedName: 512, // 512 +MultilineObjectLiterals: 1024, // 1024 +WriteClassExpressionAsTypeLiteral: 2048, // 2048 +UseTypeOfFunction: 4096, // 4096 +OmitParameterModifiers: 8192, // 8192 +UseAliasDefinedOutsideCurrentScope: 16384, // 16384 +AllowThisInObjectLiteral: 32768, // 32768 +AllowQualifedNameInPlaceOfIdentifier: 65536, // 65536 +AllowAnonymousIdentifier: 131072, // 131072 +AllowEmptyUnionOrIntersection: 262144, // 262144 +AllowEmptyTuple: 524288, // 524288 +AllowUniqueESSymbolType: 1048576, // 1048576 +AllowEmptyIndexInfoType: 2097152, // 2097152 +AllowNodeModulesRelativePaths: 67108864, // 67108864 +IgnoreErrors: 70221824, // 70221824 +InObjectTypeLiteral: 4194304, // 4194304 +InTypeAlias: 8388608, // 8388608 +InInitialEntityName: 16777216, // 16777216 +InReverseMappedType: 33554432 // 33554432 }; declare var TypeFormatFlags: { +None: 0, // 0 +NoTruncation: 1, // 1 +WriteArrayAsGenericType: 2, // 2 +UseStructuralFallback: 8, // 8 +WriteTypeArgumentsOfSignature: 32, // 32 +UseFullyQualifiedType: 64, // 64 +SuppressAnyReturnType: 256, // 256 +MultilineObjectLiterals: 1024, // 1024 +WriteClassExpressionAsTypeLiteral: 2048, // 2048 +UseTypeOfFunction: 4096, // 4096 +OmitParameterModifiers: 8192, // 8192 +UseAliasDefinedOutsideCurrentScope: 16384, // 16384 +AllowUniqueESSymbolType: 1048576, // 1048576 +AddUndefined: 131072, // 131072 +WriteArrowStyleSignature: 262144, // 262144 +InArrayType: 524288, // 524288 +InElementType: 2097152, // 2097152 +InFirstTypeArgument: 4194304, // 4194304 +InTypeAlias: 8388608, // 8388608 +WriteOwnNameForAnyLike: 0, // 0 +NodeBuilderFlagsMask: 9469291 // 9469291 }; declare var SymbolFormatFlags: { +None: 0, // 0 +WriteTypeParametersOrArguments: 1, // 1 +UseOnlyExternalAliasing: 2, // 2 +AllowAnyNodeKind: 4, // 4 +UseAliasDefinedOutsideCurrentScope: 8 // 8 }; declare var TypePredicateKind: { +This: 0, // 0 +Identifier: 1 // 1 }; declare type TypePredicateBase = { kind: $Values, type: Type }; declare type ThisTypePredicate = { ...$Exact, kind: typeof TypePredicateKind.This }; declare type IdentifierTypePredicate = { ...$Exact, kind: typeof TypePredicateKind.Identifier, parameterName: string, parameterIndex: number }; declare type TypePredicate = IdentifierTypePredicate | ThisTypePredicate; declare var SymbolFlags: { +None: 0, // 0 +FunctionScopedVariable: 1, // 1 +BlockScopedVariable: 2, // 2 +Property: 4, // 4 +EnumMember: 8, // 8 +Function: 16, // 16 +Class: 32, // 32 +Interface: 64, // 64 +ConstEnum: 128, // 128 +RegularEnum: 256, // 256 +ValueModule: 512, // 512 +NamespaceModule: 1024, // 1024 +TypeLiteral: 2048, // 2048 +ObjectLiteral: 4096, // 4096 +Method: 8192, // 8192 +Constructor: 16384, // 16384 +GetAccessor: 32768, // 32768 +SetAccessor: 65536, // 65536 +Signature: 131072, // 131072 +TypeParameter: 262144, // 262144 +TypeAlias: 524288, // 524288 +ExportValue: 1048576, // 1048576 +Alias: 2097152, // 2097152 +Prototype: 4194304, // 4194304 +ExportStar: 8388608, // 8388608 +Optional: 16777216, // 16777216 +Transient: 33554432, // 33554432 +Assignment: 67108864, // 67108864 +ModuleExports: 134217728, // 134217728 +Enum: 384, // 384 +Variable: 3, // 3 +Value: 67220415, // 67220415 +Type: 67897832, // 67897832 +Namespace: 1920, // 1920 +Module: 1536, // 1536 +Accessor: 98304, // 98304 +FunctionScopedVariableExcludes: 67220414, // 67220414 +BlockScopedVariableExcludes: 67220415, // 67220415 +ParameterExcludes: 67220415, // 67220415 +PropertyExcludes: 0, // 0 +EnumMemberExcludes: 68008959, // 68008959 +FunctionExcludes: 67219887, // 67219887 +ClassExcludes: 68008383, // 68008383 +InterfaceExcludes: 67897736, // 67897736 +RegularEnumExcludes: 68008191, // 68008191 +ConstEnumExcludes: 68008831, // 68008831 +ValueModuleExcludes: 110735, // 110735 +NamespaceModuleExcludes: 0, // 0 +MethodExcludes: 67212223, // 67212223 +GetAccessorExcludes: 67154879, // 67154879 +SetAccessorExcludes: 67187647, // 67187647 +TypeParameterExcludes: 67635688, // 67635688 +TypeAliasExcludes: 67897832, // 67897832 +AliasExcludes: 2097152, // 2097152 +ModuleMember: 2623475, // 2623475 +ExportHasLocal: 944, // 944 +BlockScoped: 418, // 418 +PropertyOrAccessor: 98308, // 98308 +ClassMember: 106500 // 106500 }; declare type Symbol = { flags: $Values, escapedName: __String, declarations: Declaration[], valueDeclaration: Declaration, members?: SymbolTable, exports?: SymbolTable, globalExports?: SymbolTable, +name: string, getFlags(): $Values, getEscapedName(): __String, getName(): string, getDeclarations(): Declaration[] | void, getDocumentationComment( typeChecker: TypeChecker | void ): SymbolDisplayPart[], getJsDocTags(): JSDocTagInfo[] }; declare var InternalSymbolName: { +Call: "__call", // "__call" +Constructor: "__constructor", // "__constructor" +New: "__new", // "__new" +Index: "__index", // "__index" +ExportStar: "__export", // "__export" +Global: "__global", // "__global" +Missing: "__missing", // "__missing" +Type: "__type", // "__type" +Object: "__object", // "__object" +JSXAttributes: "__jsxAttributes", // "__jsxAttributes" +Class: "__class", // "__class" +Function: "__function", // "__function" +Computed: "__computed", // "__computed" +Resolving: "__resolving__", // "__resolving__" +ExportEquals: "export=", // "export=" +Default: "default", // "default" +This: "this" // "this" }; declare type __String = | (string & { __escapedIdentifier: void }) | (void & { __escapedIdentifier: void }) | $Values; declare class ReadonlyUnderscoreEscapedMap { get(key: __String): T | void, has(key: __String): boolean, forEach(action: (value: T, key: __String) => void): void, +size: number, keys(): Iterator<__String>, values(): Iterator, entries(): Iterator<[__String, T]> } declare class UnderscoreEscapedMap extends ReadonlyUnderscoreEscapedMap { set(key: __String, value: T): this, delete(key: __String): boolean, clear(): void } declare type SymbolTable = UnderscoreEscapedMap; declare var TypeFlags: { +Any: 1, // 1 +Unknown: 2, // 2 +String: 4, // 4 +Number: 8, // 8 +Boolean: 16, // 16 +Enum: 32, // 32 +BigInt: 64, // 64 +StringLiteral: 128, // 128 +NumberLiteral: 256, // 256 +BooleanLiteral: 512, // 512 +EnumLiteral: 1024, // 1024 +BigIntLiteral: 2048, // 2048 +ESSymbol: 4096, // 4096 +UniqueESSymbol: 8192, // 8192 +Void: 16384, // 16384 +Undefined: 32768, // 32768 +Null: 65536, // 65536 +Never: 131072, // 131072 +TypeParameter: 262144, // 262144 +Object: 524288, // 524288 +Union: 1048576, // 1048576 +Intersection: 2097152, // 2097152 +Index: 4194304, // 4194304 +IndexedAccess: 8388608, // 8388608 +Conditional: 16777216, // 16777216 +Substitution: 33554432, // 33554432 +NonPrimitive: 67108864, // 67108864 +Literal: 2944, // 2944 +Unit: 109440, // 109440 +StringOrNumberLiteral: 384, // 384 +PossiblyFalsy: 117724, // 117724 +StringLike: 132, // 132 +NumberLike: 296, // 296 +BigIntLike: 2112, // 2112 +BooleanLike: 528, // 528 +EnumLike: 1056, // 1056 +ESSymbolLike: 12288, // 12288 +VoidLike: 49152, // 49152 +UnionOrIntersection: 3145728, // 3145728 +StructuredType: 3670016, // 3670016 +TypeVariable: 8650752, // 8650752 +InstantiableNonPrimitive: 58982400, // 58982400 +InstantiablePrimitive: 4194304, // 4194304 +Instantiable: 63176704, // 63176704 +StructuredOrInstantiable: 66846720, // 66846720 +Narrowable: 133970943, // 133970943 +NotUnionOrUnit: 67637251 // 67637251 }; declare type DestructuringPattern = | BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; declare type Type = { flags: $Values, symbol: Symbol, pattern?: DestructuringPattern, aliasSymbol?: Symbol, aliasTypeArguments?: $ReadOnlyArray, getFlags(): $Values, getSymbol(): Symbol | void, getProperties(): Symbol[], getProperty(propertyName: string): Symbol | void, getApparentProperties(): Symbol[], getCallSignatures(): $ReadOnlyArray, getConstructSignatures(): $ReadOnlyArray, getStringIndexType(): Type | void, getNumberIndexType(): Type | void, getBaseTypes(): BaseType[] | void, getNonNullableType(): Type, getConstraint(): Type | void, getDefault(): Type | void, isUnion(): boolean, isIntersection(): boolean, isUnionOrIntersection(): boolean, isLiteral(): boolean, isStringLiteral(): boolean, isNumberLiteral(): boolean, isTypeParameter(): boolean, isClassOrInterface(): boolean, isClass(): boolean }; declare type LiteralType = { ...$Exact, value: string | number | PseudoBigInt, freshType: LiteralType, regularType: LiteralType }; declare type UniqueESSymbolType = { ...$Exact, symbol: Symbol, escapedName: __String }; declare type StringLiteralType = { ...$Exact, value: string }; declare type NumberLiteralType = { ...$Exact, value: number }; declare type BigIntLiteralType = { ...$Exact, value: PseudoBigInt }; declare type EnumType = { ...$Exact }; declare var ObjectFlags: { +Class: 1, // 1 +Interface: 2, // 2 +Reference: 4, // 4 +Tuple: 8, // 8 +Anonymous: 16, // 16 +Mapped: 32, // 32 +Instantiated: 64, // 64 +ObjectLiteral: 128, // 128 +EvolvingArray: 256, // 256 +ObjectLiteralPatternWithComputedProperties: 512, // 512 +ContainsSpread: 1024, // 1024 +ReverseMapped: 2048, // 2048 +JsxAttributes: 4096, // 4096 +MarkerType: 8192, // 8192 +JSLiteral: 16384, // 16384 +FreshLiteral: 32768, // 32768 +ClassOrInterface: 3 // 3 }; declare type ObjectType = { ...$Exact, objectFlags: $Values }; declare type InterfaceType = { ...$Exact, typeParameters: TypeParameter[] | void, outerTypeParameters: TypeParameter[] | void, localTypeParameters: TypeParameter[] | void, thisType: TypeParameter | void }; declare type BaseType = ObjectType | IntersectionType; declare type InterfaceTypeWithDeclaredMembers = { ...$Exact, declaredProperties: Symbol[], declaredCallSignatures: Signature[], declaredConstructSignatures: Signature[], declaredStringIndexInfo?: IndexInfo, declaredNumberIndexInfo?: IndexInfo }; declare type TypeReference = { ...$Exact, target: GenericType, typeArguments?: $ReadOnlyArray }; declare type GenericType = { ...$Exact, ...$Exact }; declare type TupleType = { ...$Exact, minLength: number, hasRestElement: boolean, associatedNames?: __String[] }; declare type TupleTypeReference = { ...$Exact, target: TupleType }; declare type UnionOrIntersectionType = { ...$Exact, types: Type[] }; declare type UnionType = { ...$Exact }; declare type IntersectionType = { ...$Exact }; declare type StructuredType = ObjectType | UnionType | IntersectionType; declare type EvolvingArrayType = { ...$Exact, elementType: Type, finalArrayType?: Type }; declare type InstantiableType = { ...$Exact }; declare type TypeParameter = { ...$Exact }; declare type IndexedAccessType = { ...$Exact, objectType: Type, indexType: Type, constraint?: Type, simplified?: Type }; declare type TypeVariable = TypeParameter | IndexedAccessType; declare type IndexType = { ...$Exact, type: InstantiableType | UnionOrIntersectionType }; declare type ConditionalRoot = { node: ConditionalTypeNode, checkType: Type, extendsType: Type, trueType: Type, falseType: Type, isDistributive: boolean, inferTypeParameters?: TypeParameter[], outerTypeParameters?: TypeParameter[], instantiations?: Map, aliasSymbol?: Symbol, aliasTypeArguments?: Type[] }; declare type ConditionalType = { ...$Exact, root: ConditionalRoot, checkType: Type, extendsType: Type, resolvedTrueType?: Type, resolvedFalseType?: Type }; declare type SubstitutionType = { ...$Exact, typeVariable: TypeVariable, substitute: Type }; declare var SignatureKind: { +Call: 0, // 0 +Construct: 1 // 1 }; declare type Signature = { declaration?: SignatureDeclaration | JSDocSignature, typeParameters?: $ReadOnlyArray, parameters: $ReadOnlyArray, getDeclaration(): SignatureDeclaration, getTypeParameters(): TypeParameter[] | void, getParameters(): Symbol[], getReturnType(): Type, getDocumentationComment( typeChecker: TypeChecker | void ): SymbolDisplayPart[], getJsDocTags(): JSDocTagInfo[] }; declare var IndexKind: { +String: 0, // 0 +Number: 1 // 1 }; declare type IndexInfo = { type: Type, isReadonly: boolean, declaration?: IndexSignatureDeclaration }; declare var InferencePriority: { +NakedTypeVariable: 1, // 1 +HomomorphicMappedType: 2, // 2 +MappedTypeConstraint: 4, // 4 +ReturnType: 8, // 8 +LiteralKeyof: 16, // 16 +NoConstraints: 32, // 32 +AlwaysStrict: 64, // 64 +PriorityImpliesCombination: 28 // 28 }; declare type JsFileExtensionInfo = FileExtensionInfo; declare type FileExtensionInfo = { extension: string, isMixedContent: boolean, scriptKind?: $Values }; declare type DiagnosticMessage = { key: string, category: $Values, code: number, message: string, reportsUnnecessary?: {} }; declare type DiagnosticMessageChain = { messageText: string, category: $Values, code: number, next?: DiagnosticMessageChain }; declare type Diagnostic = { ...$Exact, reportsUnnecessary?: {}, source?: string, relatedInformation?: DiagnosticRelatedInformation[] }; declare type DiagnosticRelatedInformation = { category: $Values, code: number, file: SourceFile | void, start: number | void, length: number | void, messageText: string | DiagnosticMessageChain }; declare type DiagnosticWithLocation = { ...$Exact, file: SourceFile, start: number, length: number }; declare var DiagnosticCategory: { +Warning: 0, // 0 +Error: 1, // 1 +Suggestion: 2, // 2 +Message: 3 // 3 }; declare var ModuleResolutionKind: { +Classic: 1, // 1 +NodeJs: 2 // 2 }; declare type PluginImport = { name: string }; declare type ProjectReference = { path: string, originalPath?: string, prepend?: boolean, circular?: boolean }; declare type CompilerOptionsValue = | string | number | boolean | (string | number)[] | string[] | MapLike | PluginImport[] | ProjectReference[] | null | void; declare type CompilerOptions = { allowJs?: boolean, allowSyntheticDefaultImports?: boolean, allowUnreachableCode?: boolean, allowUnusedLabels?: boolean, alwaysStrict?: boolean, baseUrl?: string, charset?: string, checkJs?: boolean, declaration?: boolean, declarationMap?: boolean, emitDeclarationOnly?: boolean, declarationDir?: string, disableSizeLimit?: boolean, downlevelIteration?: boolean, emitBOM?: boolean, emitDecoratorMetadata?: boolean, experimentalDecorators?: boolean, forceConsistentCasingInFileNames?: boolean, importHelpers?: boolean, inlineSourceMap?: boolean, inlineSources?: boolean, isolatedModules?: boolean, jsx?: $Values, keyofStringsOnly?: boolean, lib?: string[], locale?: string, mapRoot?: string, maxNodeModuleJsDepth?: number, module?: $Values, moduleResolution?: $Values, newLine?: $Values, noEmit?: boolean, noEmitHelpers?: boolean, noEmitOnError?: boolean, noErrorTruncation?: boolean, noFallthroughCasesInSwitch?: boolean, noImplicitAny?: boolean, noImplicitReturns?: boolean, noImplicitThis?: boolean, noStrictGenericChecks?: boolean, noUnusedLocals?: boolean, noUnusedParameters?: boolean, noImplicitUseStrict?: boolean, noLib?: boolean, noResolve?: boolean, out?: string, outDir?: string, outFile?: string, paths?: MapLike, preserveConstEnums?: boolean, preserveSymlinks?: boolean, project?: string, reactNamespace?: string, jsxFactory?: string, composite?: boolean, removeComments?: boolean, rootDir?: string, rootDirs?: string[], skipLibCheck?: boolean, skipDefaultLibCheck?: boolean, sourceMap?: boolean, sourceRoot?: string, strict?: boolean, strictFunctionTypes?: boolean, strictBindCallApply?: boolean, strictNullChecks?: boolean, strictPropertyInitialization?: boolean, stripInternal?: boolean, suppressExcessPropertyErrors?: boolean, suppressImplicitAnyIndexErrors?: boolean, target?: $Values, traceResolution?: boolean, resolveJsonModule?: boolean, types?: string[], typeRoots?: string[], esModuleInterop?: boolean, [option: string]: CompilerOptionsValue | TsConfigSourceFile | void }; declare type TypeAcquisition = { enableAutoDiscovery?: boolean, enable?: boolean, include?: string[], exclude?: string[], [option: string]: string[] | boolean | void }; declare var ModuleKind: { +None: 0, // 0 +CommonJS: 1, // 1 +AMD: 2, // 2 +UMD: 3, // 3 +System: 4, // 4 +ES2015: 5, // 5 +ESNext: 6 // 6 }; declare var JsxEmit: { +None: 0, // 0 +Preserve: 1, // 1 +React: 2, // 2 +ReactNative: 3 // 3 }; declare var NewLineKind: { +CarriageReturnLineFeed: 0, // 0 +LineFeed: 1 // 1 }; declare type LineAndCharacter = { line: number, character: number }; declare var ScriptKind: { +Unknown: 0, // 0 +JS: 1, // 1 +JSX: 2, // 2 +TS: 3, // 3 +TSX: 4, // 4 +External: 5, // 5 +JSON: 6, // 6 +Deferred: 7 // 7 }; declare var ScriptTarget: { +ES3: 0, // 0 +ES5: 1, // 1 +ES2015: 2, // 2 +ES2016: 3, // 3 +ES2017: 4, // 4 +ES2018: 5, // 5 +ESNext: 6, // 6 +JSON: 100, // 100 +Latest: 6 // 6 }; declare var LanguageVariant: { +Standard: 0, // 0 +JSX: 1 // 1 }; declare type ParsedCommandLine = { options: CompilerOptions, typeAcquisition?: TypeAcquisition, fileNames: string[], projectReferences?: $ReadOnlyArray, raw?: any, errors: Diagnostic[], wildcardDirectories?: MapLike<$Values>, compileOnSave?: boolean }; declare var WatchDirectoryFlags: { +None: 0, // 0 +Recursive: 1 // 1 }; declare type ExpandResult = { fileNames: string[], wildcardDirectories: MapLike<$Values> }; declare type CreateProgramOptions = { rootNames: $ReadOnlyArray, options: CompilerOptions, projectReferences?: $ReadOnlyArray, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: $ReadOnlyArray }; declare type ModuleResolutionHost = { fileExists(fileName: string): boolean, readFile(fileName: string): string | void, trace?: (s: string) => void, directoryExists?: (directoryName: string) => boolean, realpath?: (path: string) => string, getCurrentDirectory?: () => string, getDirectories?: (path: string) => string[] }; declare type ResolvedModule = { resolvedFileName: string, isExternalLibraryImport?: boolean }; declare type ResolvedModuleFull = { ...$Exact, extension: $Values, packageId?: PackageId }; declare type PackageId = { name: string, subModuleName: string, version: string }; declare var Extension: { +Ts: ".ts", // ".ts" +Tsx: ".tsx", // ".tsx" +Dts: ".d.ts", // ".d.ts" +Js: ".js", // ".js" +Jsx: ".jsx", // ".jsx" +Json: ".json" // ".json" }; declare type ResolvedModuleWithFailedLookupLocations = { +resolvedModule: ResolvedModuleFull | void }; declare type ResolvedTypeReferenceDirective = { primary: boolean, resolvedFileName: string | void, packageId?: PackageId, isExternalLibraryImport?: boolean }; declare type ResolvedTypeReferenceDirectiveWithFailedLookupLocations = { +resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | void, +failedLookupLocations: $ReadOnlyArray }; declare type CompilerHost = { ...$Exact, getSourceFile( fileName: string, languageVersion: $Values, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean ): SourceFile | void, getSourceFileByPath?: ( fileName: string, path: Path, languageVersion: $Values, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean ) => SourceFile | void, getCancellationToken?: () => CancellationToken, getDefaultLibFileName(options: CompilerOptions): string, getDefaultLibLocation?: () => string, writeFile: WriteFileCallback, getCurrentDirectory(): string, getCanonicalFileName(fileName: string): string, useCaseSensitiveFileNames(): boolean, getNewLine(): string, readDirectory?: ( rootDir: string, extensions: $ReadOnlyArray, excludes: $ReadOnlyArray | void, includes: $ReadOnlyArray, depth?: number ) => string[], resolveModuleNames?: ( moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference ) => (ResolvedModule | void)[], resolveTypeReferenceDirectives?: ( typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference ) => (ResolvedTypeReferenceDirective | void)[], getEnvironmentVariable?: (name: string) => string | void, createHash?: (data: string) => string }; declare type SourceMapRange = { ...$Exact, source?: SourceMapSource }; declare type SourceMapSource = { fileName: string, text: string, skipTrivia?: (pos: number) => number, getLineAndCharacterOfPosition(pos: number): LineAndCharacter }; declare var EmitFlags: { +None: 0, // 0 +SingleLine: 1, // 1 +AdviseOnEmitNode: 2, // 2 +NoSubstitution: 4, // 4 +CapturesThis: 8, // 8 +NoLeadingSourceMap: 16, // 16 +NoTrailingSourceMap: 32, // 32 +NoSourceMap: 48, // 48 +NoNestedSourceMaps: 64, // 64 +NoTokenLeadingSourceMaps: 128, // 128 +NoTokenTrailingSourceMaps: 256, // 256 +NoTokenSourceMaps: 384, // 384 +NoLeadingComments: 512, // 512 +NoTrailingComments: 1024, // 1024 +NoComments: 1536, // 1536 +NoNestedComments: 2048, // 2048 +HelperName: 4096, // 4096 +ExportName: 8192, // 8192 +LocalName: 16384, // 16384 +InternalName: 32768, // 32768 +Indented: 65536, // 65536 +NoIndentation: 131072, // 131072 +AsyncFunctionBody: 262144, // 262144 +ReuseTempVariableScope: 524288, // 524288 +CustomPrologue: 1048576, // 1048576 +NoHoisting: 2097152, // 2097152 +HasEndOfDeclarationMarker: 4194304, // 4194304 +Iterator: 8388608, // 8388608 +NoAsciiEscaping: 16777216 // 16777216 }; declare type EmitHelper = { +name: string, +scoped: boolean, +text: string | ((node: EmitHelperUniqueNameCallback) => string), +priority?: number }; declare type EmitHelperUniqueNameCallback = (name: string) => string; declare var EmitHint: { +SourceFile: 0, // 0 +Expression: 1, // 1 +IdentifierName: 2, // 2 +MappedTypeParameter: 3, // 3 +Unspecified: 4, // 4 +EmbeddedStatement: 5 // 5 }; declare type TransformationContext = { getCompilerOptions(): CompilerOptions, startLexicalEnvironment(): void, suspendLexicalEnvironment(): void, resumeLexicalEnvironment(): void, endLexicalEnvironment(): Statement[] | void, hoistFunctionDeclaration(node: FunctionDeclaration): void, hoistVariableDeclaration(node: Identifier): void, requestEmitHelper(helper: EmitHelper): void, readEmitHelpers(): EmitHelper[] | void, enableSubstitution(kind: $Values): void, isSubstitutionEnabled(node: Node): boolean, onSubstituteNode: (hint: $Values, node: Node) => Node, enableEmitNotification(kind: $Values): void, isEmitNotificationEnabled(node: Node): boolean, onEmitNode: ( hint: $Values, node: Node, emitCallback: (hint: $Values, node: Node) => void ) => void }; declare type TransformationResult = { transformed: T[], diagnostics?: DiagnosticWithLocation[], substituteNode(hint: $Values, node: Node): Node, emitNodeWithNotification( hint: $Values, node: Node, emitCallback: (hint: $Values, node: Node) => void ): void, dispose(): void }; declare type TransformerFactory = ( context: TransformationContext ) => Transformer; declare type Transformer = (node: T) => T; declare type Visitor = (node: Node) => VisitResult; declare type VisitResult = T | T[] | void; declare type Printer = { printNode( hint: $Values, node: Node, sourceFile: SourceFile ): string, printList( format: $Values, list: NodeArray, sourceFile: SourceFile ): string, printFile(sourceFile: SourceFile): string, printBundle(bundle: Bundle): string }; declare type PrintHandlers = { hasGlobalName?: (name: string) => boolean, onEmitNode?: ( hint: $Values, node: Node | void, emitCallback: (hint: $Values, node: Node | void) => void ) => void, substituteNode?: (hint: $Values, node: Node) => Node }; declare type PrinterOptions = { removeComments?: boolean, newLine?: $Values, omitTrailingSemicolon?: boolean, noEmitHelpers?: boolean }; declare type GetEffectiveTypeRootsHost = { directoryExists?: (directoryName: string) => boolean, getCurrentDirectory?: () => string }; declare type TextSpan = { start: number, length: number }; declare type TextChangeRange = { span: TextSpan, newLength: number }; declare type SyntaxList = { ...$Exact, _children: Node[] }; declare var ListFormat: { +None: 0, // 0 +SingleLine: 0, // 0 +MultiLine: 1, // 1 +PreserveLines: 2, // 2 +LinesMask: 3, // 3 +NotDelimited: 0, // 0 +BarDelimited: 4, // 4 +AmpersandDelimited: 8, // 8 +CommaDelimited: 16, // 16 +AsteriskDelimited: 32, // 32 +DelimitersMask: 60, // 60 +AllowTrailingComma: 64, // 64 +Indented: 128, // 128 +SpaceBetweenBraces: 256, // 256 +SpaceBetweenSiblings: 512, // 512 +Braces: 1024, // 1024 +Parenthesis: 2048, // 2048 +AngleBrackets: 4096, // 4096 +SquareBrackets: 8192, // 8192 +BracketsMask: 15360, // 15360 +OptionalIfUndefined: 16384, // 16384 +OptionalIfEmpty: 32768, // 32768 +Optional: 49152, // 49152 +PreferNewLine: 65536, // 65536 +NoTrailingNewLine: 131072, // 131072 +NoInterveningComments: 262144, // 262144 +NoSpaceIfEmpty: 524288, // 524288 +SingleElement: 1048576, // 1048576 +Modifiers: 262656, // 262656 +HeritageClauses: 512, // 512 +SingleLineTypeLiteralMembers: 768, // 768 +MultiLineTypeLiteralMembers: 32897, // 32897 +TupleTypeElements: 528, // 528 +UnionTypeConstituents: 516, // 516 +IntersectionTypeConstituents: 520, // 520 +ObjectBindingPatternElements: 525136, // 525136 +ArrayBindingPatternElements: 524880, // 524880 +ObjectLiteralExpressionProperties: 526226, // 526226 +ArrayLiteralExpressionElements: 8914, // 8914 +CommaListElements: 528, // 528 +CallExpressionArguments: 2576, // 2576 +NewExpressionArguments: 18960, // 18960 +TemplateExpressionSpans: 262144, // 262144 +SingleLineBlockStatements: 768, // 768 +MultiLineBlockStatements: 129, // 129 +VariableDeclarationList: 528, // 528 +SingleLineFunctionBodyStatements: 768, // 768 +MultiLineFunctionBodyStatements: 1, // 1 +ClassHeritageClauses: 0, // 0 +ClassMembers: 129, // 129 +InterfaceMembers: 129, // 129 +EnumMembers: 145, // 145 +CaseBlockClauses: 129, // 129 +NamedImportsOrExportsElements: 525136, // 525136 +JsxElementOrFragmentChildren: 262144, // 262144 +JsxElementAttributes: 262656, // 262656 +CaseOrDefaultClauseStatements: 163969, // 163969 +HeritageClauseTypes: 528, // 528 +SourceFileStatements: 131073, // 131073 +Decorators: 49153, // 49153 +TypeArguments: 53776, // 53776 +TypeParameters: 53776, // 53776 +Parameters: 2576, // 2576 +IndexSignatureParameters: 8848, // 8848 +JSDocComment: 33 // 33 }; declare type UserPreferences = { +disableSuggestions?: boolean, +quotePreference?: "auto" | "double" | "single", +includeCompletionsForModuleExports?: boolean, +includeCompletionsWithInsertText?: boolean, +importModuleSpecifierPreference?: "relative" | "non-relative", +importModuleSpecifierEnding?: "minimal" | "index" | "js", +allowTextChangesInNewFiles?: boolean, +providePrefixAndSuffixTextForRename?: boolean }; declare type PseudoBigInt = { negative: boolean, base10Value: string }; declare var FileWatcherEventKind: { +Created: 0, // 0 +Changed: 1, // 1 +Deleted: 2 // 2 }; declare type FileWatcherCallback = ( fileName: string, eventKind: $Values ) => void; declare type DirectoryWatcherCallback = (fileName: string) => void; declare type System = { args: string[], newLine: string, useCaseSensitiveFileNames: boolean, write(s: string): void, writeOutputIsTTY?: () => boolean, readFile(path: string, encoding?: string): string | void, getFileSize?: (path: string) => number, writeFile(path: string, data: string, writeByteOrderMark?: boolean): void, watchFile?: ( path: string, callback: FileWatcherCallback, pollingInterval?: number ) => FileWatcher, watchDirectory?: ( path: string, callback: DirectoryWatcherCallback, recursive?: boolean ) => FileWatcher, resolvePath(path: string): string, fileExists(path: string): boolean, directoryExists(path: string): boolean, createDirectory(path: string): void, getExecutingFilePath(): string, getCurrentDirectory(): string, getDirectories(path: string): string[], readDirectory( path: string, extensions?: $ReadOnlyArray, exclude?: $ReadOnlyArray, include?: $ReadOnlyArray, depth?: number ): string[], getModifiedTime?: (path: string) => Date | void, setModifiedTime?: (path: string, time: Date) => void, deleteFile?: (path: string) => void, createHash?: (data: string) => string, createSHA256Hash?: (data: string) => string, getMemoryUsage?: () => number, exit(exitCode?: number): void, realpath?: (path: string) => string, setTimeout?: ( callback: (...args: any[]) => void, ms: number, ...args: any[] ) => any, clearTimeout?: (timeoutId: any) => void, clearScreen?: () => void, base64decode?: (input: string) => string, base64encode?: (input: string) => string }; declare type FileWatcher = { close(): void }; declare function getNodeMajorVersion(): number | void; declare var sys: System; declare type ErrorCallback = ( message: DiagnosticMessage, length: number ) => void; declare type Scanner = { getStartPos(): number, getToken(): $Values, getTextPos(): number, getTokenPos(): number, getTokenText(): string, getTokenValue(): string, hasExtendedUnicodeEscape(): boolean, hasPrecedingLineBreak(): boolean, isIdentifier(): boolean, isReservedWord(): boolean, isUnterminated(): boolean, reScanGreaterToken(): $Values, reScanSlashToken(): $Values, reScanTemplateToken(): $Values, scanJsxIdentifier(): $Values, scanJsxAttributeValue(): $Values, reScanJsxToken(): JsxTokenSyntaxKind, reScanLessThanToken(): $Values, scanJsxToken(): JsxTokenSyntaxKind, scanJSDocToken(): JsDocSyntaxKind, scan(): $Values, getText(): string, setText(text: string | void, start?: number, length?: number): void, setOnError(onError: ErrorCallback | void): void, setScriptTarget(scriptTarget: $Values): void, setLanguageVariant(variant: $Values): void, setTextPos(textPos: number): void, lookAhead(callback: () => T): T, scanRange(start: number, length: number, callback: () => T): T, tryScan(callback: () => T): T }; declare function tokenToString(t: $Values): string | void; declare function getPositionOfLineAndCharacter( sourceFile: SourceFileLike, line: number, character: number ): number; declare function getLineAndCharacterOfPosition( sourceFile: SourceFileLike, position: number ): LineAndCharacter; declare function isWhiteSpaceLike(ch: number): boolean; declare function isWhiteSpaceSingleLine(ch: number): boolean; declare function isLineBreak(ch: number): boolean; declare function couldStartTrivia(text: string, pos: number): boolean; declare function forEachLeadingCommentRange( text: string, pos: number, cb: ( pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean ) => U ): U | void; declare function forEachLeadingCommentRange( text: string, pos: number, cb: ( pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T ) => U, state: T ): U | void; declare function forEachTrailingCommentRange( text: string, pos: number, cb: ( pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean ) => U ): U | void; declare function forEachTrailingCommentRange( text: string, pos: number, cb: ( pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T ) => U, state: T ): U | void; declare function reduceEachLeadingCommentRange( text: string, pos: number, cb: ( pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U ) => U, state: T, initial: U ): U | void; declare function reduceEachTrailingCommentRange( text: string, pos: number, cb: ( pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T, memo: U ) => U, state: T, initial: U ): U | void; declare function getLeadingCommentRanges( text: string, pos: number ): CommentRange[] | void; declare function getTrailingCommentRanges( text: string, pos: number ): CommentRange[] | void; declare function getShebang(text: string): string | void; declare function isIdentifierStart( ch: number, languageVersion: $Values | void ): boolean; declare function isIdentifierPart( ch: number, languageVersion: $Values | void ): boolean; declare function createScanner( languageVersion: $Values, skipTrivia: boolean, languageVariant?: $Values, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number ): Scanner; declare function isExternalModuleNameRelative(moduleName: string): boolean; declare function sortAndDeduplicateDiagnostics( diagnostics: $ReadOnlyArray ): SortedReadonlyArray; declare function getDefaultLibFileName(options: CompilerOptions): string; declare function textSpanEnd(span: TextSpan): number; declare function textSpanIsEmpty(span: TextSpan): boolean; declare function textSpanContainsPosition( span: TextSpan, position: number ): boolean; declare function textSpanContainsTextSpan( span: TextSpan, other: TextSpan ): boolean; declare function textSpanOverlapsWith( span: TextSpan, other: TextSpan ): boolean; declare function textSpanOverlap( span1: TextSpan, span2: TextSpan ): TextSpan | void; declare function textSpanIntersectsWithTextSpan( span: TextSpan, other: TextSpan ): boolean; declare function textSpanIntersectsWith( span: TextSpan, start: number, length: number ): boolean; declare function decodedTextSpanIntersectsWith( start1: number, length1: number, start2: number, length2: number ): boolean; declare function textSpanIntersectsWithPosition( span: TextSpan, position: number ): boolean; declare function textSpanIntersection( span1: TextSpan, span2: TextSpan ): TextSpan | void; declare function createTextSpan(start: number, length: number): TextSpan; declare function createTextSpanFromBounds( start: number, end: number ): TextSpan; declare function textChangeRangeNewSpan(range: TextChangeRange): TextSpan; declare function textChangeRangeIsUnchanged(range: TextChangeRange): boolean; declare function createTextChangeRange( span: TextSpan, newLength: number ): TextChangeRange; declare var unchangedTextChangeRange: TextChangeRange; declare function collapseTextChangeRangesAcrossMultipleVersions( changes: $ReadOnlyArray ): TextChangeRange; declare function getTypeParameterOwner(d: Declaration): Declaration | void; declare type ParameterPropertyDeclaration = ParameterDeclaration & { parent: ConstructorDeclaration, name: Identifier }; declare function isParameterPropertyDeclaration(node: Node): boolean; declare function isEmptyBindingPattern(node: BindingName): boolean; declare function isEmptyBindingElement(node: BindingElement): boolean; declare function walkUpBindingElementsAndPatterns( binding: BindingElement ): VariableDeclaration | ParameterDeclaration; declare function getCombinedModifierFlags( node: Declaration ): $Values; declare function getCombinedNodeFlags(node: Node): $Values; declare function validateLocaleAndSetLanguage( locale: string, sys: { getExecutingFilePath(): string, resolvePath(path: string): string, fileExists(fileName: string): boolean, readFile(fileName: string): string | void }, errors?: Push ): void; declare function getOriginalNode(node: Node): Node; declare function getOriginalNode( node: Node, nodeTest: (node: Node) => boolean ): T; declare function getOriginalNode(node: Node | void): Node | void; declare function getOriginalNode( node: Node | void, nodeTest: (node: Node | void) => boolean ): T | void; declare function isParseTreeNode(node: Node): boolean; declare function getParseTreeNode(node: Node): Node; declare function getParseTreeNode( node: Node | void, nodeTest?: (node: Node) => boolean ): T | void; declare function escapeLeadingUnderscores(identifier: string): __String; declare function unescapeLeadingUnderscores(identifier: __String): string; declare function idText(identifier: Identifier): string; declare function symbolName(symbol: Symbol): string; declare function getNameOfJSDocTypedef( declaration: JSDocTypedefTag ): Identifier | void; declare function getNameOfDeclaration( declaration: Declaration | Expression ): DeclarationName | void; declare function getJSDocParameterTags( param: ParameterDeclaration ): $ReadOnlyArray; declare function getJSDocTypeParameterTags( param: TypeParameterDeclaration ): $ReadOnlyArray; declare function hasJSDocParameterTags( node: FunctionLikeDeclaration | SignatureDeclaration ): boolean; declare function getJSDocAugmentsTag(node: Node): JSDocAugmentsTag | void; declare function getJSDocClassTag(node: Node): JSDocClassTag | void; declare function getJSDocEnumTag(node: Node): JSDocEnumTag | void; declare function getJSDocThisTag(node: Node): JSDocThisTag | void; declare function getJSDocReturnTag(node: Node): JSDocReturnTag | void; declare function getJSDocTemplateTag(node: Node): JSDocTemplateTag | void; declare function getJSDocTypeTag(node: Node): JSDocTypeTag | void; declare function getJSDocType(node: Node): TypeNode | void; declare function getJSDocReturnType(node: Node): TypeNode | void; declare function getJSDocTags(node: Node): $ReadOnlyArray; declare function getAllJSDocTagsOfKind( node: Node, kind: $Values ): $ReadOnlyArray; declare function getEffectiveTypeParameterDeclarations( node: DeclarationWithTypeParameters ): $ReadOnlyArray; declare function getEffectiveConstraintOfTypeParameter( node: TypeParameterDeclaration ): TypeNode | void; declare function isNumericLiteral(node: Node): boolean; declare function isBigIntLiteral(node: Node): boolean; declare function isStringLiteral(node: Node): boolean; declare function isJsxText(node: Node): boolean; declare function isRegularExpressionLiteral(node: Node): boolean; declare function isNoSubstitutionTemplateLiteral(node: Node): boolean; declare function isTemplateHead(node: Node): boolean; declare function isTemplateMiddle(node: Node): boolean; declare function isTemplateTail(node: Node): boolean; declare function isIdentifier(node: Node): boolean; declare function isQualifiedName(node: Node): boolean; declare function isComputedPropertyName(node: Node): boolean; declare function isTypeParameterDeclaration(node: Node): boolean; declare function isParameter(node: Node): boolean; declare function isDecorator(node: Node): boolean; declare function isPropertySignature(node: Node): boolean; declare function isPropertyDeclaration(node: Node): boolean; declare function isMethodSignature(node: Node): boolean; declare function isMethodDeclaration(node: Node): boolean; declare function isConstructorDeclaration(node: Node): boolean; declare function isGetAccessorDeclaration(node: Node): boolean; declare function isSetAccessorDeclaration(node: Node): boolean; declare function isCallSignatureDeclaration(node: Node): boolean; declare function isConstructSignatureDeclaration(node: Node): boolean; declare function isIndexSignatureDeclaration(node: Node): boolean; declare function isTypePredicateNode(node: Node): boolean; declare function isTypeReferenceNode(node: Node): boolean; declare function isFunctionTypeNode(node: Node): boolean; declare function isConstructorTypeNode(node: Node): boolean; declare function isTypeQueryNode(node: Node): boolean; declare function isTypeLiteralNode(node: Node): boolean; declare function isArrayTypeNode(node: Node): boolean; declare function isTupleTypeNode(node: Node): boolean; declare function isUnionTypeNode(node: Node): boolean; declare function isIntersectionTypeNode(node: Node): boolean; declare function isConditionalTypeNode(node: Node): boolean; declare function isInferTypeNode(node: Node): boolean; declare function isParenthesizedTypeNode(node: Node): boolean; declare function isThisTypeNode(node: Node): boolean; declare function isTypeOperatorNode(node: Node): boolean; declare function isIndexedAccessTypeNode(node: Node): boolean; declare function isMappedTypeNode(node: Node): boolean; declare function isLiteralTypeNode(node: Node): boolean; declare function isImportTypeNode(node: Node): boolean; declare function isObjectBindingPattern(node: Node): boolean; declare function isArrayBindingPattern(node: Node): boolean; declare function isBindingElement(node: Node): boolean; declare function isArrayLiteralExpression(node: Node): boolean; declare function isObjectLiteralExpression(node: Node): boolean; declare function isPropertyAccessExpression(node: Node): boolean; declare function isElementAccessExpression(node: Node): boolean; declare function isCallExpression(node: Node): boolean; declare function isNewExpression(node: Node): boolean; declare function isTaggedTemplateExpression(node: Node): boolean; declare function isTypeAssertion(node: Node): boolean; declare function isParenthesizedExpression(node: Node): boolean; declare function skipPartiallyEmittedExpressions( node: Expression ): Expression; declare function skipPartiallyEmittedExpressions(node: Node): Node; declare function isFunctionExpression(node: Node): boolean; declare function isArrowFunction(node: Node): boolean; declare function isDeleteExpression(node: Node): boolean; declare function isTypeOfExpression(node: Node): boolean; declare function isVoidExpression(node: Node): boolean; declare function isAwaitExpression(node: Node): boolean; declare function isPrefixUnaryExpression(node: Node): boolean; declare function isPostfixUnaryExpression(node: Node): boolean; declare function isBinaryExpression(node: Node): boolean; declare function isConditionalExpression(node: Node): boolean; declare function isTemplateExpression(node: Node): boolean; declare function isYieldExpression(node: Node): boolean; declare function isSpreadElement(node: Node): boolean; declare function isClassExpression(node: Node): boolean; declare function isOmittedExpression(node: Node): boolean; declare function isExpressionWithTypeArguments(node: Node): boolean; declare function isAsExpression(node: Node): boolean; declare function isNonNullExpression(node: Node): boolean; declare function isMetaProperty(node: Node): boolean; declare function isTemplateSpan(node: Node): boolean; declare function isSemicolonClassElement(node: Node): boolean; declare function isBlock(node: Node): boolean; declare function isVariableStatement(node: Node): boolean; declare function isEmptyStatement(node: Node): boolean; declare function isExpressionStatement(node: Node): boolean; declare function isIfStatement(node: Node): boolean; declare function isDoStatement(node: Node): boolean; declare function isWhileStatement(node: Node): boolean; declare function isForStatement(node: Node): boolean; declare function isForInStatement(node: Node): boolean; declare function isForOfStatement(node: Node): boolean; declare function isContinueStatement(node: Node): boolean; declare function isBreakStatement(node: Node): boolean; declare function isBreakOrContinueStatement(node: Node): boolean; declare function isReturnStatement(node: Node): boolean; declare function isWithStatement(node: Node): boolean; declare function isSwitchStatement(node: Node): boolean; declare function isLabeledStatement(node: Node): boolean; declare function isThrowStatement(node: Node): boolean; declare function isTryStatement(node: Node): boolean; declare function isDebuggerStatement(node: Node): boolean; declare function isVariableDeclaration(node: Node): boolean; declare function isVariableDeclarationList(node: Node): boolean; declare function isFunctionDeclaration(node: Node): boolean; declare function isClassDeclaration(node: Node): boolean; declare function isInterfaceDeclaration(node: Node): boolean; declare function isTypeAliasDeclaration(node: Node): boolean; declare function isEnumDeclaration(node: Node): boolean; declare function isModuleDeclaration(node: Node): boolean; declare function isModuleBlock(node: Node): boolean; declare function isCaseBlock(node: Node): boolean; declare function isNamespaceExportDeclaration(node: Node): boolean; declare function isImportEqualsDeclaration(node: Node): boolean; declare function isImportDeclaration(node: Node): boolean; declare function isImportClause(node: Node): boolean; declare function isNamespaceImport(node: Node): boolean; declare function isNamedImports(node: Node): boolean; declare function isImportSpecifier(node: Node): boolean; declare function isExportAssignment(node: Node): boolean; declare function isExportDeclaration(node: Node): boolean; declare function isNamedExports(node: Node): boolean; declare function isExportSpecifier(node: Node): boolean; declare function isMissingDeclaration(node: Node): boolean; declare function isExternalModuleReference(node: Node): boolean; declare function isJsxElement(node: Node): boolean; declare function isJsxSelfClosingElement(node: Node): boolean; declare function isJsxOpeningElement(node: Node): boolean; declare function isJsxClosingElement(node: Node): boolean; declare function isJsxFragment(node: Node): boolean; declare function isJsxOpeningFragment(node: Node): boolean; declare function isJsxClosingFragment(node: Node): boolean; declare function isJsxAttribute(node: Node): boolean; declare function isJsxAttributes(node: Node): boolean; declare function isJsxSpreadAttribute(node: Node): boolean; declare function isJsxExpression(node: Node): boolean; declare function isCaseClause(node: Node): boolean; declare function isDefaultClause(node: Node): boolean; declare function isHeritageClause(node: Node): boolean; declare function isCatchClause(node: Node): boolean; declare function isPropertyAssignment(node: Node): boolean; declare function isShorthandPropertyAssignment(node: Node): boolean; declare function isSpreadAssignment(node: Node): boolean; declare function isEnumMember(node: Node): boolean; declare function isSourceFile(node: Node): boolean; declare function isBundle(node: Node): boolean; declare function isUnparsedSource(node: Node): boolean; declare function isJSDocTypeExpression(node: Node): boolean; declare function isJSDocAllType(node: JSDocAllType): boolean; declare function isJSDocUnknownType(node: Node): boolean; declare function isJSDocNullableType(node: Node): boolean; declare function isJSDocNonNullableType(node: Node): boolean; declare function isJSDocOptionalType(node: Node): boolean; declare function isJSDocFunctionType(node: Node): boolean; declare function isJSDocVariadicType(node: Node): boolean; declare function isJSDoc(node: Node): boolean; declare function isJSDocAugmentsTag(node: Node): boolean; declare function isJSDocClassTag(node: Node): boolean; declare function isJSDocEnumTag(node: Node): boolean; declare function isJSDocThisTag(node: Node): boolean; declare function isJSDocParameterTag(node: Node): boolean; declare function isJSDocReturnTag(node: Node): boolean; declare function isJSDocTypeTag(node: Node): boolean; declare function isJSDocTemplateTag(node: Node): boolean; declare function isJSDocTypedefTag(node: Node): boolean; declare function isJSDocPropertyTag(node: Node): boolean; declare function isJSDocPropertyLikeTag(node: Node): boolean; declare function isJSDocTypeLiteral(node: Node): boolean; declare function isJSDocCallbackTag(node: Node): boolean; declare function isJSDocSignature(node: Node): boolean; declare function isToken(n: Node): boolean; declare function isLiteralExpression(node: Node): boolean; declare type TemplateLiteralToken = | NoSubstitutionTemplateLiteral | TemplateHead | TemplateMiddle | TemplateTail; declare function isTemplateLiteralToken(node: Node): boolean; declare function isTemplateMiddleOrTemplateTail(node: Node): boolean; declare function isImportOrExportSpecifier(node: Node): boolean; declare function isStringTextContainingNode(node: Node): boolean; declare function isModifier(node: Node): boolean; declare function isEntityName(node: Node): boolean; declare function isPropertyName(node: Node): boolean; declare function isBindingName(node: Node): boolean; declare function isFunctionLike(node: Node): boolean; declare function isClassElement(node: Node): boolean; declare function isClassLike(node: Node): boolean; declare function isAccessor(node: Node): boolean; declare function isTypeElement(node: Node): boolean; declare function isClassOrTypeElement(node: Node): boolean; declare function isObjectLiteralElementLike(node: Node): boolean; declare function isTypeNode(node: Node): boolean; declare function isFunctionOrConstructorTypeNode(node: Node): boolean; declare function isPropertyAccessOrQualifiedName(node: Node): boolean; declare function isCallLikeExpression(node: Node): boolean; declare function isCallOrNewExpression(node: Node): boolean; declare function isTemplateLiteral(node: Node): boolean; declare function isAssertionExpression(node: Node): boolean; declare function isIterationStatement( node: Node, lookInLabeledStatements: false ): boolean; declare function isIterationStatement( node: Node, lookInLabeledStatements: boolean ): boolean; declare function isJsxOpeningLikeElement(node: Node): boolean; declare function isCaseOrDefaultClause(node: Node): boolean; declare function isJSDocCommentContainingNode(node: Node): boolean; declare function isSetAccessor(node: Node): boolean; declare function isGetAccessor(node: Node): boolean; declare function isObjectLiteralElement(node: Node): boolean; declare function isStringLiteralLike(node: Node): boolean; declare function createNode( kind: $Values, pos?: number, end?: number ): Node; declare function forEachChild( node: Node, cbNode: (node: Node) => T | void, cbNodes?: (nodes: NodeArray) => T | void ): T | void; declare function createSourceFile( fileName: string, sourceText: string, languageVersion: $Values, setParentNodes?: boolean, scriptKind?: $Values ): SourceFile; declare function parseIsolatedEntityName( text: string, languageVersion: $Values ): EntityName | void; declare function parseJsonText( fileName: string, sourceText: string ): JsonSourceFile; declare function isExternalModule(file: SourceFile): boolean; declare function updateSourceFile( sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean ): SourceFile; declare function parseCommandLine( commandLine: $ReadOnlyArray, readFile?: (path: string) => string | void ): ParsedCommandLine; declare type DiagnosticReporter = (diagnostic: Diagnostic) => void; declare type ConfigFileDiagnosticsReporter = { onUnRecoverableConfigFileDiagnostic: DiagnosticReporter }; declare type ParseConfigFileHost = { ...$Exact, ...$Exact, getCurrentDirectory(): string }; declare function getParsedCommandLineOfConfigFile( configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost ): ParsedCommandLine | void; declare function readConfigFile( fileName: string, readFile: (path: string) => string | void ): { config?: any, error?: Diagnostic }; declare function parseConfigFileTextToJson( fileName: string, jsonText: string ): { config?: any, error?: Diagnostic }; declare function readJsonConfigFile( fileName: string, readFile: (path: string) => string | void ): TsConfigSourceFile; declare function convertToObject( sourceFile: JsonSourceFile, errors: Push ): any; declare function parseJsonConfigFileContent( json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: $ReadOnlyArray ): ParsedCommandLine; declare function parseJsonSourceFileConfigFileContent( sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: $ReadOnlyArray ): ParsedCommandLine; declare function convertCompilerOptionsFromJson( jsonOptions: any, basePath: string, configFileName?: string ): { options: CompilerOptions, errors: Diagnostic[] }; declare function convertTypeAcquisitionFromJson( jsonOptions: any, basePath: string, configFileName?: string ): { options: TypeAcquisition, errors: Diagnostic[] }; declare function getEffectiveTypeRoots( options: CompilerOptions, host: GetEffectiveTypeRootsHost ): string[] | void; declare function resolveTypeReferenceDirective( typeReferenceDirectiveName: string, containingFile: string | void, options: CompilerOptions, host: ModuleResolutionHost, redirectedReference?: ResolvedProjectReference ): ResolvedTypeReferenceDirectiveWithFailedLookupLocations; declare function getAutomaticTypeDirectiveNames( options: CompilerOptions, host: ModuleResolutionHost ): string[]; declare type ModuleResolutionCache = { ...$Exact, getOrCreateCacheForDirectory( directoryName: string, redirectedReference?: ResolvedProjectReference ): Map }; declare type NonRelativeModuleNameResolutionCache = { getOrCreateCacheForModuleName( nonRelativeModuleName: string, redirectedReference?: ResolvedProjectReference ): PerModuleNameCache }; declare type PerModuleNameCache = { get(directory: string): ResolvedModuleWithFailedLookupLocations | void, set( directory: string, result: ResolvedModuleWithFailedLookupLocations ): void }; declare function createModuleResolutionCache( currentDirectory: string, getCanonicalFileName: (s: string) => string ): ModuleResolutionCache; declare function resolveModuleNameFromCache( moduleName: string, containingFile: string, cache: ModuleResolutionCache ): ResolvedModuleWithFailedLookupLocations | void; declare function resolveModuleName( moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference ): ResolvedModuleWithFailedLookupLocations; declare function nodeModuleNameResolver( moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache, redirectedReference?: ResolvedProjectReference ): ResolvedModuleWithFailedLookupLocations; declare function classicNameResolver( moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache, redirectedReference?: ResolvedProjectReference ): ResolvedModuleWithFailedLookupLocations; declare function createNodeArray( elements?: $ReadOnlyArray, hasTrailingComma?: boolean ): NodeArray; declare function createLiteral( value: | string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier ): StringLiteral; declare function createLiteral(value: number | PseudoBigInt): NumericLiteral; declare function createLiteral(value: boolean): BooleanLiteral; declare function createLiteral( value: string | number | PseudoBigInt | boolean ): PrimaryExpression; declare function createNumericLiteral(value: string): NumericLiteral; declare function createBigIntLiteral(value: string): BigIntLiteral; declare function createStringLiteral(text: string): StringLiteral; declare function createRegularExpressionLiteral( text: string ): RegularExpressionLiteral; declare function createIdentifier(text: string): Identifier; declare function updateIdentifier(node: Identifier): Identifier; declare function createTempVariable( recordTempVariable: ((node: Identifier) => void) | void ): Identifier; declare function createLoopVariable(): Identifier; declare function createUniqueName(text: string): Identifier; declare function createOptimisticUniqueName(text: string): Identifier; declare function createFileLevelUniqueName(text: string): Identifier; declare function getGeneratedNameForNode(node: Node | void): Identifier; declare function createToken>( token: TKind ): Token; declare function createSuper(): SuperExpression; declare function createThis(): ThisExpression & Token; declare function createNull(): NullLiteral & Token; declare function createTrue(): BooleanLiteral & Token; declare function createFalse(): BooleanLiteral & Token; declare function createModifier>( kind: T ): Token; declare function createModifiersFromModifierFlags( flags: $Values ): Modifier[]; declare function createQualifiedName( left: EntityName, right: string | Identifier ): QualifiedName; declare function updateQualifiedName( node: QualifiedName, left: EntityName, right: Identifier ): QualifiedName; declare function createComputedPropertyName( expression: Expression ): ComputedPropertyName; declare function updateComputedPropertyName( node: ComputedPropertyName, expression: Expression ): ComputedPropertyName; declare function createTypeParameterDeclaration( name: string | Identifier, constraint?: TypeNode, defaultType?: TypeNode ): TypeParameterDeclaration; declare function updateTypeParameterDeclaration( node: TypeParameterDeclaration, name: Identifier, constraint: TypeNode | void, defaultType: TypeNode | void ): TypeParameterDeclaration; declare function createParameter( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, dotDotDotToken: DotDotDotToken | void, name: string | BindingName, questionToken?: QuestionToken, type?: TypeNode, initializer?: Expression ): ParameterDeclaration; declare function updateParameter( node: ParameterDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, dotDotDotToken: DotDotDotToken | void, name: string | BindingName, questionToken: QuestionToken | void, type: TypeNode | void, initializer: Expression | void ): ParameterDeclaration; declare function createDecorator(expression: Expression): Decorator; declare function updateDecorator( node: Decorator, expression: Expression ): Decorator; declare function createPropertySignature( modifiers: $ReadOnlyArray | void, name: PropertyName | string, questionToken: QuestionToken | void, type: TypeNode | void, initializer: Expression | void ): PropertySignature; declare function updatePropertySignature( node: PropertySignature, modifiers: $ReadOnlyArray | void, name: PropertyName, questionToken: QuestionToken | void, type: TypeNode | void, initializer: Expression | void ): PropertySignature; declare function createProperty( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | void, type: TypeNode | void, initializer: Expression | void ): PropertyDeclaration; declare function updateProperty( node: PropertyDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | void, type: TypeNode | void, initializer: Expression | void ): PropertyDeclaration; declare function createMethodSignature( typeParameters: $ReadOnlyArray | void, parameters: $ReadOnlyArray, type: TypeNode | void, name: string | PropertyName, questionToken: QuestionToken | void ): MethodSignature; declare function updateMethodSignature( node: MethodSignature, typeParameters: NodeArray | void, parameters: NodeArray, type: TypeNode | void, name: PropertyName, questionToken: QuestionToken | void ): MethodSignature; declare function createMethod( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, asteriskToken: AsteriskToken | void, name: string | PropertyName, questionToken: QuestionToken | void, typeParameters: $ReadOnlyArray | void, parameters: $ReadOnlyArray, type: TypeNode | void, body: Block | void ): MethodDeclaration; declare function updateMethod( node: MethodDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, asteriskToken: AsteriskToken | void, name: PropertyName, questionToken: QuestionToken | void, typeParameters: $ReadOnlyArray | void, parameters: $ReadOnlyArray, type: TypeNode | void, body: Block | void ): MethodDeclaration; declare function createConstructor( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, parameters: $ReadOnlyArray, body: Block | void ): ConstructorDeclaration; declare function updateConstructor( node: ConstructorDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, parameters: $ReadOnlyArray, body: Block | void ): ConstructorDeclaration; declare function createGetAccessor( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: string | PropertyName, parameters: $ReadOnlyArray, type: TypeNode | void, body: Block | void ): GetAccessorDeclaration; declare function updateGetAccessor( node: GetAccessorDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: PropertyName, parameters: $ReadOnlyArray, type: TypeNode | void, body: Block | void ): GetAccessorDeclaration; declare function createSetAccessor( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: string | PropertyName, parameters: $ReadOnlyArray, body: Block | void ): SetAccessorDeclaration; declare function updateSetAccessor( node: SetAccessorDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: PropertyName, parameters: $ReadOnlyArray, body: Block | void ): SetAccessorDeclaration; declare function createCallSignature( typeParameters: $ReadOnlyArray | void, parameters: $ReadOnlyArray, type: TypeNode | void ): CallSignatureDeclaration; declare function updateCallSignature( node: CallSignatureDeclaration, typeParameters: NodeArray | void, parameters: NodeArray, type: TypeNode | void ): CallSignatureDeclaration; declare function createConstructSignature( typeParameters: $ReadOnlyArray | void, parameters: $ReadOnlyArray, type: TypeNode | void ): ConstructSignatureDeclaration; declare function updateConstructSignature( node: ConstructSignatureDeclaration, typeParameters: NodeArray | void, parameters: NodeArray, type: TypeNode | void ): ConstructSignatureDeclaration; declare function createIndexSignature( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, parameters: $ReadOnlyArray, type: TypeNode ): IndexSignatureDeclaration; declare function updateIndexSignature( node: IndexSignatureDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, parameters: $ReadOnlyArray, type: TypeNode ): IndexSignatureDeclaration; declare function createKeywordTypeNode( kind: $ElementType ): KeywordTypeNode; declare function createTypePredicateNode( parameterName: Identifier | ThisTypeNode | string, type: TypeNode ): TypePredicateNode; declare function updateTypePredicateNode( node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode ): TypePredicateNode; declare function createTypeReferenceNode( typeName: string | EntityName, typeArguments: $ReadOnlyArray | void ): TypeReferenceNode; declare function updateTypeReferenceNode( node: TypeReferenceNode, typeName: EntityName, typeArguments: NodeArray | void ): TypeReferenceNode; declare function createFunctionTypeNode( typeParameters: $ReadOnlyArray | void, parameters: $ReadOnlyArray, type: TypeNode | void ): FunctionTypeNode; declare function updateFunctionTypeNode( node: FunctionTypeNode, typeParameters: NodeArray | void, parameters: NodeArray, type: TypeNode | void ): FunctionTypeNode; declare function createConstructorTypeNode( typeParameters: $ReadOnlyArray | void, parameters: $ReadOnlyArray, type: TypeNode | void ): ConstructorTypeNode; declare function updateConstructorTypeNode( node: ConstructorTypeNode, typeParameters: NodeArray | void, parameters: NodeArray, type: TypeNode | void ): ConstructorTypeNode; declare function createTypeQueryNode(exprName: EntityName): TypeQueryNode; declare function updateTypeQueryNode( node: TypeQueryNode, exprName: EntityName ): TypeQueryNode; declare function createTypeLiteralNode( members: $ReadOnlyArray | void ): TypeLiteralNode; declare function updateTypeLiteralNode( node: TypeLiteralNode, members: NodeArray ): TypeLiteralNode; declare function createArrayTypeNode(elementType: TypeNode): ArrayTypeNode; declare function updateArrayTypeNode( node: ArrayTypeNode, elementType: TypeNode ): ArrayTypeNode; declare function createTupleTypeNode( elementTypes: $ReadOnlyArray ): TupleTypeNode; declare function updateTupleTypeNode( node: TupleTypeNode, elementTypes: $ReadOnlyArray ): TupleTypeNode; declare function createOptionalTypeNode(type: TypeNode): OptionalTypeNode; declare function updateOptionalTypeNode( node: OptionalTypeNode, type: TypeNode ): OptionalTypeNode; declare function createRestTypeNode(type: TypeNode): RestTypeNode; declare function updateRestTypeNode( node: RestTypeNode, type: TypeNode ): RestTypeNode; declare function createUnionTypeNode( types: $ReadOnlyArray ): UnionTypeNode; declare function updateUnionTypeNode( node: UnionTypeNode, types: NodeArray ): UnionTypeNode; declare function createIntersectionTypeNode( types: $ReadOnlyArray ): IntersectionTypeNode; declare function updateIntersectionTypeNode( node: IntersectionTypeNode, types: NodeArray ): IntersectionTypeNode; declare function createUnionOrIntersectionTypeNode( kind: typeof SyntaxKind.UnionType | typeof SyntaxKind.IntersectionType, types: $ReadOnlyArray ): UnionOrIntersectionTypeNode; declare function createConditionalTypeNode( checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode ): ConditionalTypeNode; declare function updateConditionalTypeNode( node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode ): ConditionalTypeNode; declare function createInferTypeNode( typeParameter: TypeParameterDeclaration ): InferTypeNode; declare function updateInferTypeNode( node: InferTypeNode, typeParameter: TypeParameterDeclaration ): InferTypeNode; declare function createImportTypeNode( argument: TypeNode, qualifier?: EntityName, typeArguments?: $ReadOnlyArray, isTypeOf?: boolean ): ImportTypeNode; declare function updateImportTypeNode( node: ImportTypeNode, argument: TypeNode, qualifier?: EntityName, typeArguments?: $ReadOnlyArray, isTypeOf?: boolean ): ImportTypeNode; declare function createParenthesizedType( type: TypeNode ): ParenthesizedTypeNode; declare function updateParenthesizedType( node: ParenthesizedTypeNode, type: TypeNode ): ParenthesizedTypeNode; declare function createThisTypeNode(): ThisTypeNode; declare function createTypeOperatorNode(type: TypeNode): TypeOperatorNode; declare function createTypeOperatorNode( operator: typeof SyntaxKind.KeyOfKeyword | typeof SyntaxKind.UniqueKeyword, type: TypeNode ): TypeOperatorNode; declare function updateTypeOperatorNode( node: TypeOperatorNode, type: TypeNode ): TypeOperatorNode; declare function createIndexedAccessTypeNode( objectType: TypeNode, indexType: TypeNode ): IndexedAccessTypeNode; declare function updateIndexedAccessTypeNode( node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode ): IndexedAccessTypeNode; declare function createMappedTypeNode( readonlyToken: ReadonlyToken | PlusToken | MinusToken | void, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | void, type: TypeNode | void ): MappedTypeNode; declare function updateMappedTypeNode( node: MappedTypeNode, readonlyToken: ReadonlyToken | PlusToken | MinusToken | void, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | void, type: TypeNode | void ): MappedTypeNode; declare function createLiteralTypeNode( literal: $ElementType ): LiteralTypeNode; declare function updateLiteralTypeNode( node: LiteralTypeNode, literal: $ElementType ): LiteralTypeNode; declare function createObjectBindingPattern( elements: $ReadOnlyArray ): ObjectBindingPattern; declare function updateObjectBindingPattern( node: ObjectBindingPattern, elements: $ReadOnlyArray ): ObjectBindingPattern; declare function createArrayBindingPattern( elements: $ReadOnlyArray ): ArrayBindingPattern; declare function updateArrayBindingPattern( node: ArrayBindingPattern, elements: $ReadOnlyArray ): ArrayBindingPattern; declare function createBindingElement( dotDotDotToken: DotDotDotToken | void, propertyName: string | PropertyName | void, name: string | BindingName, initializer?: Expression ): BindingElement; declare function updateBindingElement( node: BindingElement, dotDotDotToken: DotDotDotToken | void, propertyName: PropertyName | void, name: BindingName, initializer: Expression | void ): BindingElement; declare function createArrayLiteral( elements?: $ReadOnlyArray, multiLine?: boolean ): ArrayLiteralExpression; declare function updateArrayLiteral( node: ArrayLiteralExpression, elements: $ReadOnlyArray ): ArrayLiteralExpression; declare function createObjectLiteral( properties?: $ReadOnlyArray, multiLine?: boolean ): ObjectLiteralExpression; declare function updateObjectLiteral( node: ObjectLiteralExpression, properties: $ReadOnlyArray ): ObjectLiteralExpression; declare function createPropertyAccess( expression: Expression, name: string | Identifier | void ): PropertyAccessExpression; declare function updatePropertyAccess( node: PropertyAccessExpression, expression: Expression, name: Identifier ): PropertyAccessExpression; declare function createElementAccess( expression: Expression, index: number | Expression ): ElementAccessExpression; declare function updateElementAccess( node: ElementAccessExpression, expression: Expression, argumentExpression: Expression ): ElementAccessExpression; declare function createCall( expression: Expression, typeArguments: $ReadOnlyArray | void, argumentsArray: $ReadOnlyArray | void ): CallExpression; declare function updateCall( node: CallExpression, expression: Expression, typeArguments: $ReadOnlyArray | void, argumentsArray: $ReadOnlyArray ): CallExpression; declare function createNew( expression: Expression, typeArguments: $ReadOnlyArray | void, argumentsArray: $ReadOnlyArray | void ): NewExpression; declare function updateNew( node: NewExpression, expression: Expression, typeArguments: $ReadOnlyArray | void, argumentsArray: $ReadOnlyArray | void ): NewExpression; declare function createTaggedTemplate( tag: Expression, template: TemplateLiteral ): TaggedTemplateExpression; declare function createTaggedTemplate( tag: Expression, typeArguments: $ReadOnlyArray | void, template: TemplateLiteral ): TaggedTemplateExpression; declare function updateTaggedTemplate( node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral ): TaggedTemplateExpression; declare function updateTaggedTemplate( node: TaggedTemplateExpression, tag: Expression, typeArguments: $ReadOnlyArray | void, template: TemplateLiteral ): TaggedTemplateExpression; declare function createTypeAssertion( type: TypeNode, expression: Expression ): TypeAssertion; declare function updateTypeAssertion( node: TypeAssertion, type: TypeNode, expression: Expression ): TypeAssertion; declare function createParen(expression: Expression): ParenthesizedExpression; declare function updateParen( node: ParenthesizedExpression, expression: Expression ): ParenthesizedExpression; declare function createFunctionExpression( modifiers: $ReadOnlyArray | void, asteriskToken: AsteriskToken | void, name: string | Identifier | void, typeParameters: $ReadOnlyArray | void, parameters: $ReadOnlyArray | void, type: TypeNode | void, body: Block ): FunctionExpression; declare function updateFunctionExpression( node: FunctionExpression, modifiers: $ReadOnlyArray | void, asteriskToken: AsteriskToken | void, name: Identifier | void, typeParameters: $ReadOnlyArray | void, parameters: $ReadOnlyArray, type: TypeNode | void, body: Block ): FunctionExpression; declare function createArrowFunction( modifiers: $ReadOnlyArray | void, typeParameters: $ReadOnlyArray | void, parameters: $ReadOnlyArray, type: TypeNode | void, equalsGreaterThanToken: EqualsGreaterThanToken | void, body: ConciseBody ): ArrowFunction; declare function updateArrowFunction( node: ArrowFunction, modifiers: $ReadOnlyArray | void, typeParameters: $ReadOnlyArray | void, parameters: $ReadOnlyArray, type: TypeNode | void, equalsGreaterThanToken: Token, body: ConciseBody ): ArrowFunction; declare function createDelete(expression: Expression): DeleteExpression; declare function updateDelete( node: DeleteExpression, expression: Expression ): DeleteExpression; declare function createTypeOf(expression: Expression): TypeOfExpression; declare function updateTypeOf( node: TypeOfExpression, expression: Expression ): TypeOfExpression; declare function createVoid(expression: Expression): VoidExpression; declare function updateVoid( node: VoidExpression, expression: Expression ): VoidExpression; declare function createAwait(expression: Expression): AwaitExpression; declare function updateAwait( node: AwaitExpression, expression: Expression ): AwaitExpression; declare function createPrefix( operator: PrefixUnaryOperator, operand: Expression ): PrefixUnaryExpression; declare function updatePrefix( node: PrefixUnaryExpression, operand: Expression ): PrefixUnaryExpression; declare function createPostfix( operand: Expression, operator: PostfixUnaryOperator ): PostfixUnaryExpression; declare function updatePostfix( node: PostfixUnaryExpression, operand: Expression ): PostfixUnaryExpression; declare function createBinary( left: Expression, operator: BinaryOperator | BinaryOperatorToken, right: Expression ): BinaryExpression; declare function updateBinary( node: BinaryExpression, left: Expression, right: Expression, operator?: BinaryOperator | BinaryOperatorToken ): BinaryExpression; declare function createConditional( condition: Expression, whenTrue: Expression, whenFalse: Expression ): ConditionalExpression; declare function createConditional( condition: Expression, questionToken: QuestionToken, whenTrue: Expression, colonToken: ColonToken, whenFalse: Expression ): ConditionalExpression; declare function updateConditional( node: ConditionalExpression, condition: Expression, questionToken: Token, whenTrue: Expression, colonToken: Token, whenFalse: Expression ): ConditionalExpression; declare function createTemplateExpression( head: TemplateHead, templateSpans: $ReadOnlyArray ): TemplateExpression; declare function updateTemplateExpression( node: TemplateExpression, head: TemplateHead, templateSpans: $ReadOnlyArray ): TemplateExpression; declare function createTemplateHead(text: string): TemplateHead; declare function createTemplateMiddle(text: string): TemplateMiddle; declare function createTemplateTail(text: string): TemplateTail; declare function createNoSubstitutionTemplateLiteral( text: string ): NoSubstitutionTemplateLiteral; declare function createYield(expression?: Expression): YieldExpression; declare function createYield( asteriskToken: AsteriskToken | void, expression: Expression ): YieldExpression; declare function updateYield( node: YieldExpression, asteriskToken: AsteriskToken | void, expression: Expression ): YieldExpression; declare function createSpread(expression: Expression): SpreadElement; declare function updateSpread( node: SpreadElement, expression: Expression ): SpreadElement; declare function createClassExpression( modifiers: $ReadOnlyArray | void, name: string | Identifier | void, typeParameters: $ReadOnlyArray | void, heritageClauses: $ReadOnlyArray | void, members: $ReadOnlyArray ): ClassExpression; declare function updateClassExpression( node: ClassExpression, modifiers: $ReadOnlyArray | void, name: Identifier | void, typeParameters: $ReadOnlyArray | void, heritageClauses: $ReadOnlyArray | void, members: $ReadOnlyArray ): ClassExpression; declare function createOmittedExpression(): OmittedExpression; declare function createExpressionWithTypeArguments( typeArguments: $ReadOnlyArray | void, expression: Expression ): ExpressionWithTypeArguments; declare function updateExpressionWithTypeArguments( node: ExpressionWithTypeArguments, typeArguments: $ReadOnlyArray | void, expression: Expression ): ExpressionWithTypeArguments; declare function createAsExpression( expression: Expression, type: TypeNode ): AsExpression; declare function updateAsExpression( node: AsExpression, expression: Expression, type: TypeNode ): AsExpression; declare function createNonNullExpression( expression: Expression ): NonNullExpression; declare function updateNonNullExpression( node: NonNullExpression, expression: Expression ): NonNullExpression; declare function createMetaProperty( keywordToken: $ElementType, name: Identifier ): MetaProperty; declare function updateMetaProperty( node: MetaProperty, name: Identifier ): MetaProperty; declare function createTemplateSpan( expression: Expression, literal: TemplateMiddle | TemplateTail ): TemplateSpan; declare function updateTemplateSpan( node: TemplateSpan, expression: Expression, literal: TemplateMiddle | TemplateTail ): TemplateSpan; declare function createSemicolonClassElement(): SemicolonClassElement; declare function createBlock( statements: $ReadOnlyArray, multiLine?: boolean ): Block; declare function updateBlock( node: Block, statements: $ReadOnlyArray ): Block; declare function createVariableStatement( modifiers: $ReadOnlyArray | void, declarationList: | VariableDeclarationList | $ReadOnlyArray ): VariableStatement; declare function updateVariableStatement( node: VariableStatement, modifiers: $ReadOnlyArray | void, declarationList: VariableDeclarationList ): VariableStatement; declare function createEmptyStatement(): EmptyStatement; declare function createExpressionStatement( expression: Expression ): ExpressionStatement; declare function updateExpressionStatement( node: ExpressionStatement, expression: Expression ): ExpressionStatement; declare var createStatement: typeof createExpressionStatement; declare var updateStatement: typeof updateExpressionStatement; declare function createIf( expression: Expression, thenStatement: Statement, elseStatement?: Statement ): IfStatement; declare function updateIf( node: IfStatement, expression: Expression, thenStatement: Statement, elseStatement: Statement | void ): IfStatement; declare function createDo( statement: Statement, expression: Expression ): DoStatement; declare function updateDo( node: DoStatement, statement: Statement, expression: Expression ): DoStatement; declare function createWhile( expression: Expression, statement: Statement ): WhileStatement; declare function updateWhile( node: WhileStatement, expression: Expression, statement: Statement ): WhileStatement; declare function createFor( initializer: ForInitializer | void, condition: Expression | void, incrementor: Expression | void, statement: Statement ): ForStatement; declare function updateFor( node: ForStatement, initializer: ForInitializer | void, condition: Expression | void, incrementor: Expression | void, statement: Statement ): ForStatement; declare function createForIn( initializer: ForInitializer, expression: Expression, statement: Statement ): ForInStatement; declare function updateForIn( node: ForInStatement, initializer: ForInitializer, expression: Expression, statement: Statement ): ForInStatement; declare function createForOf( awaitModifier: AwaitKeywordToken | void, initializer: ForInitializer, expression: Expression, statement: Statement ): ForOfStatement; declare function updateForOf( node: ForOfStatement, awaitModifier: AwaitKeywordToken | void, initializer: ForInitializer, expression: Expression, statement: Statement ): ForOfStatement; declare function createContinue( label?: string | Identifier ): ContinueStatement; declare function updateContinue( node: ContinueStatement, label: Identifier | void ): ContinueStatement; declare function createBreak(label?: string | Identifier): BreakStatement; declare function updateBreak( node: BreakStatement, label: Identifier | void ): BreakStatement; declare function createReturn(expression?: Expression): ReturnStatement; declare function updateReturn( node: ReturnStatement, expression: Expression | void ): ReturnStatement; declare function createWith( expression: Expression, statement: Statement ): WithStatement; declare function updateWith( node: WithStatement, expression: Expression, statement: Statement ): WithStatement; declare function createSwitch( expression: Expression, caseBlock: CaseBlock ): SwitchStatement; declare function updateSwitch( node: SwitchStatement, expression: Expression, caseBlock: CaseBlock ): SwitchStatement; declare function createLabel( label: string | Identifier, statement: Statement ): LabeledStatement; declare function updateLabel( node: LabeledStatement, label: Identifier, statement: Statement ): LabeledStatement; declare function createThrow(expression: Expression): ThrowStatement; declare function updateThrow( node: ThrowStatement, expression: Expression ): ThrowStatement; declare function createTry( tryBlock: Block, catchClause: CatchClause | void, finallyBlock: Block | void ): TryStatement; declare function updateTry( node: TryStatement, tryBlock: Block, catchClause: CatchClause | void, finallyBlock: Block | void ): TryStatement; declare function createDebuggerStatement(): DebuggerStatement; declare function createVariableDeclaration( name: string | BindingName, type?: TypeNode, initializer?: Expression ): VariableDeclaration; declare function updateVariableDeclaration( node: VariableDeclaration, name: BindingName, type: TypeNode | void, initializer: Expression | void ): VariableDeclaration; declare function createVariableDeclarationList( declarations: $ReadOnlyArray, flags?: $Values ): VariableDeclarationList; declare function updateVariableDeclarationList( node: VariableDeclarationList, declarations: $ReadOnlyArray ): VariableDeclarationList; declare function createFunctionDeclaration( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, asteriskToken: AsteriskToken | void, name: string | Identifier | void, typeParameters: $ReadOnlyArray | void, parameters: $ReadOnlyArray, type: TypeNode | void, body: Block | void ): FunctionDeclaration; declare function updateFunctionDeclaration( node: FunctionDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, asteriskToken: AsteriskToken | void, name: Identifier | void, typeParameters: $ReadOnlyArray | void, parameters: $ReadOnlyArray, type: TypeNode | void, body: Block | void ): FunctionDeclaration; declare function createClassDeclaration( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: string | Identifier | void, typeParameters: $ReadOnlyArray | void, heritageClauses: $ReadOnlyArray | void, members: $ReadOnlyArray ): ClassDeclaration; declare function updateClassDeclaration( node: ClassDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: Identifier | void, typeParameters: $ReadOnlyArray | void, heritageClauses: $ReadOnlyArray | void, members: $ReadOnlyArray ): ClassDeclaration; declare function createInterfaceDeclaration( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: string | Identifier, typeParameters: $ReadOnlyArray | void, heritageClauses: $ReadOnlyArray | void, members: $ReadOnlyArray ): InterfaceDeclaration; declare function updateInterfaceDeclaration( node: InterfaceDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: Identifier, typeParameters: $ReadOnlyArray | void, heritageClauses: $ReadOnlyArray | void, members: $ReadOnlyArray ): InterfaceDeclaration; declare function createTypeAliasDeclaration( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: string | Identifier, typeParameters: $ReadOnlyArray | void, type: TypeNode ): TypeAliasDeclaration; declare function updateTypeAliasDeclaration( node: TypeAliasDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: Identifier, typeParameters: $ReadOnlyArray | void, type: TypeNode ): TypeAliasDeclaration; declare function createEnumDeclaration( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: string | Identifier, members: $ReadOnlyArray ): EnumDeclaration; declare function updateEnumDeclaration( node: EnumDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: Identifier, members: $ReadOnlyArray ): EnumDeclaration; declare function createModuleDeclaration( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: ModuleName, body: ModuleBody | void, flags?: $Values ): ModuleDeclaration; declare function updateModuleDeclaration( node: ModuleDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: ModuleName, body: ModuleBody | void ): ModuleDeclaration; declare function createModuleBlock( statements: $ReadOnlyArray ): ModuleBlock; declare function updateModuleBlock( node: ModuleBlock, statements: $ReadOnlyArray ): ModuleBlock; declare function createCaseBlock( clauses: $ReadOnlyArray ): CaseBlock; declare function updateCaseBlock( node: CaseBlock, clauses: $ReadOnlyArray ): CaseBlock; declare function createNamespaceExportDeclaration( name: string | Identifier ): NamespaceExportDeclaration; declare function updateNamespaceExportDeclaration( node: NamespaceExportDeclaration, name: Identifier ): NamespaceExportDeclaration; declare function createImportEqualsDeclaration( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: string | Identifier, moduleReference: ModuleReference ): ImportEqualsDeclaration; declare function updateImportEqualsDeclaration( node: ImportEqualsDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, name: Identifier, moduleReference: ModuleReference ): ImportEqualsDeclaration; declare function createImportDeclaration( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, importClause: ImportClause | void, moduleSpecifier: Expression ): ImportDeclaration; declare function updateImportDeclaration( node: ImportDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, importClause: ImportClause | void, moduleSpecifier: Expression ): ImportDeclaration; declare function createImportClause( name: Identifier | void, namedBindings: NamedImportBindings | void ): ImportClause; declare function updateImportClause( node: ImportClause, name: Identifier | void, namedBindings: NamedImportBindings | void ): ImportClause; declare function createNamespaceImport(name: Identifier): NamespaceImport; declare function updateNamespaceImport( node: NamespaceImport, name: Identifier ): NamespaceImport; declare function createNamedImports( elements: $ReadOnlyArray ): NamedImports; declare function updateNamedImports( node: NamedImports, elements: $ReadOnlyArray ): NamedImports; declare function createImportSpecifier( propertyName: Identifier | void, name: Identifier ): ImportSpecifier; declare function updateImportSpecifier( node: ImportSpecifier, propertyName: Identifier | void, name: Identifier ): ImportSpecifier; declare function createExportAssignment( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, isExportEquals: boolean | void, expression: Expression ): ExportAssignment; declare function updateExportAssignment( node: ExportAssignment, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, expression: Expression ): ExportAssignment; declare function createExportDeclaration( decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, exportClause: NamedExports | void, moduleSpecifier?: Expression ): ExportDeclaration; declare function updateExportDeclaration( node: ExportDeclaration, decorators: $ReadOnlyArray | void, modifiers: $ReadOnlyArray | void, exportClause: NamedExports | void, moduleSpecifier: Expression | void ): ExportDeclaration; declare function createNamedExports( elements: $ReadOnlyArray ): NamedExports; declare function updateNamedExports( node: NamedExports, elements: $ReadOnlyArray ): NamedExports; declare function createExportSpecifier( propertyName: string | Identifier | void, name: string | Identifier ): ExportSpecifier; declare function updateExportSpecifier( node: ExportSpecifier, propertyName: Identifier | void, name: Identifier ): ExportSpecifier; declare function createExternalModuleReference( expression: Expression ): ExternalModuleReference; declare function updateExternalModuleReference( node: ExternalModuleReference, expression: Expression ): ExternalModuleReference; declare function createJsxElement( openingElement: JsxOpeningElement, children: $ReadOnlyArray, closingElement: JsxClosingElement ): JsxElement; declare function updateJsxElement( node: JsxElement, openingElement: JsxOpeningElement, children: $ReadOnlyArray, closingElement: JsxClosingElement ): JsxElement; declare function createJsxSelfClosingElement( tagName: JsxTagNameExpression, typeArguments: $ReadOnlyArray | void, attributes: JsxAttributes ): JsxSelfClosingElement; declare function updateJsxSelfClosingElement( node: JsxSelfClosingElement, tagName: JsxTagNameExpression, typeArguments: $ReadOnlyArray | void, attributes: JsxAttributes ): JsxSelfClosingElement; declare function createJsxOpeningElement( tagName: JsxTagNameExpression, typeArguments: $ReadOnlyArray | void, attributes: JsxAttributes ): JsxOpeningElement; declare function updateJsxOpeningElement( node: JsxOpeningElement, tagName: JsxTagNameExpression, typeArguments: $ReadOnlyArray | void, attributes: JsxAttributes ): JsxOpeningElement; declare function createJsxClosingElement( tagName: JsxTagNameExpression ): JsxClosingElement; declare function updateJsxClosingElement( node: JsxClosingElement, tagName: JsxTagNameExpression ): JsxClosingElement; declare function createJsxFragment( openingFragment: JsxOpeningFragment, children: $ReadOnlyArray, closingFragment: JsxClosingFragment ): JsxFragment; declare function updateJsxFragment( node: JsxFragment, openingFragment: JsxOpeningFragment, children: $ReadOnlyArray, closingFragment: JsxClosingFragment ): JsxFragment; declare function createJsxAttribute( name: Identifier, initializer: StringLiteral | JsxExpression ): JsxAttribute; declare function updateJsxAttribute( node: JsxAttribute, name: Identifier, initializer: StringLiteral | JsxExpression ): JsxAttribute; declare function createJsxAttributes( properties: $ReadOnlyArray ): JsxAttributes; declare function updateJsxAttributes( node: JsxAttributes, properties: $ReadOnlyArray ): JsxAttributes; declare function createJsxSpreadAttribute( expression: Expression ): JsxSpreadAttribute; declare function updateJsxSpreadAttribute( node: JsxSpreadAttribute, expression: Expression ): JsxSpreadAttribute; declare function createJsxExpression( dotDotDotToken: DotDotDotToken | void, expression: Expression | void ): JsxExpression; declare function updateJsxExpression( node: JsxExpression, expression: Expression | void ): JsxExpression; declare function createCaseClause( expression: Expression, statements: $ReadOnlyArray ): CaseClause; declare function updateCaseClause( node: CaseClause, expression: Expression, statements: $ReadOnlyArray ): CaseClause; declare function createDefaultClause( statements: $ReadOnlyArray ): DefaultClause; declare function updateDefaultClause( node: DefaultClause, statements: $ReadOnlyArray ): DefaultClause; declare function createHeritageClause( token: $ElementType, types: $ReadOnlyArray ): HeritageClause; declare function updateHeritageClause( node: HeritageClause, types: $ReadOnlyArray ): HeritageClause; declare function createCatchClause( variableDeclaration: string | VariableDeclaration | void, block: Block ): CatchClause; declare function updateCatchClause( node: CatchClause, variableDeclaration: VariableDeclaration | void, block: Block ): CatchClause; declare function createPropertyAssignment( name: string | PropertyName, initializer: Expression ): PropertyAssignment; declare function updatePropertyAssignment( node: PropertyAssignment, name: PropertyName, initializer: Expression ): PropertyAssignment; declare function createShorthandPropertyAssignment( name: string | Identifier, objectAssignmentInitializer?: Expression ): ShorthandPropertyAssignment; declare function updateShorthandPropertyAssignment( node: ShorthandPropertyAssignment, name: Identifier, objectAssignmentInitializer: Expression | void ): ShorthandPropertyAssignment; declare function createSpreadAssignment( expression: Expression ): SpreadAssignment; declare function updateSpreadAssignment( node: SpreadAssignment, expression: Expression ): SpreadAssignment; declare function createEnumMember( name: string | PropertyName, initializer?: Expression ): EnumMember; declare function updateEnumMember( node: EnumMember, name: PropertyName, initializer: Expression | void ): EnumMember; declare function updateSourceFileNode( node: SourceFile, statements: $ReadOnlyArray, isDeclarationFile?: boolean, referencedFiles?: $ElementType, typeReferences?: $ElementType, hasNoDefaultLib?: boolean, libReferences?: $ElementType ): SourceFile; declare function getMutableClone(node: T): T; declare function createNotEmittedStatement( original: Node ): NotEmittedStatement; declare function createPartiallyEmittedExpression( expression: Expression, original?: Node ): PartiallyEmittedExpression; declare function updatePartiallyEmittedExpression( node: PartiallyEmittedExpression, expression: Expression ): PartiallyEmittedExpression; declare function createCommaList( elements: $ReadOnlyArray ): CommaListExpression; declare function updateCommaList( node: CommaListExpression, elements: $ReadOnlyArray ): CommaListExpression; declare function createBundle( sourceFiles: $ReadOnlyArray, prepends?: $ReadOnlyArray ): Bundle; declare function createUnparsedSourceFile(text: string): UnparsedSource; declare function createUnparsedSourceFile( inputFile: InputFiles, type: "js" | "dts" ): UnparsedSource; declare function createUnparsedSourceFile( text: string, mapPath: string | void, map: string | void ): UnparsedSource; declare function createInputFiles( javascriptText: string, declarationText: string ): InputFiles; declare function createInputFiles( readFileText: (path: string) => string | void, javascriptPath: string, javascriptMapPath: string | void, declarationPath: string, declarationMapPath: string | void ): InputFiles; declare function createInputFiles( javascriptText: string, declarationText: string, javascriptMapPath: string | void, javascriptMapText: string | void, declarationMapPath: string | void, declarationMapText: string | void ): InputFiles; declare function updateBundle( node: Bundle, sourceFiles: $ReadOnlyArray, prepends?: $ReadOnlyArray ): Bundle; declare function createImmediatelyInvokedFunctionExpression( statements: $ReadOnlyArray ): CallExpression; declare function createImmediatelyInvokedFunctionExpression( statements: $ReadOnlyArray, param: ParameterDeclaration, paramValue: Expression ): CallExpression; declare function createImmediatelyInvokedArrowFunction( statements: $ReadOnlyArray ): CallExpression; declare function createImmediatelyInvokedArrowFunction( statements: $ReadOnlyArray, param: ParameterDeclaration, paramValue: Expression ): CallExpression; declare function createComma(left: Expression, right: Expression): Expression; declare function createLessThan( left: Expression, right: Expression ): Expression; declare function createAssignment( left: ObjectLiteralExpression | ArrayLiteralExpression, right: Expression ): DestructuringAssignment; declare function createAssignment( left: Expression, right: Expression ): BinaryExpression; declare function createStrictEquality( left: Expression, right: Expression ): BinaryExpression; declare function createStrictInequality( left: Expression, right: Expression ): BinaryExpression; declare function createAdd( left: Expression, right: Expression ): BinaryExpression; declare function createSubtract( left: Expression, right: Expression ): BinaryExpression; declare function createPostfixIncrement( operand: Expression ): PostfixUnaryExpression; declare function createLogicalAnd( left: Expression, right: Expression ): BinaryExpression; declare function createLogicalOr( left: Expression, right: Expression ): BinaryExpression; declare function createLogicalNot(operand: Expression): PrefixUnaryExpression; declare function createVoidZero(): VoidExpression; declare function createExportDefault( expression: Expression ): ExportAssignment; declare function createExternalModuleExport( exportName: Identifier ): ExportDeclaration; declare function disposeEmitNodes(sourceFile: SourceFile): void; declare function setTextRange( range: T, location: TextRange | void ): T; declare function setEmitFlags( node: T, emitFlags: $Values ): T; declare function getSourceMapRange(node: Node): SourceMapRange; declare function setSourceMapRange( node: T, range: SourceMapRange | void ): T; declare function createSourceMapSource( fileName: string, text: string, skipTrivia?: (pos: number) => number ): SourceMapSource; declare function getTokenSourceMapRange( node: Node, token: $Values ): SourceMapRange | void; declare function setTokenSourceMapRange( node: T, token: $Values, range: SourceMapRange | void ): T; declare function getCommentRange(node: Node): TextRange; declare function setCommentRange(node: T, range: TextRange): T; declare function getSyntheticLeadingComments( node: Node ): SynthesizedComment[] | void; declare function setSyntheticLeadingComments( node: T, comments: SynthesizedComment[] | void ): T; declare function addSyntheticLeadingComment( node: T, kind: | typeof SyntaxKind.SingleLineCommentTrivia | typeof SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean ): T; declare function getSyntheticTrailingComments( node: Node ): SynthesizedComment[] | void; declare function setSyntheticTrailingComments( node: T, comments: SynthesizedComment[] | void ): T; declare function addSyntheticTrailingComment( node: T, kind: | typeof SyntaxKind.SingleLineCommentTrivia | typeof SyntaxKind.MultiLineCommentTrivia, text: string, hasTrailingNewLine?: boolean ): T; declare function moveSyntheticComments(node: T, original: Node): T; declare function getConstantValue( node: PropertyAccessExpression | ElementAccessExpression ): string | number | void; declare function setConstantValue( node: PropertyAccessExpression | ElementAccessExpression, value: string | number ): PropertyAccessExpression | ElementAccessExpression; declare function addEmitHelper(node: T, helper: EmitHelper): T; declare function addEmitHelpers( node: T, helpers: EmitHelper[] | void ): T; declare function removeEmitHelper(node: Node, helper: EmitHelper): boolean; declare function getEmitHelpers(node: Node): EmitHelper[] | void; declare function moveEmitHelpers( source: Node, target: Node, predicate: (helper: EmitHelper) => boolean ): void; declare function setOriginalNode(node: T, original: Node | void): T; declare function visitNode( node: T | void, visitor: Visitor | void, test?: (node: Node) => boolean, lift?: (node: NodeArray) => T ): T; declare function visitNode( node: T | void, visitor: Visitor | void, test?: (node: Node) => boolean, lift?: (node: NodeArray) => T ): T | void; declare function visitNodes( nodes: NodeArray | void, visitor: Visitor, test?: (node: Node) => boolean, start?: number, count?: number ): NodeArray; declare function visitNodes( nodes: NodeArray | void, visitor: Visitor, test?: (node: Node) => boolean, start?: number, count?: number ): NodeArray | void; declare function visitLexicalEnvironment( statements: NodeArray, visitor: Visitor, context: TransformationContext, start?: number, ensureUseStrict?: boolean ): NodeArray; declare function visitParameterList( nodes: NodeArray | void, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes ): NodeArray; declare function visitFunctionBody( node: FunctionBody, visitor: Visitor, context: TransformationContext ): FunctionBody; declare function visitFunctionBody( node: FunctionBody | void, visitor: Visitor, context: TransformationContext ): FunctionBody | void; declare function visitFunctionBody( node: ConciseBody, visitor: Visitor, context: TransformationContext ): ConciseBody; declare function visitEachChild( node: T, visitor: Visitor, context: TransformationContext ): T; declare function visitEachChild( node: T | void, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor ): T | void; declare function createPrinter( printerOptions?: PrinterOptions, handlers?: PrintHandlers ): Printer; declare function findConfigFile( searchPath: string, fileExists: (fileName: string) => boolean, configName?: string ): string | void; declare function resolveTripleslashReference( moduleName: string, containingFile: string ): string; declare function createCompilerHost( options: CompilerOptions, setParentNodes?: boolean ): CompilerHost; declare function getPreEmitDiagnostics( program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken ): $ReadOnlyArray; declare type FormatDiagnosticsHost = { getCurrentDirectory(): string, getCanonicalFileName(fileName: string): string, getNewLine(): string }; declare function formatDiagnostics( diagnostics: $ReadOnlyArray, host: FormatDiagnosticsHost ): string; declare function formatDiagnostic( diagnostic: Diagnostic, host: FormatDiagnosticsHost ): string; declare function formatDiagnosticsWithColorAndContext( diagnostics: $ReadOnlyArray, host: FormatDiagnosticsHost ): string; declare function flattenDiagnosticMessageText( messageText: string | DiagnosticMessageChain | void, newLine: string ): string; declare function getConfigFileParsingDiagnostics( configFileParseResult: ParsedCommandLine ): $ReadOnlyArray; declare function createProgram( createProgramOptions: CreateProgramOptions ): Program; declare function createProgram( rootNames: $ReadOnlyArray, options: CompilerOptions, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: $ReadOnlyArray ): Program; declare type ResolveProjectReferencePathHost = { fileExists(fileName: string): boolean }; declare function resolveProjectReferencePath( ref: ProjectReference ): ResolvedConfigFileName; declare function resolveProjectReferencePath( host: ResolveProjectReferencePathHost, ref: ProjectReference ): ResolvedConfigFileName; declare type EmitOutput = { outputFiles: OutputFile[], emitSkipped: boolean }; declare type OutputFile = { name: string, writeByteOrderMark: boolean, text: string }; declare type AffectedFileResult = { result: T, affected: SourceFile | Program } | void; declare type BuilderProgramHost = { useCaseSensitiveFileNames(): boolean, createHash?: (data: string) => string, writeFile?: WriteFileCallback }; declare type BuilderProgram = { getProgram(): Program, getCompilerOptions(): CompilerOptions, getSourceFile(fileName: string): SourceFile | void, getSourceFiles(): $ReadOnlyArray, getOptionsDiagnostics( cancellationToken?: CancellationToken ): $ReadOnlyArray, getGlobalDiagnostics( cancellationToken?: CancellationToken ): $ReadOnlyArray, getConfigFileParsingDiagnostics(): $ReadOnlyArray, getSyntacticDiagnostics( sourceFile?: SourceFile, cancellationToken?: CancellationToken ): $ReadOnlyArray, getDeclarationDiagnostics( sourceFile?: SourceFile, cancellationToken?: CancellationToken ): $ReadOnlyArray, getAllDependencies(sourceFile: SourceFile): $ReadOnlyArray, getSemanticDiagnostics( sourceFile?: SourceFile, cancellationToken?: CancellationToken ): $ReadOnlyArray, emit( targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers ): EmitResult, getCurrentDirectory(): string }; declare type SemanticDiagnosticsBuilderProgram = { ...$Exact, getSemanticDiagnosticsOfNextAffectedFile( cancellationToken?: CancellationToken, ignoreSourceFile?: (sourceFile: SourceFile) => boolean ): AffectedFileResult<$ReadOnlyArray> }; declare type EmitAndSemanticDiagnosticsBuilderProgram = { ...$Exact, emitNextAffectedFile( writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers ): AffectedFileResult }; declare function createSemanticDiagnosticsBuilderProgram( newProgram: Program, host: BuilderProgramHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: $ReadOnlyArray ): SemanticDiagnosticsBuilderProgram; declare function createSemanticDiagnosticsBuilderProgram( rootNames: $ReadOnlyArray | void, options: CompilerOptions | void, host?: CompilerHost, oldProgram?: SemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: $ReadOnlyArray, projectReferences?: $ReadOnlyArray ): SemanticDiagnosticsBuilderProgram; declare function createEmitAndSemanticDiagnosticsBuilderProgram( newProgram: Program, host: BuilderProgramHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: $ReadOnlyArray ): EmitAndSemanticDiagnosticsBuilderProgram; declare function createEmitAndSemanticDiagnosticsBuilderProgram( rootNames: $ReadOnlyArray | void, options: CompilerOptions | void, host?: CompilerHost, oldProgram?: EmitAndSemanticDiagnosticsBuilderProgram, configFileParsingDiagnostics?: $ReadOnlyArray, projectReferences?: $ReadOnlyArray ): EmitAndSemanticDiagnosticsBuilderProgram; declare function createAbstractBuilder( newProgram: Program, host: BuilderProgramHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: $ReadOnlyArray ): BuilderProgram; declare function createAbstractBuilder( rootNames: $ReadOnlyArray | void, options: CompilerOptions | void, host?: CompilerHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: $ReadOnlyArray, projectReferences?: $ReadOnlyArray ): BuilderProgram; declare type WatchStatusReporter = ( diagnostic: Diagnostic, newLine: string, options: CompilerOptions ) => void; declare type CreateProgram = ( rootNames: $ReadOnlyArray | void, options: CompilerOptions | void, host?: CompilerHost, oldProgram?: T, configFileParsingDiagnostics?: $ReadOnlyArray, projectReferences?: $ReadOnlyArray | void ) => T; declare type WatchHost = { onWatchStatusChange?: ( diagnostic: Diagnostic, newLine: string, options: CompilerOptions ) => void, watchFile( path: string, callback: FileWatcherCallback, pollingInterval?: number ): FileWatcher, watchDirectory( path: string, callback: DirectoryWatcherCallback, recursive?: boolean ): FileWatcher, setTimeout?: ( callback: (...args: any[]) => void, ms: number, ...args: any[] ) => any, clearTimeout?: (timeoutId: any) => void }; declare type ProgramHost = { createProgram: CreateProgram, useCaseSensitiveFileNames(): boolean, getNewLine(): string, getCurrentDirectory(): string, getDefaultLibFileName(options: CompilerOptions): string, getDefaultLibLocation?: () => string, createHash?: (data: string) => string, fileExists(path: string): boolean, readFile(path: string, encoding?: string): string | void, directoryExists?: (path: string) => boolean, getDirectories?: (path: string) => string[], readDirectory?: ( path: string, extensions?: $ReadOnlyArray, exclude?: $ReadOnlyArray, include?: $ReadOnlyArray, depth?: number ) => string[], realpath?: (path: string) => string, trace?: (s: string) => void, getEnvironmentVariable?: (name: string) => string | void, resolveModuleNames?: ( moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference ) => (ResolvedModule | void)[], resolveTypeReferenceDirectives?: ( typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference ) => (ResolvedTypeReferenceDirective | void)[] }; declare type WatchCompilerHost = { ...$Exact>, ...$Exact, afterProgramCreate?: (program: T) => void }; declare type WatchCompilerHostOfFilesAndCompilerOptions = { ...$Exact>, rootFiles: string[], options: CompilerOptions, projectReferences?: $ReadOnlyArray }; declare type WatchCompilerHostOfConfigFile = { ...$Exact>, ...$Exact, configFileName: string, optionsToExtend?: CompilerOptions, readDirectory( path: string, extensions?: $ReadOnlyArray, exclude?: $ReadOnlyArray, include?: $ReadOnlyArray, depth?: number ): string[] }; declare type Watch = { getProgram(): T }; declare type WatchOfConfigFile = { ...$Exact> }; declare type WatchOfFilesAndCompilerOptions = { ...$Exact>, updateRootFileNames(fileNames: string[]): void }; declare function createWatchCompilerHost( configFileName: string, optionsToExtend: CompilerOptions | void, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter ): WatchCompilerHostOfConfigFile; declare function createWatchCompilerHost( rootFiles: string[], options: CompilerOptions, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter, projectReferences?: $ReadOnlyArray ): WatchCompilerHostOfFilesAndCompilerOptions; declare function createWatchProgram( host: WatchCompilerHostOfFilesAndCompilerOptions ): WatchOfFilesAndCompilerOptions; declare function createWatchProgram( host: WatchCompilerHostOfConfigFile ): WatchOfConfigFile; declare type SourceFileLike = { getLineAndCharacterOfPosition(pos: number): LineAndCharacter }; declare type IScriptSnapshot = { getText(start: number, end: number): string, getLength(): number, getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange | void, dispose?: () => void }; declare function ScriptSnapshot$fromString(text: string): IScriptSnapshot; declare type PreProcessedFileInfo = { referencedFiles: FileReference[], typeReferenceDirectives: FileReference[], libReferenceDirectives: FileReference[], importedFiles: FileReference[], ambientExternalModules?: string[], isLibFile: boolean }; declare type HostCancellationToken = { isCancellationRequested(): boolean }; declare type InstallPackageOptions = { fileName: Path, packageName: string }; declare type LanguageServiceHost = { ...$Exact, getCompilationSettings(): CompilerOptions, getNewLine?: () => string, getProjectVersion?: () => string, getScriptFileNames(): string[], getScriptKind?: (fileName: string) => $Values, getScriptVersion(fileName: string): string, getScriptSnapshot(fileName: string): IScriptSnapshot | void, getProjectReferences?: () => $ReadOnlyArray | void, getLocalizedDiagnosticMessages?: () => any, getCancellationToken?: () => HostCancellationToken, getCurrentDirectory(): string, getDefaultLibFileName(options: CompilerOptions): string, log?: (s: string) => void, trace?: (s: string) => void, error?: (s: string) => void, useCaseSensitiveFileNames?: () => boolean, readDirectory?: ( path: string, extensions?: $ReadOnlyArray, exclude?: $ReadOnlyArray, include?: $ReadOnlyArray, depth?: number ) => string[], readFile?: (path: string, encoding?: string) => string | void, realpath?: (path: string) => string, fileExists?: (path: string) => boolean, getTypeRootsVersion?: () => number, resolveModuleNames?: ( moduleNames: string[], containingFile: string, reusedNames?: string[], redirectedReference?: ResolvedProjectReference ) => (ResolvedModule | void)[], getResolvedModuleWithFailedLookupLocationsFromCache?: ( modulename: string, containingFile: string ) => ResolvedModuleWithFailedLookupLocations | void, resolveTypeReferenceDirectives?: ( typeDirectiveNames: string[], containingFile: string, redirectedReference?: ResolvedProjectReference ) => (ResolvedTypeReferenceDirective | void)[], getDirectories?: (directoryName: string) => string[], getCustomTransformers?: () => CustomTransformers | void, isKnownTypesPackageName?: (name: string) => boolean, installPackage?: ( options: InstallPackageOptions ) => Promise, writeFile?: (fileName: string, content: string) => void }; declare type WithMetadata = T & { metadata?: mixed }; declare type LanguageService = { cleanupSemanticCache(): void, getSyntacticDiagnostics(fileName: string): DiagnosticWithLocation[], getSemanticDiagnostics(fileName: string): Diagnostic[], getSuggestionDiagnostics(fileName: string): DiagnosticWithLocation[], getCompilerOptionsDiagnostics(): Diagnostic[], getSyntacticClassifications( fileName: string, span: TextSpan ): ClassifiedSpan[], getSemanticClassifications( fileName: string, span: TextSpan ): ClassifiedSpan[], getEncodedSyntacticClassifications( fileName: string, span: TextSpan ): Classifications, getEncodedSemanticClassifications( fileName: string, span: TextSpan ): Classifications, getCompletionsAtPosition( fileName: string, position: number, options: GetCompletionsAtPositionOptions | void ): WithMetadata | void, getCompletionEntryDetails( fileName: string, position: number, name: string, formatOptions: FormatCodeOptions | FormatCodeSettings | void, source: string | void, preferences: UserPreferences | void ): CompletionEntryDetails | void, getCompletionEntrySymbol( fileName: string, position: number, name: string, source: string | void ): Symbol | void, getQuickInfoAtPosition( fileName: string, position: number ): QuickInfo | void, getNameOrDottedNameSpan( fileName: string, startPos: number, endPos: number ): TextSpan | void, getBreakpointStatementAtPosition( fileName: string, position: number ): TextSpan | void, getSignatureHelpItems( fileName: string, position: number, options: SignatureHelpItemsOptions | void ): SignatureHelpItems | void, getRenameInfo( fileName: string, position: number, options?: RenameInfoOptions ): RenameInfo, findRenameLocations( fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean ): $ReadOnlyArray | void, getDefinitionAtPosition( fileName: string, position: number ): $ReadOnlyArray | void, getDefinitionAndBoundSpan( fileName: string, position: number ): DefinitionInfoAndBoundSpan | void, getTypeDefinitionAtPosition( fileName: string, position: number ): $ReadOnlyArray | void, getImplementationAtPosition( fileName: string, position: number ): $ReadOnlyArray | void, getReferencesAtPosition( fileName: string, position: number ): ReferenceEntry[] | void, findReferences( fileName: string, position: number ): ReferencedSymbol[] | void, getDocumentHighlights( fileName: string, position: number, filesToSearch: string[] ): DocumentHighlights[] | void, getOccurrencesAtPosition( fileName: string, position: number ): $ReadOnlyArray | void, getNavigateToItems( searchValue: string, maxResultCount?: number, fileName?: string, excludeDtsFiles?: boolean ): NavigateToItem[], getNavigationBarItems(fileName: string): NavigationBarItem[], getNavigationTree(fileName: string): NavigationTree, getOutliningSpans(fileName: string): OutliningSpan[], getTodoComments( fileName: string, descriptors: TodoCommentDescriptor[] ): TodoComment[], getBraceMatchingAtPosition(fileName: string, position: number): TextSpan[], getIndentationAtPosition( fileName: string, position: number, options: EditorOptions | EditorSettings ): number, getFormattingEditsForRange( fileName: string, start: number, end: number, options: FormatCodeOptions | FormatCodeSettings ): TextChange[], getFormattingEditsForDocument( fileName: string, options: FormatCodeOptions | FormatCodeSettings ): TextChange[], getFormattingEditsAfterKeystroke( fileName: string, position: number, key: string, options: FormatCodeOptions | FormatCodeSettings ): TextChange[], getDocCommentTemplateAtPosition( fileName: string, position: number ): TextInsertion | void, isValidBraceCompletionAtPosition( fileName: string, position: number, openingBrace: number ): boolean, getJsxClosingTagAtPosition( fileName: string, position: number ): JsxClosingTagInfo | void, getSpanOfEnclosingComment( fileName: string, position: number, onlyMultiLine: boolean ): TextSpan | void, toLineColumnOffset?: ( fileName: string, position: number ) => LineAndCharacter, getCodeFixesAtPosition( fileName: string, start: number, end: number, errorCodes: $ReadOnlyArray, formatOptions: FormatCodeSettings, preferences: UserPreferences ): $ReadOnlyArray, getCombinedCodeFix( scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings, preferences: UserPreferences ): CombinedCodeActions, applyCodeActionCommand( action: CodeActionCommand, formatSettings?: FormatCodeSettings ): Promise, applyCodeActionCommand( action: CodeActionCommand[], formatSettings?: FormatCodeSettings ): Promise, applyCodeActionCommand( action: CodeActionCommand | CodeActionCommand[], formatSettings?: FormatCodeSettings ): Promise, applyCodeActionCommand( fileName: string, action: CodeActionCommand ): Promise, applyCodeActionCommand( fileName: string, action: CodeActionCommand[] ): Promise, applyCodeActionCommand( fileName: string, action: CodeActionCommand | CodeActionCommand[] ): Promise, getApplicableRefactors( fileName: string, positionOrRange: number | TextRange, preferences: UserPreferences | void ): ApplicableRefactorInfo[], getEditsForRefactor( fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string, preferences: UserPreferences | void ): RefactorEditInfo | void, organizeImports( scope: OrganizeImportsScope, formatOptions: FormatCodeSettings, preferences: UserPreferences | void ): $ReadOnlyArray, getEditsForFileRename( oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | void ): $ReadOnlyArray, getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput, getProgram(): Program | void, dispose(): void }; declare type JsxClosingTagInfo = { +newText: string }; declare type CombinedCodeFixScope = { type: "file", fileName: string }; declare type OrganizeImportsScope = CombinedCodeFixScope; declare type CompletionsTriggerCharacter = | "." | '"' | "'" | "`" | "/" | "@" | "<"; declare type GetCompletionsAtPositionOptions = { ...$Exact, triggerCharacter?: CompletionsTriggerCharacter, includeExternalModuleExports?: boolean, includeInsertTextCompletions?: boolean }; declare type SignatureHelpTriggerCharacter = "," | "(" | "<"; declare type SignatureHelpRetriggerCharacter = | SignatureHelpTriggerCharacter | ")"; declare type SignatureHelpItemsOptions = { triggerReason?: SignatureHelpTriggerReason }; declare type SignatureHelpTriggerReason = | SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason; declare type SignatureHelpInvokedReason = { kind: "invoked", triggerCharacter?: void }; declare type SignatureHelpCharacterTypedReason = { kind: "characterTyped", triggerCharacter: SignatureHelpTriggerCharacter }; declare type SignatureHelpRetriggeredReason = { kind: "retrigger", triggerCharacter?: SignatureHelpRetriggerCharacter }; declare type ApplyCodeActionCommandResult = { successMessage: string }; declare type Classifications = { spans: number[], endOfLineState: $Values }; declare type ClassifiedSpan = { textSpan: TextSpan, classificationType: $Values }; declare type NavigationBarItem = { text: string, kind: $Values, kindModifiers: string, spans: TextSpan[], childItems: NavigationBarItem[], indent: number, bolded: boolean, grayed: boolean }; declare type NavigationTree = { text: string, kind: $Values, kindModifiers: string, spans: TextSpan[], nameSpan: TextSpan | void, childItems?: NavigationTree[] }; declare type TodoCommentDescriptor = { text: string, priority: number }; declare type TodoComment = { descriptor: TodoCommentDescriptor, message: string, position: number }; declare type TextChange = { span: TextSpan, newText: string }; declare type FileTextChanges = { fileName: string, textChanges: TextChange[], isNewFile?: boolean }; declare type CodeAction = { description: string, changes: FileTextChanges[], commands?: CodeActionCommand[] }; declare type CodeFixAction = { ...$Exact, fixName: string, fixId?: {}, fixAllDescription?: string }; declare type CombinedCodeActions = { changes: $ReadOnlyArray, commands?: $ReadOnlyArray }; declare type CodeActionCommand = InstallPackageAction | GenerateTypesAction; declare type InstallPackageAction = {}; declare type GenerateTypesAction = { ...$Exact }; declare type GenerateTypesOptions = { +file: string, +fileToGenerateTypesFor: string, +outputFileName: string }; declare type ApplicableRefactorInfo = { name: string, description: string, inlineable?: boolean, actions: RefactorActionInfo[] }; declare type RefactorActionInfo = { name: string, description: string }; declare type RefactorEditInfo = { edits: FileTextChanges[], renameFilename?: string, renameLocation?: number, commands?: CodeActionCommand[] }; declare type TextInsertion = { newText: string, caretOffset: number }; declare type DocumentSpan = { textSpan: TextSpan, fileName: string, originalTextSpan?: TextSpan, originalFileName?: string }; declare type RenameLocation = { ...$Exact, +prefixText?: string, +suffixText?: string }; declare type ReferenceEntry = { ...$Exact, isWriteAccess: boolean, isDefinition: boolean, isInString?: true }; declare type ImplementationLocation = { ...$Exact, kind: $Values, displayParts: SymbolDisplayPart[] }; declare type DocumentHighlights = { fileName: string, highlightSpans: HighlightSpan[] }; declare var HighlightSpanKind: { +none: "none", // "none" +definition: "definition", // "definition" +reference: "reference", // "reference" +writtenReference: "writtenReference" // "writtenReference" }; declare type HighlightSpan = { fileName?: string, isInString?: true, textSpan: TextSpan, kind: $Values }; declare type NavigateToItem = { name: string, kind: $Values, kindModifiers: string, matchKind: "exact" | "prefix" | "substring" | "camelCase", isCaseSensitive: boolean, fileName: string, textSpan: TextSpan, containerName: string, containerKind: $Values }; declare var IndentStyle: { +None: 0, // 0 +Block: 1, // 1 +Smart: 2 // 2 }; declare type EditorOptions = { BaseIndentSize?: number, IndentSize: number, TabSize: number, NewLineCharacter: string, ConvertTabsToSpaces: boolean, IndentStyle: $Values }; declare type EditorSettings = { baseIndentSize?: number, indentSize?: number, tabSize?: number, newLineCharacter?: string, convertTabsToSpaces?: boolean, indentStyle?: $Values }; declare type FormatCodeOptions = { ...$Exact, InsertSpaceAfterCommaDelimiter: boolean, InsertSpaceAfterSemicolonInForStatements: boolean, InsertSpaceBeforeAndAfterBinaryOperators: boolean, InsertSpaceAfterConstructor?: boolean, InsertSpaceAfterKeywordsInControlFlowStatements: boolean, InsertSpaceAfterFunctionKeywordForAnonymousFunctions: boolean, InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: boolean, InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: boolean, InsertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean, InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: boolean, InsertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean, InsertSpaceAfterTypeAssertion?: boolean, InsertSpaceBeforeFunctionParenthesis?: boolean, PlaceOpenBraceOnNewLineForFunctions: boolean, PlaceOpenBraceOnNewLineForControlBlocks: boolean, insertSpaceBeforeTypeAnnotation?: boolean }; declare type FormatCodeSettings = { ...$Exact, +insertSpaceAfterCommaDelimiter?: boolean, +insertSpaceAfterSemicolonInForStatements?: boolean, +insertSpaceBeforeAndAfterBinaryOperators?: boolean, +insertSpaceAfterConstructor?: boolean, +insertSpaceAfterKeywordsInControlFlowStatements?: boolean, +insertSpaceAfterFunctionKeywordForAnonymousFunctions?: boolean, +insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis?: boolean, +insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets?: boolean, +insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces?: boolean, +insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces?: boolean, +insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces?: boolean, +insertSpaceAfterTypeAssertion?: boolean, +insertSpaceBeforeFunctionParenthesis?: boolean, +placeOpenBraceOnNewLineForFunctions?: boolean, +placeOpenBraceOnNewLineForControlBlocks?: boolean, +insertSpaceBeforeTypeAnnotation?: boolean, +indentMultiLineObjectLiteralBeginningOnBlankLine?: boolean }; declare function getDefaultFormatCodeSettings( newLineCharacter?: string ): FormatCodeSettings; declare type DefinitionInfo = { ...$Exact, kind: $Values, name: string, containerKind: $Values, containerName: string }; declare type DefinitionInfoAndBoundSpan = { definitions?: $ReadOnlyArray, textSpan: TextSpan }; declare type ReferencedSymbolDefinitionInfo = { ...$Exact, displayParts: SymbolDisplayPart[] }; declare type ReferencedSymbol = { definition: ReferencedSymbolDefinitionInfo, references: ReferenceEntry[] }; declare var SymbolDisplayPartKind: { +aliasName: 0, // 0 +className: 1, // 1 +enumName: 2, // 2 +fieldName: 3, // 3 +interfaceName: 4, // 4 +keyword: 5, // 5 +lineBreak: 6, // 6 +numericLiteral: 7, // 7 +stringLiteral: 8, // 8 +localName: 9, // 9 +methodName: 10, // 10 +moduleName: 11, // 11 +operator: 12, // 12 +parameterName: 13, // 13 +propertyName: 14, // 14 +punctuation: 15, // 15 +space: 16, // 16 +text: 17, // 17 +typeParameterName: 18, // 18 +enumMemberName: 19, // 19 +functionName: 20, // 20 +regularExpressionLiteral: 21 // 21 }; declare type SymbolDisplayPart = { text: string, kind: string }; declare type JSDocTagInfo = { name: string, text?: string }; declare type QuickInfo = { kind: $Values, kindModifiers: string, textSpan: TextSpan, displayParts?: SymbolDisplayPart[], documentation?: SymbolDisplayPart[], tags?: JSDocTagInfo[] }; declare type RenameInfo = RenameInfoSuccess | RenameInfoFailure; declare type RenameInfoSuccess = { canRename: true, fileToRename?: string, displayName: string, fullDisplayName: string, kind: $Values, kindModifiers: string, triggerSpan: TextSpan }; declare type RenameInfoFailure = { canRename: false, localizedErrorMessage: string }; declare type RenameInfoOptions = { +allowRenameOfImportPath?: boolean }; declare type SignatureHelpParameter = { name: string, documentation: SymbolDisplayPart[], displayParts: SymbolDisplayPart[], isOptional: boolean }; declare type SignatureHelpItem = { isVariadic: boolean, prefixDisplayParts: SymbolDisplayPart[], suffixDisplayParts: SymbolDisplayPart[], separatorDisplayParts: SymbolDisplayPart[], parameters: SignatureHelpParameter[], documentation: SymbolDisplayPart[], tags: JSDocTagInfo[] }; declare type SignatureHelpItems = { items: SignatureHelpItem[], applicableSpan: TextSpan, selectedItemIndex: number, argumentIndex: number, argumentCount: number }; declare type CompletionInfo = { isGlobalCompletion: boolean, isMemberCompletion: boolean, isNewIdentifierLocation: boolean, entries: CompletionEntry[] }; declare type CompletionEntry = { name: string, kind: $Values, kindModifiers?: string, sortText: string, insertText?: string, replacementSpan?: TextSpan, hasAction?: true, source?: string, isRecommended?: true }; declare type CompletionEntryDetails = { name: string, kind: $Values, kindModifiers: string, displayParts: SymbolDisplayPart[], documentation?: SymbolDisplayPart[], tags?: JSDocTagInfo[], codeActions?: CodeAction[], source?: SymbolDisplayPart[] }; declare type OutliningSpan = { textSpan: TextSpan, hintSpan: TextSpan, bannerText: string, autoCollapse: boolean, kind: $Values }; declare var OutliningSpanKind: { +Comment: "comment", // "comment" +Region: "region", // "region" +Code: "code", // "code" +Imports: "imports" // "imports" }; declare var OutputFileType: { +JavaScript: 0, // 0 +SourceMap: 1, // 1 +Declaration: 2 // 2 }; declare var EndOfLineState: { +None: 0, // 0 +InMultiLineCommentTrivia: 1, // 1 +InSingleQuoteStringLiteral: 2, // 2 +InDoubleQuoteStringLiteral: 3, // 3 +InTemplateHeadOrNoSubstitutionTemplate: 4, // 4 +InTemplateMiddleOrTail: 5, // 5 +InTemplateSubstitutionPosition: 6 // 6 }; declare var TokenClass: { +Punctuation: 0, // 0 +Keyword: 1, // 1 +Operator: 2, // 2 +Comment: 3, // 3 +Whitespace: 4, // 4 +Identifier: 5, // 5 +NumberLiteral: 6, // 6 +BigIntLiteral: 7, // 7 +StringLiteral: 8, // 8 +RegExpLiteral: 9 // 9 }; declare type ClassificationResult = { finalLexState: $Values, entries: ClassificationInfo[] }; declare type ClassificationInfo = { length: number, classification: $Values }; declare type Classifier = { getClassificationsForLine( text: string, lexState: $Values, syntacticClassifierAbsent: boolean ): ClassificationResult, getEncodedLexicalClassifications( text: string, endOfLineState: $Values, syntacticClassifierAbsent: boolean ): Classifications }; declare var ScriptElementKind: { +unknown: "", // "" +warning: "warning", // "warning" +keyword: "keyword", // "keyword" +scriptElement: "script", // "script" +moduleElement: "module", // "module" +classElement: "class", // "class" +localClassElement: "local class", // "local class" +interfaceElement: "interface", // "interface" +typeElement: "type", // "type" +enumElement: "enum", // "enum" +enumMemberElement: "enum member", // "enum member" +variableElement: "var", // "var" +localVariableElement: "local var", // "local var" +functionElement: "function", // "function" +localFunctionElement: "local function", // "local function" +memberFunctionElement: "method", // "method" +memberGetAccessorElement: "getter", // "getter" +memberSetAccessorElement: "setter", // "setter" +memberVariableElement: "property", // "property" +constructorImplementationElement: "constructor", // "constructor" +callSignatureElement: "call", // "call" +indexSignatureElement: "index", // "index" +constructSignatureElement: "construct", // "construct" +parameterElement: "parameter", // "parameter" +typeParameterElement: "type parameter", // "type parameter" +primitiveType: "primitive type", // "primitive type" +label: "label", // "label" +alias: "alias", // "alias" +constElement: "const", // "const" +letElement: "let", // "let" +directory: "directory", // "directory" +externalModuleName: "external module name", // "external module name" +jsxAttribute: "JSX attribute", // "JSX attribute" +string: "string" // "string" }; declare var ScriptElementKindModifier: { +none: "", // "" +publicMemberModifier: "public", // "public" +privateMemberModifier: "private", // "private" +protectedMemberModifier: "protected", // "protected" +exportedModifier: "export", // "export" +ambientModifier: "declare", // "declare" +staticModifier: "static", // "static" +abstractModifier: "abstract", // "abstract" +optionalModifier: "optional", // "optional" +dtsModifier: ".d.ts", // ".d.ts" +tsModifier: ".ts", // ".ts" +tsxModifier: ".tsx", // ".tsx" +jsModifier: ".js", // ".js" +jsxModifier: ".jsx", // ".jsx" +jsonModifier: ".json" // ".json" }; declare var ClassificationTypeNames: { +comment: "comment", // "comment" +identifier: "identifier", // "identifier" +keyword: "keyword", // "keyword" +numericLiteral: "number", // "number" +bigintLiteral: "bigint", // "bigint" +operator: "operator", // "operator" +stringLiteral: "string", // "string" +whiteSpace: "whitespace", // "whitespace" +text: "text", // "text" +punctuation: "punctuation", // "punctuation" +className: "class name", // "class name" +enumName: "enum name", // "enum name" +interfaceName: "interface name", // "interface name" +moduleName: "module name", // "module name" +typeParameterName: "type parameter name", // "type parameter name" +typeAliasName: "type alias name", // "type alias name" +parameterName: "parameter name", // "parameter name" +docCommentTagName: "doc comment tag name", // "doc comment tag name" +jsxOpenTagName: "jsx open tag name", // "jsx open tag name" +jsxCloseTagName: "jsx close tag name", // "jsx close tag name" +jsxSelfClosingTagName: "jsx self closing tag name", // "jsx self closing tag name" +jsxAttribute: "jsx attribute", // "jsx attribute" +jsxText: "jsx text", // "jsx text" +jsxAttributeStringLiteralValue: "jsx attribute string literal value" // "jsx attribute string literal value" }; declare var ClassificationType: { +comment: 1, // 1 +identifier: 2, // 2 +keyword: 3, // 3 +numericLiteral: 4, // 4 +operator: 5, // 5 +stringLiteral: 6, // 6 +regularExpressionLiteral: 7, // 7 +whiteSpace: 8, // 8 +text: 9, // 9 +punctuation: 10, // 10 +className: 11, // 11 +enumName: 12, // 12 +interfaceName: 13, // 13 +moduleName: 14, // 14 +typeParameterName: 15, // 15 +typeAliasName: 16, // 16 +parameterName: 17, // 17 +docCommentTagName: 18, // 18 +jsxOpenTagName: 19, // 19 +jsxCloseTagName: 20, // 20 +jsxSelfClosingTagName: 21, // 21 +jsxAttribute: 22, // 22 +jsxText: 23, // 23 +jsxAttributeStringLiteralValue: 24, // 24 +bigintLiteral: 25 // 25 }; declare function createClassifier(): Classifier; declare type DocumentRegistry = { acquireDocument( fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: $Values ): SourceFile, acquireDocumentWithKey( fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: $Values ): SourceFile, updateDocument( fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: $Values ): SourceFile, updateDocumentWithKey( fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: $Values ): SourceFile, getKeyForCompilationSettings( settings: CompilerOptions ): DocumentRegistryBucketKey, releaseDocument( fileName: string, compilationSettings: CompilerOptions ): void, releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void, reportStats(): string }; declare type DocumentRegistryBucketKey = string & { __bucketKey: any }; declare function createDocumentRegistry( useCaseSensitiveFileNames?: boolean, currentDirectory?: string ): DocumentRegistry; declare function preProcessFile( sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean ): PreProcessedFileInfo; declare type TranspileOptions = { compilerOptions?: CompilerOptions, fileName?: string, reportDiagnostics?: boolean, moduleName?: string, renamedDependencies?: MapLike, transformers?: CustomTransformers }; declare type TranspileOutput = { outputText: string, diagnostics?: Diagnostic[], sourceMapText?: string }; declare function transpileModule( input: string, transpileOptions: TranspileOptions ): TranspileOutput; declare function transpile( input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string ): string; declare function generateTypesForModule( name: string, moduleValue: mixed, formatSettings: FormatCodeSettings ): string; declare function generateTypesForGlobal( name: string, globalValue: mixed, formatSettings: FormatCodeSettings ): string; declare var servicesVersion: any; // "0.8"; declare function toEditorSettings( options: EditorOptions | EditorSettings ): EditorSettings; declare function displayPartsToString( displayParts: SymbolDisplayPart[] | void ): string; declare function getDefaultCompilerOptions(): CompilerOptions; declare function getSupportedCodeFixes(): string[]; declare function createLanguageServiceSourceFile( fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: $Values, version: string, setNodeParents: boolean, scriptKind?: $Values ): SourceFile; declare var disableIncrementalParsing: boolean; declare function updateLanguageServiceSourceFile( sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange | void, aggressiveChecks?: boolean ): SourceFile; declare function createLanguageService( host: LanguageServiceHost, documentRegistry?: DocumentRegistry, syntaxOnly?: boolean ): LanguageService; declare function getDefaultLibFilePath(options: CompilerOptions): string; declare function transform( source: T | T[], transformers: TransformerFactory[], compilerOptions?: CompilerOptions ): TransformationResult; declare type ActionSet = "action::set"; declare type ActionInvalidate = "action::invalidate"; declare type ActionPackageInstalled = "action::packageInstalled"; declare type ActionValueInspected = "action::valueInspected"; declare type EventTypesRegistry = "event::typesRegistry"; declare type EventBeginInstallTypes = "event::beginInstallTypes"; declare type EventEndInstallTypes = "event::endInstallTypes"; declare type EventInitializationFailed = "event::initializationFailed"; declare type TypingInstallerResponse = { +kind: | ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | ActionValueInspected | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed }; declare type TypingInstallerRequestWithProjectName = { +projectName: string }; declare type DiscoverTypings = { ...$Exact, +fileNames: string[], +projectRootPath: Path, +compilerOptions: CompilerOptions, +typeAcquisition: TypeAcquisition, +unresolvedImports: SortedReadonlyArray, +cachePath?: string, +kind: "discover" }; declare type CloseProject = { ...$Exact, +kind: "closeProject" }; declare type TypesRegistryRequest = { +kind: "typesRegistry" }; declare type InstallPackageRequest = { ...$Exact, +kind: "installPackage", +fileName: Path, +packageName: string, +projectRootPath: Path }; declare type PackageInstalledResponse = { ...$Exact, +kind: ActionPackageInstalled, +success: boolean, +message: string }; declare type InitializationFailedResponse = { ...$Exact, +kind: EventInitializationFailed, +message: string }; declare type ProjectResponse = { ...$Exact, +projectName: string }; declare type InvalidateCachedTypings = { ...$Exact, +kind: ActionInvalidate }; declare type InstallTypes = { ...$Exact, +kind: EventBeginInstallTypes | EventEndInstallTypes, +eventId: number, +typingsInstallerVersion: string, +packagesToInstall: $ReadOnlyArray }; declare type BeginInstallTypes = { ...$Exact, +kind: EventBeginInstallTypes }; declare type EndInstallTypes = { ...$Exact, +kind: EventEndInstallTypes, +installSuccess: boolean }; declare type SetTypings = { ...$Exact, +typeAcquisition: TypeAcquisition, +compilerOptions: CompilerOptions, +typings: string[], +unresolvedImports: SortedReadonlyArray, +kind: ActionSet }; } ================================================ FILE: flow-typed/npm/validate-commit-msg_vx.x.x.js ================================================ // flow-typed signature: 3171107e9ab9f3d93718e67d045d60ab // flow-typed version: <>/validate-commit-msg_v^2.14.0/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'validate-commit-msg' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'validate-commit-msg' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'validate-commit-msg/lib/cli' { declare module.exports: any; } declare module 'validate-commit-msg/lib/config' { declare module.exports: any; } declare module 'validate-commit-msg/lib/getGitFolder' { declare module.exports: any; } declare module 'validate-commit-msg/lib/validateMessage' { declare module.exports: any; } // Filename aliases declare module 'validate-commit-msg/index' { declare module.exports: $Exports<'validate-commit-msg'>; } declare module 'validate-commit-msg/index.js' { declare module.exports: $Exports<'validate-commit-msg'>; } declare module 'validate-commit-msg/lib/cli.js' { declare module.exports: $Exports<'validate-commit-msg/lib/cli'>; } declare module 'validate-commit-msg/lib/config.js' { declare module.exports: $Exports<'validate-commit-msg/lib/config'>; } declare module 'validate-commit-msg/lib/getGitFolder.js' { declare module.exports: $Exports<'validate-commit-msg/lib/getGitFolder'>; } declare module 'validate-commit-msg/lib/validateMessage.js' { declare module.exports: $Exports<'validate-commit-msg/lib/validateMessage'>; } ================================================ FILE: flow-typed/npm/vinyl-fs_vx.x.x.js ================================================ // flow-typed signature: 1e54efdda2ba4f17e510c9fa9a980cbc // flow-typed version: <>/vinyl-fs_v^3.0.2/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'vinyl-fs' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'vinyl-fs' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'vinyl-fs/lib/constants' { declare module.exports: any; } declare module 'vinyl-fs/lib/dest/index' { declare module.exports: any; } declare module 'vinyl-fs/lib/dest/options' { declare module.exports: any; } declare module 'vinyl-fs/lib/dest/prepare' { declare module.exports: any; } declare module 'vinyl-fs/lib/dest/sourcemap' { declare module.exports: any; } declare module 'vinyl-fs/lib/dest/write-contents/index' { declare module.exports: any; } declare module 'vinyl-fs/lib/dest/write-contents/write-buffer' { declare module.exports: any; } declare module 'vinyl-fs/lib/dest/write-contents/write-dir' { declare module.exports: any; } declare module 'vinyl-fs/lib/dest/write-contents/write-stream' { declare module.exports: any; } declare module 'vinyl-fs/lib/dest/write-contents/write-symbolic-link' { declare module.exports: any; } declare module 'vinyl-fs/lib/file-operations' { declare module.exports: any; } declare module 'vinyl-fs/lib/src/index' { declare module.exports: any; } declare module 'vinyl-fs/lib/src/options' { declare module.exports: any; } declare module 'vinyl-fs/lib/src/prepare' { declare module.exports: any; } declare module 'vinyl-fs/lib/src/read-contents/index' { declare module.exports: any; } declare module 'vinyl-fs/lib/src/read-contents/read-buffer' { declare module.exports: any; } declare module 'vinyl-fs/lib/src/read-contents/read-dir' { declare module.exports: any; } declare module 'vinyl-fs/lib/src/read-contents/read-stream' { declare module.exports: any; } declare module 'vinyl-fs/lib/src/read-contents/read-symbolic-link' { declare module.exports: any; } declare module 'vinyl-fs/lib/src/resolve-symlinks' { declare module.exports: any; } declare module 'vinyl-fs/lib/src/sourcemap' { declare module.exports: any; } declare module 'vinyl-fs/lib/src/wrap-vinyl' { declare module.exports: any; } declare module 'vinyl-fs/lib/symlink/index' { declare module.exports: any; } declare module 'vinyl-fs/lib/symlink/link-file' { declare module.exports: any; } declare module 'vinyl-fs/lib/symlink/options' { declare module.exports: any; } declare module 'vinyl-fs/lib/symlink/prepare' { declare module.exports: any; } // Filename aliases declare module 'vinyl-fs/index' { declare module.exports: $Exports<'vinyl-fs'>; } declare module 'vinyl-fs/index.js' { declare module.exports: $Exports<'vinyl-fs'>; } declare module 'vinyl-fs/lib/constants.js' { declare module.exports: $Exports<'vinyl-fs/lib/constants'>; } declare module 'vinyl-fs/lib/dest/index.js' { declare module.exports: $Exports<'vinyl-fs/lib/dest/index'>; } declare module 'vinyl-fs/lib/dest/options.js' { declare module.exports: $Exports<'vinyl-fs/lib/dest/options'>; } declare module 'vinyl-fs/lib/dest/prepare.js' { declare module.exports: $Exports<'vinyl-fs/lib/dest/prepare'>; } declare module 'vinyl-fs/lib/dest/sourcemap.js' { declare module.exports: $Exports<'vinyl-fs/lib/dest/sourcemap'>; } declare module 'vinyl-fs/lib/dest/write-contents/index.js' { declare module.exports: $Exports<'vinyl-fs/lib/dest/write-contents/index'>; } declare module 'vinyl-fs/lib/dest/write-contents/write-buffer.js' { declare module.exports: $Exports<'vinyl-fs/lib/dest/write-contents/write-buffer'>; } declare module 'vinyl-fs/lib/dest/write-contents/write-dir.js' { declare module.exports: $Exports<'vinyl-fs/lib/dest/write-contents/write-dir'>; } declare module 'vinyl-fs/lib/dest/write-contents/write-stream.js' { declare module.exports: $Exports<'vinyl-fs/lib/dest/write-contents/write-stream'>; } declare module 'vinyl-fs/lib/dest/write-contents/write-symbolic-link.js' { declare module.exports: $Exports<'vinyl-fs/lib/dest/write-contents/write-symbolic-link'>; } declare module 'vinyl-fs/lib/file-operations.js' { declare module.exports: $Exports<'vinyl-fs/lib/file-operations'>; } declare module 'vinyl-fs/lib/src/index.js' { declare module.exports: $Exports<'vinyl-fs/lib/src/index'>; } declare module 'vinyl-fs/lib/src/options.js' { declare module.exports: $Exports<'vinyl-fs/lib/src/options'>; } declare module 'vinyl-fs/lib/src/prepare.js' { declare module.exports: $Exports<'vinyl-fs/lib/src/prepare'>; } declare module 'vinyl-fs/lib/src/read-contents/index.js' { declare module.exports: $Exports<'vinyl-fs/lib/src/read-contents/index'>; } declare module 'vinyl-fs/lib/src/read-contents/read-buffer.js' { declare module.exports: $Exports<'vinyl-fs/lib/src/read-contents/read-buffer'>; } declare module 'vinyl-fs/lib/src/read-contents/read-dir.js' { declare module.exports: $Exports<'vinyl-fs/lib/src/read-contents/read-dir'>; } declare module 'vinyl-fs/lib/src/read-contents/read-stream.js' { declare module.exports: $Exports<'vinyl-fs/lib/src/read-contents/read-stream'>; } declare module 'vinyl-fs/lib/src/read-contents/read-symbolic-link.js' { declare module.exports: $Exports<'vinyl-fs/lib/src/read-contents/read-symbolic-link'>; } declare module 'vinyl-fs/lib/src/resolve-symlinks.js' { declare module.exports: $Exports<'vinyl-fs/lib/src/resolve-symlinks'>; } declare module 'vinyl-fs/lib/src/sourcemap.js' { declare module.exports: $Exports<'vinyl-fs/lib/src/sourcemap'>; } declare module 'vinyl-fs/lib/src/wrap-vinyl.js' { declare module.exports: $Exports<'vinyl-fs/lib/src/wrap-vinyl'>; } declare module 'vinyl-fs/lib/symlink/index.js' { declare module.exports: $Exports<'vinyl-fs/lib/symlink/index'>; } declare module 'vinyl-fs/lib/symlink/link-file.js' { declare module.exports: $Exports<'vinyl-fs/lib/symlink/link-file'>; } declare module 'vinyl-fs/lib/symlink/options.js' { declare module.exports: $Exports<'vinyl-fs/lib/symlink/options'>; } declare module 'vinyl-fs/lib/symlink/prepare.js' { declare module.exports: $Exports<'vinyl-fs/lib/symlink/prepare'>; } ================================================ FILE: flow-typed/npm/vinyl_vx.x.x.js ================================================ // flow-typed signature: 8548deefa8e7f5fa2a08051b66b1e2fd // flow-typed version: <>/vinyl_v^2.2.0/flow_v0.101.0 /** * This is an autogenerated libdef stub for: * * 'vinyl' * * Fill this stub out by replacing all the `any` types. * * Once filled out, we encourage you to share your work with the * community by sending a pull request to: * https://github.com/flowtype/flow-typed */ declare module 'vinyl' { declare module.exports: any; } /** * We include stubs for each file inside this npm package in case you need to * require those files directly. Feel free to delete any files that aren't * needed. */ declare module 'vinyl/lib/inspect-stream' { declare module.exports: any; } declare module 'vinyl/lib/is-stream' { declare module.exports: any; } declare module 'vinyl/lib/normalize' { declare module.exports: any; } // Filename aliases declare module 'vinyl/index' { declare module.exports: $Exports<'vinyl'>; } declare module 'vinyl/index.js' { declare module.exports: $Exports<'vinyl'>; } declare module 'vinyl/lib/inspect-stream.js' { declare module.exports: $Exports<'vinyl/lib/inspect-stream'>; } declare module 'vinyl/lib/is-stream.js' { declare module.exports: $Exports<'vinyl/lib/is-stream'>; } declare module 'vinyl/lib/normalize.js' { declare module.exports: $Exports<'vinyl/lib/normalize'>; } ================================================ FILE: package.json ================================================ { "name": "polished", "version": "4.3.1", "description": "A lightweight toolset for writing styles in Javascript.", "license": "MIT", "author": "Brian Hough (https://polished.js.org)", "homepage": "https://polished.js.org", "bugs": "https://github.com/styled-components/polished/issues", "repository": { "type": "git", "url": "git+https://github.com/styled-components/polished.git" }, "keywords": [ "styled-components", "polished", "emotion", "glamor", "css-in-js", "inline-styles", "react", "flow", "typescript", "color manipulate", "color manipulation", "curried color manipulation", "color", "colour" ], "main": "dist/polished.cjs.js", "module": "dist/polished.esm.js", "types": "lib/index.d.ts", "sideEffects": false, "scripts": { "build": "yarn build:lib && yarn build:dist && yarn build:flow && yarn build:docs && yarn build:typescript", "prebuild:lib": "shx rm -rf lib/*", "build:lib": "cross-env BABEL_ENV=cjs babel --out-dir lib src --ignore test.js", "prebuild:umd": "shx rm -rf dist/*", "prebuild:dist": "shx rm -rf dist/*", "build:dist": "rollup -c", "build:docs": "yarn build:docs:site", "prebuild:docs:site": "shx rm -rf docs/*", "build:docs:site": "documentation build src/** -t docs-theme --github -o docs -f html -c ./.documentation.json", "postbuild:docs:site": "shx cp CNAME docs/CNAME && shx cp dist/polished.js docs/assets/", "build:watch": "npm-watch", "build:flow": "flow-copy-source -v -i '{**/test/*.js,**/*.test.js}' src lib", "build:typescript": "tsgen \"lib/**/*.js.flow\" --ignore \"lib/**/_*.js.flow\"", "test": "jest src", "typescript": "tsc ./typescript-test.ts --noEmit --target es6 --module es2015 --moduleResolution node --allowJs", "lint": "eslint src", "flow": "flow check && flow batch-coverage src/ --show-all --strip-root", "docs": "pushstate-server -d docs", "prepare": "yarn build && yarn typescript && husky install", "semantic-release": "semantic-release" }, "lint-staged": { "src/**/*.js": [ "prettier --write", "eslint --fix" ] }, "watch": { "build:docs": "src/**/*.js", "build:lib": "src/**/*.js" }, "dependencies": { "@babel/runtime": "^7.17.8" }, "devDependencies": { "@babel/cli": "^7.17.6", "@babel/core": "^7.17.8", "@babel/eslint-parser": "^7.17.0", "@babel/plugin-transform-runtime": "^7.17.0", "@babel/polyfill": "^7.12.1", "@babel/preset-env": "^7.16.11", "@babel/preset-flow": "^7.16.7", "@rollup/plugin-babel": "^5.3.1", "@rollup/plugin-node-resolve": "^13.1.3", "@rollup/plugin-replace": "^4.0.0", "babel-eslint": "^10.1.0", "babel-jest": "^27.5.1", "babel-plugin-add-module-exports": "^1.0.2", "babel-plugin-preval": "5.1.0", "cross-env": "^7.0.3", "cz-conventional-changelog": "^3.1.0", "documentation": "12.3.0", "eslint": "^8.56.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-plugin-import": "^2.29.1", "flow-bin": "^0.133.0", "flow-copy-source": "^2.0.8", "husky": "^7.0.4", "jest": "^27.5.1", "lint-staged": "^12.3.7", "npm-watch": "^0.11.0", "prettier": "^3.2.4", "pushstate-server": "^3.1.0", "ramda": "^0.29.1", "rollup": "^2.70.1", "rollup-plugin-sourcemaps": "^0.6.3", "rollup-plugin-terser": "^7.0.2", "semantic-release": "^19.0.2", "shx": "^0.3.4", "tsgen": "1.3.0", "typescript": "4.6.3", "validate-commit-msg": "^2.14.0" }, "config": { "commitizen": { "path": "./node_modules/cz-conventional-changelog" } }, "jest": { "coverageDirectory": "./coverage/", "collectCoverage": true, "testURL": "http://localhost/", "verbose": true, "testEnvironment": "jsdom" }, "collective": { "type": "opencollective", "url": "https://opencollective.com/polished" }, "engines": { "node": ">=10" } } ================================================ FILE: rollup.config.js ================================================ import babel from "@rollup/plugin-babel"; import resolve from "@rollup/plugin-node-resolve"; import replace from "@rollup/plugin-replace"; import sourceMaps from "rollup-plugin-sourcemaps"; import { terser } from "rollup-plugin-terser"; const root = process.platform === "win32" ? path.resolve("/") : "/"; const external = (id) => !id.startsWith(".") && !id.startsWith(root); const globals = { "@babel/runtime/helpers/esm/extends": "extends", "@babel/runtime/helpers/esm/assertThisInitialized": "assertThisInitialized", "@babel/runtime/helpers/esm/inheritsLoose": "inheritsLoose", "@babel/runtime/helpers/esm/wrapNativeSuper": "wrapNativeSuper", "@babel/runtime/helpers/esm/taggedTemplateLiteralLoose": "taggedTemplateLiteralLoose", }; const input = "src/index.js"; const name = "polished"; const getBabelOptions = ({ useESModules }, targets) => ({ babelrc: false, babelHelpers: 'runtime', presets: [ [ "@babel/preset-env", { loose: true, modules: false, exclude: [/transform-typeof-symbol/], targets, bugfixes: true, }, ], "@babel/flow", ], plugins: [ "add-module-exports", "preval", [ "@babel/transform-runtime", { useESModules }, ">0.5%, not dead, ie >= 11, not op_mini all", ], ], }); export default [ { input, output: { file: `dist/${name}.esm.js`, format: "esm" }, external, plugins: [ sourceMaps(), resolve(), babel(getBabelOptions({ useESModules: true })), ], }, { input, output: { file: `dist/${name}.cjs.js`, format: "cjs" }, external, plugins: [ sourceMaps(), resolve(), babel(getBabelOptions({ useESModules: false })), ], }, { input, output: { file: `dist/${name}.js`, format: "umd", name, globals }, external, plugins: [ sourceMaps(), resolve(), babel(getBabelOptions({ useESModules: true })), replace({ "process.env.NODE_ENV": JSON.stringify("development") }), ], }, { input, output: { file: `dist/${name}.min.js`, format: "umd", name, globals }, external, plugins: [ sourceMaps(), resolve(), babel(getBabelOptions({ useESModules: true })), replace({ "process.env.NODE_ENV": JSON.stringify("production") }), terser(), ], }, ]; ================================================ FILE: src/color/adjustHue.js ================================================ // @flow import parseToHsl from './parseToHsl' import toColorString from './toColorString' import curry from '../internalHelpers/_curry' /** * Changes the hue of the color. Hue is a number between 0 to 360. The first * argument for adjustHue is the amount of degrees the color is rotated around * the color wheel, always producing a positive hue value. * * @example * // Styles as object usage * const styles = { * background: adjustHue(180, '#448'), * background: adjustHue('180', 'rgba(101,100,205,0.7)'), * } * * // styled-components usage * const div = styled.div` * background: ${adjustHue(180, '#448')}; * background: ${adjustHue('180', 'rgba(101,100,205,0.7)')}; * ` * * // CSS in JS Output * element { * background: "#888844"; * background: "rgba(136,136,68,0.7)"; * } */ function adjustHue(degree: number | string, color: string): string { if (color === 'transparent') return color const hslColor = parseToHsl(color) return toColorString({ ...hslColor, hue: hslColor.hue + parseFloat(degree), }) } // prettier-ignore const curriedAdjustHue = curry/* :: */(adjustHue) export default curriedAdjustHue ================================================ FILE: src/color/complement.js ================================================ // @flow import parseToHsl from './parseToHsl' import toColorString from './toColorString' /** * Returns the complement of the provided color. This is identical to adjustHue(180, ). * * @example * // Styles as object usage * const styles = { * background: complement('#448'), * background: complement('rgba(204,205,100,0.7)'), * } * * // styled-components usage * const div = styled.div` * background: ${complement('#448')}; * background: ${complement('rgba(204,205,100,0.7)')}; * ` * * // CSS in JS Output * element { * background: "#884"; * background: "rgba(153,153,153,0.7)"; * } */ export default function complement(color: string): string { if (color === 'transparent') return color const hslColor = parseToHsl(color) return toColorString({ ...hslColor, hue: (hslColor.hue + 180) % 360, }) } ================================================ FILE: src/color/darken.js ================================================ // @flow import curry from '../internalHelpers/_curry' import guard from '../internalHelpers/_guard' import parseToHsl from './parseToHsl' import toColorString from './toColorString' /** * Returns a string value for the darkened color. * * @example * // Styles as object usage * const styles = { * background: darken(0.2, '#FFCD64'), * background: darken('0.2', 'rgba(255,205,100,0.7)'), * } * * // styled-components usage * const div = styled.div` * background: ${darken(0.2, '#FFCD64')}; * background: ${darken('0.2', 'rgba(255,205,100,0.7)')}; * ` * * // CSS in JS Output * * element { * background: "#ffbd31"; * background: "rgba(255,189,49,0.7)"; * } */ function darken(amount: number | string, color: string): string { if (color === 'transparent') return color const hslColor = parseToHsl(color) return toColorString({ ...hslColor, lightness: guard(0, 1, hslColor.lightness - parseFloat(amount)), }) } // prettier-ignore const curriedDarken = curry/* :: */(darken) export default curriedDarken ================================================ FILE: src/color/desaturate.js ================================================ // @flow import curry from '../internalHelpers/_curry' import guard from '../internalHelpers/_guard' import parseToHsl from './parseToHsl' import toColorString from './toColorString' /** * Decreases the intensity of a color. Its range is between 0 to 1. The first * argument of the desaturate function is the amount by how much the color * intensity should be decreased. * * @example * // Styles as object usage * const styles = { * background: desaturate(0.2, '#CCCD64'), * background: desaturate('0.2', 'rgba(204,205,100,0.7)'), * } * * // styled-components usage * const div = styled.div` * background: ${desaturate(0.2, '#CCCD64')}; * background: ${desaturate('0.2', 'rgba(204,205,100,0.7)')}; * ` * * // CSS in JS Output * element { * background: "#b8b979"; * background: "rgba(184,185,121,0.7)"; * } */ function desaturate(amount: number | string, color: string): string { if (color === 'transparent') return color const hslColor = parseToHsl(color) return toColorString({ ...hslColor, saturation: guard(0, 1, hslColor.saturation - parseFloat(amount)), }) } // prettier-ignore const curriedDesaturate = curry/* :: */(desaturate) export default curriedDesaturate ================================================ FILE: src/color/getContrast.js ================================================ // @flow import getLuminance from './getLuminance' /** * Returns the contrast ratio between two colors based on * [W3's recommended equation for calculating contrast](http://www.w3.org/TR/WCAG20/#contrast-ratiodef). * * @example * const contrastRatio = getContrast('#444', '#fff'); */ export default function getContrast(color1: string, color2: string): number { const luminance1 = getLuminance(color1) const luminance2 = getLuminance(color2) return parseFloat( (luminance1 > luminance2 ? (luminance1 + 0.05) / (luminance2 + 0.05) : (luminance2 + 0.05) / (luminance1 + 0.05) ).toFixed(2), ) } ================================================ FILE: src/color/getLuminance.js ================================================ // @flow import parseToRgb from './parseToRgb' /** * Returns a number (float) representing the luminance of a color. * * @example * // Styles as object usage * const styles = { * background: getLuminance('#CCCD64') >= getLuminance('#0000ff') ? '#CCCD64' : '#0000ff', * background: getLuminance('rgba(58, 133, 255, 1)') >= getLuminance('rgba(255, 57, 149, 1)') ? * 'rgba(58, 133, 255, 1)' : * 'rgba(255, 57, 149, 1)', * } * * // styled-components usage * const div = styled.div` * background: ${getLuminance('#CCCD64') >= getLuminance('#0000ff') ? '#CCCD64' : '#0000ff'}; * background: ${getLuminance('rgba(58, 133, 255, 1)') >= getLuminance('rgba(255, 57, 149, 1)') ? * 'rgba(58, 133, 255, 1)' : * 'rgba(255, 57, 149, 1)'}; * * // CSS in JS Output * * div { * background: "#CCCD64"; * background: "rgba(58, 133, 255, 1)"; * } */ export default function getLuminance(color: string): number { if (color === 'transparent') return 0 const rgbColor: { [string]: number } = parseToRgb(color) const [r, g, b] = Object.keys(rgbColor).map(key => { const channel = rgbColor[key] / 255 return channel <= 0.03928 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4 }) return parseFloat((0.2126 * r + 0.7152 * g + 0.0722 * b).toFixed(3)) } ================================================ FILE: src/color/grayscale.js ================================================ // @flow import parseToHsl from './parseToHsl' import toColorString from './toColorString' /** * Converts the color to a grayscale, by reducing its saturation to 0. * * @example * // Styles as object usage * const styles = { * background: grayscale('#CCCD64'), * background: grayscale('rgba(204,205,100,0.7)'), * } * * // styled-components usage * const div = styled.div` * background: ${grayscale('#CCCD64')}; * background: ${grayscale('rgba(204,205,100,0.7)')}; * ` * * // CSS in JS Output * element { * background: "#999"; * background: "rgba(153,153,153,0.7)"; * } */ export default function grayscale(color: string): string { if (color === 'transparent') return color return toColorString({ ...parseToHsl(color), saturation: 0, }) } ================================================ FILE: src/color/hsl.js ================================================ // @flow import hslToHex from '../internalHelpers/_hslToHex' import PolishedError from '../internalHelpers/_errors' import type { HslColor } from '../types/color' /** * Returns a string value for the color. The returned result is the smallest possible hex notation. * * @example * // Styles as object usage * const styles = { * background: hsl(359, 0.75, 0.4), * background: hsl({ hue: 360, saturation: 0.75, lightness: 0.4 }), * } * * // styled-components usage * const div = styled.div` * background: ${hsl(359, 0.75, 0.4)}; * background: ${hsl({ hue: 360, saturation: 0.75, lightness: 0.4 })}; * ` * * // CSS in JS Output * * element { * background: "#b3191c"; * background: "#b3191c"; * } */ export default function hsl( value: HslColor | number, saturation?: number, lightness?: number, ): string { if ( typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number' ) { return hslToHex(value, saturation, lightness) } else if (typeof value === 'object' && saturation === undefined && lightness === undefined) { return hslToHex(value.hue, value.saturation, value.lightness) } throw new PolishedError(1) } ================================================ FILE: src/color/hslToColorString.js ================================================ // @flow import hsl from './hsl' import hsla from './hsla' import PolishedError from '../internalHelpers/_errors' import type { HslColor, HslaColor } from '../types/color' /** * Converts a HslColor or HslaColor object to a color string. * This util is useful in case you only know on runtime which color object is * used. Otherwise we recommend to rely on `hsl` or `hsla`. * * @example * // Styles as object usage * const styles = { * background: hslToColorString({ hue: 240, saturation: 1, lightness: 0.5 }), * background: hslToColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 }), * } * * // styled-components usage * const div = styled.div` * background: ${hslToColorString({ hue: 240, saturation: 1, lightness: 0.5 })}; * background: ${hslToColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 })}; * ` * * // CSS in JS Output * element { * background: "#00f"; * background: "rgba(179,25,25,0.72)"; * } */ export default function hslToColorString(color: HslColor | HslaColor | number): string { if ( typeof color === 'object' && typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' ) { if (color.alpha && typeof color.alpha === 'number') { return hsla({ hue: color.hue, saturation: color.saturation, lightness: color.lightness, alpha: color.alpha, }) } return hsl({ hue: color.hue, saturation: color.saturation, lightness: color.lightness, }) } throw new PolishedError(45) } ================================================ FILE: src/color/hsla.js ================================================ // @flow import hslToHex from '../internalHelpers/_hslToHex' import hslToRgb from '../internalHelpers/_hslToRgb' import PolishedError from '../internalHelpers/_errors' import type { HslaColor } from '../types/color' /** * Returns a string value for the color. The returned result is the smallest possible rgba or hex notation. * * @example * // Styles as object usage * const styles = { * background: hsla(359, 0.75, 0.4, 0.7), * background: hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 }), * background: hsla(359, 0.75, 0.4, 1), * } * * // styled-components usage * const div = styled.div` * background: ${hsla(359, 0.75, 0.4, 0.7)}; * background: ${hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 })}; * background: ${hsla(359, 0.75, 0.4, 1)}; * ` * * // CSS in JS Output * * element { * background: "rgba(179,25,28,0.7)"; * background: "rgba(179,25,28,0.7)"; * background: "#b3191c"; * } */ export default function hsla( value: HslaColor | number, saturation?: number, lightness?: number, alpha?: number, ): string { if ( typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number' && typeof alpha === 'number' ) { return alpha >= 1 ? hslToHex(value, saturation, lightness) : `rgba(${hslToRgb(value, saturation, lightness)},${alpha})` } else if ( typeof value === 'object' && saturation === undefined && lightness === undefined && alpha === undefined ) { return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : `rgba(${hslToRgb(value.hue, value.saturation, value.lightness)},${value.alpha})` } throw new PolishedError(2) } ================================================ FILE: src/color/invert.js ================================================ // @flow import parseToRgb from './parseToRgb' import toColorString from './toColorString' /** * Inverts the red, green and blue values of a color. * * @example * // Styles as object usage * const styles = { * background: invert('#CCCD64'), * background: invert('rgba(101,100,205,0.7)'), * } * * // styled-components usage * const div = styled.div` * background: ${invert('#CCCD64')}; * background: ${invert('rgba(101,100,205,0.7)')}; * ` * * // CSS in JS Output * * element { * background: "#33329b"; * background: "rgba(154,155,50,0.7)"; * } */ export default function invert(color: string): string { if (color === 'transparent') return color // parse color string to rgb const value = parseToRgb(color) return toColorString({ ...value, red: 255 - value.red, green: 255 - value.green, blue: 255 - value.blue, }) } ================================================ FILE: src/color/lighten.js ================================================ // @flow import curry from '../internalHelpers/_curry' import guard from '../internalHelpers/_guard' import parseToHsl from './parseToHsl' import toColorString from './toColorString' /** * Returns a string value for the lightened color. * * @example * // Styles as object usage * const styles = { * background: lighten(0.2, '#CCCD64'), * background: lighten('0.2', 'rgba(204,205,100,0.7)'), * } * * // styled-components usage * const div = styled.div` * background: ${lighten(0.2, '#FFCD64')}; * background: ${lighten('0.2', 'rgba(204,205,100,0.7)')}; * ` * * // CSS in JS Output * * element { * background: "#e5e6b1"; * background: "rgba(229,230,177,0.7)"; * } */ function lighten(amount: number | string, color: string): string { if (color === 'transparent') return color const hslColor = parseToHsl(color) return toColorString({ ...hslColor, lightness: guard(0, 1, hslColor.lightness + parseFloat(amount)), }) } // prettier-ignore const curriedLighten = curry/* :: */(lighten) export default curriedLighten ================================================ FILE: src/color/meetsContrastGuidelines.js ================================================ // @flow import getContrast from './getContrast' import type { ContrastScores } from '../types/color' /** * Determines which contrast guidelines have been met for two colors. * Based on the [contrast calculations recommended by W3](https://www.w3.org/WAI/WCAG21/Understanding/contrast-enhanced.html). * * @example * const scores = meetsContrastGuidelines('#444', '#fff'); */ export default function meetsContrastGuidelines(color1: string, color2: string): ContrastScores { const contrastRatio = getContrast(color1, color2) return { AA: contrastRatio >= 4.5, AALarge: contrastRatio >= 3, AAA: contrastRatio >= 7, AAALarge: contrastRatio >= 4.5, } } ================================================ FILE: src/color/mix.js ================================================ // @flow import curry from '../internalHelpers/_curry' import rgba from './rgba' import parseToRgb from './parseToRgb' /** * Mixes the two provided colors together by calculating the average of each of the RGB components weighted to the first color by the provided weight. * * @example * // Styles as object usage * const styles = { * background: mix(0.5, '#f00', '#00f') * background: mix(0.25, '#f00', '#00f') * background: mix('0.5', 'rgba(255, 0, 0, 0.5)', '#00f') * } * * // styled-components usage * const div = styled.div` * background: ${mix(0.5, '#f00', '#00f')}; * background: ${mix(0.25, '#f00', '#00f')}; * background: ${mix('0.5', 'rgba(255, 0, 0, 0.5)', '#00f')}; * ` * * // CSS in JS Output * * element { * background: "#7f007f"; * background: "#3f00bf"; * background: "rgba(63, 0, 191, 0.75)"; * } */ function mix(weight: number | string, color: string, otherColor: string): string { if (color === 'transparent') return otherColor if (otherColor === 'transparent') return color if (weight === 0) return otherColor const parsedColor1 = parseToRgb(color) const color1 = { ...parsedColor1, alpha: typeof parsedColor1.alpha === 'number' ? parsedColor1.alpha : 1, } const parsedColor2 = parseToRgb(otherColor) const color2 = { ...parsedColor2, alpha: typeof parsedColor2.alpha === 'number' ? parsedColor2.alpha : 1, } // The formula is copied from the original Sass implementation: // http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method const alphaDelta = color1.alpha - color2.alpha const x = parseFloat(weight) * 2 - 1 const y = x * alphaDelta === -1 ? x : x + alphaDelta const z = 1 + x * alphaDelta const weight1 = (y / z + 1) / 2.0 const weight2 = 1 - weight1 const mixedColor = { red: Math.floor(color1.red * weight1 + color2.red * weight2), green: Math.floor(color1.green * weight1 + color2.green * weight2), blue: Math.floor(color1.blue * weight1 + color2.blue * weight2), alpha: color1.alpha * parseFloat(weight) + color2.alpha * (1 - parseFloat(weight)), } return rgba(mixedColor) } // prettier-ignore const curriedMix = curry/* :: */(mix) export default curriedMix ================================================ FILE: src/color/opacify.js ================================================ // @flow import curry from '../internalHelpers/_curry' import guard from '../internalHelpers/_guard' import rgba from './rgba' import parseToRgb from './parseToRgb' /** * Increases the opacity of a color. Its range for the amount is between 0 to 1. * * * @example * // Styles as object usage * const styles = { * background: opacify(0.1, 'rgba(255, 255, 255, 0.9)'); * background: opacify(0.2, 'hsla(0, 0%, 100%, 0.5)'), * background: opacify('0.5', 'rgba(255, 0, 0, 0.2)'), * } * * // styled-components usage * const div = styled.div` * background: ${opacify(0.1, 'rgba(255, 255, 255, 0.9)')}; * background: ${opacify(0.2, 'hsla(0, 0%, 100%, 0.5)')}, * background: ${opacify('0.5', 'rgba(255, 0, 0, 0.2)')}, * ` * * // CSS in JS Output * * element { * background: "#fff"; * background: "rgba(255,255,255,0.7)"; * background: "rgba(255,0,0,0.7)"; * } */ function opacify(amount: number | string, color: string): string { if (color === 'transparent') return color const parsedColor = parseToRgb(color) const alpha: number = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1 const colorWithAlpha = { ...parsedColor, alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100), } return rgba(colorWithAlpha) } // prettier-ignore const curriedOpacify = curry/* :: */(opacify) export default curriedOpacify ================================================ FILE: src/color/parseToHsl.js ================================================ // @flow import parseToRgb from './parseToRgb' import rgbToHsl from '../internalHelpers/_rgbToHsl' import type { HslColor, HslaColor } from '../types/color' /** * Returns an HslColor or HslaColor object. This utility function is only useful * if want to extract a color component. With the color util `toColorString` you * can convert a HslColor or HslaColor object back to a string. * * @example * // Assigns `{ hue: 0, saturation: 1, lightness: 0.5 }` to color1 * const color1 = parseToHsl('rgb(255, 0, 0)'); * // Assigns `{ hue: 128, saturation: 1, lightness: 0.5, alpha: 0.75 }` to color2 * const color2 = parseToHsl('hsla(128, 100%, 50%, 0.75)'); */ export default function parseToHsl(color: string): HslColor | HslaColor { // Note: At a later stage we can optimize this function as right now a hsl // color would be parsed converted to rgb values and converted back to hsl. return rgbToHsl(parseToRgb(color)) } ================================================ FILE: src/color/parseToRgb.js ================================================ // @flow import hslToRgb from '../internalHelpers/_hslToRgb' import nameToHex from '../internalHelpers/_nameToHex' import PolishedError from '../internalHelpers/_errors' import type { RgbColor, RgbaColor } from '../types/color' const hexRegex = /^#[a-fA-F0-9]{6}$/ const hexRgbaRegex = /^#[a-fA-F0-9]{8}$/ const reducedHexRegex = /^#[a-fA-F0-9]{3}$/ const reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/ const rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i const rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i const hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i const hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i /** * Returns an RgbColor or RgbaColor object. This utility function is only useful * if want to extract a color component. With the color util `toColorString` you * can convert a RgbColor or RgbaColor object back to a string. * * @example * // Assigns `{ red: 255, green: 0, blue: 0 }` to color1 * const color1 = parseToRgb('rgb(255, 0, 0)'); * // Assigns `{ red: 92, green: 102, blue: 112, alpha: 0.75 }` to color2 * const color2 = parseToRgb('hsla(210, 10%, 40%, 0.75)'); */ export default function parseToRgb(color: string): RgbColor | RgbaColor { if (typeof color !== 'string') { throw new PolishedError(3) } const normalizedColor = nameToHex(color) if (normalizedColor.match(hexRegex)) { return { red: parseInt(`${normalizedColor[1]}${normalizedColor[2]}`, 16), green: parseInt(`${normalizedColor[3]}${normalizedColor[4]}`, 16), blue: parseInt(`${normalizedColor[5]}${normalizedColor[6]}`, 16), } } if (normalizedColor.match(hexRgbaRegex)) { const alpha = parseFloat( (parseInt(`${normalizedColor[7]}${normalizedColor[8]}`, 16) / 255).toFixed(2), ) return { red: parseInt(`${normalizedColor[1]}${normalizedColor[2]}`, 16), green: parseInt(`${normalizedColor[3]}${normalizedColor[4]}`, 16), blue: parseInt(`${normalizedColor[5]}${normalizedColor[6]}`, 16), alpha, } } if (normalizedColor.match(reducedHexRegex)) { return { red: parseInt(`${normalizedColor[1]}${normalizedColor[1]}`, 16), green: parseInt(`${normalizedColor[2]}${normalizedColor[2]}`, 16), blue: parseInt(`${normalizedColor[3]}${normalizedColor[3]}`, 16), } } if (normalizedColor.match(reducedRgbaHexRegex)) { const alpha = parseFloat( (parseInt(`${normalizedColor[4]}${normalizedColor[4]}`, 16) / 255).toFixed(2), ) return { red: parseInt(`${normalizedColor[1]}${normalizedColor[1]}`, 16), green: parseInt(`${normalizedColor[2]}${normalizedColor[2]}`, 16), blue: parseInt(`${normalizedColor[3]}${normalizedColor[3]}`, 16), alpha, } } const rgbMatched = rgbRegex.exec(normalizedColor) if (rgbMatched) { return { red: parseInt(`${rgbMatched[1]}`, 10), green: parseInt(`${rgbMatched[2]}`, 10), blue: parseInt(`${rgbMatched[3]}`, 10), } } const rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50)) if (rgbaMatched) { return { red: parseInt(`${rgbaMatched[1]}`, 10), green: parseInt(`${rgbaMatched[2]}`, 10), blue: parseInt(`${rgbaMatched[3]}`, 10), alpha: parseFloat(`${rgbaMatched[4]}`) > 1 ? parseFloat(`${rgbaMatched[4]}`) / 100 : parseFloat(`${rgbaMatched[4]}`), } } const hslMatched = hslRegex.exec(normalizedColor) if (hslMatched) { const hue = parseInt(`${hslMatched[1]}`, 10) const saturation = parseInt(`${hslMatched[2]}`, 10) / 100 const lightness = parseInt(`${hslMatched[3]}`, 10) / 100 const rgbColorString = `rgb(${hslToRgb(hue, saturation, lightness)})` const hslRgbMatched = rgbRegex.exec(rgbColorString) if (!hslRgbMatched) { throw new PolishedError(4, normalizedColor, rgbColorString) } return { red: parseInt(`${hslRgbMatched[1]}`, 10), green: parseInt(`${hslRgbMatched[2]}`, 10), blue: parseInt(`${hslRgbMatched[3]}`, 10), } } const hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50)) if (hslaMatched) { const hue = parseInt(`${hslaMatched[1]}`, 10) const saturation = parseInt(`${hslaMatched[2]}`, 10) / 100 const lightness = parseInt(`${hslaMatched[3]}`, 10) / 100 const rgbColorString = `rgb(${hslToRgb(hue, saturation, lightness)})` const hslRgbMatched = rgbRegex.exec(rgbColorString) if (!hslRgbMatched) { throw new PolishedError(4, normalizedColor, rgbColorString) } return { red: parseInt(`${hslRgbMatched[1]}`, 10), green: parseInt(`${hslRgbMatched[2]}`, 10), blue: parseInt(`${hslRgbMatched[3]}`, 10), alpha: parseFloat(`${hslaMatched[4]}`) > 1 ? parseFloat(`${hslaMatched[4]}`) / 100 : parseFloat(`${hslaMatched[4]}`), } } throw new PolishedError(5) } ================================================ FILE: src/color/readableColor.js ================================================ // @flow import getContrast from './getContrast' import getLuminance from './getLuminance' const defaultReturnIfLightColor = '#000' const defaultReturnIfDarkColor = '#fff' /** * Returns black or white (or optional passed colors) for best * contrast depending on the luminosity of the given color. * When passing custom return colors, strict mode ensures that the * return color always meets or exceeds WCAG level AA or greater. If this test * fails, the default return color (black or white) is returned in place of the * custom return color. You can optionally turn off strict mode. * * Follows [W3C specs for readability](https://www.w3.org/TR/WCAG20-TECHS/G18.html). * * @example * // Styles as object usage * const styles = { * color: readableColor('#000'), * color: readableColor('black', '#001', '#ff8'), * color: readableColor('white', '#001', '#ff8'), * color: readableColor('red', '#333', '#ddd', true) * } * * // styled-components usage * const div = styled.div` * color: ${readableColor('#000')}; * color: ${readableColor('black', '#001', '#ff8')}; * color: ${readableColor('white', '#001', '#ff8')}; * color: ${readableColor('red', '#333', '#ddd', true)}; * ` * * // CSS in JS Output * element { * color: "#fff"; * color: "#ff8"; * color: "#001"; * color: "#000"; * } */ export default function readableColor( color: string, returnIfLightColor?: string = defaultReturnIfLightColor, returnIfDarkColor?: string = defaultReturnIfDarkColor, strict?: boolean = true, ): string { const isColorLight = getLuminance(color) > 0.179 const preferredReturnColor = isColorLight ? returnIfLightColor : returnIfDarkColor if (!strict || getContrast(color, preferredReturnColor) >= 4.5) { return preferredReturnColor } return isColorLight ? defaultReturnIfLightColor : defaultReturnIfDarkColor } ================================================ FILE: src/color/rgb.js ================================================ // @flow import reduceHexValue from '../internalHelpers/_reduceHexValue' import toHex from '../internalHelpers/_numberToHex' import PolishedError from '../internalHelpers/_errors' import type { RgbColor } from '../types/color' /** * Returns a string value for the color. The returned result is the smallest possible hex notation. * * @example * // Styles as object usage * const styles = { * background: rgb(255, 205, 100), * background: rgb({ red: 255, green: 205, blue: 100 }), * } * * // styled-components usage * const div = styled.div` * background: ${rgb(255, 205, 100)}; * background: ${rgb({ red: 255, green: 205, blue: 100 })}; * ` * * // CSS in JS Output * * element { * background: "#ffcd64"; * background: "#ffcd64"; * } */ export default function rgb(value: RgbColor | number, green?: number, blue?: number): string { if (typeof value === 'number' && typeof green === 'number' && typeof blue === 'number') { return reduceHexValue(`#${toHex(value)}${toHex(green)}${toHex(blue)}`) } else if (typeof value === 'object' && green === undefined && blue === undefined) { return reduceHexValue(`#${toHex(value.red)}${toHex(value.green)}${toHex(value.blue)}`) } throw new PolishedError(6) } ================================================ FILE: src/color/rgbToColorString.js ================================================ // @flow import rgb from './rgb' import rgba from './rgba' import PolishedError from '../internalHelpers/_errors' import type { RgbColor, RgbaColor } from '../types/color' /** * Converts a RgbColor or RgbaColor object to a color string. * This util is useful in case you only know on runtime which color object is * used. Otherwise we recommend to rely on `rgb` or `rgba`. * * @example * // Styles as object usage * const styles = { * background: rgbToColorString({ red: 255, green: 205, blue: 100 }), * background: rgbToColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 }), * } * * // styled-components usage * const div = styled.div` * background: ${rgbToColorString({ red: 255, green: 205, blue: 100 })}; * background: ${rgbToColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 })}; * ` * * // CSS in JS Output * element { * background: "#ffcd64"; * background: "rgba(255,205,100,0.72)"; * } */ export default function rgbToColorString(color: RgbColor | RgbaColor): string { if ( typeof color === 'object' && typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' ) { if (typeof color.alpha === 'number') { return rgba({ red: color.red, green: color.green, blue: color.blue, alpha: color.alpha, }) } return rgb({ red: color.red, green: color.green, blue: color.blue }) } throw new PolishedError(46) } ================================================ FILE: src/color/rgba.js ================================================ // @flow import parseToRGB from './parseToRgb' import rgb from './rgb' import PolishedError from '../internalHelpers/_errors' import type { RgbaColor } from '../types/color' /** * Returns a string value for the color. The returned result is the smallest possible rgba or hex notation. * * Can also be used to fade a color by passing a hex value or named CSS color along with an alpha value. * * @example * // Styles as object usage * const styles = { * background: rgba(255, 205, 100, 0.7), * background: rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 }), * background: rgba(255, 205, 100, 1), * background: rgba('#ffffff', 0.4), * background: rgba('black', 0.7), * } * * // styled-components usage * const div = styled.div` * background: ${rgba(255, 205, 100, 0.7)}; * background: ${rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 })}; * background: ${rgba(255, 205, 100, 1)}; * background: ${rgba('#ffffff', 0.4)}; * background: ${rgba('black', 0.7)}; * ` * * // CSS in JS Output * * element { * background: "rgba(255,205,100,0.7)"; * background: "rgba(255,205,100,0.7)"; * background: "#ffcd64"; * background: "rgba(255,255,255,0.4)"; * background: "rgba(0,0,0,0.7)"; * } */ export default function rgba( firstValue: RgbaColor | number | string, secondValue?: number, thirdValue?: number, fourthValue?: number, ): string { if (typeof firstValue === 'string' && typeof secondValue === 'number') { const rgbValue = parseToRGB(firstValue) return `rgba(${rgbValue.red},${rgbValue.green},${rgbValue.blue},${secondValue})` } else if ( typeof firstValue === 'number' && typeof secondValue === 'number' && typeof thirdValue === 'number' && typeof fourthValue === 'number' ) { return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : `rgba(${firstValue},${secondValue},${thirdValue},${fourthValue})` } else if ( typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined ) { return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : `rgba(${firstValue.red},${firstValue.green},${firstValue.blue},${firstValue.alpha})` } throw new PolishedError(7) } ================================================ FILE: src/color/saturate.js ================================================ // @flow import curry from '../internalHelpers/_curry' import guard from '../internalHelpers/_guard' import parseToHsl from './parseToHsl' import toColorString from './toColorString' /** * Increases the intensity of a color. Its range is between 0 to 1. The first * argument of the saturate function is the amount by how much the color * intensity should be increased. * * @example * // Styles as object usage * const styles = { * background: saturate(0.2, '#CCCD64'), * background: saturate('0.2', 'rgba(204,205,100,0.7)'), * } * * // styled-components usage * const div = styled.div` * background: ${saturate(0.2, '#FFCD64')}; * background: ${saturate('0.2', 'rgba(204,205,100,0.7)')}; * ` * * // CSS in JS Output * * element { * background: "#e0e250"; * background: "rgba(224,226,80,0.7)"; * } */ function saturate(amount: number | string, color: string): string { if (color === 'transparent') return color const hslColor = parseToHsl(color) return toColorString({ ...hslColor, saturation: guard(0, 1, hslColor.saturation + parseFloat(amount)), }) } // prettier-ignore const curriedSaturate = curry/* :: */(saturate) export default curriedSaturate ================================================ FILE: src/color/setHue.js ================================================ // @flow import curry from '../internalHelpers/_curry' import parseToHsl from './parseToHsl' import toColorString from './toColorString' /** * Sets the hue of a color to the provided value. The hue range can be * from 0 and 359. * * @example * // Styles as object usage * const styles = { * background: setHue(42, '#CCCD64'), * background: setHue('244', 'rgba(204,205,100,0.7)'), * } * * // styled-components usage * const div = styled.div` * background: ${setHue(42, '#CCCD64')}; * background: ${setHue('244', 'rgba(204,205,100,0.7)')}; * ` * * // CSS in JS Output * element { * background: "#cdae64"; * background: "rgba(107,100,205,0.7)"; * } */ function setHue(hue: number | string, color: string): string { if (color === 'transparent') return color return toColorString({ ...parseToHsl(color), hue: parseFloat(hue), }) } // prettier-ignore const curriedSetHue = curry/* :: */(setHue) export default curriedSetHue ================================================ FILE: src/color/setLightness.js ================================================ // @flow import curry from '../internalHelpers/_curry' import parseToHsl from './parseToHsl' import toColorString from './toColorString' /** * Sets the lightness of a color to the provided value. The lightness range can be * from 0 and 1. * * @example * // Styles as object usage * const styles = { * background: setLightness(0.2, '#CCCD64'), * background: setLightness('0.75', 'rgba(204,205,100,0.7)'), * } * * // styled-components usage * const div = styled.div` * background: ${setLightness(0.2, '#CCCD64')}; * background: ${setLightness('0.75', 'rgba(204,205,100,0.7)')}; * ` * * // CSS in JS Output * element { * background: "#4d4d19"; * background: "rgba(223,224,159,0.7)"; * } */ function setLightness(lightness: number | string, color: string): string { if (color === 'transparent') return color return toColorString({ ...parseToHsl(color), lightness: parseFloat(lightness), }) } // prettier-ignore const curriedSetLightness = curry/* :: */(setLightness) export default curriedSetLightness ================================================ FILE: src/color/setSaturation.js ================================================ // @flow import curry from '../internalHelpers/_curry' import parseToHsl from './parseToHsl' import toColorString from './toColorString' /** * Sets the saturation of a color to the provided value. The saturation range can be * from 0 and 1. * * @example * // Styles as object usage * const styles = { * background: setSaturation(0.2, '#CCCD64'), * background: setSaturation('0.75', 'rgba(204,205,100,0.7)'), * } * * // styled-components usage * const div = styled.div` * background: ${setSaturation(0.2, '#CCCD64')}; * background: ${setSaturation('0.75', 'rgba(204,205,100,0.7)')}; * ` * * // CSS in JS Output * element { * background: "#adad84"; * background: "rgba(228,229,76,0.7)"; * } */ function setSaturation(saturation: number | string, color: string): string { if (color === 'transparent') return color return toColorString({ ...parseToHsl(color), saturation: parseFloat(saturation), }) } // prettier-ignore const curriedSetSaturation = curry/* :: */(setSaturation) export default curriedSetSaturation ================================================ FILE: src/color/shade.js ================================================ // @flow import curry from '../internalHelpers/_curry' import mix from './mix' /** * Shades a color by mixing it with black. `shade` can produce * hue shifts, where as `darken` manipulates the luminance channel and therefore * doesn't produce hue shifts. * * @example * // Styles as object usage * const styles = { * background: shade(0.25, '#00f') * } * * // styled-components usage * const div = styled.div` * background: ${shade(0.25, '#00f')}; * ` * * // CSS in JS Output * * element { * background: "#00003f"; * } */ function shade(percentage: number | string, color: string): string { if (color === 'transparent') return color return mix(parseFloat(percentage), 'rgb(0, 0, 0)', color) } // prettier-ignore const curriedShade = curry/* :: */(shade) export default curriedShade ================================================ FILE: src/color/test/adjustHue.test.js ================================================ // @flow import adjustHue from '../adjustHue' describe('adjustHue', () => { it('should adjustHue of a reduced hex color', () => { expect(adjustHue(20, '#448')).toEqual('#5b4488') }) it('should adjustHue of a hex color', () => { expect(adjustHue(20, '#CCCD64')).toEqual('#a9cd64') }) it('should adjustHue of an 8-digit hex color', () => { expect(adjustHue(20, '#6564CDB3')).toEqual('rgba(136,100,205,0.7)') }) it('should adjustHue of an 4-digit hex color', () => { expect(adjustHue(20, '#0f08')).toEqual('rgba(0,255,85,0.53)') }) it('should adjustHue of a color with opacity', () => { expect(adjustHue(20, 'rgba(101,100,205,0.7)')).toEqual('rgba(136,100,205,0.7)') }) it('should adjustHue of a color and not go beyond 360', () => { expect(adjustHue(350, '#448')).toEqual('#444f88') }) it('should adjustHue when passed a string for adjustment', () => { expect(adjustHue('20', '#448')).toEqual('#5b4488') }) it('should return transparent when passed transparent', () => { expect(adjustHue('20', 'transparent')).toEqual('transparent') }) }) ================================================ FILE: src/color/test/complement.test.js ================================================ // @flow import complement from '../complement' describe('complement', () => { it('should return the complement of a reduced hex color', () => { expect(complement('#448')).toEqual('#884') }) it('should return the complement of a hex color', () => { expect(complement('#CCCD64')).toEqual('#6564cd') }) it('should return the complement of an 8-digit hex color', () => { expect(complement('#6564CDB3')).toEqual('rgba(204,205,100,0.7)') }) it('should return the complement of an 4-digit hex color', () => { expect(complement('#0f08')).toEqual('rgba(255,0,255,0.53)') }) it('should return the complement of a color with opacity', () => { expect(complement('rgba(101,100,205,0.7)')).toEqual('rgba(204,205,100,0.7)') }) it('should return transparent when passed transparent', () => { expect(complement('transparent')).toEqual('transparent') }) }) ================================================ FILE: src/color/test/darken.test.js ================================================ // @flow import darken from '../darken' describe('darken', () => { it('should darken a color by 20%', () => { expect(darken(0.2, '#444')).toEqual('#111') }) it('should darken an 8-digit hex color by 20%', () => { expect(darken(0.2, '#6564CDB3')).toEqual('rgba(51,50,153,0.7)') }) it('should darken an 4-digit hex color by 30%', () => { expect(darken(0.3, '#0f08')).toEqual('rgba(0,102,0,0.53)') }) it('should darken a color with opacity by 20%', () => { expect(darken(0.2, 'rgba(101,100,205,0.7)')).toEqual('rgba(51,50,153,0.7)') }) it('should darken a color with a value of 255 and opacity by 10%', () => { expect(darken(0.1, 'rgba(255,140,140,0.7)')).toEqual('rgba(255,89,89,0.7)') }) it('should darken a color but not go below 0', () => { expect(darken(0.8, 'rgba(40,20,10,0.7)')).toEqual('rgba(0,0,0,0.7)') }) it('should darken a color by when passed a string for amount', () => { expect(darken('0.2', '#444')).toEqual('#111') }) it('should return transparent when passed transparent', () => { expect(darken('0.2', 'transparent')).toEqual('transparent') }) }) ================================================ FILE: src/color/test/desaturate.test.js ================================================ // @flow import desaturate from '../desaturate' describe('desaturate', () => { it('should desaturate a reduced hex color by 10%', () => { expect(desaturate(0.1, '#444')).toEqual('#444') }) it('should desaturate a hex color by 20%', () => { expect(desaturate(0.2, '#CCCD64')).toEqual('#b8b979') }) it('should desaturate an 8-digit hex color by 20%', () => { expect(desaturate(0.2, '#6564CDB3')).toEqual('rgba(121,121,185,0.7)') }) it('should desaturate an 4-digit hex color by 20%', () => { expect(desaturate(0.2, '#0f08')).toEqual('rgba(25,230,25,0.53)') }) it('should desaturate a color with opacity by 20%', () => { expect(desaturate(0.2, 'rgba(101,100,205,0.7)')).toEqual('rgba(121,121,185,0.7)') }) it('should desaturate a color but not go below 0', () => { expect(desaturate(0.8, 'rgba(40,20,10,0.7)')).toEqual('rgba(25,25,25,0.7)') }) it('should return transparent when passed transparent', () => { expect(desaturate(0.8, 'transparent')).toEqual('transparent') }) }) ================================================ FILE: src/color/test/getContrast.test.js ================================================ // @flow import getContrast from '../getContrast' describe('getContrast', () => { it('should return the color contrast of two hex colors', () => { expect(getContrast('#444', '#fff')).toEqual(9.72) }) it('should return the color contrast of two 8-digit hex colors', () => { expect(getContrast('#6564CDB3', '#ffffff')).toEqual(4.93) }) it('should return the color contrast of two 4-digit hex colors', () => { expect(getContrast('#0f08', '#000')).toEqual(15.3) }) it('should return the color contrast of two rgba colors', () => { expect(getContrast('rgba(101,100,205,0.7)', 'rgba(0,0,0,1)')).toEqual(4.26) }) it('should return the color contrast of two rgb colors', () => { expect(getContrast('rgb(204,205,100)', 'rgb(0,0,0)')).toEqual(12.48) }) it('should return the color contrast of two hsla colors', () => { expect(getContrast('hsla(250, 100%, 50%, 0.2)', 'hsla(0, 100%, 100%, 1)')).toEqual(8.27) }) it('should return the color contrast of two hsl colors', () => { expect(getContrast('hsl(0, 100%, 50%)', 'hsl(0, 100%, 100%)')).toEqual(3.99) }) it('should return the color contrast of two named CSS colors', () => { expect(getContrast('papayawhip', 'white')).toEqual(1.13) }) it('should return 1 when used with a transparent color', () => { expect(getContrast('transparent', '#000')).toEqual(1) }) }) ================================================ FILE: src/color/test/getLuminance.test.js ================================================ // @flow import getLuminance from '../getLuminance' describe('getLuminance', () => { it('should return the luminance of a hex color', () => { expect(getLuminance('#444')).toEqual(0.058) }) it('should return the luminance of an 8-digit hex color', () => { expect(getLuminance('#6564CDB3')).toEqual(0.163) }) it('should return the luminance of an 4-digit hex color', () => { expect(getLuminance('#0f08')).toEqual(0.715) }) it('should return the luminance of an rgba color', () => { expect(getLuminance('rgba(101,100,205,0.7)')).toEqual(0.163) }) it('should return the luminance of an rgb color', () => { expect(getLuminance('rgb(204,205,100)')).toEqual(0.574) }) it('should return the luminance of an hlsa color', () => { expect(getLuminance('hsla(250, 100%, 50%, 0.2)')).toEqual(0.077) }) it('should return the luminance of an hls color', () => { expect(getLuminance('hsl(0, 100%, 50%)')).toEqual(0.213) }) it('should return the luminance of a named CSS color', () => { expect(getLuminance('papayawhip')).toEqual(0.878) }) it('should return 0 when passed transparent', () => { expect(getLuminance('transparent')).toEqual(0) }) }) ================================================ FILE: src/color/test/grayscale.test.js ================================================ // @flow import grayscale from '../grayscale' describe('grayscale', () => { it('should grayscale a reduced hex color', () => { expect(grayscale('#444')).toEqual('#444') }) it('should grayscale a hex color', () => { expect(grayscale('#CCCD64')).toEqual('#999') }) it('should grayscale an 8-digit hex color', () => { expect(grayscale('#6564CDB3')).toEqual('rgba(153,153,153,0.7)') }) it('should grayscale an 4-digit hex color', () => { expect(grayscale('#0f08')).toEqual('rgba(128,128,128,0.53)') }) it('should grayscale a color with opacity', () => { expect(grayscale('rgba(101,100,205,0.7)')).toEqual('rgba(153,153,153,0.7)') }) it('should return transparent when passed transparent', () => { expect(grayscale('transparent')).toEqual('transparent') }) }) ================================================ FILE: src/color/test/hsl.test.js ================================================ // @flow import hsl from '../hsl' describe('hsl', () => { it('should convert numbers to a hex color', () => { expect({ background: hsl(360, 0.75, 0.4) }).toEqual({ background: '#b31919', }) }) it('should convert a hls object to a hex color', () => { expect({ background: hsl({ hue: 360, saturation: 0.75, lightness: 0.4 }), }).toEqual({ background: '#b31919', }) }) it('should convert to a reduce hex value if possible', () => { expect({ background: hsl(360, 1, 0.4) }).toEqual({ background: '#c00', }) }) it('should throw an error if an object and multiple arguments are passed', () => { expect(() => ({ background: hsl({ hue: 360, saturation: 0.75, lightness: 0.4 }, 250, 100), })).toThrow( 'Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).', ) }) }) ================================================ FILE: src/color/test/hslToColorString.test.js ================================================ // @flow import hslToColorString from '../hslToColorString' describe('hslToColorString', () => { it('should convert a HslColor to a reduced hex string', () => { expect({ background: hslToColorString({ hue: 240, saturation: 1, lightness: 0.5 }), }).toEqual({ background: '#00f', }) }) it('should convert a HslColor to a hex string', () => { expect({ background: hslToColorString({ hue: 360, saturation: 0.75, lightness: 0.4, }), }).toEqual({ background: '#b31919', }) }) it('should convert a HslaColor to a rgba string', () => { expect({ background: hslToColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72, }), }).toEqual({ background: 'rgba(179,25,25,0.72)', }) }) it('should throw an error if anything else than a HslColor or HslaColor is provided', () => { // $FlowFixMe expect(() => hslToColorString({ red: 255, green: 1, hue: 240 })).toThrow( 'Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.', ) }) }) ================================================ FILE: src/color/test/hsla.test.js ================================================ // @flow import hsla from '../hsla' describe('hsla', () => { it('should convert numbers to a rgba color', () => { expect({ background: hsla(360, 0.75, 0.4, 0.5) }).toEqual({ background: 'rgba(179,25,25,0.5)', }) }) it('should convert numbers to a hex color', () => { expect({ background: hsla(360, 0.75, 0.4, 1) }).toEqual({ background: '#b31919', }) }) it('should convert a hlsa object to a rgba color', () => { expect({ background: hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.5, }), }).toEqual({ background: 'rgba(179,25,25,0.5)', }) }) it('should convert a hlsa object to a hex color', () => { expect({ background: hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 1, }), }).toEqual({ background: '#b31919', }) }) it('should convert to a reduce hex value if possible', () => { expect({ background: hsla(360, 1, 0.4, 1) }).toEqual({ background: '#c00', }) }) it('should throw an error if an object and multiple arguments are passed', () => { expect(() => ({ background: hsla( { hue: 360, saturation: 0.75, lightness: 0.4, alpha: 1, }, 250, 100, 1, ), })).toThrow( 'Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).', ) }) }) ================================================ FILE: src/color/test/invert.test.js ================================================ // @flow import invert from '../invert' describe('invert', () => { it('should invert a reduced hex color', () => { expect(invert('#448')).toEqual('#bb7') }) it('should invert a hex color', () => { expect(invert('#CCCD64')).toEqual('#33329b') }) it('should invert an 8-digit hex color', () => { expect(invert('#6564CDB3')).toEqual('rgba(154,155,50,0.7)') }) it('should invert an 4-digit hex color', () => { expect(invert('#0f08')).toEqual('rgba(255,0,255,0.53)') }) it('should invert a color with opacity', () => { expect(invert('rgba(101,100,205,0.7)')).toEqual('rgba(154,155,50,0.7)') }) it('should return transparent when passed transparent', () => { expect(invert('transparent')).toEqual('transparent') }) }) ================================================ FILE: src/color/test/lighten.test.js ================================================ // @flow import lighten from '../lighten' describe('lighten', () => { it('should lighten a color by 10%', () => { expect(lighten(0.1, '#444')).toEqual('#5e5e5e') }) it('should lighten a hex color by 20%', () => { expect(lighten(0.2, '#CCCD64')).toEqual('#e5e6b1') }) it('should lighten an 8-digit hex color by 20%', () => { expect(lighten(0.2, '#6564CDB3')).toEqual('rgba(178,177,230,0.7)') }) it('should lighten an 4-digit hex color by 20%', () => { expect(lighten(0.2, '#0f08')).toEqual('rgba(102,255,102,0.53)') }) it('should lighten a color with opacity by 20%', () => { expect(lighten(0.2, 'rgba(101,100,205,0.7)')).toEqual('rgba(178,177,230,0.7)') }) it('should lighten a color but not go beyond 255', () => { expect(lighten(0.8, 'rgba(255,200,200,0.7)')).toEqual('rgba(255,255,255,0.7)') }) it('should lighten a color when passed a string for amount', () => { expect(lighten('0.1', '#444')).toEqual('#5e5e5e') }) it('should return transparent when passed transparent', () => { expect(lighten('0.1', 'transparent')).toEqual('transparent') }) }) ================================================ FILE: src/color/test/meetsContrastGuidelines.test.js ================================================ // @flow import meetsContrastGuidelines from '../meetsContrastGuidelines' describe('meetsContrastGuidelines', () => { it('should return the color contrast guidelines of two hex colors', () => { expect(meetsContrastGuidelines('#444', '#fff')).toEqual({ AA: true, AAA: true, AAALarge: true, AALarge: true, }) }) it('should return the color contrast guidelines of two 8-digit hex colors', () => { expect(meetsContrastGuidelines('#6564CDB3', '#ffffff')).toEqual({ AA: true, AAA: false, AAALarge: true, AALarge: true, }) }) it('should return the color contrast guidelines of two 4-digit hex colors', () => { expect(meetsContrastGuidelines('#0f08', '#000')).toEqual({ AA: true, AAA: true, AAALarge: true, AALarge: true, }) }) it('should return the color contrast guidelines of two rgba colors', () => { expect(meetsContrastGuidelines('rgba(101,100,205,0.7)', 'rgba(0,0,0,1)')).toEqual({ AA: false, AAA: false, AAALarge: false, AALarge: true, }) }) it('should return the color contrast guidelines of two rgb colors', () => { expect(meetsContrastGuidelines('rgb(204,205,100)', 'rgb(0,0,0)')).toEqual({ AA: true, AAA: true, AAALarge: true, AALarge: true, }) }) it('should return the color contrast guidelines of two hsla colors', () => { expect(meetsContrastGuidelines('hsla(250, 100%, 50%, 0.2)', 'hsla(0, 100%, 100%, 1)')).toEqual({ AA: true, AAA: true, AAALarge: true, AALarge: true, }) }) it('should return the color contrast guidelines of two hsl colors', () => { expect(meetsContrastGuidelines('hsl(0, 100%, 50%)', 'hsl(0, 100%, 100%)')).toEqual({ AA: false, AAA: false, AAALarge: false, AALarge: true, }) }) it('should return the color contrast guidelines of two named CSS colors', () => { expect(meetsContrastGuidelines('papayawhip', 'black')).toEqual({ AA: true, AAA: true, AAALarge: true, AALarge: true, }) }) it('should return failing contrast guidelines when used with a transparent color', () => { expect(meetsContrastGuidelines('transparent', '#000')).toEqual({ AA: false, AAA: false, AAALarge: false, AALarge: false, }) }) }) ================================================ FILE: src/color/test/mix.test.js ================================================ // @flow import mix from '../mix' describe('mix', () => { it('should mix two colors with by a weight of 25%', () => { expect(mix(0.25, '#f00', '#00f')).toEqual('#3f00bf') }) it('should mix a color with an 8-digit hex color', () => { expect(mix(0.5, '#FF00007F', '#00f')).toEqual('rgba(63,0,191,0.75)') }) it('should mix a 8-digit hex color with a 4-digit hex color', () => { expect(mix(0.5, '#FF00007F', '#0f08')).toEqual('rgba(123,131,0,0.515)') }) it('should mix a color with a color with an opacity lower than 1', () => { expect(mix(0.51, 'rgba(242, 236, 228, 0.5)', '#6b717f')).toEqual('rgba(141,144,153,0.745)') }) it('should mix two rgba colors', () => { expect(mix(0.7, 'rgba(0, 0, 0, 1)', 'rgba(255, 255, 255, 0)')).toEqual('rgba(0,0,0,0.7)') }) it('should mix two colors when weight is a string', () => { expect(mix('0.5', 'rgba(255, 0, 0, 0.5)', '#00f')).toEqual('rgba(63,0,191,0.75)') }) it('should return otherColor when passed transparent color', () => { expect(mix('0.5', 'transparent', '#00f')).toEqual('#00f') }) it('should return color when passed transparent otherColor', () => { expect(mix('0.5', 'rgba(255, 0, 0, 0.5)', 'transparent')).toEqual('rgba(255, 0, 0, 0.5)') }) it('should return transparent when passed transparent for both colors', () => { expect(mix('0.5', 'transparent', 'transparent')).toEqual('transparent') }) it('should return the second color when weight is 0', () => { expect(mix(0, 'rgba(0, 0, 0, 1)', 'rgba(255, 255, 255, 0)')).toEqual('rgba(255, 255, 255, 0)') }) }) ================================================ FILE: src/color/test/opacify.test.js ================================================ // @flow import opacify from '../opacify' describe('opacify', () => { it('should increase the opacity of hex #fff by 0.1 and still be 1', () => { expect(opacify(0.1, '#fff')).toEqual('#fff') }) it('should increase the opacity of an 8-digit hex color by 0.1 and still be 1', () => { expect(opacify(0.1, '#6564CDB3')).toEqual('rgba(101,100,205,0.8)') }) it('should increase the opacity of an 4-digit hex color by 0.1 and still be 1', () => { expect(opacify(0.1, '#0f08')).toEqual('rgba(0,255,0,0.63)') }) it('should increase the opacity of rgba(255, 0, 0, 0.5) by 0.1', () => { expect(opacify(0.1, 'rgba(101, 100, 205, 0.7)')).toEqual('rgba(101,100,205,0.8)') }) it('should increase the opacity of rgba(255, 0, 0, .5) by 0.5', () => { expect(opacify(0.5, 'rgba(255, 0, 0, .5)')).toEqual('#f00') }) it('should increase the opacity of hsl(0, 0%, 100%) by 0.2 and still be 1', () => { expect(opacify(0.2, 'hsl(0, 0%, 100%)')).toEqual('#fff') }) it('should increase the opacity of hsla(0, 0%, 100%, .3) by 0.5', () => { expect(opacify(0.5, 'hsla(0, 0%, 100%, .3)')).toEqual('rgba(255,255,255,0.8)') }) it('should not decrease the opacity below 0', () => { expect(opacify(-0.5, 'rgba(255, 0, 0, .2)')).toEqual('rgba(255,0,0,0)') }) it('should not increase the opacity beyond 1', () => { expect(opacify(0.5, 'rgba(255, 0, 0, .8)')).toEqual('#f00') }) it('should increase the opacity when passed a string for amount', () => { expect(opacify('0.1', '#fff')).toEqual('#fff') }) it('should return transparent when passed transparent', () => { expect(opacify('0.1', 'transparent')).toEqual('transparent') }) it('should throw an error when enter an invalid color', () => { expect(() => { opacify(0.5, 'not a color') }).toThrow( "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.", ) }) }) ================================================ FILE: src/color/test/parseToHsl.test.js ================================================ import parseToHsl from '../parseToHsl' describe('parseToHsl', () => { it('should parse a hex color representation', () => { expect(parseToHsl('#Ff43AE')).toEqual({ hue: 325.8510638297872, lightness: 0.6313725490196078, saturation: 1, }) }) it('should parse an 8-digit hex color representation', () => { expect(parseToHsl('#Ff43AEA7')).toEqual({ alpha: 0.65, hue: 325.8510638297872, lightness: 0.6313725490196078, saturation: 1, }) }) it('should parse an 4-digit hex color representation', () => { expect(parseToHsl('#0f08')).toEqual({ alpha: 0.53, hue: 120, lightness: 0.5, saturation: 1, }) }) it('should parse a reduced hex color representation', () => { expect(parseToHsl('#45a')).toEqual({ hue: 230, lightness: 0.4666666666666667, saturation: 0.42857142857142855, }) }) it('should parse a rgba color representation', () => { expect(parseToHsl('rgba(174,67,255,0.6)')).toEqual({ alpha: 0.6, hue: 274.1489361702128, lightness: 0.6313725490196078, saturation: 1, }) expect(parseToHsl('rgba(174 67 255 / 0.6)')).toEqual({ alpha: 0.6, hue: 274.1489361702128, lightness: 0.6313725490196078, saturation: 1, }) expect(parseToHsl('rgb(174 67 255 / 60%)')).toEqual({ alpha: 0.6, hue: 274.1489361702128, lightness: 0.6313725490196078, saturation: 1, }) }) it('should parse a rgba color representation with a precise alpha', () => { expect(parseToHsl('rgba(174,67,255,.12345)')).toEqual({ alpha: 0.12345, hue: 274.1489361702128, lightness: 0.6313725490196078, saturation: 1, }) expect(parseToHsl('rgba(174,67,255,12.345%)')).toEqual({ alpha: 0.12345, hue: 274.1489361702128, lightness: 0.6313725490196078, saturation: 1, }) }) it('should parse a rgb color representation', () => { expect(parseToHsl('rgb(174,67,255)')).toEqual({ hue: 274.1489361702128, lightness: 0.6313725490196078, saturation: 1, }) expect(parseToHsl('rgb(174 67 255)')).toEqual({ hue: 274.1489361702128, lightness: 0.6313725490196078, saturation: 1, }) }) it('should parse a hsl color representation', () => { expect(parseToHsl('hsl(210,10%,4%)')).toEqual({ hue: 210, lightness: 0.0392156862745098, saturation: 0.1, }) expect(parseToHsl('hsl(210deg 10% 4%)')).toEqual({ hue: 210, lightness: 0.0392156862745098, saturation: 0.1, }) }) it('should parse a hsl color representation with a float', () => { expect(parseToHsl('hsl(210.99,10%,4%)')).toEqual({ hue: 210, lightness: 0.0392156862745098, saturation: 0.1, }) expect(parseToHsl('hsl(210.99deg 10% 4%)')).toEqual({ hue: 210, lightness: 0.0392156862745098, saturation: 0.1, }) }) it('should parse a hsl 4 space-separated color representation', () => { expect(parseToHsl('hsl(210 10% 4%)')).toEqual({ hue: 210, lightness: 0.0392156862745098, saturation: 0.1, }) expect(parseToHsl('hsl(210deg 10% 4%)')).toEqual({ hue: 210, lightness: 0.0392156862745098, saturation: 0.1, }) }) it('should parse a hsl 4 space-separated color representation with a float', () => { expect(parseToHsl('hsl(210.99 10% 4%)')).toEqual({ hue: 210, lightness: 0.0392156862745098, saturation: 0.1, }) expect(parseToHsl('hsl(210.99deg 10% 4%)')).toEqual({ hue: 210, lightness: 0.0392156862745098, saturation: 0.1, }) }) it('should parse a hsla color representation', () => { expect(parseToHsl('hsla(210,10%,40%,0.75)')).toEqual({ alpha: 0.75, hue: 209.99999999999997, lightness: 0.4, saturation: 0.09803921568627451, }) expect(parseToHsl('hsla(210deg 10% 40% / 0.75)')).toEqual({ alpha: 0.75, hue: 209.99999999999997, lightness: 0.4, saturation: 0.09803921568627451, }) expect(parseToHsl('hsl(210deg 10% 40% / 75%)')).toEqual({ alpha: 0.75, hue: 209.99999999999997, lightness: 0.4, saturation: 0.09803921568627451, }) }) it('should parse a hsla color representation with a float', () => { expect(parseToHsl('hsla(210.99,10%,40%,0.75)')).toEqual({ alpha: 0.75, hue: 209.99999999999997, lightness: 0.4, saturation: 0.09803921568627451, }) expect(parseToHsl('hsla(210.99deg 10% 40% / 0.75)')).toEqual({ alpha: 0.75, hue: 209.99999999999997, lightness: 0.4, saturation: 0.09803921568627451, }) expect(parseToHsl('hsl(210.99deg 10% 40% / 75%)')).toEqual({ alpha: 0.75, hue: 209.99999999999997, lightness: 0.4, saturation: 0.09803921568627451, }) }) it('should parse a hsla color representation with a precise alpha', () => { expect(parseToHsl('hsla(210,10%,40%,.12345)')).toEqual({ alpha: 0.12345, hue: 209.99999999999997, lightness: 0.4, saturation: 0.09803921568627451, }) expect(parseToHsl('hsla(210,10%,40%,12.345%)')).toEqual({ alpha: 0.12345, hue: 209.99999999999997, lightness: 0.4, saturation: 0.09803921568627451, }) }) it('should parse a hsla 4 space-separated color representation', () => { expect(parseToHsl('hsla(210 10% 40% / 0.75)')).toEqual({ alpha: 0.75, hue: 209.99999999999997, lightness: 0.4, saturation: 0.09803921568627451, }) expect(parseToHsl('hsla(210deg 10% 40% / 0.75)')).toEqual({ alpha: 0.75, hue: 209.99999999999997, lightness: 0.4, saturation: 0.09803921568627451, }) expect(parseToHsl('hsl(210deg 10% 40% / 75%)')).toEqual({ alpha: 0.75, hue: 209.99999999999997, lightness: 0.4, saturation: 0.09803921568627451, }) }) it('should parse a hsla 4 space-separated color representation with a float', () => { expect(parseToHsl('hsla(210.99 10% 40% / 0.75)')).toEqual({ alpha: 0.75, hue: 209.99999999999997, lightness: 0.4, saturation: 0.09803921568627451, }) expect(parseToHsl('hsla(210.99deg 10% 40% / 0.75)')).toEqual({ alpha: 0.75, hue: 209.99999999999997, lightness: 0.4, saturation: 0.09803921568627451, }) expect(parseToHsl('hsl(210.99deg 10% 40% / 75%)')).toEqual({ alpha: 0.75, hue: 209.99999999999997, lightness: 0.4, saturation: 0.09803921568627451, }) }) it('should throw an error if an invalid color string is provided', () => { expect(() => { parseToHsl('(174,67,255)') }).toThrow( "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.", ) }) }) ================================================ FILE: src/color/test/parseToRgb.test.js ================================================ import parseToRgb from '../parseToRgb' describe('parseToRgb', () => { it('should parse a hex color representation', () => { expect(parseToRgb('#Ff43AE')).toEqual({ blue: 174, green: 67, red: 255, }) }) it('should parse an 8-digit hex color representation', () => { expect(parseToRgb('#Ff43AEFF')).toEqual({ alpha: 1, blue: 174, green: 67, red: 255, }) }) it('should parse an 4-digit hex color representation', () => { expect(parseToRgb('#0f08')).toEqual({ alpha: 0.53, blue: 0, green: 255, red: 0, }) }) it('should parse a reduced hex color representation', () => { expect(parseToRgb('#45a')).toEqual({ blue: 170, green: 85, red: 68, }) }) it('should parse a rgba color representation', () => { expect(parseToRgb('rgba(174,67,255,0.6)')).toEqual({ alpha: 0.6, blue: 255, green: 67, red: 174, }) expect(parseToRgb('rgba(174 67 255 / 0.6)')).toEqual({ alpha: 0.6, blue: 255, green: 67, red: 174, }) expect(parseToRgb('rgb(174 67 255 / 0.6)')).toEqual({ alpha: 0.6, blue: 255, green: 67, red: 174, }) }) it('should parse a rgb color representation', () => { expect(parseToRgb('rgb(174,67,255)')).toEqual({ blue: 255, green: 67, red: 174, }) expect(parseToRgb('rgb(174 67 255)')).toEqual({ blue: 255, green: 67, red: 174, }) }) it('should parse a hsl color representation', () => { expect(parseToRgb('hsl(210,10%,4%)')).toEqual({ blue: 11, green: 10, red: 9, }) expect(parseToRgb('hsl(210 10% 4%)')).toEqual({ blue: 11, green: 10, red: 9, }) }) it('should parse a hsl color representation with decimal values', () => { expect(parseToRgb('hsl(210,16.4%,13.2%)')).toEqual({ blue: 38, green: 33, red: 28, }) expect(parseToRgb('hsl(210 16.4% 13.2%)')).toEqual({ blue: 38, green: 33, red: 28, }) }) it('should parse a hsla color representation', () => { expect(parseToRgb('hsla(210,10%,40%,0.75)')).toEqual({ alpha: 0.75, blue: 112, green: 102, red: 92, }) expect(parseToRgb('hsla(210 10% 40% / 0.75)')).toEqual({ alpha: 0.75, blue: 112, green: 102, red: 92, }) expect(parseToRgb('hsl(210 10% 40% / 0.75)')).toEqual({ alpha: 0.75, blue: 112, green: 102, red: 92, }) }) it('should parse a hsla color representation with decimal values', () => { expect(parseToRgb('hsla(210,0.5%,0.5%,1.0)')).toEqual({ alpha: 1, blue: 0, green: 0, red: 0, }) expect(parseToRgb('hsla(210 0.5% 0.5% / 1.0)')).toEqual({ alpha: 1, blue: 0, green: 0, red: 0, }) expect(parseToRgb('hsl(210 0.5% 0.5% / 1.0)')).toEqual({ alpha: 1, blue: 0, green: 0, red: 0, }) }) it('should throw an error if an invalid color string is provided', () => { expect(() => { parseToRgb('(174,67,255)') }).toThrow( "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.", ) }) it('should throw an error if an invalid color string is provided', () => { expect(() => { parseToRgb(12345) }).toThrow( 'Passed an incorrect argument to a color function, please pass a string representation of a color.', ) }) it('should throw an error if an invalid hsl string is provided', () => { expect(() => { parseToRgb('hsl(210,120%,4%)') }).toThrow( `Couldn't generate valid rgb string from ${'hsl(210,120%,4%)'}, it returned ${'rgb(-2,10,22)'}.`, ) }) it('should throw an error if an unparsable hsla string is provided', () => { expect(() => { parseToRgb('hsla(210,120%,4%,0.7)') }).toThrow( `Couldn't generate valid rgb string from ${'hsla(210,120%,4%,0.7)'}, it returned ${'rgb(-2,10,22)'}.`, ) }) }) ================================================ FILE: src/color/test/readableColor.test.js ================================================ // @flow import readableColor from '../readableColor' describe('readableColor', () => { it('should return black given white hex, #fff', () => { expect(readableColor('#fff')).toEqual('#000') }) it('should return white given black, #000', () => { expect(readableColor('#000')).toEqual('#fff') }) it('should return custom light color when passed a dark color', () => { expect(readableColor('black', '#001', '#ff8')).toEqual('#ff8') }) it('should return custom dark color when passed a light color', () => { expect(readableColor('white', '#001', '#ff8')).toEqual('#001') }) it('should return black given red, #FF0000', () => { expect(readableColor('#FF0000')).toEqual('#000') }) it('should return white given blue, #0000FF', () => { expect(readableColor('#0000FF')).toEqual('#fff') }) it('should return black given gray, #787878', () => { expect(readableColor('#787878')).toEqual('#000') }) it('should return white given gray, #757575', () => { expect(readableColor('#757575')).toEqual('#fff') }) it('should return white given black, #0000001A', () => { expect(readableColor('#0000001A')).toEqual('#fff') }) it('should return black given white, #FFFFFFBF', () => { expect(readableColor('#FFFFFFBF')).toEqual('#000') }) it('should return black given white, rgb(255,255,255)', () => { expect(readableColor('rgb(255,255,255)')).toEqual('#000') }) it('should return white given black, rgb(0,0,0)', () => { expect(readableColor('rgb(0,0,0)')).toEqual('#fff') }) it('should return black given rgb(120,120,120)', () => { expect(readableColor('rgb(120,120,120)')).toEqual('#000') }) it('should return white given rgb(117,117,117)', () => { expect(readableColor('rgb(117,117,117)')).toEqual('#fff') }) it('should return white given black, rgba(0,0,0,0.7)', () => { expect(readableColor('rgba(0,0,0,0.7)')).toEqual('#fff') }) it('should return white given black, rgba(0,0,0,0.1)', () => { expect(readableColor('rgba(0,0,0,0.1)')).toEqual('#fff') }) it('should return white given black, "black"', () => { expect(readableColor('black')).toEqual('#fff') }) it('should return black given papayawhip, "papayawhip"', () => { expect(readableColor('papayawhip')).toEqual('#000') }) it('should return black given palevioletred, "palevioletred"', () => { expect(readableColor('palevioletred')).toEqual('#000') }) it('should return black given white, "white"', () => { expect(readableColor('white')).toEqual('#000') }) it('should return black given red, hsl(0, 100%, 50%)', () => { expect(readableColor('hsl(0, 100%, 50%)')).toEqual('#000') }) it('should return white given blue, hsl(250, 100%, 50%)', () => { expect(readableColor('hsl(250, 100%, 50%)')).toEqual('#fff') }) it('should return black given gray, hsl(0, 0%, 47%)', () => { expect(readableColor('hsl(0, 0%, 47%)')).toEqual('#000') }) it('should return white given gray, hsl(0, 0%, 45%)', () => { expect(readableColor('hsl(0, 0%, 45%)')).toEqual('#fff') }) it('should return white given blue, hsla(250, 100%, 50%, 0.2)', () => { expect(readableColor('hsla(250, 100%, 50%, 0.2)')).toEqual('#fff') }) it('should return custom light background when contrast meets AA in strict mode', () => { expect(readableColor('red', '#001', '#ff8')).toEqual('#001') }) it('should return custom dark background when contrast meets AA in strict mode', () => { expect(readableColor('darkred', '#001', '#ff8')).toEqual('#ff8') }) it('should return the default light background when contrast fails AA in strict mode', () => { expect(readableColor('red', '#333', '#aaa')).toEqual('#000') }) it('should return the default dark background when contrast fails AA in strict mode', () => { expect(readableColor('darkred', '#333', '#aaa')).toEqual('#fff') }) it('should return the the passed colors when constrast fails AA with strict mode off', () => { expect(readableColor('darkred', '#333', '#aaa', false)).toEqual('#aaa') }) }) ================================================ FILE: src/color/test/rgb.test.js ================================================ // @flow import rgb from '../rgb' describe('rgb', () => { it('should convert multiple numbers to a hex color', () => { expect({ background: rgb(255, 205, 100) }).toEqual({ background: '#ffcd64', }) }) it('should convert a rgb object to a hex color', () => { expect({ background: rgb({ red: 255, green: 205, blue: 100 }), }).toEqual({ background: '#ffcd64', }) }) it('should convert to a reduce hex value if possible', () => { expect({ background: rgb({ red: 255, green: 255, blue: 255 }), }).toEqual({ background: '#fff', }) }) it('should throw an error if an object and multiple arguments are passed', () => { expect(() => ({ background: rgb({ red: 255, green: 1, blue: 1 }, 250, 100), })).toThrow( 'Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).', ) }) }) ================================================ FILE: src/color/test/rgbToColorString.test.js ================================================ // @flow import rgbToColorString from '../rgbToColorString' describe('rgbToColorString', () => { it('should convert a RgbColor to a reduced hex string', () => { expect({ background: rgbToColorString({ red: 255, green: 255, blue: 255 }), }).toEqual({ background: '#fff', }) }) it('should convert a RgbColor to a hex string', () => { expect({ background: rgbToColorString({ red: 255, green: 205, blue: 100 }), }).toEqual({ background: '#ffcd64', }) }) it('should convert a RgbaColor to a rgba string', () => { expect({ background: rgbToColorString({ red: 255, green: 205, blue: 100, alpha: 0.72, }), }).toEqual({ background: 'rgba(255,205,100,0.72)', }) }) it('should convert a RgbaColor with 0 alpha to a rgba string', () => { expect({ background: rgbToColorString({ red: 255, green: 205, blue: 100, alpha: 0.0, }), }).toEqual({ background: 'rgba(255,205,100,0)', }) }) it('should throw an error if anything else than a RgbColor or RgbaColor is provided', () => { // $FlowFixMe expect(() => rgbToColorString({ red: 255, green: 1, hue: 240 })).toThrow( 'Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.', ) }) }) ================================================ FILE: src/color/test/rgba.test.js ================================================ // @flow import rgba from '../rgba' describe('rgb', () => { it('should convert a hex value and an alpha value to a rgba string', () => { expect(rgba('#ffffff', 0.4)).toEqual('rgba(255,255,255,0.4)') }) it('should convert a named CSS color and an alpha value to a rgba string', () => { expect(rgba('black', 0.7)).toEqual('rgba(0,0,0,0.7)') }) it('should convert multiple numbers to a rgba string', () => { expect({ background: rgba(255, 205, 100, 0.75) }).toEqual({ background: 'rgba(255,205,100,0.75)', }) }) it('should convert multiple numbers with full opacity to a hex color', () => { expect({ background: rgba(255, 205, 100, 1) }).toEqual({ background: '#ffcd64', }) }) it('should convert a rgba object to a rgba string', () => { expect({ background: rgba({ red: 255, green: 205, blue: 100, alpha: 0.75, }), }).toEqual({ background: 'rgba(255,205,100,0.75)', }) }) it('should convert a rgba object with full opacity to a hex color', () => { expect({ background: rgba({ red: 255, green: 205, blue: 100, alpha: 1, }), }).toEqual({ background: '#ffcd64', }) }) it('should convert a rgba object with full opacity to a reduced hex color', () => { expect({ background: rgba({ red: 255, green: 255, blue: 255, alpha: 1, }), }).toEqual({ background: '#fff', }) }) it('should throw an error if an object and multiple arguments are passed', () => { expect(() => ({ background: rgba( { red: 255, green: 1, blue: 1, alpha: 180, }, 250, 100, 0.5, ), })).toThrow( 'Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).', ) }) }) ================================================ FILE: src/color/test/saturate.test.js ================================================ // @flow import saturate from '../saturate' describe('saturate', () => { it('should saturate a color by 10%', () => { expect(saturate(0.1, '#444')).toEqual('#4b3d3d') }) it('should saturate a hex color by 20%', () => { expect(saturate(0.2, '#CCCD64')).toEqual('#e0e250') }) it('should saturate an 8-digit hex color by 20%', () => { expect(saturate(0.2, '#6564CDB3')).toEqual('rgba(81,80,226,0.7)') }) it('should saturate an 4-digit hex color by 20%', () => { expect(saturate(0.2, '#0f08')).toEqual('rgba(0,255,0,0.53)') }) it('should saturate a color with opacity by 20%', () => { expect(saturate(0.2, 'rgba(101,100,205,0.7)')).toEqual('rgba(81,80,226,0.7)') }) it('should saturate a color but not go beyond 255', () => { expect(saturate(0.8, 'rgba(255,200,200,0.7)')).toEqual('rgba(255,200,200,0.7)') }) it('should saturate a color when passed a string for amount', () => { expect(saturate('0.1', '#444')).toEqual('#4b3d3d') }) it('should return transparent when passed transparent', () => { expect(saturate('0.1', 'transparent')).toEqual('transparent') }) }) ================================================ FILE: src/color/test/setHue.test.js ================================================ // @flow import setHue from '../setHue' describe('setHue', () => { it('should update the hue and return a hex color', () => { expect(setHue(42, '#CCCD64')).toEqual('#cdae64') }) it('should update the hue of an 8-digit hex color and return a hex color', () => { expect(setHue(244, '#6564CDB3')).toEqual('rgba(107,100,205,0.7)') }) it('should update the hue of an 4-digit hex color and return a hex color', () => { expect(setHue(244, '#0f08')).toEqual('rgba(17,0,255,0.53)') }) it('should update the hue and return a color with opacity', () => { expect(setHue(244, 'rgba(101,100,205,0.7)')).toEqual('rgba(107,100,205,0.7)') }) it('should update the hue when passed a string for hue', () => { expect(setHue('42', '#CCCD64')).toEqual('#cdae64') }) it('should return transparent when passed transparent', () => { expect(setHue('42', 'transparent')).toEqual('transparent') }) }) ================================================ FILE: src/color/test/setLightness.test.js ================================================ // @flow import setLightness from '../setLightness' describe('setLightness', () => { it('should update the lightness and return a hex color', () => { expect(setLightness(0.2, '#CCCD64')).toEqual('#4d4d19') }) it('should update the lightness of an 8-digit hex color and return a hex color', () => { expect(setLightness(0.2, '#6564CDB3')).toEqual('rgba(25,25,77,0.7)') }) it('should update the lightness of an 4-digit hex color and return a hex color', () => { expect(setLightness(0.2, '#0f08')).toEqual('rgba(0,102,0,0.53)') }) it('should update the lightness and return a color with opacity', () => { expect(setLightness(0.2, 'rgba(101,100,205,0.7)')).toEqual('rgba(25,25,77,0.7)') }) it('should update the lightness when passed a string', () => { expect(setLightness('0.2', '#CCCD64')).toEqual('#4d4d19') }) it('should return transparent when passed transparent', () => { expect(setLightness('0.2', 'transparent')).toEqual('transparent') }) }) ================================================ FILE: src/color/test/setSaturation.test.js ================================================ // @flow import setSaturation from '../setSaturation' describe('setSaturation', () => { it('should update the saturation of an hex color and return a hex color', () => { expect(setSaturation(0.2, '#CCCD64')).toEqual('#adad84') }) it('should update the saturation of an 8-digit hex color and return an rgba color', () => { expect(setSaturation(0.2, '#6564CDB3')).toEqual('rgba(132,132,173,0.7)') }) it('should update the saturation of an 4-digit hex color and return an rgba color', () => { expect(setSaturation(0.2, '#0f08')).toEqual('rgba(102,153,102,0.53)') }) it('should update the saturation of an rgb color and return a hex color', () => { expect(setSaturation(0.2, 'rgb(101,100,205)')).toEqual('#8484ad') }) it('should update the saturation of an rgba color and return an rgba color', () => { expect(setSaturation(0.2, 'rgba(101,100,205,0.7)')).toEqual('rgba(132,132,173,0.7)') }) it('should update the saturation when passed a string', () => { expect(setSaturation('0.75', 'rgba(204,205,100,0.7)')).toEqual('rgba(228,229,76,0.7)') }) it('should return transparent when passed transparent', () => { expect(setSaturation('0.75', 'transparent')).toEqual('transparent') }) }) ================================================ FILE: src/color/test/shade.test.js ================================================ // @flow import shade from '../shade' describe('shade', () => { it('should shade the provided color with white by the given percentage', () => { expect(shade(0.25, '#00f')).toEqual('#0000bf') }) it('should shade the provided 8-digit hex color with white by the given percentage', () => { expect(shade(0.25, '#000fffcc')).toEqual('rgba(0,10,170,0.8500000000000001)') }) it('should shade the provided 4-digit hex color with white by the given percentage', () => { expect(shade(0.25, '#0f08')).toEqual('rgba(0,132,0,0.6475)') }) it('should shade the provided color when passed a string for amount', () => { expect(shade('0.25', '#00f')).toEqual('#0000bf') }) it('should return transparent when passed transparent', () => { expect(shade('0.25', 'transparent')).toEqual('transparent') }) }) ================================================ FILE: src/color/test/tint.test.js ================================================ // @flow import tint from '../tint' describe('test', () => { it('should tint the provided color with white by the given percentage', () => { expect(tint(0.25, '#00f')).toEqual('#3f3fff') }) it('should tint the provided 8-digit hex color with white by the given percentage', () => { expect(tint(0.25, '#000fffcc')).toEqual('rgba(85,95,255,0.8500000000000001)') }) it('should tint the provided 4-digit hex color with white by the given percentage', () => { expect(tint(0.25, '#0f08')).toEqual('rgba(122,255,122,0.6475)') }) it('should tint the provided color when passed a string for amount', () => { expect(tint('0.25', '#00f')).toEqual('#3f3fff') }) it('should return transparent when passed transparent', () => { expect(tint('0.25', 'transparent')).toEqual('transparent') }) }) ================================================ FILE: src/color/test/toColorString.test.js ================================================ // @flow import toColorString from '../toColorString' describe('toColorString', () => { it('should convert a RgbColor to a reduced hex string', () => { expect({ background: toColorString({ red: 255, green: 255, blue: 255 }), }).toEqual({ background: '#fff', }) }) it('should convert a RgbColor to a hex string', () => { expect({ background: toColorString({ red: 255, green: 205, blue: 100 }), }).toEqual({ background: '#ffcd64', }) }) it('should convert a RgbaColor to a rgba string', () => { expect({ background: toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72, }), }).toEqual({ background: 'rgba(255,205,100,0.72)', }) }) it('should convert a HslColor to a reduced hex string', () => { expect({ background: toColorString({ hue: 240, saturation: 1, lightness: 0.5 }), }).toEqual({ background: '#00f', }) }) it('should convert a HslColor to a hex string', () => { expect({ background: toColorString({ hue: 360, saturation: 0.75, lightness: 0.4 }), }).toEqual({ background: '#b31919', }) }) it('should convert a HslaColor to a rgba string', () => { expect({ background: toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72, }), }).toEqual({ background: 'rgba(179,25,25,0.72)', }) }) it('should throw an error if anything else than a RgbColor, RgbaColor, HslColor or HslaColor is provided', () => { expect(() => toColorString({ red: 255, green: 1, hue: 240 })).toThrow( 'Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.', ) }) }) ================================================ FILE: src/color/test/transparentize.test.js ================================================ // @flow import transparentize from '../transparentize' describe('transparentize', () => { it('should reduce the opacity of hex #fff by 0.1', () => { expect(transparentize(0.1, '#fff')).toEqual('rgba(255,255,255,0.9)') }) it('should reduce the opacity of an 8-digit hex color by 0.1', () => { expect(transparentize(0.1, '#6564CDB3')).toEqual('rgba(101,100,205,0.6)') }) it('should reduce the opacity of an 4-digit hex color by 0.1', () => { expect(transparentize(0.1, '#0f08')).toEqual('rgba(0,255,0,0.43)') }) it('should reduce the opacity of rgb(255, 0, 255) by 0.1', () => { expect(transparentize(0.1, 'rgb(255, 0, 255)')).toEqual('rgba(255,0,255,0.9)') }) it('should reduce the opacity of rgba(255, 0, 0, 1) by 0.1', () => { expect(transparentize(0.1, 'rgba(101, 100, 205, .7)')).toEqual('rgba(101,100,205,0.6)') }) it('should reduce the opacity of rgba(255, 0, 0, .5) by 0.3', () => { expect(transparentize(0.3, 'rgba(255, 0, 0, .5)')).toEqual('rgba(255,0,0,0.2)') }) it('should reduce the opacity of rgba(255, 0, 0, .5) by 0.5', () => { expect(transparentize(0.5, 'rgba(255, 0, 0, .5)')).toEqual('rgba(255,0,0,0)') }) it('should reduce the opacity of hsl(0, 0%, 100%) by 0.2', () => { expect(transparentize(0.2, 'hsl(0, 0%, 100%)')).toEqual('rgba(255,255,255,0.8)') }) it('should reduce the opacity of hsl(0, 0.5%, 0.5%) by 0.1', () => { expect(transparentize(0.1, 'hsl(0, 0.5%, 0.5%)')).toEqual('rgba(0,0,0,0.9)') }) it('should reduce the opacity of hsla(0, 0%, 100%, .8) by 0.5', () => { expect(transparentize(0.5, 'hsla(0, 0%, 100%, .8)')).toEqual('rgba(255,255,255,0.3)') }) it('should reduce the opacity of hsla(0, 0.5%, 0.5%, .1) by 0.4', () => { expect(transparentize(0.4, 'hsla(0, 0.5%, 0.5%, 0.4)')).toEqual('rgba(0,0,0,0)') }) it('should not reduce the opacity below 0', () => { expect(transparentize(0.5, 'rgba(255, 0, 0, .2)')).toEqual('rgba(255,0,0,0)') }) it('should not increase the opacity beyond 1', () => { expect(transparentize(-0.5, 'rgba(255, 0, 0, .8)')).toEqual('#f00') }) it('should properly round a float to 2 decimals.', () => { expect(transparentize(0.55, '#01B0BB')).toEqual('rgba(1,176,187,0.45)') }) it('should reduce the opacity when passed a string for amount', () => { expect(transparentize('0.1', '#fff')).toEqual('rgba(255,255,255,0.9)') }) it('should return transparent when passed transparent', () => { expect(transparentize('0.1', 'transparent')).toEqual('transparent') }) it('should throw an error when enter an invalid color', () => { expect(() => { transparentize(0.5, 'not a color') }).toThrow( "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.", ) }) }) ================================================ FILE: src/color/tint.js ================================================ // @flow import curry from '../internalHelpers/_curry' import mix from './mix' /** * Tints a color by mixing it with white. `tint` can produce * hue shifts, where as `lighten` manipulates the luminance channel and therefore * doesn't produce hue shifts. * * @example * // Styles as object usage * const styles = { * background: tint(0.25, '#00f') * } * * // styled-components usage * const div = styled.div` * background: ${tint(0.25, '#00f')}; * ` * * // CSS in JS Output * * element { * background: "#bfbfff"; * } */ function tint(percentage: number | string, color: string): string { if (color === 'transparent') return color return mix(parseFloat(percentage), 'rgb(255, 255, 255)', color) } // prettier-ignore const curriedTint = curry/* :: */(tint) export default curriedTint ================================================ FILE: src/color/toColorString.js ================================================ // @flow import hsl from './hsl' import hsla from './hsla' import rgb from './rgb' import rgba from './rgba' import PolishedError from '../internalHelpers/_errors' const isRgb = (color: Object): boolean => typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined') const isRgba = (color: Object): boolean => typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && typeof color.alpha === 'number' const isHsl = (color: Object): boolean => typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined') const isHsla = (color: Object): boolean => typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && typeof color.alpha === 'number' /** * Converts a RgbColor, RgbaColor, HslColor or HslaColor object to a color string. * This util is useful in case you only know on runtime which color object is * used. Otherwise we recommend to rely on `rgb`, `rgba`, `hsl` or `hsla`. * * @example * // Styles as object usage * const styles = { * background: toColorString({ red: 255, green: 205, blue: 100 }), * background: toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 }), * background: toColorString({ hue: 240, saturation: 1, lightness: 0.5 }), * background: toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 }), * } * * // styled-components usage * const div = styled.div` * background: ${toColorString({ red: 255, green: 205, blue: 100 })}; * background: ${toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 })}; * background: ${toColorString({ hue: 240, saturation: 1, lightness: 0.5 })}; * background: ${toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 })}; * ` * * // CSS in JS Output * element { * background: "#ffcd64"; * background: "rgba(255,205,100,0.72)"; * background: "#00f"; * background: "rgba(179,25,25,0.72)"; * } */ export default function toColorString(color: Object): string { if (typeof color !== 'object') throw new PolishedError(8) if (isRgba(color)) return rgba(color) if (isRgb(color)) return rgb(color) if (isHsla(color)) return hsla(color) if (isHsl(color)) return hsl(color) throw new PolishedError(8) } ================================================ FILE: src/color/transparentize.js ================================================ // @flow import curry from '../internalHelpers/_curry' import guard from '../internalHelpers/_guard' import rgba from './rgba' import parseToRgb from './parseToRgb' /** * Decreases the opacity of a color. Its range for the amount is between 0 to 1. * * * @example * // Styles as object usage * const styles = { * background: transparentize(0.1, '#fff'), * background: transparentize(0.2, 'hsl(0, 0%, 100%)'), * background: transparentize('0.5', 'rgba(255, 0, 0, 0.8)'), * } * * // styled-components usage * const div = styled.div` * background: ${transparentize(0.1, '#fff')}; * background: ${transparentize(0.2, 'hsl(0, 0%, 100%)')}; * background: ${transparentize('0.5', 'rgba(255, 0, 0, 0.8)')}; * ` * * // CSS in JS Output * * element { * background: "rgba(255,255,255,0.9)"; * background: "rgba(255,255,255,0.8)"; * background: "rgba(255,0,0,0.3)"; * } */ function transparentize(amount: number | string, color: string): string { if (color === 'transparent') return color const parsedColor = parseToRgb(color) const alpha: number = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1 const colorWithAlpha = { ...parsedColor, alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100), } return rgba(colorWithAlpha) } // prettier-ignore const curriedTransparentize = curry/* :: */( transparentize, ) export default curriedTransparentize ================================================ FILE: src/easings/easeIn.js ================================================ // @flow import type { TimingFunction } from '../types/timingFunction' const functionsMap = { back: 'cubic-bezier(0.600, -0.280, 0.735, 0.045)', circ: 'cubic-bezier(0.600, 0.040, 0.980, 0.335)', cubic: 'cubic-bezier(0.550, 0.055, 0.675, 0.190)', expo: 'cubic-bezier(0.950, 0.050, 0.795, 0.035)', quad: 'cubic-bezier(0.550, 0.085, 0.680, 0.530)', quart: 'cubic-bezier(0.895, 0.030, 0.685, 0.220)', quint: 'cubic-bezier(0.755, 0.050, 0.855, 0.060)', sine: 'cubic-bezier(0.470, 0.000, 0.745, 0.715)', } /** * String to represent common easing functions as demonstrated here: (github.com/jaukia/easie). * * @example * // Styles as object usage * const styles = { * 'transitionTimingFunction': easeIn('quad') * } * * // styled-components usage * const div = styled.div` * transitionTimingFunction: ${easeIn('quad')}; * ` * * // CSS as JS Output * * 'div': { * 'transitionTimingFunction': 'cubic-bezier(0.550, 0.085, 0.680, 0.530)', * } */ export default function easeIn(functionName: string): TimingFunction { return functionsMap[functionName.toLowerCase().trim()] } ================================================ FILE: src/easings/easeInOut.js ================================================ // @flow import type { TimingFunction } from '../types/timingFunction' const functionsMap = { back: 'cubic-bezier(0.680, -0.550, 0.265, 1.550)', circ: 'cubic-bezier(0.785, 0.135, 0.150, 0.860)', cubic: 'cubic-bezier(0.645, 0.045, 0.355, 1.000)', expo: 'cubic-bezier(1.000, 0.000, 0.000, 1.000)', quad: 'cubic-bezier(0.455, 0.030, 0.515, 0.955)', quart: 'cubic-bezier(0.770, 0.000, 0.175, 1.000)', quint: 'cubic-bezier(0.860, 0.000, 0.070, 1.000)', sine: 'cubic-bezier(0.445, 0.050, 0.550, 0.950)', } /** * String to represent common easing functions as demonstrated here: (github.com/jaukia/easie). * * @example * // Styles as object usage * const styles = { * 'transitionTimingFunction': easeInOut('quad') * } * * // styled-components usage * const div = styled.div` * transitionTimingFunction: ${easeInOut('quad')}; * ` * * // CSS as JS Output * * 'div': { * 'transitionTimingFunction': 'cubic-bezier(0.455, 0.030, 0.515, 0.955)', * } */ export default function easeInOut(functionName: string): TimingFunction { return functionsMap[functionName.toLowerCase().trim()] } ================================================ FILE: src/easings/easeOut.js ================================================ // @flow import type { TimingFunction } from '../types/timingFunction' const functionsMap = { back: 'cubic-bezier(0.175, 0.885, 0.320, 1.275)', cubic: 'cubic-bezier(0.215, 0.610, 0.355, 1.000)', circ: 'cubic-bezier(0.075, 0.820, 0.165, 1.000)', expo: 'cubic-bezier(0.190, 1.000, 0.220, 1.000)', quad: 'cubic-bezier(0.250, 0.460, 0.450, 0.940)', quart: 'cubic-bezier(0.165, 0.840, 0.440, 1.000)', quint: 'cubic-bezier(0.230, 1.000, 0.320, 1.000)', sine: 'cubic-bezier(0.390, 0.575, 0.565, 1.000)', } /** * String to represent common easing functions as demonstrated here: (github.com/jaukia/easie). * * @example * // Styles as object usage * const styles = { * 'transitionTimingFunction': easeOut('quad') * } * * // styled-components usage * const div = styled.div` * transitionTimingFunction: ${easeOut('quad')}; * ` * * // CSS as JS Output * * 'div': { * 'transitionTimingFunction': 'cubic-bezier(0.250, 0.460, 0.450, 0.940)', * } */ export default function easeOut(functionName: string): TimingFunction { return functionsMap[functionName.toLowerCase().trim()] } ================================================ FILE: src/easings/test/easeIn.test.js ================================================ // @flow import easeIn from '../easeIn' describe('easeIn', () => { it('should return easeInBack cubic-bezier', () => { expect({ 'transition-timing-function': easeIn('back'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.600, -0.280, 0.735, 0.045)', }) }) it('should return easeInCirc cubic-bezier', () => { expect({ 'transition-timing-function': easeIn('circ'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.600, 0.040, 0.980, 0.335)', }) }) it('should return easeInCubic cubic-bezier', () => { expect({ 'transition-timing-function': easeIn('cubic'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.550, 0.055, 0.675, 0.190)', }) }) it('should return easeInExpo cubic-bezier', () => { expect({ 'transition-timing-function': easeIn('expo'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.950, 0.050, 0.795, 0.035)', }) }) it('should return easeInQuad cubic-bezier', () => { expect({ 'transition-timing-function': easeIn('quad'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.550, 0.085, 0.680, 0.530)', }) }) it('should return easeInQuart cubic-bezier', () => { expect({ 'transition-timing-function': easeIn('quart'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.895, 0.030, 0.685, 0.220)', }) }) it('should return easeInQuint cubic-bezier', () => { expect({ 'transition-timing-function': easeIn('quint'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.755, 0.050, 0.855, 0.060)', }) }) it('should return easeInSine cubic-bezier', () => { expect({ 'transition-timing-function': easeIn('sine'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.470, 0.000, 0.745, 0.715)', }) }) }) ================================================ FILE: src/easings/test/easeInOut.test.js ================================================ // @flow import easeInOut from '../easeInOut' describe('easeInOut', () => { it('should return easeInOutBack cubic-bezier', () => { expect({ 'transition-timing-function': easeInOut('back'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.680, -0.550, 0.265, 1.550)', }) }) it('should return easeInOutCirc cubic-bezier', () => { expect({ 'transition-timing-function': easeInOut('circ'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.785, 0.135, 0.150, 0.860)', }) }) it('should return easeInOutCubic cubic-bezier', () => { expect({ 'transition-timing-function': easeInOut('cubic'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.645, 0.045, 0.355, 1.000)', }) }) it('should return easeInOutExpo cubic-bezier', () => { expect({ 'transition-timing-function': easeInOut('expo'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(1.000, 0.000, 0.000, 1.000)', }) }) it('should return easeInOutQuad cubic-bezier', () => { expect({ 'transition-timing-function': easeInOut('quad'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.455, 0.030, 0.515, 0.955)', }) }) it('should return easeInOutQuart cubic-bezier', () => { expect({ 'transition-timing-function': easeInOut('quart'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.770, 0.000, 0.175, 1.000)', }) }) it('should return easeInOutQuint cubic-bezier', () => { expect({ 'transition-timing-function': easeInOut('quint'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.860, 0.000, 0.070, 1.000)', }) }) }) ================================================ FILE: src/easings/test/easeOut.test.js ================================================ // @flow import easeOut from '../easeOut' describe('easeOut', () => { it('should return easeOutBack cubic-bezier', () => { expect({ 'transition-timing-function': easeOut('back'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.175, 0.885, 0.320, 1.275)', }) }) it('should return easeOutCirc cubic-bezier', () => { expect({ 'transition-timing-function': easeOut('circ'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.075, 0.820, 0.165, 1.000)', }) }) it('should return easeOutCubic cubic-bezier', () => { expect({ 'transition-timing-function': easeOut('cubic'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.215, 0.610, 0.355, 1.000)', }) }) it('should return easeOutExpo cubic-bezier', () => { expect({ 'transition-timing-function': easeOut('expo'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.190, 1.000, 0.220, 1.000)', }) }) it('should return easeOutQuad cubic-bezier', () => { expect({ 'transition-timing-function': easeOut('quad'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.250, 0.460, 0.450, 0.940)', }) }) it('should return easeOutQuart cubic-bezier', () => { expect({ 'transition-timing-function': easeOut('quart'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.165, 0.840, 0.440, 1.000)', }) }) it('should return easeOutQuint cubic-bezier', () => { expect({ 'transition-timing-function': easeOut('quint'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.230, 1.000, 0.320, 1.000)', }) }) }) ================================================ FILE: src/helpers/cssVar.js ================================================ // @flow import PolishedError from '../internalHelpers/_errors' const cssVariableRegex = /--[\S]*/g /** * Fetches the value of a passed CSS Variable in the :root scope, or otherwise returns a defaultValue if provided. * * @example * // Styles as object usage * const styles = { * 'background': cssVar('--background-color'), * } * * // styled-components usage * const div = styled.div` * background: ${cssVar('--background-color')}; * ` * * // CSS in JS Output * * element { * 'background': 'red' * } */ export default function cssVar( cssVariable: string, defaultValue?: string | number, ): string | number { if (!cssVariable || !cssVariable.match(cssVariableRegex)) { throw new PolishedError(73) } let variableValue /* eslint-disable */ /* istanbul ignore next */ if (typeof document !== 'undefined' && document.documentElement !== null) { variableValue = getComputedStyle(document.documentElement).getPropertyValue(cssVariable) } /* eslint-enable */ if (variableValue) { return variableValue.trim() } else if (defaultValue) { return defaultValue } throw new PolishedError(74) } ================================================ FILE: src/helpers/directionalProperty.js ================================================ // @flow import capitalizeString from '../internalHelpers/_capitalizeString' import type { Styles } from '../types/style' const positionMap = ['Top', 'Right', 'Bottom', 'Left'] function generateProperty(property: string, position: string) { if (!property) return position.toLowerCase() const splitProperty = property.split('-') if (splitProperty.length > 1) { splitProperty.splice(1, 0, position) return splitProperty.reduce((acc, val) => `${acc}${capitalizeString(val)}`) } const joinedProperty = property.replace(/([a-z])([A-Z])/g, `$1${position}$2`) return property === joinedProperty ? `${property}${position}` : joinedProperty } function generateStyles(property: string, valuesWithDefaults: Array) { const styles = {} for (let i = 0; i < valuesWithDefaults.length; i += 1) { if (valuesWithDefaults[i] || valuesWithDefaults[i] === 0) { styles[generateProperty(property, positionMap[i])] = valuesWithDefaults[i] } } return styles } /** * Enables shorthand for direction-based properties. It accepts a property (hyphenated or camelCased) and up to four values that map to top, right, bottom, and left, respectively. You can optionally pass an empty string to get only the directional values as properties. You can also optionally pass a null argument for a directional value to ignore it. * @example * // Styles as object usage * const styles = { * ...directionalProperty('padding', '12px', '24px', '36px', '48px') * } * * // styled-components usage * const div = styled.div` * ${directionalProperty('padding', '12px', '24px', '36px', '48px')} * ` * * // CSS as JS Output * * div { * 'paddingTop': '12px', * 'paddingRight': '24px', * 'paddingBottom': '36px', * 'paddingLeft': '48px' * } */ export default function directionalProperty( property: string, ...values: Array ): Styles { // prettier-ignore const [firstValue, secondValue = firstValue, thirdValue = firstValue, fourthValue = secondValue] = values const valuesWithDefaults = [firstValue, secondValue, thirdValue, fourthValue] return generateStyles(property, valuesWithDefaults) } ================================================ FILE: src/helpers/em.js ================================================ // @flow import pixelsto from '../internalHelpers/_pxto' /** * Convert pixel value to ems. The default base value is 16px, but can be changed by passing a * second argument to the function. * @function * @param {string|number} pxval * @param {string|number} [base='16px'] * @example * // Styles as object usage * const styles = { * 'height': em('16px') * } * * // styled-components usage * const div = styled.div` * height: ${em('16px')} * ` * * // CSS in JS Output * * element { * 'height': '1em' * } */ const em: (value: string | number, base?: string | number) => string = pixelsto('em') export default em ================================================ FILE: src/helpers/getValueAndUnit.js ================================================ // @flow const cssRegex = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/ /** * Returns a given CSS value and its unit as elements of an array. * * @example * // Styles as object usage * const styles = { * '--dimension': getValueAndUnit('100px')[0], * '--unit': getValueAndUnit('100px')[1], * } * * // styled-components usage * const div = styled.div` * --dimension: ${getValueAndUnit('100px')[0]}; * --unit: ${getValueAndUnit('100px')[1]}; * ` * * // CSS in JS Output * * element { * '--dimension': 100, * '--unit': 'px', * } */ export default function getValueAndUnit(value: string | number): any { if (typeof value !== 'string') return [value, ''] const matchedValue = value.match(cssRegex) if (matchedValue) return [parseFloat(value), matchedValue[2]] return [value, undefined] } ================================================ FILE: src/helpers/important.js ================================================ // @flow import type { Styles } from '../types/style' import PolishedError from '../internalHelpers/_errors' /** * Helper for targeting rules in a style block generated by polished modules that need !important-level specificity. Can optionally specify a rule (or rules) to target specific rules. * * @example * // Styles as object usage * const styles = { * ...important(cover()) * } * * // styled-components usage * const div = styled.div` * ${important(cover())} * ` * * // CSS as JS Output * * div: { * 'position': 'absolute !important', * 'top': '0 !important', * 'right: '0 !important', * 'bottom': '0 !important', * 'left: '0 !important' * } */ export default function important(styleBlock: Styles, rules?: Array | string): Styles { if (typeof styleBlock !== 'object' || styleBlock === null) { throw new PolishedError(75, typeof styleBlock) } const newStyleBlock = {} Object.keys(styleBlock).forEach(key => { if (typeof styleBlock[key] === 'object' && styleBlock[key] !== null) { newStyleBlock[key] = important(styleBlock[key], rules) } else if (!rules || (rules && (rules === key || rules.indexOf(key) >= 0))) { newStyleBlock[key] = `${styleBlock[key]} !important` } else { newStyleBlock[key] = styleBlock[key] } }) return newStyleBlock } ================================================ FILE: src/helpers/modularScale.js ================================================ // @flow import getValueAndUnit from './getValueAndUnit' import PolishedError from '../internalHelpers/_errors' import type { ModularScaleRatio } from '../types/modularScaleRatio' export const ratioNames = { minorSecond: 1.067, majorSecond: 1.125, minorThird: 1.2, majorThird: 1.25, perfectFourth: 1.333, augFourth: 1.414, perfectFifth: 1.5, minorSixth: 1.6, goldenSection: 1.618, majorSixth: 1.667, minorSeventh: 1.778, majorSeventh: 1.875, octave: 2, majorTenth: 2.5, majorEleventh: 2.667, majorTwelfth: 3, doubleOctave: 4, } function getRatio(ratioName: string): number { return ratioNames[ratioName] } /** * Establish consistent measurements and spacial relationships throughout your projects by incrementing an em or rem value up or down a defined scale. We provide a list of commonly used scales as pre-defined variables. * @example * // Styles as object usage * const styles = { * // Increment two steps up the default scale * 'fontSize': modularScale(2) * } * * // styled-components usage * const div = styled.div` * // Increment two steps up the default scale * fontSize: ${modularScale(2)} * ` * * // CSS in JS Output * * element { * 'fontSize': '1.77689em' * } */ export default function modularScale( steps: number, base?: number | string = '1em', ratio?: ModularScaleRatio = 1.333, ): string { if (typeof steps !== 'number') { throw new PolishedError(42) } if (typeof ratio === 'string' && !ratioNames[ratio]) { throw new PolishedError(43) } const [realBase, unit] = typeof base === 'string' ? getValueAndUnit(base) : [base, ''] const realRatio = typeof ratio === 'string' ? getRatio(ratio) : ratio if (typeof realBase === 'string') { throw new PolishedError(44, base) } return `${realBase * realRatio ** steps}${unit || ''}` } ================================================ FILE: src/helpers/rem.js ================================================ // @flow import pixelsto from '../internalHelpers/_pxto' /** * Convert pixel value to rems. The default base value is 16px, but can be changed by passing a * second argument to the function. * @function * @param {string|number} pxval * @param {string|number} [base='16px'] * @example * // Styles as object usage * const styles = { * 'height': rem('16px') * } * * // styled-components usage * const div = styled.div` * height: ${rem('16px')} * ` * * // CSS in JS Output * * element { * 'height': '1rem' * } */ const rem: (value: string | number, base?: string | number) => string = pixelsto('rem') export default rem ================================================ FILE: src/helpers/remToPx.js ================================================ // @flow import getValueAndUnit from './getValueAndUnit' import PolishedError from '../internalHelpers/_errors' const defaultFontSize = 16 function convertBase(base: string | number): number { const deconstructedValue = getValueAndUnit(base) if (deconstructedValue[1] === 'px') { return parseFloat(base) } if (deconstructedValue[1] === '%') { return (parseFloat(base) / 100) * defaultFontSize } throw new PolishedError(78, deconstructedValue[1]) } function getBaseFromDoc(): number { /* eslint-disable */ /* istanbul ignore next */ if (typeof document !== 'undefined' && document.documentElement !== null) { const rootFontSize = getComputedStyle(document.documentElement).fontSize return rootFontSize ? convertBase(rootFontSize) : defaultFontSize } /* eslint-enable */ /* istanbul ignore next */ return defaultFontSize } /** * Convert rem values to px. By default, the base value is pulled from the font-size property on the root element (if it is set in % or px). It defaults to 16px if not found on the root. You can also override the base value by providing your own base in % or px. * @example * // Styles as object usage * const styles = { * 'height': remToPx('1.6rem') * 'height': remToPx('1.6rem', '10px') * } * * // styled-components usage * const div = styled.div` * height: ${remToPx('1.6rem')} * height: ${remToPx('1.6rem', '10px')} * ` * * // CSS in JS Output * * element { * 'height': '25.6px', * 'height': '16px', * } */ export default function remToPx(value: string | number, base?: string | number): string { const deconstructedValue = getValueAndUnit(value) if (deconstructedValue[1] !== 'rem' && deconstructedValue[1] !== '') { throw new PolishedError(77, deconstructedValue[1]) } const newBase = base ? convertBase(base) : getBaseFromDoc() return `${deconstructedValue[0] * newBase}px` } ================================================ FILE: src/helpers/stripUnit.js ================================================ // @flow const cssRegex = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/ /** * Returns a given CSS value minus its unit of measure. * * @example * // Styles as object usage * const styles = { * '--dimension': stripUnit('100px') * } * * // styled-components usage * const div = styled.div` * --dimension: ${stripUnit('100px')}; * ` * * // CSS in JS Output * * element { * '--dimension': 100 * } */ export default function stripUnit(value: string | number): string | number { if (typeof value !== 'string') return value const matchedValue = value.match(cssRegex) return matchedValue ? parseFloat(value) : value } ================================================ FILE: src/helpers/test/cssVar.test.js ================================================ // @flow import cssVar from '../cssVar' beforeAll(() => { // $FlowFixMe document.documentElement.style.setProperty('--background', '#FFF') // eslint-disable-line no-undef // $FlowFixMe document.documentElement.style.setProperty('--foreground-color', '#000') // eslint-disable-line no-undef // $FlowFixMe document.documentElement.style.setProperty('--our-background-color', 'red') // eslint-disable-line no-undef // $FlowFixMe document.documentElement.style.setProperty('--our-Background-Color', 'orange') // eslint-disable-line no-undef // $FlowFixMe document.documentElement.style.setProperty('--our-complex-value', '12px 12px') // eslint-disable-line no-undef }) describe('cssVar', () => { test('gets a css variable', () => { expect(cssVar('--background')).toEqual('#FFF') }) test('gets a hyphenated css variable', () => { expect(cssVar('--foreground-color')).toEqual('#000') }) test('gets a complex hyphenated css variable', () => { expect(cssVar('--our-background-color')).toEqual('red') }) test('respects casing', () => { expect(cssVar('--our-Background-Color')).toEqual('orange') }) test('respects complex values', () => { expect(cssVar('--our-complex-value')).toEqual('12px 12px') }) test("returns default when variable isn't found.", () => { expect(cssVar('--unfound-variable', 'orange')).toEqual('orange') }) test('errors when variable is not found and no default is provided', () => { expect(() => { cssVar('--unfound-variable') }).toThrow('CSS variable not found and no default was provided.') }) test('errors when variable is not formatted correctly', () => { expect(() => { cssVar('-bad-formatted-variable') }).toThrow('Please provide a valid CSS variable.') }) }) ================================================ FILE: src/helpers/test/directionalProperty.test.js ================================================ // @flow import directionalProperty from '../directionalProperty' describe('directionalProperty', () => { it('properly generates properties when passed a hyphenated property', () => { expect(directionalProperty('border-width', '12px')).toEqual({ borderBottomWidth: '12px', borderLeftWidth: '12px', borderRightWidth: '12px', borderTopWidth: '12px', }) }) it('properly generates properties when passed a camelCased property', () => { expect(directionalProperty('borderWidth', '12px')).toEqual({ borderBottomWidth: '12px', borderLeftWidth: '12px', borderRightWidth: '12px', borderTopWidth: '12px', }) }) it('properly passes just the position when not given a property', () => { expect(directionalProperty('', '12px')).toEqual({ bottom: '12px', left: '12px', right: '12px', top: '12px', }) }) it('properly sets unitless 0', () => { expect(directionalProperty('', 0)).toEqual({ bottom: 0, left: 0, right: 0, top: 0, }) }) // One Param it('properly applies a value when passed only one', () => { expect(directionalProperty('border', '12px')).toEqual({ borderBottom: '12px', borderLeft: '12px', borderRight: '12px', borderTop: '12px', }) }) it('properly applies a integer value when passed only one', () => { expect(directionalProperty('border', 12)).toEqual({ borderBottom: 12, borderLeft: 12, borderRight: 12, borderTop: 12, }) }) // Two Params it('properly applies values when passed two', () => { expect(directionalProperty('border', '12px', '24px')).toEqual({ borderBottom: '12px', borderLeft: '24px', borderRight: '24px', borderTop: '12px', }) }) it('properly applies values when passed two integers', () => { expect(directionalProperty('border', 12, 24)).toEqual({ borderBottom: 12, borderLeft: 24, borderRight: 24, borderTop: 12, }) }) it('properly applies values when passed a string and an integer', () => { expect(directionalProperty('border', 12, '24px')).toEqual({ borderBottom: 12, borderLeft: '24px', borderRight: '24px', borderTop: 12, }) }) it('properly skips top and bottom properties when first value is null', () => { expect(directionalProperty('border', null, '12px')).toEqual({ borderLeft: '12px', borderRight: '12px', }) }) it('properly skips left and right properties when second value is null', () => { expect(directionalProperty('border', '12px', null)).toEqual({ borderBottom: '12px', borderTop: '12px', }) }) // Three Params it('properly applies values when passed three', () => { expect(directionalProperty('border', '12px', '24px', '36px')).toEqual({ borderBottom: '36px', borderLeft: '24px', borderRight: '24px', borderTop: '12px', }) }) it('properly skips top property when first value is null', () => { expect(directionalProperty('border', null, '24px', '36px')).toEqual({ borderBottom: '36px', borderLeft: '24px', borderRight: '24px', }) }) it('properly skips right and left properties when second value is null', () => { expect(directionalProperty('border', '12px', null, '36px')).toEqual({ borderBottom: '36px', borderTop: '12px', }) }) it('properly skips bottom property when last value is null', () => { expect(directionalProperty('border', '12px', '24px', null)).toEqual({ borderLeft: '24px', borderRight: '24px', borderTop: '12px', }) }) it('properly applies values when passed a mixture of three value types', () => { expect(directionalProperty('border', 12, '24px', null)).toEqual({ borderLeft: '24px', borderRight: '24px', borderTop: 12, }) }) // Four Params it('properly applies values when passed four', () => { expect(directionalProperty('border', '12px', '24px', '36px', '48px')).toEqual({ borderBottom: '36px', borderLeft: '48px', borderRight: '24px', borderTop: '12px', }) }) it('properly skips top property when first value is null', () => { expect(directionalProperty('border', null, '24px', '36px', '48px')).toEqual({ borderBottom: '36px', borderLeft: '48px', borderRight: '24px', }) }) it('properly skips right property when second value is null', () => { expect(directionalProperty('border', '12px', null, '36px', '48px')).toEqual({ borderBottom: '36px', borderLeft: '48px', borderTop: '12px', }) }) it('properly skips bottom property when third value is null', () => { expect(directionalProperty('border', '12px', '24px', null, '48px')).toEqual({ borderLeft: '48px', borderRight: '24px', borderTop: '12px', }) }) it('properly skips left property when fourth value is null', () => { expect(directionalProperty('border', '12px', '24px', '36px', null)).toEqual({ borderBottom: '36px', borderRight: '24px', borderTop: '12px', }) }) it('properly applies valuew when passed a mixture of four value types', () => { expect(directionalProperty('border', 12, '24px', 36, null)).toEqual({ borderBottom: 36, borderRight: '24px', borderTop: 12, }) }) }) ================================================ FILE: src/helpers/test/em.test.js ================================================ // @flow import em from '../em' describe('em', () => { it('should convert a simple number to ems', () => { expect({ height: em(16) }).toEqual({ height: '1em', }) }) }) ================================================ FILE: src/helpers/test/getValueAndUnit.test.js ================================================ // @flow import getValueAndUnit from '../getValueAndUnit' describe('getValueAndUnit', () => { it('should get value and px from whole values', () => { expect(getValueAndUnit('1px')).toEqual([1, 'px']) }) it('should get value and px from values', () => { expect(getValueAndUnit('1.5px')).toEqual([1.5, 'px']) }) it('should get value and pt from whole values', () => { expect(getValueAndUnit('1pt')).toEqual([1, 'pt']) }) it('should get value and pt from values', () => { expect(getValueAndUnit('1.5pt')).toEqual([1.5, 'pt']) }) it('should get value and pc from whole values', () => { expect(getValueAndUnit('1pc')).toEqual([1, 'pc']) }) it('should get value and pc from values', () => { expect(getValueAndUnit('1.5pc')).toEqual([1.5, 'pc']) }) it('should get value and mm from whole values', () => { expect(getValueAndUnit('1mm')).toEqual([1, 'mm']) }) it('should get value and mm from values', () => { expect(getValueAndUnit('1.5mm')).toEqual([1.5, 'mm']) }) it('should get value and q from whole values', () => { expect(getValueAndUnit('1q')).toEqual([1, 'q']) }) it('should get value and q from values', () => { expect(getValueAndUnit('1.5q')).toEqual([1.5, 'q']) }) it('should get value and cm from whole values', () => { expect(getValueAndUnit('1cm')).toEqual([1, 'cm']) }) it('should get value and cm from values', () => { expect(getValueAndUnit('1.5cm')).toEqual([1.5, 'cm']) }) it('should get value and in from whole values', () => { expect(getValueAndUnit('1in')).toEqual([1, 'in']) }) it('should get value and in from values', () => { expect(getValueAndUnit('1.5in')).toEqual([1.5, 'in']) }) it('should get value and em from whole value', () => { expect(getValueAndUnit('1em')).toEqual([1, 'em']) }) it('should get value and em from decimal values', () => { expect(getValueAndUnit('1.2em')).toEqual([1.2, 'em']) }) it('should get value and rem from whole values', () => { expect(getValueAndUnit('1rem')).toEqual([1, 'rem']) }) it('should get value and rem from decimal values', () => { expect(getValueAndUnit('1.2rem')).toEqual([1.2, 'rem']) }) it('should get value and ex from whole values', () => { expect(getValueAndUnit('1ex')).toEqual([1, 'ex']) }) it('should get value and ex from decimal values', () => { expect(getValueAndUnit('1.2ex')).toEqual([1.2, 'ex']) }) it('should get value and ch from whole values', () => { expect(getValueAndUnit('1ch')).toEqual([1, 'ch']) }) it('should get value and ch from decimal values', () => { expect(getValueAndUnit('1.2ch')).toEqual([1.2, 'ch']) }) it('should get value and vh from whole values', () => { expect(getValueAndUnit('100vh')).toEqual([100, 'vh']) }) it('should get value and vh from decimal values', () => { expect(getValueAndUnit('33.33vh')).toEqual([33.33, 'vh']) }) it('should get value and vw from whole values', () => { expect(getValueAndUnit('100vw')).toEqual([100, 'vw']) }) it('should get value and vw from decimal values', () => { expect(getValueAndUnit('33.33vw')).toEqual([33.33, 'vw']) }) it('should get value and vmin from whole values', () => { expect(getValueAndUnit('100vmin')).toEqual([100, 'vmin']) }) it('should get value and vmin from decimal values', () => { expect(getValueAndUnit('33.33vmin')).toEqual([33.33, 'vmin']) }) it('should get value and vmax from whole values', () => { expect(getValueAndUnit('100vmax')).toEqual([100, 'vmax']) }) it('should get value and vmax from decimal values', () => { expect(getValueAndUnit('33.33vmax')).toEqual([33.33, 'vmax']) }) it('should get value and % from whole values', () => { expect(getValueAndUnit('80%')).toEqual([80, '%']) }) it('should get value and % from decimal values', () => { expect(getValueAndUnit('33.3%')).toEqual([33.3, '%']) }) it('should return value and no unit when passed a number string', () => { expect(getValueAndUnit('33')).toEqual([33, '']) }) it('should return value and no unit when passed a number string', () => { expect(getValueAndUnit('33px33')).toEqual(['33px33', undefined]) }) }) ================================================ FILE: src/helpers/test/important.test.js ================================================ // @flow import important from '../important' import cover from '../../mixins/cover' describe('important', () => { it('should add !important to a single rule in a flat style block', () => { expect(important({ color: 'red' })).toEqual({ color: 'red !important', }) }) it('should add !important to a single rule in a flat style block when the value is a number', () => { expect(important({ fontSize: 12 })).toEqual({ fontSize: '12 !important', }) }) it('should add !important to every rule in a flat style block', () => { expect( important({ color: 'red', background: 'blue', }), ).toEqual({ background: 'blue !important', color: 'red !important', }) }) it('should add !important to a target rule when passed as a string', () => { expect( important( { color: 'red', background: 'blue', }, 'color', ), ).toEqual({ background: 'blue', color: 'red !important', }) }) it('should add !important to a target rule when passed as a single item array', () => { expect( important( { color: 'red', background: 'blue', }, ['color'], ), ).toEqual({ background: 'blue', color: 'red !important', }) }) it('should add !important to a target rule when passed as an array', () => { expect( important( { color: 'red', background: 'blue', height: '100px', }, ['color', 'height'], ), ).toEqual({ background: 'blue', color: 'red !important', height: '100px !important', }) }) it('should add !important to a mixture of unnested and nested target rules when passed as an array', () => { expect( important( { background: 'blue', height: '100px', div: { color: 'red', }, }, ['color', 'height'], ), ).toEqual({ background: 'blue', div: { color: 'red !important', }, height: '100px !important', }) }) it('should add !important to all rules in a polished module', () => { expect(important(cover())).toEqual({ bottom: '0 !important', left: '0 !important', position: 'absolute !important', right: '0 !important', top: '0 !important', }) }) it('should add !important to a specific rule in a polished module', () => { expect(important(cover(), 'position')).toEqual({ bottom: 0, left: 0, position: 'absolute !important', right: 0, top: 0, }) }) it('should return original styles when no properties are found', () => { expect( important( { color: 'red', background: 'blue', height: '100px', }, ['width', 'fontSize'], ), ).toEqual({ background: 'blue', color: 'red', height: '100px', }) }) it('should throw an error when passed a non-object', () => { expect(() => { // $FlowFixMe important('test') }).toThrow('important requires a valid style object, got a string instead.') }) }) ================================================ FILE: src/helpers/test/modularScale.test.js ================================================ // @flow import modularScale, { ratioNames } from '../modularScale' describe('modularScale', () => { it('should throw an error if no steps are provided', () => { // $FlowFixMe expect(() => ({ 'font-size': modularScale() })).toThrow() }) it('should use perfect fourth and 1em base by default', () => { expect({ 'font-size': modularScale(1) }).toEqual({ 'font-size': '1.333em', }) expect({ 'font-size': modularScale(2) }).toEqual({ 'font-size': '1.776889em', }) expect({ 'font-size': modularScale(0) }).toEqual({ 'font-size': '1em', }) }) it('should allow adjusting the base', () => { expect({ 'font-size': modularScale(1, '2em') }).toEqual({ 'font-size': '2.666em', }) }) it('should allow a number as a base', () => { expect({ 'font-size': modularScale(1, 2) }).toEqual({ 'font-size': '2.666', }) }) it('should allow properly look up preset ratio', () => { expect({ 'font-size': modularScale(1, '1em', 'minorSecond'), }).toEqual({ 'font-size': '1.067em', }) }) it('should allow adjusting the ratio', () => { expect({ 'font-size': modularScale(1, '1em', 1) }).toEqual({ 'font-size': '1em', }) }) it('should allow any of the predefined ratio names', () => { const expectedRatio = { minorSecond: '1.067em', majorSecond: '1.125em', minorThird: '1.2em', majorThird: '1.25em', perfectFourth: '1.333em', augFourth: '1.414em', perfectFifth: '1.5em', minorSixth: '1.6em', goldenSection: '1.618em', majorSixth: '1.667em', minorSeventh: '1.778em', majorSeventh: '1.875em', octave: '2em', majorTenth: '2.5em', majorEleventh: '2.667em', majorTwelfth: '3em', doubleOctave: '4em', } Object.keys(ratioNames).forEach(ratio => { expect({ 'font-size': modularScale(1, '1em', ratioNames[ratio]), }).toEqual({ 'font-size': expectedRatio[ratio], }) }) }) it('should throw an error if an invalid base is provided', () => { expect(() => { modularScale(2, 'invalid') }).toThrow() }) it('should throw an error if an invalid ratio is provided', () => { expect(() => { // $FlowFixMe modularScale(2, '1em', 'invalid') }).toThrow() }) }) ================================================ FILE: src/helpers/test/rem.test.js ================================================ // @flow import rem from '../rem' describe('rem', () => { it('should convert a simple number to rems', () => { expect({ height: rem(16) }).toEqual({ height: '1rem', }) }) }) ================================================ FILE: src/helpers/test/remToPx.test.js ================================================ // @flow import remToPx from '../remToPx' describe('remToPx', () => { beforeEach(() => { // $FlowFixMe document.documentElement.style.setProperty('font-size', '62.5%') // eslint-disable-line no-undef }) test('calculate px value when a base in % is set on the root.', () => { expect(remToPx('1.6rem')).toEqual('16px') }) afterEach(() => { // $FlowFixMe document.documentElement.style.removeProperty('font-size') // eslint-disable-line no-undef }) }) describe('remToPx', () => { beforeEach(() => { // $FlowFixMe document.documentElement.style.setProperty('font-size', '10px') // eslint-disable-line no-undef }) test('calculate px value when a base in px is set on the root.', () => { expect(remToPx('1.6rem')).toEqual('16px') }) afterEach(() => { // $FlowFixMe document.documentElement.style.removeProperty('font-size') // eslint-disable-line no-undef }) }) describe('remToPx', () => { test('calculate px value when no base is set on the root or provided.', () => { expect(remToPx('1.6rem')).toEqual('25.6px') }) }) describe('remToPx', () => { beforeEach(() => { // $FlowFixMe document.documentElement.style.setProperty('font-size', '10pt') // eslint-disable-line no-undef }) test('errors when an invalid base is set on the root.', () => { expect(() => { remToPx('1.6rem') }).toThrow('base must be set in "px" or "%" but you set it in "pt".') }) afterEach(() => { // $FlowFixMe document.documentElement.style.removeProperty('font-size') // eslint-disable-line no-undef }) }) describe('remToPx', () => { beforeEach(() => { // $FlowFixMe document.documentElement.style.setProperty('font-size', '10px') // eslint-disable-line no-undef }) test('errors when an invalid value is provided.', () => { expect(() => { remToPx('1.6em') }).toThrow('remToPx expects a value in "rem" but you provided it in "em".') }) afterEach(() => { // $FlowFixMe document.documentElement.style.removeProperty('font-size') // eslint-disable-line no-undef }) }) describe('remToPx', () => { test('calculate px value when a base in px is provided.', () => { expect(remToPx('1.6rem', '10px')).toEqual('16px') }) test('calculate px value when a base in % is provided.', () => { expect(remToPx('1.6rem', '62.5%')).toEqual('16px') }) test('calculate px value when a unitless base is provided.', () => { expect(remToPx('1.6', '62.5%')).toEqual('16px') }) test('errors an invalid base is provided.', () => { expect(() => { remToPx('1.6rem', '10pt') }).toThrow('base must be set in "px" or "%" but you set it in "pt".') }) test('errors when an invalid value is provided.', () => { expect(() => { remToPx('1.6em', '10px') }).toThrow('remToPx expects a value in "rem" but you provided it in "em".') }) }) ================================================ FILE: src/helpers/test/stripUnit.test.js ================================================ // @flow import stripUnit from '../stripUnit' describe('stripUnit', () => { it('should strip px from whole values', () => { expect({ '--dimension': stripUnit('1px') }).toEqual({ '--dimension': 1, }) }) it('should strip px from values', () => { expect({ '--dimension': stripUnit('1.5px') }).toEqual({ '--dimension': 1.5, }) }) it('should strip pt from whole values', () => { expect({ '--dimension': stripUnit('1pt') }).toEqual({ '--dimension': 1, }) }) it('should strip pt from values', () => { expect({ '--dimension': stripUnit('1.5pt') }).toEqual({ '--dimension': 1.5, }) }) it('should strip pc from whole values', () => { expect({ '--dimension': stripUnit('1pc') }).toEqual({ '--dimension': 1, }) }) it('should strip pc from values', () => { expect({ '--dimension': stripUnit('1.5pc') }).toEqual({ '--dimension': 1.5, }) }) it('should strip mm from whole values', () => { expect({ '--dimension': stripUnit('1mm') }).toEqual({ '--dimension': 1, }) }) it('should strip mm from values', () => { expect({ '--dimension': stripUnit('1.5mm') }).toEqual({ '--dimension': 1.5, }) }) it('should strip q from whole values', () => { expect({ '--dimension': stripUnit('1q') }).toEqual({ '--dimension': 1, }) }) it('should strip q from values', () => { expect({ '--dimension': stripUnit('1.5q') }).toEqual({ '--dimension': 1.5, }) }) it('should strip cm from whole values', () => { expect({ '--dimension': stripUnit('1cm') }).toEqual({ '--dimension': 1, }) }) it('should strip cm from values', () => { expect({ '--dimension': stripUnit('1.5cm') }).toEqual({ '--dimension': 1.5, }) }) it('should strip in from whole values', () => { expect({ '--dimension': stripUnit('1in') }).toEqual({ '--dimension': 1, }) }) it('should strip in from values', () => { expect({ '--dimension': stripUnit('1.5in') }).toEqual({ '--dimension': 1.5, }) }) it('should strip em from whole value', () => { expect({ '--dimension': stripUnit('1em') }).toEqual({ '--dimension': 1, }) }) it('should strip em from decimal values', () => { expect({ '--dimension': stripUnit('1.2em') }).toEqual({ '--dimension': 1.2, }) }) it('should strip rem from whole values', () => { expect({ '--dimension': stripUnit('1rem') }).toEqual({ '--dimension': 1, }) }) it('should strip rem from decimal values', () => { expect({ '--dimension': stripUnit('1.2rem') }).toEqual({ '--dimension': 1.2, }) }) it('should strip ex from whole values', () => { expect({ '--dimension': stripUnit('1ex') }).toEqual({ '--dimension': 1, }) }) it('should strip ex from decimal values', () => { expect({ '--dimension': stripUnit('1.2ex') }).toEqual({ '--dimension': 1.2, }) }) it('should strip ch from whole values', () => { expect({ '--dimension': stripUnit('1ch') }).toEqual({ '--dimension': 1, }) }) it('should strip ch from decimal values', () => { expect({ '--dimension': stripUnit('1.2ch') }).toEqual({ '--dimension': 1.2, }) }) it('should strip vh from whole values', () => { expect({ '--dimension': stripUnit('100vh') }).toEqual({ '--dimension': 100, }) }) it('should strip vh from decimal values', () => { expect({ '--dimension': stripUnit('33.33vh') }).toEqual({ '--dimension': 33.33, }) }) it('should strip vw from whole values', () => { expect({ '--dimension': stripUnit('100vw') }).toEqual({ '--dimension': 100, }) }) it('should strip vw from decimal values', () => { expect({ '--dimension': stripUnit('33.33vw') }).toEqual({ '--dimension': 33.33, }) }) it('should strip vmin from whole values', () => { expect({ '--dimension': stripUnit('100vmin') }).toEqual({ '--dimension': 100, }) }) it('should strip vmin from decimal values', () => { expect({ '--dimension': stripUnit('33.33vmin') }).toEqual({ '--dimension': 33.33, }) }) it('should strip vmax from whole values', () => { expect({ '--dimension': stripUnit('100vmax') }).toEqual({ '--dimension': 100, }) }) it('should strip vmax from decimal values', () => { expect({ '--dimension': stripUnit('33.33vmax') }).toEqual({ '--dimension': 33.33, }) }) it('should strip % from whole values', () => { expect({ '--dimension': stripUnit('80%') }).toEqual({ '--dimension': 80, }) }) it('should strip % from decimal values', () => { expect({ '--dimension': stripUnit('33.3%') }).toEqual({ '--dimension': 33.3, }) }) it('should return a unitless value when passed', () => { expect({ '--dimension': stripUnit('33') }).toEqual({ '--dimension': 33, }) // $FlowFixMe expect({ '--dimension': stripUnit(33) }).toEqual({ '--dimension': 33, }) }) it('should return invalid value when passed', () => { expect({ '--dimension': stripUnit('blah') }).toEqual({ '--dimension': 'blah', }) }) }) ================================================ FILE: src/index.js ================================================ // @flow // Math import math from './math/math' // Helpers import cssVar from './helpers/cssVar' import directionalProperty from './helpers/directionalProperty' import em from './helpers/em' import getValueAndUnit from './helpers/getValueAndUnit' import important from './helpers/important' import modularScale from './helpers/modularScale' import rem from './helpers/rem' import remToPx from './helpers/remToPx' import stripUnit from './helpers/stripUnit' // Easings import easeIn from './easings/easeIn' import easeInOut from './easings/easeInOut' import easeOut from './easings/easeOut' // Mixins import between from './mixins/between' import clearFix from './mixins/clearFix' import cover from './mixins/cover' import ellipsis from './mixins/ellipsis' import fluidRange from './mixins/fluidRange' import fontFace from './mixins/fontFace' import hideText from './mixins/hideText' import hideVisually from './mixins/hideVisually' import hiDPI from './mixins/hiDPI' import linearGradient from './mixins/linearGradient' import normalize from './mixins/normalize' import radialGradient from './mixins/radialGradient' import retinaImage from './mixins/retinaImage' import timingFunctions from './mixins/timingFunctions' import triangle from './mixins/triangle' import wordWrap from './mixins/wordWrap' // Color import adjustHue from './color/adjustHue' import complement from './color/complement' import darken from './color/darken' import desaturate from './color/desaturate' import getContrast from './color/getContrast' import getLuminance from './color/getLuminance' import grayscale from './color/grayscale' import hsl from './color/hsl' import hsla from './color/hsla' import hslToColorString from './color/hslToColorString' import invert from './color/invert' import lighten from './color/lighten' import meetsContrastGuidelines from './color/meetsContrastGuidelines' import mix from './color/mix' import opacify from './color/opacify' import parseToHsl from './color/parseToHsl' import parseToRgb from './color/parseToRgb' import readableColor from './color/readableColor' import rgb from './color/rgb' import rgba from './color/rgba' import rgbToColorString from './color/rgbToColorString' import saturate from './color/saturate' import setHue from './color/setHue' import setLightness from './color/setLightness' import setSaturation from './color/setSaturation' import shade from './color/shade' import tint from './color/tint' import toColorString from './color/toColorString' import transparentize from './color/transparentize' // Shorthands import animation from './shorthands/animation' import backgroundImages from './shorthands/backgroundImages' import backgrounds from './shorthands/backgrounds' import border from './shorthands/border' import borderColor from './shorthands/borderColor' import borderRadius from './shorthands/borderRadius' import borderStyle from './shorthands/borderStyle' import borderWidth from './shorthands/borderWidth' import buttons from './shorthands/buttons' import margin from './shorthands/margin' import padding from './shorthands/padding' import position from './shorthands/position' import size from './shorthands/size' import textInputs from './shorthands/textInputs' import transitions from './shorthands/transitions' export { adjustHue, animation, backgroundImages, backgrounds, between, border, borderColor, borderRadius, borderStyle, borderWidth, buttons, clearFix, complement, cover, cssVar, darken, desaturate, directionalProperty, easeIn, easeInOut, easeOut, ellipsis, em, fluidRange, fontFace, getContrast, getLuminance, getValueAndUnit, grayscale, invert, hideText, hideVisually, hiDPI, hsl, hsla, hslToColorString, important, lighten, linearGradient, margin, math, meetsContrastGuidelines, mix, modularScale, normalize, opacify, padding, parseToHsl, parseToRgb, position, radialGradient, readableColor, rem, remToPx, retinaImage, rgb, rgba, rgbToColorString, saturate, setHue, setLightness, setSaturation, shade, size, stripUnit, textInputs, timingFunctions, tint, toColorString, transitions, transparentize, triangle, wordWrap, } ================================================ FILE: src/internalHelpers/_capitalizeString.js ================================================ // @flow // @private function capitalizeString(string: string): string { return string.charAt(0).toUpperCase() + string.slice(1) } export default capitalizeString ================================================ FILE: src/internalHelpers/_constructGradientValue.js ================================================ // @flow function constructGradientValue(literals: Array, ...substitutions: Array): string { let template = '' for (let i = 0; i < literals.length; i += 1) { template += literals[i] if (i === substitutions.length - 1 && substitutions[i]) { const definedValues = substitutions.filter(substitute => !!substitute) // Adds leading coma if properties preceed color-stops if (definedValues.length > 1) { template = template.slice(0, -1) template += `, ${substitutions[i]}` // No trailing space if color-stops is the only param provided } else if (definedValues.length === 1) { template += `${substitutions[i]}` } } else if (substitutions[i]) { template += `${substitutions[i]} ` } } return template.trim() } export default constructGradientValue ================================================ FILE: src/internalHelpers/_curry.js ================================================ // @flow // Type definitions taken from https://github.com/gcanti/flow-static-land/blob/master/src/Fun.js type Fn1 = (a: A, ...rest: Array) => B type Fn2 = (a: A, b: B, ...rest: Array) => C type Fn3 = (a: A, b: B, c: C, ...rest: Array) => D type CurriedFn2 = Fn1> & Fn2 // eslint-disable-next-line no-unused-vars type CurriedFn3 = Fn1> & Fn2> & Fn3 // eslint-disable-next-line no-unused-vars declare function curry(f: Fn2): CurriedFn2 // eslint-disable-next-line no-redeclare declare function curry(f: Fn3): CurriedFn3 function curried(f: Function, length: number, acc: Array): Function { return function fn() { // eslint-disable-next-line prefer-rest-params const combined = acc.concat(Array.prototype.slice.call(arguments)) return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined) } } // eslint-disable-next-line no-redeclare export default function curry(f: Function): Function { // eslint-disable-line no-redeclare return curried(f, f.length, []) } ================================================ FILE: src/internalHelpers/_endsWith.js ================================================ // @flow /** * Check if a string ends with something * @private */ export default function endsWith(string: string, suffix: string): boolean { return string.substr(-suffix.length) === suffix } ================================================ FILE: src/internalHelpers/_errors.js ================================================ // @flow // based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js declare var preval: Function /** * Parse errors.md and turn it into a simple hash of code: message * @private */ const ERRORS = preval` const fs = require('fs'); const md = fs.readFileSync(__dirname + '/errors.md', 'utf8'); module.exports = md.split(/^#/gm).slice(1).reduce((errors, str) => { const [, code, message] = str.split(/^.*?(\\d+)\\s*\\n/) errors[code] = message return errors; }, {}); ` /** * super basic version of sprintf * @private */ function format(...args) { let a = args[0] const b = [] let c for (c = 1; c < args.length; c += 1) { b.push(args[c]) } b.forEach(d => { a = a.replace(/%[a-z]/, d) }) return a } /** * Create an error file out of errors.md for development and a simple web link to the full errors * in production mode. * @private */ export default class PolishedError extends Error { constructor(code: string | number, ...args: Array) { if (process.env.NODE_ENV === 'production') { super( `An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#${code} for more information.`, ) } else { super(format(ERRORS[code], ...args)) } } } ================================================ FILE: src/internalHelpers/_guard.js ================================================ // @flow function guard(lowerBoundary: number, upperBoundary: number, value: number): number { return Math.max(lowerBoundary, Math.min(upperBoundary, value)) } export default guard ================================================ FILE: src/internalHelpers/_hslToHex.js ================================================ // @flow import hslToRgb from './_hslToRgb' import reduceHexValue from './_reduceHexValue' import toHex from './_numberToHex' function colorToHex(color: number): string { return toHex(Math.round(color * 255)) } function convertToHex(red: number, green: number, blue: number): string { return reduceHexValue(`#${colorToHex(red)}${colorToHex(green)}${colorToHex(blue)}`) } function hslToHex(hue: number, saturation: number, lightness: number): string { return hslToRgb(hue, saturation, lightness, convertToHex) } export default hslToHex ================================================ FILE: src/internalHelpers/_hslToRgb.js ================================================ // @flow type ConversionFunction = (red: number, green: number, blue: number) => string function colorToInt(color: number): number { return Math.round(color * 255) } function convertToInt(red: number, green: number, blue: number): string { return `${colorToInt(red)},${colorToInt(green)},${colorToInt(blue)}` } function hslToRgb( hue: number, saturation: number, lightness: number, convert: ConversionFunction = convertToInt, ): string { if (saturation === 0) { // achromatic return convert(lightness, lightness, lightness) } // formulae from https://en.wikipedia.org/wiki/HSL_and_HSV const huePrime = (((hue % 360) + 360) % 360) / 60 const chroma = (1 - Math.abs(2 * lightness - 1)) * saturation const secondComponent = chroma * (1 - Math.abs((huePrime % 2) - 1)) let red = 0 let green = 0 let blue = 0 if (huePrime >= 0 && huePrime < 1) { red = chroma green = secondComponent } else if (huePrime >= 1 && huePrime < 2) { red = secondComponent green = chroma } else if (huePrime >= 2 && huePrime < 3) { green = chroma blue = secondComponent } else if (huePrime >= 3 && huePrime < 4) { green = secondComponent blue = chroma } else if (huePrime >= 4 && huePrime < 5) { red = secondComponent blue = chroma } else if (huePrime >= 5 && huePrime < 6) { red = chroma blue = secondComponent } const lightnessModification = lightness - chroma / 2 const finalRed = red + lightnessModification const finalGreen = green + lightnessModification const finalBlue = blue + lightnessModification return convert(finalRed, finalGreen, finalBlue) } export default hslToRgb ================================================ FILE: src/internalHelpers/_nameToHex.js ================================================ // @flow const namedColorMap = { aliceblue: 'f0f8ff', antiquewhite: 'faebd7', aqua: '00ffff', aquamarine: '7fffd4', azure: 'f0ffff', beige: 'f5f5dc', bisque: 'ffe4c4', black: '000', blanchedalmond: 'ffebcd', blue: '0000ff', blueviolet: '8a2be2', brown: 'a52a2a', burlywood: 'deb887', cadetblue: '5f9ea0', chartreuse: '7fff00', chocolate: 'd2691e', coral: 'ff7f50', cornflowerblue: '6495ed', cornsilk: 'fff8dc', crimson: 'dc143c', cyan: '00ffff', darkblue: '00008b', darkcyan: '008b8b', darkgoldenrod: 'b8860b', darkgray: 'a9a9a9', darkgreen: '006400', darkgrey: 'a9a9a9', darkkhaki: 'bdb76b', darkmagenta: '8b008b', darkolivegreen: '556b2f', darkorange: 'ff8c00', darkorchid: '9932cc', darkred: '8b0000', darksalmon: 'e9967a', darkseagreen: '8fbc8f', darkslateblue: '483d8b', darkslategray: '2f4f4f', darkslategrey: '2f4f4f', darkturquoise: '00ced1', darkviolet: '9400d3', deeppink: 'ff1493', deepskyblue: '00bfff', dimgray: '696969', dimgrey: '696969', dodgerblue: '1e90ff', firebrick: 'b22222', floralwhite: 'fffaf0', forestgreen: '228b22', fuchsia: 'ff00ff', gainsboro: 'dcdcdc', ghostwhite: 'f8f8ff', gold: 'ffd700', goldenrod: 'daa520', gray: '808080', green: '008000', greenyellow: 'adff2f', grey: '808080', honeydew: 'f0fff0', hotpink: 'ff69b4', indianred: 'cd5c5c', indigo: '4b0082', ivory: 'fffff0', khaki: 'f0e68c', lavender: 'e6e6fa', lavenderblush: 'fff0f5', lawngreen: '7cfc00', lemonchiffon: 'fffacd', lightblue: 'add8e6', lightcoral: 'f08080', lightcyan: 'e0ffff', lightgoldenrodyellow: 'fafad2', lightgray: 'd3d3d3', lightgreen: '90ee90', lightgrey: 'd3d3d3', lightpink: 'ffb6c1', lightsalmon: 'ffa07a', lightseagreen: '20b2aa', lightskyblue: '87cefa', lightslategray: '789', lightslategrey: '789', lightsteelblue: 'b0c4de', lightyellow: 'ffffe0', lime: '0f0', limegreen: '32cd32', linen: 'faf0e6', magenta: 'f0f', maroon: '800000', mediumaquamarine: '66cdaa', mediumblue: '0000cd', mediumorchid: 'ba55d3', mediumpurple: '9370db', mediumseagreen: '3cb371', mediumslateblue: '7b68ee', mediumspringgreen: '00fa9a', mediumturquoise: '48d1cc', mediumvioletred: 'c71585', midnightblue: '191970', mintcream: 'f5fffa', mistyrose: 'ffe4e1', moccasin: 'ffe4b5', navajowhite: 'ffdead', navy: '000080', oldlace: 'fdf5e6', olive: '808000', olivedrab: '6b8e23', orange: 'ffa500', orangered: 'ff4500', orchid: 'da70d6', palegoldenrod: 'eee8aa', palegreen: '98fb98', paleturquoise: 'afeeee', palevioletred: 'db7093', papayawhip: 'ffefd5', peachpuff: 'ffdab9', peru: 'cd853f', pink: 'ffc0cb', plum: 'dda0dd', powderblue: 'b0e0e6', purple: '800080', rebeccapurple: '639', red: 'f00', rosybrown: 'bc8f8f', royalblue: '4169e1', saddlebrown: '8b4513', salmon: 'fa8072', sandybrown: 'f4a460', seagreen: '2e8b57', seashell: 'fff5ee', sienna: 'a0522d', silver: 'c0c0c0', skyblue: '87ceeb', slateblue: '6a5acd', slategray: '708090', slategrey: '708090', snow: 'fffafa', springgreen: '00ff7f', steelblue: '4682b4', tan: 'd2b48c', teal: '008080', thistle: 'd8bfd8', tomato: 'ff6347', turquoise: '40e0d0', violet: 'ee82ee', wheat: 'f5deb3', white: 'fff', whitesmoke: 'f5f5f5', yellow: 'ff0', yellowgreen: '9acd32', } /** * Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color. * @private */ function nameToHex(color: string): string { if (typeof color !== 'string') return color const normalizedColorName = color.toLowerCase() return namedColorMap[normalizedColorName] ? `#${namedColorMap[normalizedColorName]}` : color } export default nameToHex ================================================ FILE: src/internalHelpers/_numberToHex.js ================================================ // @flow function numberToHex(value: number): string { const hex = value.toString(16) return hex.length === 1 ? `0${hex}` : hex } export default numberToHex ================================================ FILE: src/internalHelpers/_pxto.js ================================================ // @flow import endsWith from './_endsWith' import stripUnit from '../helpers/stripUnit' import PolishedError from './_errors' /** * Factory function that creates pixel-to-x converters * @private */ const pxtoFactory = (to: string) => ( pxval: string | number, base?: string | number = '16px', ): string => { let newPxval = pxval let newBase = base if (typeof pxval === 'string') { if (!endsWith(pxval, 'px')) { throw new PolishedError(69, to, pxval) } newPxval = stripUnit(pxval) } if (typeof base === 'string') { if (!endsWith(base, 'px')) { throw new PolishedError(70, to, base) } newBase = stripUnit(base) } if (typeof newPxval === 'string') { throw new PolishedError(71, pxval, to) } if (typeof newBase === 'string') { throw new PolishedError(72, base, to) } return `${newPxval / newBase}${to}` } export default pxtoFactory ================================================ FILE: src/internalHelpers/_reduceHexValue.js ================================================ // @flow /** * Reduces hex values if possible e.g. #ff8866 to #f86 * @private */ const reduceHexValue = (value: string): string => { if ( value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6] ) { return `#${value[1]}${value[3]}${value[5]}` } return value } export default reduceHexValue ================================================ FILE: src/internalHelpers/_rgbToHsl.js ================================================ // @flow import type { HslColor, HslaColor, RgbColor, RgbaColor, } from '../types/color' function rgbToHsl(color: RgbColor | RgbaColor): HslColor | HslaColor { // make sure rgb are contained in a set of [0, 255] const red = color.red / 255 const green = color.green / 255 const blue = color.blue / 255 const max = Math.max(red, green, blue) const min = Math.min(red, green, blue) const lightness = (max + min) / 2 if (max === min) { // achromatic if (color.alpha !== undefined) { return { hue: 0, saturation: 0, lightness, alpha: color.alpha, } } else { return { hue: 0, saturation: 0, lightness } } } let hue const delta = max - min const saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min) switch (max) { case red: hue = (green - blue) / delta + (green < blue ? 6 : 0) break case green: hue = (blue - red) / delta + 2 break default: // blue case hue = (red - green) / delta + 4 break } hue *= 60 if (color.alpha !== undefined) { return { hue, saturation, lightness, alpha: color.alpha, } } return { hue, saturation, lightness } } export default rgbToHsl ================================================ FILE: src/internalHelpers/_statefulSelectors.js ================================================ // @flow import PolishedError from './_errors' import type { InteractionState } from '../types/interactionState' function generateSelectors(template: Function, state: InteractionState): string { const stateSuffix = state ? `:${state}` : '' return template(stateSuffix) } /** * Function helper that adds an array of states to a template of selectors. Used in textInputs and buttons. * @private */ function statefulSelectors( states: Array, template: Function, stateMap?: Array, ): string { if (!template) throw new PolishedError(67) if (states.length === 0) return generateSelectors(template, null) let selectors = [] for (let i = 0; i < states.length; i += 1) { if (stateMap && stateMap.indexOf(states[i]) < 0) { throw new PolishedError(68) } selectors.push(generateSelectors(template, states[i])) } selectors = selectors.join(',') return selectors } export default statefulSelectors ================================================ FILE: src/internalHelpers/errors.md ================================================ **DO NOT REMOVE ERRORS OR MAKE NEW ONES OUT OF SEQUENCE, ALWAYS ADD TO THE END.** **COLOR** ## 1 Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }). ## 2 Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }). ## 3 Passed an incorrect argument to a color function, please pass a string representation of a color. ## 4 Couldn't generate valid rgb string from %s, it returned %s. ## 5 Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation. ## 6 Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }). ## 7 Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }). ## 8 Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object. ## 9 Please provide a number of steps to the modularScale helper. ## 10 Please pass a number or one of the predefined scales to the modularScale helper as the ratio. ## 11 Invalid value passed as base to modularScale, expected number or em string but got "%s" ## 12 Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead. ## 13 Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead. ## 14 Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12. ## 15 Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12. ## 16 You must provide a template to this method. ## 17 You passed an unsupported selector state to this method. ## 18 minScreen and maxScreen must be provided as stringified numbers with the same units. ## 19 fromSize and toSize must be provided as stringified numbers with the same units. ## 20 expects either an array of objects or a single object with the properties prop, fromSize, and toSize. ## 21 expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`. ## 22 expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`. ## 23 fontFace expects a name of a font-family. ## 24 fontFace expects either the path to the font file(s) or a name of a local copy. ## 25 fontFace expects localFonts to be an array. ## 26 fontFace expects fileFormats to be an array. ## 27 radialGradient requries at least 2 color-stops to properly render. ## 28 Please supply a filename to retinaImage() as the first argument. ## 29 Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'. ## 30 Passed an invalid value to `height` or `width`. Please provide a pixel based unit. ## 31 The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation ## 32 To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s']) To pass a single animation please supply them in simple values, e.g. animation('rotate', '2s') ## 33 The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation ## 34 borderRadius expects a radius value as a string or number as the second argument. ## 35 borderRadius expects one of "top", "bottom", "left" or "right" as the first argument. ## 36 Property must be a string value. ## 37 Syntax Error at %s. ## 38 Formula contains a function that needs parentheses at %s. ## 39 Formula is missing closing parenthesis at %s. ## 40 Formula has too many closing parentheses at %s. ## 41 All values in a formula must have the same unit or be unitless. ## 42 Please provide a number of steps to the modularScale helper. ## 43 Please pass a number or one of the predefined scales to the modularScale helper as the ratio. ## 44 Invalid value passed as base to modularScale, expected number or em/rem string but got %s. ## 45 Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object. ## 46 Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object. ## 47 minScreen and maxScreen must be provided as stringified numbers with the same units. ## 48 fromSize and toSize must be provided as stringified numbers with the same units. ## 49 Expects either an array of objects or a single object with the properties prop, fromSize, and toSize. ## 50 Expects the objects in the first argument array to have the properties prop, fromSize, and toSize. ## 51 Expects the first argument object to have the properties prop, fromSize, and toSize. ## 52 fontFace expects either the path to the font file(s) or a name of a local copy. ## 53 fontFace expects localFonts to be an array. ## 54 fontFace expects fileFormats to be an array. ## 55 fontFace expects a name of a font-family. ## 56 linearGradient requries at least 2 color-stops to properly render. ## 57 radialGradient requries at least 2 color-stops to properly render. ## 58 Please supply a filename to retinaImage() as the first argument. ## 59 Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'. ## 60 Passed an invalid value to `height` or `width`. Please provide a pixel based unit. ## 61 Property must be a string value. ## 62 borderRadius expects a radius value as a string or number as the second argument. ## 63 borderRadius expects one of "top", "bottom", "left" or "right" as the first argument. ## 64 The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation. ## 65 To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s'). ## 66 The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation. ## 67 You must provide a template to this method. ## 68 You passed an unsupported selector state to this method. ## 69 Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead. ## 70 Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead. ## 71 Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12. ## 72 Passed invalid base value %s to %s(), please pass a value like "12px" or 12. ## 73 Please provide a valid CSS variable. ## 74 CSS variable not found and no default was provided. ## 75 important requires a valid style object, got a %s instead. ## 76 fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen. ## 77 remToPx expects a value in "rem" but you provided it in "%s". ## 78 base must be set in "px" or "%" but you set it in "%s". ================================================ FILE: src/internalHelpers/test/_capitalizeString.test.js ================================================ // @flow import capitalizeString from '../_capitalizeString' describe('capitalizeString', () => { it('capitalizes a string', () => { expect(capitalizeString('polished')).toEqual('Polished') }) it('returns a capitalized string untouched', () => { expect(capitalizeString('Polished')).toEqual('Polished') }) }) ================================================ FILE: src/internalHelpers/test/_curry.test.js ================================================ // @flow import curry from '../_curry' describe('curry', () => { it('should execute the function right now', () => { const fn = (amount, color) => `${amount}-${color}` expect(curry(fn)(0.5, '#FFF')).toEqual('0.5-#FFF') }) it('should create another function that can be executed', () => { const fn = (amount, color) => `${amount}-${color}` expect(curry(fn)(0.5)('#FFF')).toEqual('0.5-#FFF') }) }) ================================================ FILE: src/internalHelpers/test/_errors.test.js ================================================ // @flow import math from '../../math/math' import exponential from '../../math/presets/exponentialSymbols' const OLD_ENV = process.env beforeEach(() => { jest.resetModules() process.env = { ...OLD_ENV } delete process.env.NODE_ENV }) afterEach(() => { process.env = OLD_ENV }) describe('errors', () => { it('should throw an error when a function has no opening parenthesis', () => { process.env.NODE_ENV = 'production' expect(() => { math('1px + sqrt 4', exponential) }).toThrow( 'An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#38 for more information.', ) }) }) ================================================ FILE: src/internalHelpers/test/_guard.test.js ================================================ // @flow import guard from '../_guard' describe('guard', () => { it('should return the value in case it is within the boundary', () => { expect(guard(0, 1, 0.4)).toEqual(0.4) }) it('should return the upper boundary in case the value is higher', () => { expect(guard(0, 1, 1.4)).toEqual(1) }) it('should return the lower boundary in case the value is lower', () => { expect(guard(0, 1, -0.2)).toEqual(0) }) }) ================================================ FILE: src/internalHelpers/test/_hslToHex.test.js ================================================ // @flow import hslToHex from '../_hslToHex' describe('hslToHex', () => { it('should convert numbers to a hex color', () => { expect({ background: hslToHex(360, 0.75, 0.4) }).toEqual({ background: '#b31919', }) }) it('should convert the color red', () => { expect({ background: hslToHex(0, 1, 0.5) }).toEqual({ background: '#f00', }) }) it('should convert the color yellow', () => { expect({ background: hslToHex(60, 1, 0.5) }).toEqual({ background: '#ff0', }) }) it('should convert the color lime', () => { expect({ background: hslToHex(120, 1, 0.5) }).toEqual({ background: '#0f0', }) }) it('should convert the color cyan', () => { expect({ background: hslToHex(180, 1, 0.5) }).toEqual({ background: '#0ff', }) }) it('should convert the color blue', () => { expect({ background: hslToHex(240, 1, 0.5) }).toEqual({ background: '#00f', }) }) it('should convert the color magenta', () => { expect({ background: hslToHex(300, 1, 0.5) }).toEqual({ background: '#f0f', }) }) it('should convert black', () => { expect({ background: hslToHex(360, 0, 0.4) }).toEqual({ background: '#666', }) }) }) ================================================ FILE: src/internalHelpers/test/_hslToRgb.test.js ================================================ // @flow import hslToRgb from '../_hslToRgb' describe('hslToRgb', () => { it('should convert numbers to a hex color', () => { expect({ background: `rgb(${hslToRgb(360, 0.75, 0.4)})` }).toEqual({ background: 'rgb(179,25,25)', }) }) it('should convert the color red', () => { expect({ background: `rgb(${hslToRgb(0, 1, 0.5)})` }).toEqual({ background: 'rgb(255,0,0)', }) }) it('should convert the color yellow', () => { expect({ background: `rgb(${hslToRgb(60, 1, 0.5)})` }).toEqual({ background: 'rgb(255,255,0)', }) }) it('should convert the color lime', () => { expect({ background: `rgb(${hslToRgb(120, 1, 0.5)})` }).toEqual({ background: 'rgb(0,255,0)', }) }) it('should convert the color cyan', () => { expect({ background: `rgb(${hslToRgb(180, 1, 0.5)})` }).toEqual({ background: 'rgb(0,255,255)', }) }) it('should convert the color blue', () => { expect({ background: `rgb(${hslToRgb(240, 1, 0.5)})` }).toEqual({ background: 'rgb(0,0,255)', }) }) it('should convert the color magenta', () => { expect({ background: `rgb(${hslToRgb(300, 1, 0.5)})` }).toEqual({ background: 'rgb(255,0,255)', }) }) it('should convert black', () => { expect({ background: `rgb(${hslToRgb(360, 0, 0.4)})` }).toEqual({ background: 'rgb(102,102,102)', }) }) it('should convert correctly even when passed a "faulty" negative hue', () => { expect({ background: `rgb(${hslToRgb(-10, 1, 0.5)})` }).toEqual({ background: 'rgb(255,0,43)', }) expect({ background: `rgb(${hslToRgb(-100, 1, 0.5)})` }).toEqual({ background: 'rgb(85,0,255)', }) expect({ background: `rgb(${hslToRgb(-1000, 1, 0.5)})` }).toEqual({ background: 'rgb(170,255,0)', }) }) }) ================================================ FILE: src/internalHelpers/test/_nameToHex.test.js ================================================ // @flow import nameToHex from '../_nameToHex' describe('nameToHex', () => { it('should convert a named color to a hex value', () => { expect({ background: nameToHex('white') }).toEqual({ background: '#fff', }) }) it('should convert a camel-cased named color to a hex value', () => { expect({ background: nameToHex('PowderBlue') }).toEqual({ background: '#b0e0e6', }) }) it('should return a passed hex value without mutation', () => { expect({ background: nameToHex('#fff') }).toEqual({ background: '#fff', }) }) it('should return a passed RGB string value without mutation', () => { expect({ background: nameToHex('rgb(0,0,0)') }).toEqual({ background: 'rgb(0,0,0)', }) }) it('should return a passed HSL value without mutation', () => { expect({ background: nameToHex('hsl(180, 50%, 50%)') }).toEqual({ background: 'hsl(180, 50%, 50%)', }) }) it('should return a non-string value without mutation', () => { // $FlowFixMe expect({ background: nameToHex(2) }).toEqual({ background: 2, }) }) }) ================================================ FILE: src/internalHelpers/test/_numberToHex.test.js ================================================ import numberToHex from '../_numberToHex' describe('numberToHex', () => { it('should convert 0 to "00"', () => { expect(numberToHex(0)).toEqual('00') }) it('should convert 15 to "0f"', () => { expect(numberToHex(15)).toEqual('0f') }) it('should convert 16 to "10"', () => { expect(numberToHex(16)).toEqual('10') }) it('should convert 17 to "11"', () => { expect(numberToHex(17)).toEqual('11') }) }) ================================================ FILE: src/internalHelpers/test/_pxto.test.js ================================================ import pxto from '../_pxto' describe('pxto', () => { let em describe('factory', () => { it('should allow creating a simple pixels-to-x converter', () => { em = pxto('em') expect(em).toBeInstanceOf(Function) }) }) describe('converter', () => { it('should convert a simple number to ems', () => { expect({ height: em(16) }).toEqual({ height: '1em', }) }) it('should convert a simple string with px to ems', () => { expect({ height: em('16px') }).toEqual({ height: '1em', }) }) it('should convert a complex number to ems', () => { expect({ height: em(18) }).toEqual({ height: '1.125em', }) }) it('should convert a complex string with px to ems', () => { expect({ height: em('18px') }).toEqual({ height: '1.125em', }) }) it('should allow changing the base with a number', () => { expect({ height: em('16px', 8) }).toEqual({ height: '2em', }) }) it('should allow changing the base with a string', () => { expect({ height: em('16px', '8px') }).toEqual({ height: '2em', }) }) it('should throw an error if a non-pixel value is passed for the first arg', () => { expect(() => ({ height: em('10em') })).toThrow( 'Expected a string ending in "px" or a number passed as the first argument to em(), got 10em instead.', ) }) it('should throw an error if a non-pixel value is passed for the second arg', () => { expect(() => ({ height: em('10px', '16em') })).toThrow( 'Expected a string ending in "px" or a number passed as the second argument to em(), got 16em instead.', ) }) it('should throw an error if an invalid pixel value is passed', () => { expect(() => ({ height: em('apx') })).toThrow( 'Passed invalid pixel value apx to em(), please pass a value like "12px" or 12.', ) }) it('should throw an error if an invalid base value is passed', () => { expect(() => ({ height: em('16px', 'apx') })).toThrow( 'Passed invalid base value apx to em(), please pass a value like "12px" or 12.', ) }) }) }) ================================================ FILE: src/internalHelpers/test/_reduceHexValue.test.js ================================================ import reduceHexValue from '../_reduceHexValue' describe('reduceHexValue', () => { it('should reduce #ffffff to #fff', () => { expect(reduceHexValue('#ffffff')).toEqual('#fff') }) it('should reduce #884422 to #842', () => { expect(reduceHexValue('#884422')).toEqual('#842') }) it('should not reduce #112234', () => { expect(reduceHexValue('#112234')).toEqual('#112234') }) it('should not reduce #fff', () => { expect(reduceHexValue('#fff')).toEqual('#fff') }) it('should return the value in case it can not be reduced', () => { expect(reduceHexValue('You rock!')).toEqual('You rock!') }) }) ================================================ FILE: src/internalHelpers/test/_rgbToHsl.test.js ================================================ // @flow import rgbToHsl from '../_rgbToHsl' describe('hslToHex', () => { it('should convert the color red', () => { expect({ background: rgbToHsl({ red: 255, green: 0, blue: 0 }), }).toEqual({ background: { hue: 0, lightness: 0.5, saturation: 1, }, }) }) it('should convert the color blue', () => { expect({ background: rgbToHsl({ red: 0, green: 0, blue: 255 }), }).toEqual({ background: { hue: 240, lightness: 0.5, saturation: 1, }, }) }) it('should convert the color green', () => { expect({ background: rgbToHsl({ red: 0, green: 255, blue: 0 }), }).toEqual({ background: { hue: 120, lightness: 0.5, saturation: 1, }, }) }) it('should convert black', () => { expect({ background: rgbToHsl({ red: 0, green: 0, blue: 0 }), }).toEqual({ background: { hue: 0, lightness: 0, saturation: 0, }, }) }) it('should convert the color red with a transparency of 0.6', () => { expect({ background: rgbToHsl({ red: 255, green: 0, blue: 0, alpha: 0.5, }), }).toEqual({ background: { alpha: 0.5, hue: 0, lightness: 0.5, saturation: 1, }, }) }) it('should convert black with a transparency of 0.6', () => { expect({ background: rgbToHsl({ red: 0, green: 0, blue: 0, alpha: 0.5, }), }).toEqual({ background: { alpha: 0.5, hue: 0, lightness: 0, saturation: 0, }, }) }) }) ================================================ FILE: src/internalHelpers/test/_statefulSelectors.test.js ================================================ import statefulSelectors from '../_statefulSelectors' const mockStateMap = [null, ':before', ':after'] function mockTemplate(pseudoSelector) { return `section a${pseudoSelector}, p a${pseudoSelector}` } describe('statefulSelectors', () => { // Selectors it('populates selectors for a single state', () => { expect({ [statefulSelectors([':before'], mockTemplate, mockStateMap)]: { content: 'hello', }, }).toEqual({ [`section a::before, p a::before`]: { content: 'hello', }, }) }) it('populates selectors for a multiple states', () => { expect({ [statefulSelectors([':before', ':after'], mockTemplate, mockStateMap)]: { content: 'hello', }, }).toEqual({ [`section a::before, p a::before,section a::after, p a::after`]: { content: 'hello', }, }) }) it('populates both base selectors and selectors for a single state', () => { expect({ [statefulSelectors([null, ':after'], mockTemplate, mockStateMap)]: { content: 'hello', }, }).toEqual({ [`section a, p a,section a::after, p a::after`]: { content: 'hello', }, }) }) it('populates both base selectors and selectors for a single state when not passed a stateMap', () => { expect({ [statefulSelectors([null, ':after'], mockTemplate)]: { content: 'hello', }, }).toEqual({ [`section a, p a,section a::after, p a::after`]: { content: 'hello', }, }) }) // Errors it('throws an error when passed a state it does not recognize', () => { expect(() => ({ [statefulSelectors([':visited'], mockTemplate, mockStateMap)]: { content: 'hello', }, })).toThrow('You passed an unsupported selector state to this method') }) it('throws an error when passed one of the states it is passed is not recognized', () => { expect(() => ({ [statefulSelectors(['hover', ':visited'], mockTemplate, mockStateMap)]: { content: 'hello', }, })).toThrow('You passed an unsupported selector state to this method') }) it('throws an error when not passed a template', () => { expect(() => ({ [statefulSelectors([':visited'])]: { content: 'hello', }, })).toThrow('You must provide a template to this method.') }) }) ================================================ FILE: src/math/math.js ================================================ // @flow import defaultSymbolMap from './presets/defaultSymbols' import PolishedError from '../internalHelpers/_errors' const unitRegExp = /((?!\w)a|na|hc|mc|dg|me[r]?|xe|ni(?![a-zA-Z])|mm|cp|tp|xp|q(?!s)|hv|xamv|nimv|wv|sm|s(?!\D|$)|ged|darg?|nrut)/g // Merges additional math functionality into the defaults. function mergeSymbolMaps(additionalSymbols?: Object): Object { const symbolMap = {} symbolMap.symbols = additionalSymbols ? { ...defaultSymbolMap.symbols, ...additionalSymbols.symbols } : { ...defaultSymbolMap.symbols } return symbolMap } function exec(operators: Array, values: Array): Array { const op = operators.pop() values.push(op.f(...[].concat(...values.splice(-op.argCount)))) return op.precedence } function calculate(expression: string, additionalSymbols?: Object): number { const symbolMap = mergeSymbolMaps(additionalSymbols) let match const operators = [symbolMap.symbols['('].prefix] const values = [] const pattern = new RegExp( // Pattern for numbers `\\d+(?:\\.\\d+)?|${ // ...and patterns for individual operators/function names Object.keys(symbolMap.symbols) .map(key => symbolMap.symbols[key]) // longer symbols should be listed first // $FlowFixMe .sort((a, b) => b.symbol.length - a.symbol.length) // $FlowFixMe .map(val => val.regSymbol) .join('|') }|(\\S)`, 'g', ) pattern.lastIndex = 0 // Reset regular expression object let afterValue = false do { match = pattern.exec(expression) const [token, bad] = match || [')', undefined] const notNumber = symbolMap.symbols[token] const notNewValue = notNumber && !notNumber.prefix && !notNumber.func const notAfterValue = !notNumber || (!notNumber.postfix && !notNumber.infix) // Check for syntax errors: if (bad || (afterValue ? notAfterValue : notNewValue)) { throw new PolishedError(37, match ? match.index : expression.length, expression) } if (afterValue) { // We either have an infix or postfix operator (they should be mutually exclusive) const curr = notNumber.postfix || notNumber.infix do { const prev = operators[operators.length - 1] if ((curr.precedence - prev.precedence || prev.rightToLeft) > 0) break // Apply previous operator, since it has precedence over current one } while (exec(operators, values)) // Exit loop after executing an opening parenthesis or function afterValue = curr.notation === 'postfix' if (curr.symbol !== ')') { operators.push(curr) // Postfix always has precedence over any operator that follows after it if (afterValue) exec(operators, values) } } else if (notNumber) { // prefix operator or function operators.push(notNumber.prefix || notNumber.func) if (notNumber.func) { // Require an opening parenthesis match = pattern.exec(expression) if (!match || match[0] !== '(') { throw new PolishedError(38, match ? match.index : expression.length, expression) } } } else { // number values.push(+token) afterValue = true } } while (match && operators.length) if (operators.length) { throw new PolishedError(39, match ? match.index : expression.length, expression) } else if (match) { throw new PolishedError(40, match ? match.index : expression.length, expression) } else { return values.pop() } } function reverseString(str: string): string { return str.split('').reverse().join('') } /** * Helper for doing math with CSS Units. Accepts a formula as a string. All values in the formula must have the same unit (or be unitless). Supports complex formulas utliziing addition, subtraction, multiplication, division, square root, powers, factorial, min, max, as well as parentheses for order of operation. * *In cases where you need to do calculations with mixed units where one unit is a [relative length unit](https://developer.mozilla.org/en-US/docs/Web/CSS/length#Relative_length_units), you will want to use [CSS Calc](https://developer.mozilla.org/en-US/docs/Web/CSS/calc). * * *warning* While we've done everything possible to ensure math safely evalutes formulas expressed as strings, you should always use extreme caution when passing `math` user provided values. * @example * // Styles as object usage * const styles = { * fontSize: math('12rem + 8rem'), * fontSize: math('(12px + 2px) * 3'), * fontSize: math('3px^2 + sqrt(4)'), * } * * // styled-components usage * const div = styled.div` * fontSize: ${math('12rem + 8rem')}; * fontSize: ${math('(12px + 2px) * 3')}; * fontSize: ${math('3px^2 + sqrt(4)')}; * ` * * // CSS as JS Output * * div: { * fontSize: '20rem', * fontSize: '42px', * fontSize: '11px', * } */ export default function math(formula: string, additionalSymbols?: Object): string { const reversedFormula = reverseString(formula) const formulaMatch = reversedFormula.match(unitRegExp) // Check that all units are the same if (formulaMatch && !formulaMatch.every(unit => unit === formulaMatch[0])) { throw new PolishedError(41) } const cleanFormula = reverseString(reversedFormula.replace(unitRegExp, '')) return `${calculate(cleanFormula, additionalSymbols)}${ formulaMatch ? reverseString(formulaMatch[0]) : '' }` } ================================================ FILE: src/math/presets/defaultSymbols.js ================================================ // @flow function last(...a: Array): number { return a[a.length - 1] } function negation(a: number): number { return -a } function addition(a: number, b: number): number { return a + b } function subtraction(a: number, b: number): number { return a - b } function multiplication(a: number, b: number): number { return a * b } function division(a: number, b: number): number { return a / b } function max(...a: Array): number { return Math.max(...a) } function min(...a: Array): number { return Math.min(...a) } function comma(...a: Array): Array { return Array.of(...a) } const defaultSymbols = { symbols: { '*': { infix: { symbol: '*', f: multiplication, notation: 'infix', precedence: 4, rightToLeft: 0, argCount: 2, }, symbol: '*', regSymbol: '\\*', }, '/': { infix: { symbol: '/', f: division, notation: 'infix', precedence: 4, rightToLeft: 0, argCount: 2, }, symbol: '/', regSymbol: '/', }, '+': { infix: { symbol: '+', f: addition, notation: 'infix', precedence: 2, rightToLeft: 0, argCount: 2, }, prefix: { symbol: '+', f: last, notation: 'prefix', precedence: 3, rightToLeft: 0, argCount: 1, }, symbol: '+', regSymbol: '\\+', }, '-': { infix: { symbol: '-', f: subtraction, notation: 'infix', precedence: 2, rightToLeft: 0, argCount: 2, }, prefix: { symbol: '-', f: negation, notation: 'prefix', precedence: 3, rightToLeft: 0, argCount: 1, }, symbol: '-', regSymbol: '-', }, ',': { infix: { symbol: ',', f: comma, notation: 'infix', precedence: 1, rightToLeft: 0, argCount: 2, }, symbol: ',', regSymbol: ',', }, '(': { prefix: { symbol: '(', f: last, notation: 'prefix', precedence: 0, rightToLeft: 0, argCount: 1, }, symbol: '(', regSymbol: '\\(', }, ')': { postfix: { symbol: ')', f: undefined, notation: 'postfix', precedence: 0, rightToLeft: 0, argCount: 1, }, symbol: ')', regSymbol: '\\)', }, min: { func: { symbol: 'min', f: min, notation: 'func', precedence: 0, rightToLeft: 0, argCount: 1, }, symbol: 'min', regSymbol: 'min\\b', }, max: { func: { symbol: 'max', f: max, notation: 'func', precedence: 0, rightToLeft: 0, argCount: 1, }, symbol: 'max', regSymbol: 'max\\b', }, }, } export default defaultSymbols ================================================ FILE: src/math/presets/exponentialSymbols.js ================================================ // @flow function factorial(a: number): number { if (a % 1 || !(+a >= 0)) return NaN if (a > 170) return Infinity else if (a === 0) return 1 else { return a * factorial(a - 1) } } function power(a: number, b: number): number { return a ** b } function sqrt(a: number): number { return Math.sqrt(a) } const exponentialSymbols = { symbols: { '!': { postfix: { symbol: '!', f: factorial, notation: 'postfix', precedence: 6, rightToLeft: 0, argCount: 1, }, symbol: '!', regSymbol: '!', }, '^': { infix: { symbol: '^', f: power, notation: 'infix', precedence: 5, rightToLeft: 1, argCount: 2, }, symbol: '^', regSymbol: '\\^', }, sqrt: { func: { symbol: 'sqrt', f: sqrt, notation: 'func', precedence: 0, rightToLeft: 0, argCount: 1, }, symbol: 'sqrt', regSymbol: 'sqrt\\b', }, }, } export default exponentialSymbols ================================================ FILE: src/math/test/math.test.js ================================================ // @flow import math from '../math' import exponential from '../presets/exponentialSymbols' describe('math', () => { it('should handle non-length units', () => { expect(math('1ms + 2ms')).toEqual(`${1 + 2}ms`) expect(math('1s + 2s')).toEqual(`${1 + 2}s`) expect(math('1deg + 2deg')).toEqual(`${1 + 2}deg`) expect(math('1grad + 2grad')).toEqual(`${1 + 2}grad`) expect(math('1rad + 2rad')).toEqual(`${1 + 2}rad`) expect(math('1turn + 2turn')).toEqual(`${1 + 2}turn`) }) it('should be able to do simple addition', () => { expect(math('1rem + 2rem')).toEqual(`${1 + 2}rem`) expect(math('1rem + 2')).toEqual(`${1 + 2}rem`) expect(math('1em + 5em')).toEqual(`${1 + 5}em`) expect(math('1em + -5em')).toEqual(`${1 + -5}em`) expect(math('1in + 5in + 10')).toEqual(`${1 + 5 + 10}in`) }) it('should be able to do simple subtraction', () => { expect(math('1rem - 2rem')).toEqual(`${1 - 2}rem`) expect(math('1rem - 2')).toEqual(`${1 - 2}rem`) expect(math('1em - 5em')).toEqual(`${1 - 5}em`) expect(math('1em - -5em')).toEqual(`${1 - -5}em`) expect(math('1in - 5in - 10')).toEqual(`${1 - 5 - 10}in`) }) it('should be able to do simple multiplication', () => { expect(math('1rem * 2rem')).toEqual(`${1 * 2}rem`) expect(math('1rem * 2')).toEqual(`${1 * 2}rem`) expect(math('1em * 5em')).toEqual(`${1 * 5}em`) expect(math('1em * -5em')).toEqual(`${1 * -5}em`) expect(math('1in * 5in * 10')).toEqual(`${1 * 5 * 10}in`) }) it('should be able to do simple division', () => { expect(math('1rem / 2rem')).toEqual(`${1 / 2}rem`) expect(math('1rem / 2')).toEqual(`${1 / 2}rem`) expect(math('1em / 5em')).toEqual(`${1 / 5}em`) expect(math('1em / -5em')).toEqual(`${1 / -5}em`) expect(math('1in / 5in / 10')).toEqual(`${1 / 5 / 10}in`) }) it('should be able to do simple min', () => { expect(math('min(3em, 4em, 1em, 2em)')).toEqual(`${Math.min(3, 4, 1, 2)}em`) expect(math('min(3em, -4em, 1em, 2em)')).toEqual(`${Math.min(3, -4, 1, 2)}em`) }) it('should be able to do simple max', () => { expect(math('max(3em, 8em, 1em, 2em)')).toEqual(`${Math.max(3, 8, 1, 2)}em`) expect(math('max(3em, -8em, 1em, 2em)')).toEqual(`${Math.max(3, -8, 1, 2)}em`) }) it('should be able to do simple factorial', () => { expect(math('3em!', exponential)).toEqual('6em') expect(math('171em!', exponential)).toEqual('Infinityem') expect(math('0px!', exponential)).toEqual('1px') expect(math('-0.5px!', exponential)).toEqual('NaNpx') expect(math('-5px!', exponential)).toEqual('-120px') }) it('should be able to process square root', () => { expect(math('0 + sqrt(4em)', exponential)).toEqual(`${Math.sqrt(4)}em`) expect(math('sqrt(4em)', exponential)).toEqual(`${Math.sqrt(4)}em`) expect(math('sqrt(2em + 4em) * 1', exponential)).toEqual(`${Math.sqrt(2 + 4)}em`) expect(math('sqrt(-4em)', exponential)).toEqual(`${Math.sqrt(-4)}em`) expect(math('sqrt(4em / 2em)', exponential)).toEqual(`${Math.sqrt(4 / 2)}em`) expect(math('sqrt(4em + 2em * 5)', exponential)).toEqual(`${Math.sqrt(4 + 2 * 5)}em`) expect(math('sqrt(4em - 2 / 5em)', exponential)).toEqual(`${Math.sqrt(4 - 2 / 5)}em`) }) it('should be able to process exponent power', () => { expect(math('2em^3', exponential)).toEqual(`${2 ** 3}em`) }) it('should be able to process parentheses', () => { expect(math('(1rem + 2rem) * 5')).toEqual(`${(1 + 2) * 5}rem`) expect(math('(4em + 2) * 5em + sqrt(4em - 2 / 5em)', exponential)).toEqual( `${(4 + 2) * 5 + Math.sqrt(4 - 2 / 5)}em`, ) }) it('should throw an error when formula contains multiple units', () => { expect(() => { math('1vw + 1vh + 1pt') }).toThrow('All values in a formula must have the same unit or be unitless.') }) it('should throw an error when formula is missing a closing parenthesis', () => { expect(() => { math('(1px + 2px * 3') }).toThrow('Formula is missing closing parenthesis at 10') }) it('should throw an error when formula has an extra closing parenthesis', () => { expect(() => { math('(1px + 2px) * 3)') }).toThrow('Formula has too many closing parentheses at 11') }) it('should throw an error when formula has no opening parenthesis', () => { expect(() => { math('1px + 2px) * 3') }).toThrow('Formula has too many closing parentheses at 5') }) it('should throw an error when a function has no opening parenthesis', () => { expect(() => { math('1px + sqrt 4', exponential) }).toThrow('Formula contains a function that needs parentheses at 9') }) it('should throw an error when passed a non-formula string', () => { expect(() => { math("eval('1+2+3')") }).toThrow('Syntax Error at 0') }) }) ================================================ FILE: src/mixins/between.js ================================================ // @flow import getValueAndUnit from '../helpers/getValueAndUnit' import PolishedError from '../internalHelpers/_errors' /** * Returns a CSS calc formula for linear interpolation of a property between two values. Accepts optional minScreen (defaults to '320px') and maxScreen (defaults to '1200px'). * * @example * // Styles as object usage * const styles = { * fontSize: between('20px', '100px', '400px', '1000px'), * fontSize: between('20px', '100px') * } * * // styled-components usage * const div = styled.div` * fontSize: ${between('20px', '100px', '400px', '1000px')}; * fontSize: ${between('20px', '100px')} * ` * * // CSS as JS Output * * h1: { * 'fontSize': 'calc(-33.33333333333334px + 13.333333333333334vw)', * 'fontSize': 'calc(-9.090909090909093px + 9.090909090909092vw)' * } */ export default function between( fromSize: string | number, toSize: string | number, minScreen?: string = '320px', maxScreen?: string = '1200px', ): string { const [unitlessFromSize, fromSizeUnit] = getValueAndUnit(fromSize) const [unitlessToSize, toSizeUnit] = getValueAndUnit(toSize) const [unitlessMinScreen, minScreenUnit] = getValueAndUnit(minScreen) const [unitlessMaxScreen, maxScreenUnit] = getValueAndUnit(maxScreen) if ( typeof unitlessMinScreen !== 'number' || typeof unitlessMaxScreen !== 'number' || !minScreenUnit || !maxScreenUnit || minScreenUnit !== maxScreenUnit ) { throw new PolishedError(47) } if ( typeof unitlessFromSize !== 'number' || typeof unitlessToSize !== 'number' || fromSizeUnit !== toSizeUnit ) { throw new PolishedError(48) } if (fromSizeUnit !== minScreenUnit || toSizeUnit !== maxScreenUnit) { throw new PolishedError(76) } const slope = (unitlessFromSize - unitlessToSize) / (unitlessMinScreen - unitlessMaxScreen) const base = unitlessToSize - slope * unitlessMaxScreen return `calc(${base.toFixed(2)}${fromSizeUnit || ''} + ${(100 * slope).toFixed(2)}vw)` } ================================================ FILE: src/mixins/clearFix.js ================================================ // @flow import type { Styles } from '../types/style' /** * CSS to contain a float (credit to CSSMojo). * * @example * // Styles as object usage * const styles = { * ...clearFix(), * } * * // styled-components usage * const div = styled.div` * ${clearFix()} * ` * * // CSS as JS Output * * '&::after': { * 'clear': 'both', * 'content': '""', * 'display': 'table' * } */ export default function clearFix(parent?: string = '&'): Styles { const pseudoSelector = `${parent}::after` return { [pseudoSelector]: { clear: 'both', content: '""', display: 'table', }, } } ================================================ FILE: src/mixins/cover.js ================================================ // @flow import type { Styles } from '../types/style' /** * CSS to fully cover an area. Can optionally be passed an offset to act as a "padding". * * @example * // Styles as object usage * const styles = { * ...cover() * } * * // styled-components usage * const div = styled.div` * ${cover()} * ` * * // CSS as JS Output * * div: { * 'position': 'absolute', * 'top': '0', * 'right: '0', * 'bottom': '0', * 'left: '0' * } */ export default function cover(offset?: number | string = 0): Styles { return { position: 'absolute', top: offset, right: offset, bottom: offset, left: offset, } } ================================================ FILE: src/mixins/ellipsis.js ================================================ // @flow import type { Styles } from '../types/style' /** * CSS to represent truncated text with an ellipsis. You can optionally pass a max-width and number of lines before truncating. * * @example * // Styles as object usage * const styles = { * ...ellipsis('250px') * } * * // styled-components usage * const div = styled.div` * ${ellipsis('250px')} * ` * * // CSS as JS Output * * div: { * 'display': 'inline-block', * 'maxWidth': '250px', * 'overflow': 'hidden', * 'textOverflow': 'ellipsis', * 'whiteSpace': 'nowrap', * 'wordWrap': 'normal' * } */ export default function ellipsis(width?: ?string | ?number, lines?: number = 1): Styles { const styles = { display: 'inline-block', maxWidth: width || '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', wordWrap: 'normal', } return lines > 1 ? { ...styles, WebkitBoxOrient: 'vertical', WebkitLineClamp: lines, display: '-webkit-box', whiteSpace: 'normal', } : styles } ================================================ FILE: src/mixins/fluidRange.js ================================================ // @flow import between from './between' import PolishedError from '../internalHelpers/_errors' import type { FluidRangeConfiguration } from '../types/fluidRangeConfiguration' import type { Styles } from '../types/style' /** * Returns a set of media queries that resizes a property (or set of properties) between a provided fromSize and toSize. Accepts optional minScreen (defaults to '320px') and maxScreen (defaults to '1200px') to constrain the interpolation. * * @example * // Styles as object usage * const styles = { * ...fluidRange( * { * prop: 'padding', * fromSize: '20px', * toSize: '100px', * }, * '400px', * '1000px', * ) * } * * // styled-components usage * const div = styled.div` * ${fluidRange( * { * prop: 'padding', * fromSize: '20px', * toSize: '100px', * }, * '400px', * '1000px', * )} * ` * * // CSS as JS Output * * div: { * "@media (min-width: 1000px)": Object { * "padding": "100px", * }, * "@media (min-width: 400px)": Object { * "padding": "calc(-33.33333333333334px + 13.333333333333334vw)", * }, * "padding": "20px", * } */ export default function fluidRange( cssProp: Array | FluidRangeConfiguration, minScreen?: string = '320px', maxScreen?: string = '1200px', ): Styles { if ((!Array.isArray(cssProp) && typeof cssProp !== 'object') || cssProp === null) { throw new PolishedError(49) } if (Array.isArray(cssProp)) { const mediaQueries = {} const fallbacks = {} for (const obj of cssProp) { if (!obj.prop || !obj.fromSize || !obj.toSize) { throw new PolishedError(50) } fallbacks[obj.prop] = obj.fromSize mediaQueries[`@media (min-width: ${minScreen})`] = { ...mediaQueries[`@media (min-width: ${minScreen})`], [obj.prop]: between(obj.fromSize, obj.toSize, minScreen, maxScreen), } mediaQueries[`@media (min-width: ${maxScreen})`] = { ...mediaQueries[`@media (min-width: ${maxScreen})`], [obj.prop]: obj.toSize, } } return { ...fallbacks, ...mediaQueries, } } else { if (!cssProp.prop || !cssProp.fromSize || !cssProp.toSize) { throw new PolishedError(51) } return { [cssProp.prop]: cssProp.fromSize, [`@media (min-width: ${minScreen})`]: { [cssProp.prop]: between(cssProp.fromSize, cssProp.toSize, minScreen, maxScreen), }, [`@media (min-width: ${maxScreen})`]: { [cssProp.prop]: cssProp.toSize, }, } } } ================================================ FILE: src/mixins/fontFace.js ================================================ // @flow import PolishedError from '../internalHelpers/_errors' import type { FontFaceConfiguration } from '../types/fontFaceConfiguration' import type { Styles } from '../types/style' const dataURIRegex = /^\s*data:([a-z]+\/[a-z-]+(;[a-z-]+=[a-z-]+)?)?(;charset=[a-z0-9-]+)?(;base64)?,[a-z0-9!$&',()*+,;=\-._~:@/?%\s]*\s*$/i const formatHintMap = { woff: 'woff', woff2: 'woff2', ttf: 'truetype', otf: 'opentype', eot: 'embedded-opentype', svg: 'svg', svgz: 'svg', } function generateFormatHint(format: string, formatHint: boolean): string { if (!formatHint) return '' return ` format("${formatHintMap[format]}")` } function isDataURI(fontFilePath: string): boolean { return !!fontFilePath.replace(/\s+/g, ' ').match(dataURIRegex) } function generateFileReferences( fontFilePath: string, fileFormats: Array, formatHint: boolean, ): string { if (isDataURI(fontFilePath)) { return `url("${fontFilePath}")${generateFormatHint(fileFormats[0], formatHint)}` } const fileFontReferences = fileFormats.map( format => `url("${fontFilePath}.${format}")${generateFormatHint(format, formatHint)}`, ) return fileFontReferences.join(', ') } function generateLocalReferences(localFonts: Array): string { const localFontReferences = localFonts.map(font => `local("${font}")`) return localFontReferences.join(', ') } function generateSources( fontFilePath?: string, localFonts: Array | null, fileFormats: Array, formatHint: boolean, ): string { const fontReferences = [] if (localFonts) fontReferences.push(generateLocalReferences(localFonts)) if (fontFilePath) { fontReferences.push(generateFileReferences(fontFilePath, fileFormats, formatHint)) } return fontReferences.join(', ') } /** * CSS for a @font-face declaration. Defaults to check for local copies of the font on the user's machine. You can disable this by passing `null` to localFonts. * * @example * // Styles as object basic usage * const styles = { * ...fontFace({ * 'fontFamily': 'Sans-Pro', * 'fontFilePath': 'path/to/file' * }) * } * * // styled-components basic usage * const GlobalStyle = createGlobalStyle`${ * fontFace({ * 'fontFamily': 'Sans-Pro', * 'fontFilePath': 'path/to/file' * } * )}` * * // CSS as JS Output * * '@font-face': { * 'fontFamily': 'Sans-Pro', * 'src': 'url("path/to/file.eot"), url("path/to/file.woff2"), url("path/to/file.woff"), url("path/to/file.ttf"), url("path/to/file.svg")', * } */ export default function fontFace({ fontFamily, fontFilePath, fontStretch, fontStyle, fontVariant, fontWeight, fileFormats = ['eot', 'woff2', 'woff', 'ttf', 'svg'], formatHint = false, localFonts = [fontFamily], unicodeRange, fontDisplay, fontVariationSettings, fontFeatureSettings, }: FontFaceConfiguration): Styles { // Error Handling if (!fontFamily) throw new PolishedError(55) if (!fontFilePath && !localFonts) { throw new PolishedError(52) } if (localFonts && !Array.isArray(localFonts)) { throw new PolishedError(53) } if (!Array.isArray(fileFormats)) { throw new PolishedError(54) } const fontFaceDeclaration = { '@font-face': { fontFamily, src: generateSources(fontFilePath, localFonts, fileFormats, formatHint), unicodeRange, fontStretch, fontStyle, fontVariant, fontWeight, fontDisplay, fontVariationSettings, fontFeatureSettings, }, } // Removes undefined fields for cleaner css object. return JSON.parse(JSON.stringify(fontFaceDeclaration)) } ================================================ FILE: src/mixins/hiDPI.js ================================================ // @flow /** * Generates a media query to target HiDPI devices. * * @example * // Styles as object usage * const styles = { * [hiDPI(1.5)]: { * width: 200px; * } * } * * // styled-components usage * const div = styled.div` * ${hiDPI(1.5)} { * width: 200px; * } * ` * * // CSS as JS Output * * '@media only screen and (-webkit-min-device-pixel-ratio: 1.5), * only screen and (min--moz-device-pixel-ratio: 1.5), * only screen and (-o-min-device-pixel-ratio: 1.5/1), * only screen and (min-resolution: 144dpi), * only screen and (min-resolution: 1.5dppx)': { * 'width': '200px', * } */ export default function hiDPI(ratio?: number = 1.3): string { return ` @media only screen and (-webkit-min-device-pixel-ratio: ${ratio}), only screen and (min--moz-device-pixel-ratio: ${ratio}), only screen and (-o-min-device-pixel-ratio: ${ratio}/1), only screen and (min-resolution: ${Math.round(ratio * 96)}dpi), only screen and (min-resolution: ${ratio}dppx) ` } ================================================ FILE: src/mixins/hideText.js ================================================ // @flow import type { Styles } from '../types/style' /** * CSS to hide text to show a background image in a SEO-friendly way. * * @example * // Styles as object usage * const styles = { * 'backgroundImage': 'url(logo.png)', * ...hideText(), * } * * // styled-components usage * const div = styled.div` * backgroundImage: url(logo.png); * ${hideText()}; * ` * * // CSS as JS Output * * 'div': { * 'backgroundImage': 'url(logo.png)', * 'textIndent': '101%', * 'overflow': 'hidden', * 'whiteSpace': 'nowrap', * } */ export default function hideText(): Styles { return { textIndent: '101%', overflow: 'hidden', whiteSpace: 'nowrap', } } ================================================ FILE: src/mixins/hideVisually.js ================================================ // @flow import type { Styles } from '../types/style' /** * CSS to hide content visually but remain accessible to screen readers. * from [HTML5 Boilerplate](https://github.com/h5bp/html5-boilerplate/blob/9a176f57af1cfe8ec70300da4621fb9b07e5fa31/src/css/main.css#L121) * * @example * // Styles as object usage * const styles = { * ...hideVisually(), * } * * // styled-components usage * const div = styled.div` * ${hideVisually()}; * ` * * // CSS as JS Output * * 'div': { * 'border': '0', * 'clip': 'rect(0 0 0 0)', * 'height': '1px', * 'margin': '-1px', * 'overflow': 'hidden', * 'padding': '0', * 'position': 'absolute', * 'whiteSpace': 'nowrap', * 'width': '1px', * } */ export default function hideVisually(): Styles { return { border: '0', clip: 'rect(0 0 0 0)', height: '1px', margin: '-1px', overflow: 'hidden', padding: '0', position: 'absolute', whiteSpace: 'nowrap', width: '1px', } } ================================================ FILE: src/mixins/linearGradient.js ================================================ // @flow import constructGradientValue from '../internalHelpers/_constructGradientValue' import PolishedError from '../internalHelpers/_errors' import type { LinearGradientConfiguration } from '../types/linearGradientConfiguration' import type { Styles } from '../types/style' /** * CSS for declaring a linear gradient, including a fallback background-color. The fallback is either the first color-stop or an explicitly passed fallback color. * * @example * // Styles as object usage * const styles = { * ...linearGradient({ colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], toDirection: 'to top right', fallback: '#FFF', }) * } * * // styled-components usage * const div = styled.div` * ${linearGradient({ colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], toDirection: 'to top right', fallback: '#FFF', })} *` * * // CSS as JS Output * * div: { * 'backgroundColor': '#FFF', * 'backgroundImage': 'linear-gradient(to top right, #00FFFF 0%, rgba(0, 0, 255, 0) 50%, #0000FF 95%)', * } */ export default function linearGradient({ colorStops, fallback, toDirection = '', }: LinearGradientConfiguration): Styles { if (!colorStops || colorStops.length < 2) { throw new PolishedError(56) } return { backgroundColor: fallback || colorStops[0] .replace(/,\s+/g, ',') .split(' ')[0] .replace(/,(?=\S)/g, ', '), backgroundImage: constructGradientValue`linear-gradient(${toDirection}${colorStops .join(', ') .replace(/,(?=\S)/g, ', ')})`, } } ================================================ FILE: src/mixins/normalize.js ================================================ // @flow import type { Styles } from '../types/style' /** * CSS to normalize abnormalities across browsers (normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css) * * @example * // Styles as object usage * const styles = { * ...normalize(), * } * * // styled-components usage * const GlobalStyle = createGlobalStyle`${normalize()}` * * // CSS as JS Output * * html { * lineHeight: 1.15, * textSizeAdjust: 100%, * } ... */ export default function normalize(): Array { return [ { html: { lineHeight: '1.15', textSizeAdjust: '100%', }, body: { margin: '0', }, main: { display: 'block', }, h1: { fontSize: '2em', margin: '0.67em 0', }, hr: { boxSizing: 'content-box', height: '0', overflow: 'visible', }, pre: { fontFamily: 'monospace, monospace', fontSize: '1em', }, a: { backgroundColor: 'transparent', }, 'abbr[title]': { borderBottom: 'none', textDecoration: 'underline', }, [`b, strong`]: { fontWeight: 'bolder', }, [`code, kbd, samp`]: { fontFamily: 'monospace, monospace', fontSize: '1em', }, small: { fontSize: '80%', }, [`sub, sup`]: { fontSize: '75%', lineHeight: '0', position: 'relative', verticalAlign: 'baseline', }, sub: { bottom: '-0.25em', }, sup: { top: '-0.5em', }, img: { borderStyle: 'none', }, [`button, input, optgroup, select, textarea`]: { fontFamily: 'inherit', fontSize: '100%', lineHeight: '1.15', margin: '0', }, [`button, input`]: { overflow: 'visible', }, [`button, select`]: { textTransform: 'none', }, [`button, html [type="button"], [type="reset"], [type="submit"]`]: { WebkitAppearance: 'button', }, [`button::-moz-focus-inner, [type="button"]::-moz-focus-inner, [type="reset"]::-moz-focus-inner, [type="submit"]::-moz-focus-inner`]: { borderStyle: 'none', padding: '0', }, [`button:-moz-focusring, [type="button"]:-moz-focusring, [type="reset"]:-moz-focusring, [type="submit"]:-moz-focusring`]: { outline: '1px dotted ButtonText', }, fieldset: { padding: '0.35em 0.625em 0.75em', }, legend: { boxSizing: 'border-box', color: 'inherit', display: 'table', maxWidth: '100%', padding: '0', whiteSpace: 'normal', }, progress: { verticalAlign: 'baseline', }, textarea: { overflow: 'auto', }, [`[type="checkbox"], [type="radio"]`]: { boxSizing: 'border-box', padding: '0', }, [`[type="number"]::-webkit-inner-spin-button, [type="number"]::-webkit-outer-spin-button`]: { height: 'auto', }, '[type="search"]': { WebkitAppearance: 'textfield', outlineOffset: '-2px', }, '[type="search"]::-webkit-search-decoration': { WebkitAppearance: 'none', }, '::-webkit-file-upload-button': { WebkitAppearance: 'button', font: 'inherit', }, details: { display: 'block', }, summary: { display: 'list-item', }, template: { display: 'none', }, '[hidden]': { display: 'none', }, }, { 'abbr[title]': { textDecoration: 'underline dotted', }, }, ] } ================================================ FILE: src/mixins/radialGradient.js ================================================ // @flow import constructGradientValue from '../internalHelpers/_constructGradientValue' import PolishedError from '../internalHelpers/_errors' import type { RadialGradientConfiguration } from '../types/radialGradientConfiguration' import type { Styles } from '../types/style' /** * CSS for declaring a radial gradient, including a fallback background-color. The fallback is either the first color-stop or an explicitly passed fallback color. * * @example * // Styles as object usage * const styles = { * ...radialGradient({ * colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], * extent: 'farthest-corner at 45px 45px', * position: 'center', * shape: 'ellipse', * }) * } * * // styled-components usage * const div = styled.div` * ${radialGradient({ * colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], * extent: 'farthest-corner at 45px 45px', * position: 'center', * shape: 'ellipse', * })} *` * * // CSS as JS Output * * div: { * 'backgroundColor': '#00FFFF', * 'backgroundImage': 'radial-gradient(center ellipse farthest-corner at 45px 45px, #00FFFF 0%, rgba(0, 0, 255, 0) 50%, #0000FF 95%)', * } */ export default function radialGradient({ colorStops, extent = '', fallback, position = '', shape = '', }: RadialGradientConfiguration): Styles { if (!colorStops || colorStops.length < 2) { throw new PolishedError(57) } return { backgroundColor: fallback || colorStops[0].split(' ')[0], backgroundImage: constructGradientValue`radial-gradient(${position}${shape}${extent}${colorStops.join( ', ', )})`, } } ================================================ FILE: src/mixins/retinaImage.js ================================================ // @flow import hiDPI from './hiDPI' import PolishedError from '../internalHelpers/_errors' import type { Styles } from '../types/style' /** * A helper to generate a retina background image and non-retina * background image. The retina background image will output to a HiDPI media query. The mixin uses * a _2x.png filename suffix by default. * * @example * // Styles as object usage * const styles = { * ...retinaImage('my-img') * } * * // styled-components usage * const div = styled.div` * ${retinaImage('my-img')} * ` * * // CSS as JS Output * div { * backgroundImage: 'url(my-img.png)', * '@media only screen and (-webkit-min-device-pixel-ratio: 1.3), * only screen and (min--moz-device-pixel-ratio: 1.3), * only screen and (-o-min-device-pixel-ratio: 1.3/1), * only screen and (min-resolution: 144dpi), * only screen and (min-resolution: 1.5dppx)': { * backgroundImage: 'url(my-img_2x.png)', * } * } */ export default function retinaImage( filename: string, backgroundSize?: string, extension?: string = 'png', retinaFilename?: string, retinaSuffix?: string = '_2x', ): Styles { if (!filename) { throw new PolishedError(58) } // Replace the dot at the beginning of the passed extension if one exists const ext = extension.replace(/^\./, '') const rFilename = retinaFilename ? `${retinaFilename}.${ext}` : `${filename}${retinaSuffix}.${ext}` return { backgroundImage: `url(${filename}.${ext})`, [hiDPI()]: { backgroundImage: `url(${rFilename})`, ...(backgroundSize ? { backgroundSize } : {}), }, } } ================================================ FILE: src/mixins/test/between.test.js ================================================ // @flow import between from '../between' describe('between', () => { it('should return a valid calc formula when passed min/max screen sizes', () => { expect(between('20px', '100px', '400px', '1000px')).toEqual('calc(-33.33px + 13.33vw)') }) it('should return a valid calc formula when not passed min/max screen sizes', () => { expect(between('20px', '100px')).toEqual('calc(-9.09px + 9.09vw)') }) // Errors it('should throw an error when not passed min/max screen size as a string', () => { expect(() => { // $FlowFixMe between('20px', '100px', 400, 1000) }).toThrow( 'minScreen and maxScreen must be provided as stringified numbers with the same units.', ) }) it('should throw an error when passed min/max screen size with different units', () => { expect(() => { // $FlowFixMe between('20px', '100px', '4em', '1000px') }).toThrow( 'minScreen and maxScreen must be provided as stringified numbers with the same units.', ) }) it('should throw an error when passed to/from size with different units', () => { expect(() => { // $FlowFixMe between('1em', '100px', '400px', '1000px') }).toThrow('fromSize and toSize must be provided as stringified numbers with the same units.') }) it('should throw an error when passed to/from size with different units than mix/max screen', () => { expect(() => { // $FlowFixMe between('1em', '100em', '400px', '1000px') }).toThrow( 'fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.', ) }) it('should throw an error when passed to/from size with no units but mix/max with units', () => { expect(() => { // $FlowFixMe between(20, 100) }).toThrow( 'fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.', ) }) }) ================================================ FILE: src/mixins/test/clearFix.test.js ================================================ // @flow import clearFix from '../clearFix' describe('clearFix', () => { it('should pass parent to pseudo selector', () => { expect(clearFix('div')).toEqual({ 'div::after': { clear: 'both', content: '""', display: 'table', }, }) }) it('should default to & when no parent is passed', () => { expect(clearFix()).toEqual({ '&::after': { clear: 'both', content: '""', display: 'table', }, }) }) }) ================================================ FILE: src/mixins/test/cover.test.js ================================================ // @flow import cover from '../cover' describe('cover', () => { it('should cover full screen when passed no parameters', () => { expect(cover()).toEqual({ bottom: 0, left: 0, position: 'absolute', right: 0, top: 0, }) }) it('should cover full screen with an offset when passed one', () => { expect(cover('100px')).toEqual({ bottom: '100px', left: '100px', position: 'absolute', right: '100px', top: '100px', }) }) }) ================================================ FILE: src/mixins/test/ellipsis.test.js ================================================ // @flow import ellipsis from '../ellipsis' describe('ellipsis', () => { it('should pass parameter to the value of max-width', () => { expect(ellipsis('300px')).toEqual({ display: 'inline-block', maxWidth: '300px', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', wordWrap: 'normal', }) }) it('should pass parameter of type integer to the value of max-width', () => { expect(ellipsis(300)).toEqual({ display: 'inline-block', maxWidth: 300, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', wordWrap: 'normal', }) }) it('should default lines to 1 and max-width to 100%', () => { expect(ellipsis()).toEqual({ display: 'inline-block', maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', wordWrap: 'normal', }) }) it('should truncate text after 3 lines', () => { expect(ellipsis(null, 3)).toEqual({ WebkitBoxOrient: 'vertical', WebkitLineClamp: 3, display: '-webkit-box', maxWidth: '100%', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'normal', wordWrap: 'normal', }) }) it('should truncate text after 3 lines and 500px max-width', () => { expect(ellipsis('500px', 3)).toEqual({ WebkitBoxOrient: 'vertical', WebkitLineClamp: 3, display: '-webkit-box', maxWidth: '500px', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'normal', wordWrap: 'normal', }) }) }) ================================================ FILE: src/mixins/test/fluidRange.test.js ================================================ // @flow import fluidRange from '../fluidRange' describe('fluidRange', () => { it('should return a valid object when passed a single cssValues object and min/max screen sizes', () => { expect( fluidRange( { prop: 'padding', fromSize: '20px', toSize: '100px', }, '400px', '1000px', ), ).toEqual({ '@media (min-width: 1000px)': { padding: '100px', }, '@media (min-width: 400px)': { padding: 'calc(-33.33px + 13.33vw)', }, padding: '20px', }) }) it('should return a valid object when passed multiple cssValues in an array and min/max screen sizes', () => { expect( fluidRange( [ { prop: 'padding', fromSize: '20px', toSize: '100px', }, { prop: 'margin', fromSize: '5px', toSize: '25px', }, ], '400px', '1000px', ), ).toEqual({ '@media (min-width: 1000px)': { margin: '25px', padding: '100px', }, '@media (min-width: 400px)': { margin: 'calc(-8.33px + 3.33vw)', padding: 'calc(-33.33px + 13.33vw)', }, margin: '5px', padding: '20px', }) }) it('should use defaults when min/maxScreen are not passed', () => { expect( fluidRange({ prop: 'padding', fromSize: '20px', toSize: '100px', }), ).toEqual({ '@media (min-width: 1200px)': { padding: '100px', }, '@media (min-width: 320px)': { padding: 'calc(-9.09px + 9.09vw)', }, padding: '20px', }) }) // Errors it('should throw an error when not passed an Array or Object as the first argument', () => { expect(() => { // $FlowFixMe fluidRange('padding', '400px', '1000px') }).toThrow( 'Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.', ) }) it('should throw an error when not passed a first argument', () => { expect(() => { // $FlowFixMe fluidRange(null, '400px', '1000px') }).toThrow( 'Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.', ) }) it('should throw an error when the first argument is an object and does not include all required keys.', () => { expect(() => { // $FlowFixMe fluidRange({}, '400px', '1000px') }).toThrow( 'Expects the first argument object to have the properties prop, fromSize, and toSize.', ) }) it('should throw an error when the first argument is an array of objects that do not include all required keys.', () => { expect(() => { fluidRange( [ // $FlowFixMe { toSize: '100px', }, // $FlowFixMe { fromSize: '5px', }, ], '400px', '1000px', ) }).toThrow( 'Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.', ) }) it('should throw an error when passed non-string values for min/maxScreen', () => { expect(() => { // $FlowFixMe fluidRange( { prop: 'padding', fromSize: '20px', toSize: '100px', }, // $FlowFixMe 400, // $FlowFixMe 1000, ) }).toThrow( 'minScreen and maxScreen must be provided as stringified numbers with the same units.', ) }) it('should throw an error when passed unitless string values for mix/maxScreen', () => { expect(() => { fluidRange( { prop: 'padding', fromSize: '20px', toSize: '100px', }, 'inherit', 'initial', ) }).toThrow( 'minScreen and maxScreen must be provided as stringified numbers with the same units.', ) }) it('should throw an error when passed string values for mix/maxScreen with different units', () => { expect(() => { fluidRange( { prop: 'padding', fromSize: '20px', toSize: '100px', }, '100px', '100%', ) }).toThrow( 'minScreen and maxScreen must be provided as stringified numbers with the same units.', ) }) it('should throw an error when passed string values for mix/maxScreen with different units', () => { expect(() => { fluidRange( { prop: 'padding', fromSize: '20px', toSize: '100em', }, '100px', '200px', ) }).toThrow('fromSize and toSize must be provided as stringified numbers with the same units.') }) }) ================================================ FILE: src/mixins/test/fontFace.test.js ================================================ // @flow import fontFace from '../fontFace' describe('fontFace', () => { it('should return a valid object when passed just a family and source', () => { expect({ ...fontFace({ fontFamily: 'Sans Pro', fontFilePath: 'path/to/file', }), }).toEqual({ '@font-face': { fontFamily: 'Sans Pro', src: 'local("Sans Pro"), url("path/to/file.eot"), url("path/to/file.woff2"), url("path/to/file.woff"), url("path/to/file.ttf"), url("path/to/file.svg")', }, }) }) it('should return a valid object when passed false for localFonts', () => { expect({ ...fontFace({ fontFamily: 'Sans Pro', fontFilePath: 'path/to/file', localFonts: null, }), }).toEqual({ '@font-face': { fontFamily: 'Sans Pro', src: 'url("path/to/file.eot"), url("path/to/file.woff2"), url("path/to/file.woff"), url("path/to/file.ttf"), url("path/to/file.svg")', }, }) }) it('should return a valid object when passed both local and file-based sources', () => { expect({ ...fontFace({ fontFamily: 'Sans Pro', localFonts: ['sans-pro'], fontFilePath: 'path/to/file', }), }).toEqual({ '@font-face': { fontFamily: 'Sans Pro', src: 'local("sans-pro"), url("path/to/file.eot"), url("path/to/file.woff2"), url("path/to/file.woff"), url("path/to/file.ttf"), url("path/to/file.svg")', }, }) }) it('should return a valid object when passed both a file-based source and multiple local sources', () => { expect({ ...fontFace({ fontFamily: 'Sans Pro', localFonts: ['sans-pro', 'sans pro'], fontFilePath: 'path/to/file', }), }).toEqual({ '@font-face': { fontFamily: 'Sans Pro', src: 'local("sans-pro"), local("sans pro"), url("path/to/file.eot"), url("path/to/file.woff2"), url("path/to/file.woff"), url("path/to/file.ttf"), url("path/to/file.svg")', }, }) }) it('should return a valid object when passed only local sources', () => { expect({ ...fontFace({ fontFamily: 'Sans Pro', localFonts: ['sans-pro', 'sans pro'], }), }).toEqual({ '@font-face': { fontFamily: 'Sans Pro', src: 'local("sans-pro"), local("sans pro")', }, }) }) it('should respect the file format configuration object', () => { expect({ ...fontFace({ fontFamily: 'Sans Pro', fontFilePath: 'path/to/file', fileFormats: ['eot', 'svg'], }), }).toEqual({ '@font-face': { fontFamily: 'Sans Pro', src: 'local("Sans Pro"), url("path/to/file.eot"), url("path/to/file.svg")', }, }) }) it('should return base64 src', () => { expect({ ...fontFace({ fontFamily: 'Sans Pro', fontFilePath: 'data:application/x-font-woff;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC', }), }).toEqual({ '@font-face': { fontFamily: 'Sans Pro', src: 'local("Sans Pro"), url("data:application/x-font-woff;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC")', }, }) }) it('should return base64 src with format hint', () => { expect({ ...fontFace({ fontFamily: 'Sans Pro', fontFilePath: 'data:application/x-font-woff;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC', fileFormats: ['woff'], formatHint: true, }), }).toEqual({ '@font-face': { fontFamily: 'Sans Pro', src: 'local("Sans Pro"), url("data:application/x-font-woff;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC") format("woff")', }, }) }) it('should set passed font configuration variables', () => { expect({ ...fontFace({ fontFamily: 'Sans Pro', fontFilePath: 'path/to/file', fontStretch: 'condensed', fontStyle: 'italic', fontWeight: 'bold', fontVariant: 'small-caps', unicodeRange: 'U+26', fontDisplay: 'swap', fontVariationSettings: '"XHGT" 0.7', fontFeatureSettings: '"smcp" on', }), }).toEqual({ '@font-face': { fontDisplay: 'swap', fontFamily: 'Sans Pro', fontFeatureSettings: '"smcp" on', fontStretch: 'condensed', fontStyle: 'italic', fontVariant: 'small-caps', fontVariationSettings: '"XHGT" 0.7', fontWeight: 'bold', src: 'local("Sans Pro"), url("path/to/file.eot"), url("path/to/file.woff2"), url("path/to/file.woff"), url("path/to/file.ttf"), url("path/to/file.svg")', unicodeRange: 'U+26', }, }) }) it('should set generate format hints', () => { expect({ ...fontFace({ fontFamily: 'Sans Pro', fontFilePath: 'path/to/file', fileFormats: ['eot', 'svg', 'svgz', 'woff', 'woff2', 'otf', 'ttf'], formatHint: true, fontStretch: 'condensed', fontStyle: 'italic', fontWeight: 'bold', }), }).toEqual({ '@font-face': { fontFamily: 'Sans Pro', fontStretch: 'condensed', fontStyle: 'italic', fontWeight: 'bold', src: 'local("Sans Pro"), url("path/to/file.eot") format("embedded-opentype"), url("path/to/file.svg") format("svg"), url("path/to/file.svgz") format("svg"), url("path/to/file.woff") format("woff"), url("path/to/file.woff2") format("woff2"), url("path/to/file.otf") format("opentype"), url("path/to/file.ttf") format("truetype")', }, }) }) it('should throw an error when not passed a fontfamily', () => { expect(() => { // $FlowFixMe fontFace({ fontFilePath: 'path/to/file', }) }).toThrow('fontFace expects a name of a font-family.') }) it('should throw an error when not passed a file path or a local source', () => { expect(() => { fontFace({ fontFamily: 'Sans Pro', localFonts: null, }) }).toThrow('fontFace expects either the path to the font file(s) or a name of a local copy.') }) it('should throw an error when localFonts is not an array', () => { expect(() => { fontFace({ fontFamily: 'Sans Pro', fontFilePath: 'path/to/file', // $FlowFixMe localFonts: 'Helvetica', }) }).toThrow('fontFace expects localFonts to be an array.') }) it('should throw an error when fileFormats is not an array', () => { expect(() => { fontFace({ fontFamily: 'Sans Pro', fontFilePath: 'path/to/file', // $FlowFixMe fileFormats: 'svg', }) }).toThrow('fontFace expects fileFormats to be an array.') }) }) ================================================ FILE: src/mixins/test/hiDPI.test.js ================================================ // @flow import hiDPI from '../hiDPI' describe('hiDPI', () => { it('should pass ratio to media query', () => { expect({ [hiDPI(1.5)]: { width: '200px', }, }).toEqual({ [` @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (-o-min-device-pixel-ratio: 1.5/1), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx) `]: { width: '200px', }, }) }) it('should set a default ratio of 1.3 when no ratio is passed', () => { expect({ [hiDPI()]: { width: '200px', }, }).toEqual({ [` @media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 1.3/1), only screen and (min-resolution: 125dpi), only screen and (min-resolution: 1.3dppx) `]: { width: '200px', }, }) }) }) ================================================ FILE: src/mixins/test/hideText.test.js ================================================ // @flow import hideText from '../hideText' describe('hideText', () => { it('should return the CSS in JS', () => { expect({ ...hideText() }).toEqual({ overflow: 'hidden', textIndent: '101%', whiteSpace: 'nowrap', }) }) it('should add rules when block has existing rules', () => { expect({ ...hideText(), 'background-image': 'url(logo.png)', }).toEqual({ 'background-image': 'url(logo.png)', overflow: 'hidden', textIndent: '101%', whiteSpace: 'nowrap', }) }) }) ================================================ FILE: src/mixins/test/hideVisually.test.js ================================================ // @flow import hideVisually from '../hideVisually' describe('hideVisually', () => { it('should return the CSS in JS', () => { expect({ ...hideVisually() }).toEqual({ border: '0', clip: 'rect(0 0 0 0)', height: '1px', margin: '-1px', overflow: 'hidden', padding: '0', position: 'absolute', whiteSpace: 'nowrap', width: '1px', }) }) }) ================================================ FILE: src/mixins/test/linearGradient.test.js ================================================ // @flow import linearGradient from '../linearGradient' describe('linearGradient', () => { it('returns the correct object when only passed two color stops, including parsed fallback with no percentage', () => { expect({ ...linearGradient({ colorStops: ['#fff', '#000'], }), }).toEqual({ backgroundColor: '#fff', backgroundImage: 'linear-gradient(#fff, #000)', }) }) it('returns the right value for fallback when first value is rgb(a)', () => { expect({ ...linearGradient({ colorStops: [ 'rgba(19, 20, 21, 0.5) 0%', 'rgba(83, 250, 197, 0.5) 33%', 'rgba(93, 84, 255, 0.5) 100%', ], toDirection: '0deg', }), }).toEqual({ backgroundColor: 'rgba(19, 20, 21, 0.5)', backgroundImage: 'linear-gradient(0deg, rgba(19, 20, 21, 0.5) 0%, rgba(83, 250, 197, 0.5) 33%, rgba(93, 84, 255, 0.5) 100%)', }) }) it('consistently formats without spaces in rgb(a)', () => { expect({ ...linearGradient({ colorStops: [ 'rgba(19,20,21,0.5) 0%', 'rgba(83,250,197,0.5) 33%', 'rgba(93,84,255,0.5) 100%', ], toDirection: '0deg', }), }).toEqual({ backgroundColor: 'rgba(19, 20, 21, 0.5)', backgroundImage: 'linear-gradient(0deg, rgba(19, 20, 21, 0.5) 0%, rgba(83, 250, 197, 0.5) 33%, rgba(93, 84, 255, 0.5) 100%)', }) }) it('returns the correct object when passed toDirection, including parsed fallback with percentage', () => { expect({ ...linearGradient({ colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], toDirection: '90deg', }), }).toEqual({ backgroundColor: '#00FFFF', backgroundImage: 'linear-gradient(90deg, #00FFFF 0%, rgba(0, 0, 255, 0) 50%, #0000FF 95%)', }) }) it('properly overrides the fallback when it is passed', () => { expect({ ...linearGradient({ colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], toDirection: 'to top right', fallback: '#FFF', }), }).toEqual({ backgroundColor: '#FFF', backgroundImage: 'linear-gradient(to top right, #00FFFF 0%, rgba(0, 0, 255, 0) 50%, #0000FF 95%)', }) }) it('should throw an error when not provided at least 2 color-stops', () => { expect(() => { linearGradient({ colorStops: ['#00FFFF 0%'], toDirection: 'to top right', fallback: '#FFF', }) }).toThrow('linearGradient requries at least 2 color-stops to properly render.') }) }) ================================================ FILE: src/mixins/test/normalize.test.js ================================================ // @flow import normalize from '../normalize' describe('normalize', () => { it('should return rules', () => { expect(normalize()).toEqual([ { '::-webkit-file-upload-button': { WebkitAppearance: 'button', font: 'inherit', }, '[hidden]': { display: 'none', }, [`[type="checkbox"], [type="radio"]`]: { boxSizing: 'border-box', padding: '0', }, [`[type="number"]::-webkit-inner-spin-button, [type="number"]::-webkit-outer-spin-button`]: { height: 'auto', }, '[type="search"]': { WebkitAppearance: 'textfield', outlineOffset: '-2px', }, '[type="search"]::-webkit-search-decoration': { WebkitAppearance: 'none', }, a: { backgroundColor: 'transparent', }, 'abbr[title]': { borderBottom: 'none', textDecoration: 'underline', }, [`b, strong`]: { fontWeight: 'bolder', }, body: { margin: '0', }, [`button, html [type="button"], [type="reset"], [type="submit"]`]: { WebkitAppearance: 'button', }, [`button, input`]: { overflow: 'visible', }, [`button, input, optgroup, select, textarea`]: { fontFamily: 'inherit', fontSize: '100%', lineHeight: '1.15', margin: '0', }, [`button, select`]: { textTransform: 'none', }, [`button:-moz-focusring, [type="button"]:-moz-focusring, [type="reset"]:-moz-focusring, [type="submit"]:-moz-focusring`]: { outline: '1px dotted ButtonText', }, [`button::-moz-focus-inner, [type="button"]::-moz-focus-inner, [type="reset"]::-moz-focus-inner, [type="submit"]::-moz-focus-inner`]: { borderStyle: 'none', padding: '0', }, [`code, kbd, samp`]: { fontFamily: 'monospace, monospace', fontSize: '1em', }, details: { display: 'block', }, fieldset: { padding: '0.35em 0.625em 0.75em', }, h1: { fontSize: '2em', margin: '0.67em 0', }, hr: { boxSizing: 'content-box', height: '0', overflow: 'visible', }, html: { lineHeight: '1.15', textSizeAdjust: '100%', }, img: { borderStyle: 'none', }, legend: { boxSizing: 'border-box', color: 'inherit', display: 'table', maxWidth: '100%', padding: '0', whiteSpace: 'normal', }, main: { display: 'block', }, pre: { fontFamily: 'monospace, monospace', fontSize: '1em', }, progress: { verticalAlign: 'baseline', }, small: { fontSize: '80%', }, sub: { bottom: '-0.25em', }, [`sub, sup`]: { fontSize: '75%', lineHeight: '0', position: 'relative', verticalAlign: 'baseline', }, summary: { display: 'list-item', }, sup: { top: '-0.5em', }, template: { display: 'none', }, textarea: { overflow: 'auto', }, }, { 'abbr[title]': { textDecoration: 'underline dotted', }, }, ]) }) }) ================================================ FILE: src/mixins/test/radialGradient.test.js ================================================ // @flow import radialGradient from '../radialGradient' describe('radialGradient', () => { it('returns the correct object when only passed two color stops, including parsed fallback with no percentage', () => { expect({ ...radialGradient({ colorStops: ['#fff', '#000'], }), }).toEqual({ backgroundColor: '#fff', backgroundImage: 'radial-gradient(#fff, #000)', }) }) it('returns the correct object when passed extent, shape, and position, including parsed fallback with percentage', () => { expect({ ...radialGradient({ colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], extent: 'farthest-corner at 45px 45px', position: 'center', shape: 'ellipse', }), }).toEqual({ backgroundColor: '#00FFFF', backgroundImage: 'radial-gradient(center ellipse farthest-corner at 45px 45px, #00FFFF 0%, rgba(0, 0, 255, 0) 50%, #0000FF 95%)', }) }) it('returns the correct object when passed extent and shape', () => { expect({ ...radialGradient({ colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], extent: 'farthest-corner at 45px 45px', shape: 'ellipse', }), }).toEqual({ backgroundColor: '#00FFFF', backgroundImage: 'radial-gradient(ellipse farthest-corner at 45px 45px, #00FFFF 0%, rgba(0, 0, 255, 0) 50%, #0000FF 95%)', }) }) it('returns the correct object when passed just extent', () => { expect({ ...radialGradient({ colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], extent: 'farthest-corner at 45px 45px', }), }).toEqual({ backgroundColor: '#00FFFF', backgroundImage: 'radial-gradient(farthest-corner at 45px 45px, #00FFFF 0%, rgba(0, 0, 255, 0) 50%, #0000FF 95%)', }) }) it('properly overrides the fallback when it is passed', () => { expect({ ...radialGradient({ colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], extent: 'farthest-corner at 45px 45px', fallback: '#FFF', }), }).toEqual({ backgroundColor: '#FFF', backgroundImage: 'radial-gradient(farthest-corner at 45px 45px, #00FFFF 0%, rgba(0, 0, 255, 0) 50%, #0000FF 95%)', }) }) it('should throw an error when not provided at least 2 color-stops', () => { expect(() => { radialGradient({ colorStops: ['#00FFFF 0%'], extent: 'farthest-corner at 45px 45px', fallback: '#FFF', }) }).toThrow('radialGradient requries at least 2 color-stops to properly render.') }) }) ================================================ FILE: src/mixins/test/retinaImage.test.js ================================================ // @flow import retinaImage from '../retinaImage' describe('retinaImage', () => { it('should throw an error if no filename is passed', () => { // $FlowFixMe expect(() => ({ ...retinaImage() })).toThrow() }) it('should use _2x and png as the default suffix and extension, respectively', () => { expect({ ...retinaImage('img') }).toEqual({ [` @media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 1.3/1), only screen and (min-resolution: 125dpi), only screen and (min-resolution: 1.3dppx) `]: { backgroundImage: 'url(img_2x.png)', }, backgroundImage: 'url(img.png)', }) }) it('should set the background-size if one is passed in', () => { expect({ ...retinaImage('img', 'cover') }).toEqual({ [` @media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 1.3/1), only screen and (min-resolution: 125dpi), only screen and (min-resolution: 1.3dppx) `]: { backgroundImage: 'url(img_2x.png)', backgroundSize: 'cover', }, backgroundImage: 'url(img.png)', }) }) it('should set the extension if one is passed in', () => { expect({ ...retinaImage('img', undefined, 'jpg') }).toEqual({ [` @media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 1.3/1), only screen and (min-resolution: 125dpi), only screen and (min-resolution: 1.3dppx) `]: { backgroundImage: 'url(img_2x.jpg)', }, backgroundImage: 'url(img.jpg)', }) }) it('should allow passing in an extension with a dot', () => { expect({ ...retinaImage('img', undefined, '.jpg') }).toEqual({ [` @media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 1.3/1), only screen and (min-resolution: 125dpi), only screen and (min-resolution: 1.3dppx) `]: { backgroundImage: 'url(img_2x.jpg)', }, backgroundImage: 'url(img.jpg)', }) }) it('should allow passing in a separate filename for the retina version', () => { expect({ ...retinaImage('img', undefined, undefined, 'retina_img'), }).toEqual({ [` @media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 1.3/1), only screen and (min-resolution: 125dpi), only screen and (min-resolution: 1.3dppx) `]: { backgroundImage: 'url(retina_img.png)', }, backgroundImage: 'url(img.png)', }) }) it('should allow passing in a separate suffix for the retina version', () => { expect({ ...retinaImage('img', undefined, undefined, undefined, '_5x'), }).toEqual({ [` @media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 1.3/1), only screen and (min-resolution: 125dpi), only screen and (min-resolution: 1.3dppx) `]: { backgroundImage: 'url(img_5x.png)', }, backgroundImage: 'url(img.png)', }) }) }) ================================================ FILE: src/mixins/test/timingFunctions.test.js ================================================ // @flow import timingFunctions from '../timingFunctions' describe('timingFunctions', () => { it('should return easeInBack cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInBack'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.600, -0.280, 0.735, 0.045)', }) }) it('should return easeInCirc cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInCirc'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.600, 0.040, 0.980, 0.335)', }) }) it('should return easeInCubic cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInCubic'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.550, 0.055, 0.675, 0.190)', }) }) it('should return easeInExpo cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInExpo'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.950, 0.050, 0.795, 0.035)', }) }) it('should return easeInQuad cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInQuad'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.550, 0.085, 0.680, 0.530)', }) }) it('should return easeInQuart cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInQuart'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.895, 0.030, 0.685, 0.220)', }) }) it('should return easeInQuint cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInQuint'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.755, 0.050, 0.855, 0.060)', }) }) it('should return easeInSine cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInSine'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.470, 0.000, 0.745, 0.715)', }) }) it('should return easeOutBack cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeOutBack'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.175, 0.885, 0.320, 1.275)', }) }) it('should return easeOutCirc cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeOutCirc'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.075, 0.820, 0.165, 1.000)', }) }) it('should return easeOutCubic cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeOutCubic'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.215, 0.610, 0.355, 1.000)', }) }) it('should return easeOutExpo cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeOutExpo'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.190, 1.000, 0.220, 1.000)', }) }) it('should return easeOutQuad cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeOutQuad'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.250, 0.460, 0.450, 0.940)', }) }) it('should return easeOutQuart cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeOutQuart'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.165, 0.840, 0.440, 1.000)', }) }) it('should return easeOutQuint cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeOutQuint'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.230, 1.000, 0.320, 1.000)', }) }) it('should return easeOutSine cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeOutSine'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.390, 0.575, 0.565, 1.000)', }) }) it('should return easeInOutBack cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInOutBack'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.680, -0.550, 0.265, 1.550)', }) }) it('should return easeInOutCirc cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInOutCirc'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.785, 0.135, 0.150, 0.860)', }) }) it('should return easeInOutCubic cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInOutCubic'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.645, 0.045, 0.355, 1.000)', }) }) it('should return easeInOutExpo cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInOutExpo'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(1.000, 0.000, 0.000, 1.000)', }) }) it('should return easeInOutQuad cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInOutQuad'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.455, 0.030, 0.515, 0.955)', }) }) it('should return easeInOutQuart cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInOutQuart'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.770, 0.000, 0.175, 1.000)', }) }) it('should return easeInOutQuint cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInOutQuint'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.860, 0.000, 0.070, 1.000)', }) }) it('should return easeInOutSine cubic-bezier', () => { expect({ 'transition-timing-function': timingFunctions('easeInOutSine'), }).toEqual({ 'transition-timing-function': 'cubic-bezier(0.445, 0.050, 0.550, 0.950)', }) }) }) ================================================ FILE: src/mixins/test/triangle.test.js ================================================ // @flow import triangle from '../triangle' describe('triangle', () => { it('should generate a proper triangle when passed all parameters', () => { expect({ ...triangle({ foregroundColor: 'red', backgroundColor: 'black', pointingDirection: 'right', height: 10, width: 20, }), }).toEqual({ borderColor: 'black', borderLeftColor: 'red', borderStyle: 'solid', borderWidth: '5 0 5 20', height: '0', width: '0', }) }) it('should generate a proper triangle when passed all parameters with units on width/height', () => { expect({ ...triangle({ foregroundColor: 'red', backgroundColor: 'black', pointingDirection: 'right', height: '10em', width: '20em', }), }).toEqual({ borderColor: 'black', borderLeftColor: 'red', borderStyle: 'solid', borderWidth: '5em 0 5em 20em', height: '0', width: '0', }) }) it('should generate a proper triangle when passed all parameters with units on width/height with float values', () => { expect({ ...triangle({ foregroundColor: 'red', backgroundColor: 'black', pointingDirection: 'right', height: '10.5em', width: '20.5em', }), }).toEqual({ borderColor: 'black', borderLeftColor: 'red', borderStyle: 'solid', borderWidth: '5.25em 0 5.25em 20.5em', height: '0', width: '0', }) }) it('should default to a transparent background when not passed a backgroundColor', () => { expect({ ...triangle({ foregroundColor: 'red', pointingDirection: 'right', height: '10px', width: '20px', }), }).toEqual({ borderColor: 'transparent', borderLeftColor: 'red', borderStyle: 'solid', borderWidth: '5px 0 5px 20px', height: '0', width: '0', }) }) it('should generate a proper triangle when passed string values for height and width', () => { expect({ ...triangle({ foregroundColor: 'red', backgroundColor: 'black', pointingDirection: 'right', height: '10px', width: '20px', }), }).toEqual({ borderColor: 'black', borderLeftColor: 'red', borderStyle: 'solid', borderWidth: '5px 0 5px 20px', height: '0', width: '0', }) }) it('should properly render top pointing arrow with green foregroundColor, width of 20px and height 20px', () => { expect({ ...triangle({ foregroundColor: 'green', pointingDirection: 'top', height: '20px', width: '20px', }), }).toEqual({ borderBottomColor: 'green', borderColor: 'transparent', borderStyle: 'solid', borderWidth: '0 10px 20px 10px', height: '0', width: '0', }) }) it('should properly render right pointing arrow with width of 20px and height 10px', () => { expect({ ...triangle({ foregroundColor: 'red', pointingDirection: 'right', height: '10px', width: '20px', }), }).toEqual({ borderColor: 'transparent', borderLeftColor: 'red', borderStyle: 'solid', borderWidth: '5px 0 5px 20px', height: '0', width: '0', }) }) it('should properly render bottom pointing arrow with red foregroundColor, width of 20px and height 20px', () => { expect({ ...triangle({ foregroundColor: 'red', pointingDirection: 'bottom', height: '20px', width: '10px', }), }).toEqual({ borderColor: 'transparent', borderStyle: 'solid', borderTopColor: 'red', borderWidth: '20px 5px 0 5px', height: '0', width: '0', }) }) it('should properly render left pointing arrow with blue foregroundColor, width of 10px and height 20px', () => { expect({ ...triangle({ foregroundColor: 'blue', pointingDirection: 'left', height: '20px', width: '10px', }), }).toEqual({ borderColor: 'transparent', borderRightColor: 'blue', borderStyle: 'solid', borderWidth: '10px 10px 10px 0', height: '0', width: '0', }) }) it('should properly render topRight pointing arrow with blue foregroundColor, width of 20px and height 20px', () => { expect({ ...triangle({ foregroundColor: 'blue', pointingDirection: 'topRight', height: '20px', width: '20px', }), }).toEqual({ borderColor: 'transparent', borderRightColor: 'blue', borderStyle: 'solid', borderWidth: '0 20px 20px 0', height: '0', width: '0', }) }) it('should properly render bottomRight pointing arrow with blue foregroundColor, width of 20px and height 20px', () => { expect({ ...triangle({ foregroundColor: 'blue', pointingDirection: 'bottomRight', height: '20px', width: '20px', }), }).toEqual({ borderBottomColor: 'blue', borderColor: 'transparent', borderStyle: 'solid', borderWidth: '0 0 20px 20px', height: '0', width: '0', }) }) it('should properly render bottomLeft pointing arrow with blue foregroundColor, width of 20px and height 20px', () => { expect({ ...triangle({ foregroundColor: 'blue', pointingDirection: 'bottomLeft', height: '20px', width: '20px', }), }).toEqual({ borderColor: 'transparent', borderLeftColor: 'blue', borderStyle: 'solid', borderWidth: '20px 0 0 20px', height: '0', width: '0', }) }) it('should properly render topLeft pointing arrow with blue foregroundColor, width of 20px and height 20px', () => { expect({ ...triangle({ foregroundColor: 'blue', pointingDirection: 'topLeft', height: '20px', width: '20px', }), }).toEqual({ borderColor: 'transparent', borderStyle: 'solid', borderTopColor: 'blue', borderWidth: '20px 20px 0 0', height: '0', width: '0', }) }) it('should throw an error when pointingDirection is not provided', () => { expect(() => { // $FlowFixMe triangle({ foregroundColor: 'blue', height: '20px', width: '10px', }) }).toThrow( "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.", ) }) it('should throw an error when pointingDirection does not match corresponding options', () => { expect(() => { triangle({ foregroundColor: 'blue', height: '20px', width: '10px', // $FlowFixMe pointingDirection: false, }) }).toThrow( "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.", ) }) it('should throw an error when height or width is not a unit based value.', () => { expect(() => { triangle({ foregroundColor: 'blue', height: 'inherit', width: 'inherit', pointingDirection: 'bottom', }) }).toThrow('Passed an invalid value to `height` or `width`. Please provide a pixel based unit') }) }) ================================================ FILE: src/mixins/test/wordWrap.test.js ================================================ // @flow import wordWrap from '../wordWrap' describe('wordWrap', () => { it('should accept other values', () => { expect({ ...wordWrap('break-all'), }).toEqual({ overflowWrap: 'break-all', wordBreak: 'break-all', wordWrap: 'break-all', }) }) it('should default wrap to break-word', () => { expect({ ...wordWrap(), }).toEqual({ overflowWrap: 'break-word', wordBreak: 'break-all', wordWrap: 'break-word', }) }) }) ================================================ FILE: src/mixins/timingFunctions.js ================================================ // @flow import type { TimingFunction } from '../types/timingFunction' /* eslint-disable key-spacing */ const functionsMap = { easeInBack: 'cubic-bezier(0.600, -0.280, 0.735, 0.045)', easeInCirc: 'cubic-bezier(0.600, 0.040, 0.980, 0.335)', easeInCubic: 'cubic-bezier(0.550, 0.055, 0.675, 0.190)', easeInExpo: 'cubic-bezier(0.950, 0.050, 0.795, 0.035)', easeInQuad: 'cubic-bezier(0.550, 0.085, 0.680, 0.530)', easeInQuart: 'cubic-bezier(0.895, 0.030, 0.685, 0.220)', easeInQuint: 'cubic-bezier(0.755, 0.050, 0.855, 0.060)', easeInSine: 'cubic-bezier(0.470, 0.000, 0.745, 0.715)', easeOutBack: 'cubic-bezier(0.175, 0.885, 0.320, 1.275)', easeOutCubic: 'cubic-bezier(0.215, 0.610, 0.355, 1.000)', easeOutCirc: 'cubic-bezier(0.075, 0.820, 0.165, 1.000)', easeOutExpo: 'cubic-bezier(0.190, 1.000, 0.220, 1.000)', easeOutQuad: 'cubic-bezier(0.250, 0.460, 0.450, 0.940)', easeOutQuart: 'cubic-bezier(0.165, 0.840, 0.440, 1.000)', easeOutQuint: 'cubic-bezier(0.230, 1.000, 0.320, 1.000)', easeOutSine: 'cubic-bezier(0.390, 0.575, 0.565, 1.000)', easeInOutBack: 'cubic-bezier(0.680, -0.550, 0.265, 1.550)', easeInOutCirc: 'cubic-bezier(0.785, 0.135, 0.150, 0.860)', easeInOutCubic: 'cubic-bezier(0.645, 0.045, 0.355, 1.000)', easeInOutExpo: 'cubic-bezier(1.000, 0.000, 0.000, 1.000)', easeInOutQuad: 'cubic-bezier(0.455, 0.030, 0.515, 0.955)', easeInOutQuart: 'cubic-bezier(0.770, 0.000, 0.175, 1.000)', easeInOutQuint: 'cubic-bezier(0.860, 0.000, 0.070, 1.000)', easeInOutSine: 'cubic-bezier(0.445, 0.050, 0.550, 0.950)', } /* eslint-enable key-spacing */ function getTimingFunction(functionName: string): string { return functionsMap[functionName] } /** * String to represent common easing functions as demonstrated here: (github.com/jaukia/easie). * * @deprecated - This will be deprecated in v5 in favor of `easeIn`, `easeOut`, `easeInOut`. * * @example * // Styles as object usage * const styles = { * 'transitionTimingFunction': timingFunctions('easeInQuad') * } * * // styled-components usage * const div = styled.div` * transitionTimingFunction: ${timingFunctions('easeInQuad')}; * ` * * // CSS as JS Output * * 'div': { * 'transitionTimingFunction': 'cubic-bezier(0.550, 0.085, 0.680, 0.530)', * } */ export default function timingFunctions(timingFunction: TimingFunction): string { return getTimingFunction(timingFunction) } ================================================ FILE: src/mixins/triangle.js ================================================ // @flow import getValueAndUnit from '../helpers/getValueAndUnit' import PolishedError from '../internalHelpers/_errors' import type { SideKeyword } from '../types/sideKeyword' import type { Styles } from '../types/style' import type { TriangleConfiguration } from '../types/triangleConfiguration' const getBorderWidth = ( pointingDirection: SideKeyword, height: [number, string], width: [number, string], ): string => { const fullWidth = `${width[0]}${width[1] || ''}` const halfWidth = `${width[0] / 2}${width[1] || ''}` const fullHeight = `${height[0]}${height[1] || ''}` const halfHeight = `${height[0] / 2}${height[1] || ''}` switch (pointingDirection) { case 'top': return `0 ${halfWidth} ${fullHeight} ${halfWidth}` case 'topLeft': return `${fullWidth} ${fullHeight} 0 0` case 'left': return `${halfHeight} ${fullWidth} ${halfHeight} 0` case 'bottomLeft': return `${fullWidth} 0 0 ${fullHeight}` case 'bottom': return `${fullHeight} ${halfWidth} 0 ${halfWidth}` case 'bottomRight': return `0 0 ${fullWidth} ${fullHeight}` case 'right': return `${halfHeight} 0 ${halfHeight} ${fullWidth}` case 'topRight': default: return `0 ${fullWidth} ${fullHeight} 0` } } const getBorderColor = (pointingDirection: SideKeyword, foregroundColor: string): Object => { switch (pointingDirection) { case 'top': case 'bottomRight': return { borderBottomColor: foregroundColor } case 'right': case 'bottomLeft': return { borderLeftColor: foregroundColor } case 'bottom': case 'topLeft': return { borderTopColor: foregroundColor } case 'left': case 'topRight': return { borderRightColor: foregroundColor } default: throw new PolishedError(59) } } /** * CSS to represent triangle with any pointing direction with an optional background color. * * @example * // Styles as object usage * * const styles = { * ...triangle({ pointingDirection: 'right', width: '100px', height: '100px', foregroundColor: 'red' }) * } * * * // styled-components usage * const div = styled.div` * ${triangle({ pointingDirection: 'right', width: '100px', height: '100px', foregroundColor: 'red' })} * * * // CSS as JS Output * * div: { * 'borderColor': 'transparent transparent transparent red', * 'borderStyle': 'solid', * 'borderWidth': '50px 0 50px 100px', * 'height': '0', * 'width': '0', * } */ export default function triangle({ pointingDirection, height, width, foregroundColor, backgroundColor = 'transparent', }: TriangleConfiguration): Styles { const widthAndUnit = getValueAndUnit(width) const heightAndUnit = getValueAndUnit(height) if (isNaN(heightAndUnit[0]) || isNaN(widthAndUnit[0])) { throw new PolishedError(60) } return { width: '0', height: '0', borderColor: backgroundColor, ...getBorderColor(pointingDirection, foregroundColor), borderStyle: 'solid', borderWidth: getBorderWidth(pointingDirection, heightAndUnit, widthAndUnit), } } ================================================ FILE: src/mixins/wordWrap.js ================================================ // @flow import type { Styles } from '../types/style' /** * Provides an easy way to change the `wordWrap` property. * * @example * // Styles as object usage * const styles = { * ...wordWrap('break-word') * } * * // styled-components usage * const div = styled.div` * ${wordWrap('break-word')} * ` * * // CSS as JS Output * * const styles = { * overflowWrap: 'break-word', * wordWrap: 'break-word', * wordBreak: 'break-all', * } */ export default function wordWrap(wrap?: string = 'break-word'): Styles { const wordBreak = wrap === 'break-word' ? 'break-all' : wrap return { overflowWrap: wrap, wordWrap: wrap, wordBreak, } } ================================================ FILE: src/shorthands/animation.js ================================================ // @flow import PolishedError from '../internalHelpers/_errors' import type { Styles } from '../types/style' /** * Shorthand for easily setting the animation property. Allows either multiple arrays with animations * or a single animation spread over the arguments. * @example * // Styles as object usage * const styles = { * ...animation(['rotate', '1s', 'ease-in-out'], ['colorchange', '2s']) * } * * // styled-components usage * const div = styled.div` * ${animation(['rotate', '1s', 'ease-in-out'], ['colorchange', '2s'])} * ` * * // CSS as JS Output * * div { * 'animation': 'rotate 1s ease-in-out, colorchange 2s' * } * @example * // Styles as object usage * const styles = { * ...animation('rotate', '1s', 'ease-in-out') * } * * // styled-components usage * const div = styled.div` * ${animation('rotate', '1s', 'ease-in-out')} * ` * * // CSS as JS Output * * div { * 'animation': 'rotate 1s ease-in-out' * } */ export default function animation( ...args: Array | string | number> ): Styles { // Allow single or multiple animations passed const multiMode = Array.isArray(args[0]) if (!multiMode && args.length > 8) { throw new PolishedError(64) } const code = args .map(arg => { if ((multiMode && !Array.isArray(arg)) || (!multiMode && Array.isArray(arg))) { throw new PolishedError(65) } if (Array.isArray(arg) && arg.length > 8) { throw new PolishedError(66) } return Array.isArray(arg) ? arg.join(' ') : arg }) .join(', ') return { animation: code, } } ================================================ FILE: src/shorthands/backgroundImages.js ================================================ // @flow import type { Styles } from '../types/style' /** * Shorthand that accepts any number of backgroundImage values as parameters for creating a single background statement. * @example * // Styles as object usage * const styles = { * ...backgroundImages('url("/image/background.jpg")', 'linear-gradient(red, green)') * } * * // styled-components usage * const div = styled.div` * ${backgroundImages('url("/image/background.jpg")', 'linear-gradient(red, green)')} * ` * * // CSS as JS Output * * div { * 'backgroundImage': 'url("/image/background.jpg"), linear-gradient(red, green)' * } */ export default function backgroundImages(...properties: Array): Styles { return { backgroundImage: properties.join(', '), } } ================================================ FILE: src/shorthands/backgrounds.js ================================================ // @flow import type { Styles } from '../types/style' /** * Shorthand that accepts any number of background values as parameters for creating a single background statement. * @example * // Styles as object usage * const styles = { * ...backgrounds('url("/image/background.jpg")', 'linear-gradient(red, green)', 'center no-repeat') * } * * // styled-components usage * const div = styled.div` * ${backgrounds('url("/image/background.jpg")', 'linear-gradient(red, green)', 'center no-repeat')} * ` * * // CSS as JS Output * * div { * 'background': 'url("/image/background.jpg"), linear-gradient(red, green), center no-repeat' * } */ export default function backgrounds(...properties: Array): Styles { return { background: properties.join(', '), } } ================================================ FILE: src/shorthands/border.js ================================================ // @flow import capitalizeString from '../internalHelpers/_capitalizeString' import type { SideKeyword } from '../types/sideKeyword' import type { Styles } from '../types/style' const sideMap = ['top', 'right', 'bottom', 'left'] /** * Shorthand for the border property that splits out individual properties for use with tools like Fela and Styletron. A side keyword can optionally be passed to target only one side's border properties. * * @example * // Styles as object usage * const styles = { * ...border('1px', 'solid', 'red') * } * * // styled-components usage * const div = styled.div` * ${border('1px', 'solid', 'red')} * ` * * // CSS as JS Output * * div { * 'borderColor': 'red', * 'borderStyle': 'solid', * 'borderWidth': `1px`, * } * * // Styles as object usage * const styles = { * ...border('top', '1px', 'solid', 'red') * } * * // styled-components usage * const div = styled.div` * ${border('top', '1px', 'solid', 'red')} * ` * * // CSS as JS Output * * div { * 'borderTopColor': 'red', * 'borderTopStyle': 'solid', * 'borderTopWidth': `1px`, * } */ export default function border( sideKeyword: SideKeyword | string | number, ...values: Array ): Styles { if (typeof sideKeyword === 'string' && sideMap.indexOf(sideKeyword) >= 0) { return { [`border${capitalizeString(sideKeyword)}Width`]: values[0], [`border${capitalizeString(sideKeyword)}Style`]: values[1], [`border${capitalizeString(sideKeyword)}Color`]: values[2], } } else { values.unshift(sideKeyword) return { borderWidth: values[0], borderStyle: values[1], borderColor: values[2], } } } ================================================ FILE: src/shorthands/borderColor.js ================================================ // @flow import directionalProperty from '../helpers/directionalProperty' import type { Styles } from '../types/style' /** * Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions. * @example * // Styles as object usage * const styles = { * ...borderColor('red', 'green', 'blue', 'yellow') * } * * // styled-components usage * const div = styled.div` * ${borderColor('red', 'green', 'blue', 'yellow')} * ` * * // CSS as JS Output * * div { * 'borderTopColor': 'red', * 'borderRightColor': 'green', * 'borderBottomColor': 'blue', * 'borderLeftColor': 'yellow' * } */ export default function borderColor(...values: Array): Styles { return directionalProperty('borderColor', ...values) } ================================================ FILE: src/shorthands/borderRadius.js ================================================ // @flow import capitalizeString from '../internalHelpers/_capitalizeString' import PolishedError from '../internalHelpers/_errors' import type { Styles } from '../types/style' /** * Shorthand that accepts a value for side and a value for radius and applies the radius value to both corners of the side. * @example * // Styles as object usage * const styles = { * ...borderRadius('top', '5px') * } * * // styled-components usage * const div = styled.div` * ${borderRadius('top', '5px')} * ` * * // CSS as JS Output * * div { * 'borderTopRightRadius': '5px', * 'borderTopLeftRadius': '5px', * } */ export default function borderRadius(side: string, radius: string | number): Styles { const uppercaseSide = capitalizeString(side) if (!radius && radius !== 0) { throw new PolishedError(62) } if (uppercaseSide === 'Top' || uppercaseSide === 'Bottom') { return { [`border${uppercaseSide}RightRadius`]: radius, [`border${uppercaseSide}LeftRadius`]: radius, } } if (uppercaseSide === 'Left' || uppercaseSide === 'Right') { return { [`borderTop${uppercaseSide}Radius`]: radius, [`borderBottom${uppercaseSide}Radius`]: radius, } } throw new PolishedError(63) } ================================================ FILE: src/shorthands/borderStyle.js ================================================ // @flow import directionalProperty from '../helpers/directionalProperty' import type { Styles } from '../types/style' /** * Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions. * @example * // Styles as object usage * const styles = { * ...borderStyle('solid', 'dashed', 'dotted', 'double') * } * * // styled-components usage * const div = styled.div` * ${borderStyle('solid', 'dashed', 'dotted', 'double')} * ` * * // CSS as JS Output * * div { * 'borderTopStyle': 'solid', * 'borderRightStyle': 'dashed', * 'borderBottomStyle': 'dotted', * 'borderLeftStyle': 'double' * } */ export default function borderStyle(...values: Array): Styles { return directionalProperty('borderStyle', ...values) } ================================================ FILE: src/shorthands/borderWidth.js ================================================ // @flow import directionalProperty from '../helpers/directionalProperty' import type { Styles } from '../types/style' /** * Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions. * @example * // Styles as object usage * const styles = { * ...borderWidth('12px', '24px', '36px', '48px') * } * * // styled-components usage * const div = styled.div` * ${borderWidth('12px', '24px', '36px', '48px')} * ` * * // CSS as JS Output * * div { * 'borderTopWidth': '12px', * 'borderRightWidth': '24px', * 'borderBottomWidth': '36px', * 'borderLeftWidth': '48px' * } */ export default function borderWidth(...values: Array): Styles { return directionalProperty('borderWidth', ...values) } ================================================ FILE: src/shorthands/buttons.js ================================================ // @flow import statefulSelectors from '../internalHelpers/_statefulSelectors' import type { InteractionState } from '../types/interactionState' const stateMap = [undefined, null, 'active', 'focus', 'hover'] function template(state: string): string { return `button${state}, input[type="button"]${state}, input[type="reset"]${state}, input[type="submit"]${state}` } /** * Populates selectors that target all buttons. You can pass optional states to append to the selectors. * @example * // Styles as object usage * const styles = { * [buttons('active')]: { * 'border': 'none' * } * } * * // styled-components usage * const div = styled.div` * > ${buttons('active')} { * border: none; * } * ` * * // CSS in JS Output * * 'button:active, * 'input[type="button"]:active, * 'input[type=\"reset\"]:active, * 'input[type=\"submit\"]:active: { * 'border': 'none' * } */ export default function buttons(...states: Array): string { return statefulSelectors(states, template, stateMap) } ================================================ FILE: src/shorthands/margin.js ================================================ // @flow import directionalProperty from '../helpers/directionalProperty' import type { Styles } from '../types/style' /** * Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions. * @example * // Styles as object usage * const styles = { * ...margin('12px', '24px', '36px', '48px') * } * * // styled-components usage * const div = styled.div` * ${margin('12px', '24px', '36px', '48px')} * ` * * // CSS as JS Output * * div { * 'marginTop': '12px', * 'marginRight': '24px', * 'marginBottom': '36px', * 'marginLeft': '48px' * } */ export default function margin(...values: Array): Styles { return directionalProperty('margin', ...values) } ================================================ FILE: src/shorthands/padding.js ================================================ // @flow import directionalProperty from '../helpers/directionalProperty' import type { Styles } from '../types/style' /** * Shorthand that accepts up to four values, including null to skip a value, and maps them to their respective directions. * @example * // Styles as object usage * const styles = { * ...padding('12px', '24px', '36px', '48px') * } * * // styled-components usage * const div = styled.div` * ${padding('12px', '24px', '36px', '48px')} * ` * * // CSS as JS Output * * div { * 'paddingTop': '12px', * 'paddingRight': '24px', * 'paddingBottom': '36px', * 'paddingLeft': '48px' * } */ export default function padding(...values: Array): Styles { return directionalProperty('padding', ...values) } ================================================ FILE: src/shorthands/position.js ================================================ // @flow import directionalProperty from '../helpers/directionalProperty' import type { Styles } from '../types/style' const positionMap = ['absolute', 'fixed', 'relative', 'static', 'sticky'] /** * Shorthand accepts up to five values, including null to skip a value, and maps them to their respective directions. The first value can optionally be a position keyword. * @example * // Styles as object usage * const styles = { * ...position('12px', '24px', '36px', '48px') * } * * // styled-components usage * const div = styled.div` * ${position('12px', '24px', '36px', '48px')} * ` * * // CSS as JS Output * * div { * 'top': '12px', * 'right': '24px', * 'bottom': '36px', * 'left': '48px' * } * * // Styles as object usage * const styles = { * ...position('absolute', '12px', '24px', '36px', '48px') * } * * // styled-components usage * const div = styled.div` * ${position('absolute', '12px', '24px', '36px', '48px')} * ` * * // CSS as JS Output * * div { * 'position': 'absolute', * 'top': '12px', * 'right': '24px', * 'bottom': '36px', * 'left': '48px' * } */ export default function position( firstValue?: string | number | null, ...values: Array ): Styles { if (positionMap.indexOf(firstValue) >= 0 && firstValue) { return { ...directionalProperty('', ...values), position: firstValue, } } else { return directionalProperty('', firstValue, ...values) } } ================================================ FILE: src/shorthands/size.js ================================================ // @flow import type { Styles } from '../types/style' /** * Shorthand to set the height and width properties in a single statement. * @example * // Styles as object usage * const styles = { * ...size('300px', '250px') * } * * // styled-components usage * const div = styled.div` * ${size('300px', '250px')} * ` * * // CSS as JS Output * * div { * 'height': '300px', * 'width': '250px', * } */ export default function size(height: string | number, width?: string | number = height): Styles { return { height, width, } } ================================================ FILE: src/shorthands/test/animation.test.js ================================================ // @flow import animation from '../animation' describe('animation', () => { describe('single mode', () => { it('should pass first eight arguments to the CSS', () => { expect({ ...animation('rotate', '1s', 'ease-in-out', '0.5s', 5, 'reverse', 'forwards', 'paused'), }).toEqual({ animation: 'rotate, 1s, ease-in-out, 0.5s, 5, reverse, forwards, paused', }) }) it('should be fine with less than eight arguments', () => { expect({ ...animation('rotate', '1s', 'ease-in-out') }).toEqual({ animation: 'rotate, 1s, ease-in-out', }) }) it('should throw an error if more than eight elements are supplied', () => { expect(() => { animation('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'oops') }).toThrow() }) }) describe('multi mode', () => { it('should pass first eight arguments to the CSS in multi mode', () => { expect({ ...animation(['rotate', '1s', 'ease-in-out', '0.5s', 5, 'reverse', 'forwards', 'paused']), }).toEqual({ animation: 'rotate 1s ease-in-out 0.5s 5 reverse forwards paused', }) }) it('should be fine with less than eight arguments', () => { expect({ ...animation(['rotate', '1s', 'ease-in-out']), }).toEqual({ animation: 'rotate 1s ease-in-out', }) }) it('should be fine with multiple animations', () => { expect({ ...animation(['rotate', '1s', 'ease-in-out'], ['colorchange', '2s']), }).toEqual({ animation: 'rotate 1s ease-in-out, colorchange 2s', }) }) it('should throw an error if more than eight elements are supplied in an array', () => { expect(() => { animation(['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'oops']) }).toThrow() }) it('should throw an error if more than eight elements are supplied in a second array', () => { expect(() => { animation( ['rotate'], ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'oops'], ) }).toThrow() }) }) it('should not allow arrays in single mode', () => { expect(() => { animation('rotate', ['move', '2s'], '1s') }).toThrow() }) it('should not allow simple root level values in multi mode', () => { expect(() => { animation(['move', '2s'], 'rotate', '2s') }).toThrow() }) }) ================================================ FILE: src/shorthands/test/backgroundImages.test.js ================================================ import backgroundImages from '../backgroundImages' describe('backgroundImages', () => { it('should generate a single background from a parameter', () => { expect({ ...backgroundImages('url("/image/background.jpg")'), }).toEqual({ backgroundImage: 'url("/image/background.jpg")', }) }) it('should generate a multiple backgroundImages from multiple parameters', () => { expect({ ...backgroundImages('url("/image/background.jpg")', 'linear-gradient(red, green)'), }).toEqual({ backgroundImage: 'url("/image/background.jpg"), linear-gradient(red, green)', }) }) }) ================================================ FILE: src/shorthands/test/backgrounds.test.js ================================================ import backgrounds from '../backgrounds' describe('backgrounds', () => { it('should generate a single background from a parameter', () => { expect({ ...backgrounds('url("/image/background.jpg")'), }).toEqual({ background: 'url("/image/background.jpg")', }) }) it('should generate a multiple backgrounds from multiple parameters', () => { expect({ ...backgrounds( 'url("/image/background.jpg")', 'linear-gradient(red, green)', 'center no-repeat', ), }).toEqual({ background: 'url("/image/background.jpg"), linear-gradient(red, green), center no-repeat', }) }) }) ================================================ FILE: src/shorthands/test/border.test.js ================================================ // @flow import border from '../border' describe('border', () => { it('properly returns separated border styles', () => { expect(border('1px', 'solid', 'red')).toEqual({ borderColor: 'red', borderStyle: 'solid', borderWidth: '1px', }) }) it('properly returns separated border styles for a specific side', () => { expect(border('top', '1px', 'solid', 'red')).toEqual({ borderTopColor: 'red', borderTopStyle: 'solid', borderTopWidth: '1px', }) }) it('properly returns separated border styles when passed a number for borderWidth', () => { expect(border(1, 'solid', 'red')).toEqual({ borderColor: 'red', borderStyle: 'solid', borderWidth: 1, }) }) it('properly returns separated border styles for a specific side when passed a number for borderWidth', () => { expect(border('top', 1, 'solid', 'red')).toEqual({ borderTopColor: 'red', borderTopStyle: 'solid', borderTopWidth: 1, }) }) }) ================================================ FILE: src/shorthands/test/borderColor.test.js ================================================ // @flow import borderColor from '../borderColor' describe('borderColor', () => { it('properly applies a value when passed only one', () => { expect(borderColor('red')).toEqual({ borderBottomColor: 'red', borderLeftColor: 'red', borderRightColor: 'red', borderTopColor: 'red', }) }) it('properly applies values when passed two', () => { expect(borderColor('red', 'blue')).toEqual({ borderBottomColor: 'red', borderLeftColor: 'blue', borderRightColor: 'blue', borderTopColor: 'red', }) }) it('properly applies values when passed three', () => { expect(borderColor('red', 'blue', 'green')).toEqual({ borderBottomColor: 'green', borderLeftColor: 'blue', borderRightColor: 'blue', borderTopColor: 'red', }) }) it('properly applies values when passed four', () => { expect(borderColor('red', 'blue', 'green', 'yellow')).toEqual({ borderBottomColor: 'green', borderLeftColor: 'yellow', borderRightColor: 'blue', borderTopColor: 'red', }) }) }) ================================================ FILE: src/shorthands/test/borderRadius.test.js ================================================ // @flow import borderRadius from '../borderRadius' describe('borderRadius', () => { it('returns the proper values for the top side', () => { expect(borderRadius('top', '5px')).toEqual({ borderTopLeftRadius: '5px', borderTopRightRadius: '5px', }) }) it('returns the proper values for the bottom side', () => { expect(borderRadius('bottom', '5px')).toEqual({ borderBottomLeftRadius: '5px', borderBottomRightRadius: '5px', }) }) it('returns the proper values for the right side', () => { expect(borderRadius('right', '5px')).toEqual({ borderBottomRightRadius: '5px', borderTopRightRadius: '5px', }) }) it('returns the proper values for the left side', () => { expect(borderRadius('left', '5px')).toEqual({ borderBottomLeftRadius: '5px', borderTopLeftRadius: '5px', }) }) it('returns the proper values when passed an integer', () => { expect(borderRadius('left', 5)).toEqual({ borderBottomLeftRadius: 5, borderTopLeftRadius: 5, }) }) it('returns the proper values when passed zero', () => { expect(borderRadius('left', 0)).toEqual({ borderBottomLeftRadius: 0, borderTopLeftRadius: 0, }) }) it('should throw an error when no radius value is provided', () => { expect(() => { // $FlowFixMe borderRadius('top') }).toThrow('borderRadius expects a radius value as a string or number as the second argument.') }) it('should throw an error when an invalid side value is provided', () => { expect(() => { borderRadius('all', '100%') }).toThrow( 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.', ) }) }) ================================================ FILE: src/shorthands/test/borderStyle.test.js ================================================ // @flow import borderStyle from '../borderStyle' describe('borderStyle', () => { it('properly applies a value when passed only one', () => { expect(borderStyle('solid')).toEqual({ borderBottomStyle: 'solid', borderLeftStyle: 'solid', borderRightStyle: 'solid', borderTopStyle: 'solid', }) }) it('properly applies values when passed two', () => { expect(borderStyle('solid', 'dashed')).toEqual({ borderBottomStyle: 'solid', borderLeftStyle: 'dashed', borderRightStyle: 'dashed', borderTopStyle: 'solid', }) }) it('properly applies values when passed three', () => { expect(borderStyle('solid', 'dashed', 'dotted')).toEqual({ borderBottomStyle: 'dotted', borderLeftStyle: 'dashed', borderRightStyle: 'dashed', borderTopStyle: 'solid', }) }) it('properly applies values when passed four', () => { expect(borderStyle('solid', 'dashed', 'dotted', 'double')).toEqual({ borderBottomStyle: 'dotted', borderLeftStyle: 'double', borderRightStyle: 'dashed', borderTopStyle: 'solid', }) }) }) ================================================ FILE: src/shorthands/test/borderWidth.test.js ================================================ // @flow import borderWidth from '../borderWidth' describe('borderWidth', () => { it('properly applies a value when passed only one', () => { expect(borderWidth('12px')).toEqual({ borderBottomWidth: '12px', borderLeftWidth: '12px', borderRightWidth: '12px', borderTopWidth: '12px', }) }) it('properly applies values when passed two', () => { expect(borderWidth('12px', '24px')).toEqual({ borderBottomWidth: '12px', borderLeftWidth: '24px', borderRightWidth: '24px', borderTopWidth: '12px', }) }) it('properly applies values when passed three', () => { expect(borderWidth('12px', '24px', '36px')).toEqual({ borderBottomWidth: '36px', borderLeftWidth: '24px', borderRightWidth: '24px', borderTopWidth: '12px', }) }) it('properly applies values when passed four', () => { expect(borderWidth('12px', '24px', '36px', '48px')).toEqual({ borderBottomWidth: '36px', borderLeftWidth: '48px', borderRightWidth: '24px', borderTopWidth: '12px', }) }) it('properly applies values when passed integers', () => { expect(borderWidth(12, 24, 36, 48)).toEqual({ borderBottomWidth: 36, borderLeftWidth: 48, borderRightWidth: 24, borderTopWidth: 12, }) }) it('properly applies values when passed zero', () => { expect(borderWidth(0)).toEqual({ borderBottomWidth: 0, borderLeftWidth: 0, borderRightWidth: 0, borderTopWidth: 0, }) }) }) ================================================ FILE: src/shorthands/test/buttons.test.js ================================================ // @flow import buttons from '../buttons' describe('buttons', () => { it('populates base button selectors', () => { expect({ [buttons()]: { 'border-color': 'black' } }).toEqual({ [`button, input[type="button"], input[type="reset"], input[type="submit"]`]: { 'border-color': 'black', }, }) }) it('populates buttons selectors for a single state', () => { expect({ [buttons('active')]: { 'border-color': 'black' }, }).toEqual({ [`button:active, input[type="button"]:active, input[type="reset"]:active, input[type="submit"]:active`]: { 'border-color': 'black', }, }) }) it('populates both base selectors and selectors for a single state', () => { expect({ [buttons(null, 'focus')]: { 'border-color': 'black' }, }).toEqual({ [`button, input[type="button"], input[type="reset"], input[type="submit"],button:focus, input[type="button"]:focus, input[type="reset"]:focus, input[type="submit"]:focus`]: { 'border-color': 'black', }, }) }) it('populates button selectors for multiple states', () => { expect({ [buttons('active', 'focus')]: { 'border-color': 'black' }, }).toEqual({ [`button:active, input[type="button"]:active, input[type="reset"]:active, input[type="submit"]:active,button:focus, input[type="button"]:focus, input[type="reset"]:focus, input[type="submit"]:focus`]: { 'border-color': 'black', }, }) }) it('throws an error when passed a state it does not recognize', () => { expect(() => ({ // $FlowFixMe [buttons('clicked')]: { 'border-color': 'black' }, })).toThrow('You passed an unsupported selector state to this method') }) }) ================================================ FILE: src/shorthands/test/margin.test.js ================================================ // @flow import margin from '../margin' describe('margin', () => { it('properly applies a value when passed only one', () => { expect(margin('12px')).toEqual({ marginBottom: '12px', marginLeft: '12px', marginRight: '12px', marginTop: '12px', }) }) it('properly applies values when passed two', () => { expect(margin('12px', '24px')).toEqual({ marginBottom: '12px', marginLeft: '24px', marginRight: '24px', marginTop: '12px', }) }) it('properly applies values when passed three', () => { expect(margin('12px', '24px', '36px')).toEqual({ marginBottom: '36px', marginLeft: '24px', marginRight: '24px', marginTop: '12px', }) }) it('properly applies values when passed four', () => { expect(margin('12px', '24px', '36px', '48px')).toEqual({ marginBottom: '36px', marginLeft: '48px', marginRight: '24px', marginTop: '12px', }) }) it('properly applies values when passed four', () => { expect(margin(12, 24, 36, 48)).toEqual({ marginBottom: 36, marginLeft: 48, marginRight: 24, marginTop: 12, }) }) it('properly applies zero value', () => { expect(margin(0)).toEqual({ marginBottom: 0, marginLeft: 0, marginRight: 0, marginTop: 0, }) }) }) ================================================ FILE: src/shorthands/test/padding.test.js ================================================ // @flow import padding from '../padding' describe('padding', () => { it('properly applies a value when passed only one', () => { expect(padding('12px')).toEqual({ paddingBottom: '12px', paddingLeft: '12px', paddingRight: '12px', paddingTop: '12px', }) }) it('properly applies values when passed two', () => { expect(padding('12px', '24px')).toEqual({ paddingBottom: '12px', paddingLeft: '24px', paddingRight: '24px', paddingTop: '12px', }) }) it('properly applies values when passed three', () => { expect(padding('12px', '24px', '36px')).toEqual({ paddingBottom: '36px', paddingLeft: '24px', paddingRight: '24px', paddingTop: '12px', }) }) it('properly applies values when passed four', () => { expect(padding('12px', '24px', '36px', '48px')).toEqual({ paddingBottom: '36px', paddingLeft: '48px', paddingRight: '24px', paddingTop: '12px', }) }) it('properly applies values when passed four', () => { expect(padding(12, 24, 36, 48)).toEqual({ paddingBottom: 36, paddingLeft: 48, paddingRight: 24, paddingTop: 12, }) }) it('properly applies zero value', () => { expect(padding(0)).toEqual({ paddingBottom: 0, paddingLeft: 0, paddingRight: 0, paddingTop: 0, }) }) }) ================================================ FILE: src/shorthands/test/position.test.js ================================================ // @flow import position from '../position' describe('position', () => { it('properly applies a value when passed only one', () => { expect(position('relative', '12px')).toEqual({ bottom: '12px', left: '12px', position: 'relative', right: '12px', top: '12px', }) }) it('properly applies values when passed two', () => { expect(position('relative', '12px', '24px')).toEqual({ bottom: '12px', left: '24px', position: 'relative', right: '24px', top: '12px', }) }) it('properly applies values when passed three', () => { expect(position('relative', '12px', '24px', '36px')).toEqual({ bottom: '36px', left: '24px', position: 'relative', right: '24px', top: '12px', }) }) it('properly applies values when passed four', () => { expect(position('relative', '12px', '24px', '36px', '48px')).toEqual({ bottom: '36px', left: '48px', position: 'relative', right: '24px', top: '12px', }) }) it('properly ignores position property, when not passed one', () => { expect(position('12px', '24px', '36px', '48px')).toEqual({ bottom: '36px', left: '48px', right: '24px', top: '12px', }) }) it('properly skips values when passed undefined`', () => { expect(position('relative', '12px', null, '36px', '48px')).toEqual({ bottom: '36px', left: '48px', position: 'relative', top: '12px', }) }) it('properly skips first value when passed undefined', () => { expect(position(null, '24px', '36px', '48px')).toEqual({ bottom: '36px', left: '48px', right: '24px', }) }) it('properly applies values when passed four integers', () => { expect(position('relative', 12, 24, 36, 48)).toEqual({ bottom: 36, left: 48, position: 'relative', right: 24, top: 12, }) }) it('properly applies zero value', () => { expect(position('relative', 0)).toEqual({ bottom: 0, left: 0, position: 'relative', right: 0, top: 0, }) }) }) ================================================ FILE: src/shorthands/test/size.test.js ================================================ // @flow import size from '../size' describe('size', () => { it('should pass parameters to the values of height and width', () => { expect({ ...size('300px', '250px') }).toEqual({ height: '300px', width: '250px', }) }) it('should set height and width to the same value when only one parameter is passed', () => { expect({ ...size('300px') }).toEqual({ height: '300px', width: '300px', }) }) it('should pass parameters to the values of height and width when passed integers', () => { expect({ ...size(300, 250) }).toEqual({ height: 300, width: 250, }) }) it('should pass parameters to the values of height and width when passed zero', () => { expect({ ...size(0) }).toEqual({ height: 0, width: 0, }) }) }) ================================================ FILE: src/shorthands/test/textInputs.test.js ================================================ // @flow import textInputs from '../textInputs' describe('textInputs', () => { it('populates base text input selectors', () => { expect({ [textInputs()]: { 'border-color': 'black' } }).toEqual({ [`input[type="color"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"], input:not([type]), textarea`]: { 'border-color': 'black', }, }) }) it('populates text input selectors for a single state', () => { expect({ [textInputs('active')]: { 'border-color': 'black' }, }).toEqual({ [`input[type="color"]:active, input[type="date"]:active, input[type="datetime"]:active, input[type="datetime-local"]:active, input[type="email"]:active, input[type="month"]:active, input[type="number"]:active, input[type="password"]:active, input[type="search"]:active, input[type="tel"]:active, input[type="text"]:active, input[type="time"]:active, input[type="url"]:active, input[type="week"]:active, input:not([type]):active, textarea:active`]: { 'border-color': 'black', }, }) }) it('populates both base selectors and selectors for a single state', () => { expect({ [textInputs(null, 'focus')]: { 'border-color': 'black' }, }).toEqual({ [`input[type="color"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"], input:not([type]), textarea,input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="email"]:focus, input[type="month"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="time"]:focus, input[type="url"]:focus, input[type="week"]:focus, input:not([type]):focus, textarea:focus`]: { 'border-color': 'black', }, }) }) it('populates text input selectors for multiple states', () => { expect({ [textInputs('active', 'focus')]: { 'border-color': 'black' }, }).toEqual({ [`input[type="color"]:active, input[type="date"]:active, input[type="datetime"]:active, input[type="datetime-local"]:active, input[type="email"]:active, input[type="month"]:active, input[type="number"]:active, input[type="password"]:active, input[type="search"]:active, input[type="tel"]:active, input[type="text"]:active, input[type="time"]:active, input[type="url"]:active, input[type="week"]:active, input:not([type]):active, textarea:active,input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="email"]:focus, input[type="month"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="time"]:focus, input[type="url"]:focus, input[type="week"]:focus, input:not([type]):focus, textarea:focus`]: { 'border-color': 'black', }, }) }) it('throws an error when passed a state it does not recognize', () => { expect(() => ({ // $FlowFixMe [textInputs('clicked')]: { 'border-color': 'black' }, })).toThrow('You passed an unsupported selector state to this method') }) }) ================================================ FILE: src/shorthands/test/transitions.test.js ================================================ import transitions from '../transitions' describe('transitions', () => { it('should generate a single transition from a parameter', () => { expect({ ...transitions('opacity 1.0s ease-in 0s'), }).toEqual({ transition: 'opacity 1.0s ease-in 0s', }) }) it('should generate a multiple transitions from multiple parameters', () => { expect({ ...transitions('opacity 1.0s ease-in 0s', 'width 2.0s ease-in 2s'), }).toEqual({ transition: 'opacity 1.0s ease-in 0s, width 2.0s ease-in 2s', }) }) it('should apply the same transition to an array of properties', () => { expect({ ...transitions(['color', 'background-color'], '2.0s ease-in 2s'), }).toEqual({ transition: 'color 2.0s ease-in 2s, background-color 2.0s ease-in 2s', }) }) it('should throw an error when passed a non-string value', () => { expect(() => ({ // $FlowFixMe ...transitions(['color', 'background-color'], 1), })).toThrow('Property must be a string value.') }) }) ================================================ FILE: src/shorthands/textInputs.js ================================================ // @flow import statefulSelectors from '../internalHelpers/_statefulSelectors' import type { InteractionState } from '../types/interactionState' const stateMap = [undefined, null, 'active', 'focus', 'hover'] function template(state: string): string { return `input[type="color"]${state}, input[type="date"]${state}, input[type="datetime"]${state}, input[type="datetime-local"]${state}, input[type="email"]${state}, input[type="month"]${state}, input[type="number"]${state}, input[type="password"]${state}, input[type="search"]${state}, input[type="tel"]${state}, input[type="text"]${state}, input[type="time"]${state}, input[type="url"]${state}, input[type="week"]${state}, input:not([type])${state}, textarea${state}` } /** * Populates selectors that target all text inputs. You can pass optional states to append to the selectors. * @example * // Styles as object usage * const styles = { * [textInputs('active')]: { * 'border': 'none' * } * } * * // styled-components usage * const div = styled.div` * > ${textInputs('active')} { * border: none; * } * ` * * // CSS in JS Output * * 'input[type="color"]:active, * input[type="date"]:active, * input[type="datetime"]:active, * input[type="datetime-local"]:active, * input[type="email"]:active, * input[type="month"]:active, * input[type="number"]:active, * input[type="password"]:active, * input[type="search"]:active, * input[type="tel"]:active, * input[type="text"]:active, * input[type="time"]:active, * input[type="url"]:active, * input[type="week"]:active, * input:not([type]):active, * textarea:active': { * 'border': 'none' * } */ export default function textInputs(...states: Array): string { return statefulSelectors(states, template, stateMap) } ================================================ FILE: src/shorthands/transitions.js ================================================ // @flow import type { Styles } from '../types/style' import PolishedError from '../internalHelpers/_errors' /** * Accepts any number of transition values as parameters for creating a single transition statement. You may also pass an array of properties as the first parameter that you would like to apply the same transition values to (second parameter). * @example * // Styles as object usage * const styles = { * ...transitions('opacity 1.0s ease-in 0s', 'width 2.0s ease-in 2s'), * ...transitions(['color', 'background-color'], '2.0s ease-in 2s') * } * * // styled-components usage * const div = styled.div` * ${transitions('opacity 1.0s ease-in 0s', 'width 2.0s ease-in 2s')}; * ${transitions(['color', 'background-color'], '2.0s ease-in 2s'),}; * ` * * // CSS as JS Output * * div { * 'transition': 'opacity 1.0s ease-in 0s, width 2.0s ease-in 2s' * 'transition': 'color 2.0s ease-in 2s, background-color 2.0s ease-in 2s', * } */ export default function transitions(...properties: Array>): Styles { if (Array.isArray(properties[0]) && properties.length === 2) { const value = properties[1] if (typeof value !== 'string') { throw new PolishedError(61) } const transitionsString = properties[0] .map((property: string): string => `${property} ${value}`) .join(', ') return { transition: transitionsString, } } else { return { transition: properties.join(', '), } } } ================================================ FILE: src/types/color.js ================================================ // @flow // Note: we define properties with JSdoc since documentation.js doesn't recognize // exported types yet. See https://github.com/documentationjs/documentation/issues/680 /** * @property {boolean} AA * @property {boolean} AALarge * @property {boolean} AAA * @property {boolean} AAALarge */ export type ContrastScores = {| AA: boolean, AALarge: boolean, AAA: boolean, AAALarge: boolean, |} /** * @property {number} hue * @property {number} saturation * @property {number} lightness */ export type HslColor = {| hue: number, saturation: number, lightness: number, |} /** * @property {number} hue * @property {number} saturation * @property {number} lightness * @property {number} alpha */ export type HslaColor = {| hue: number, saturation: number, lightness: number, alpha: number, |} /** * @property {number} red * @property {number} green * @property {number} blue */ export type RgbColor = {| red: number, green: number, blue: number, |} /** * @property {number} red * @property {number} green * @property {number} blue * @property {number} alpha */ export type RgbaColor = {| red: number, green: number, blue: number, alpha: number, |} ================================================ FILE: src/types/fluidRangeConfiguration.js ================================================ // @flow // Note: we define properties with JSdoc since documentation.js doesn't recognize // exported types yet. See https://github.com/documentationjs/documentation/issues/680 /** * @property {string} prop * @property {string} fromSize * @property {string} toSize */ export type FluidRangeConfiguration = {| prop: string, fromSize: string | number, toSize: string | number, |} ================================================ FILE: src/types/fontFaceConfiguration.js ================================================ // @flow // Note: we define properties with JSdoc since documentation.js doesn't recognize // exported types yet. See https://github.com/documentationjs/documentation/issues/680 /** * @property {string} fontFamily * @property {?string} fontFilePath * @property {?string} fontStretch * @property {?string} fontStyle * @property {?string} fontVariant * @property {?string} fontWeight * @property {?Array} fileFormats * @property {?boolean} formatHint * @property {?Array | null} localFonts * @property {?string} unicodeRange * @property {?string} fontDisplay * @property {?string} fontVariationSettings * @property {?string} fontFeatureSettings */ export type FontFaceConfiguration = { fontFamily: string, fontFilePath?: string, fontStretch?: string, fontStyle?: string, fontVariant?: string, fontWeight?: string, fileFormats?: Array, formatHint?: boolean, localFonts?: Array | null, unicodeRange?: string, fontDisplay?: string, fontVariationSettings?: string, fontFeatureSettings?: string, } ================================================ FILE: src/types/interactionState.js ================================================ // @flow // Note: we define properties with JSdoc since documentation.js doesn't recognize // exported types yet. See https://github.com/documentationjs/documentation/issues/680 /** * @property {undefined, null, 'active', 'focus', 'hover'} InteractionState */ export type InteractionState = typeof undefined | null | 'active' | 'focus' | 'hover' ================================================ FILE: src/types/linearGradientConfiguration.js ================================================ // @flow // Note: we define properties with JSdoc since documentation.js doesn't recognize // exported types yet. See https://github.com/documentationjs/documentation/issues/680 /** * @property {Array} colorStops * @property {?string} toDirection * @property {?string} fallback */ export type LinearGradientConfiguration = { colorStops: Array, toDirection?: string, fallback?: string, } ================================================ FILE: src/types/modularScaleRatio.js ================================================ // @flow // Note: we define properties with JSdoc since documentation.js doesn't recognize // exported types yet. See https://github.com/documentationjs/documentation/issues/680 /** * @property {number, 'minorSecond', 'majorSecond', 'minorThird', 'majorThird', 'perfectFourth', 'augFourth', 'perfectFifth', 'minorSixth', 'goldenSection', 'majorSixth', 'minorSeventh', 'majorSeventh', 'octave', 'majorTenth', 'majorEleventh', 'majorTwelfth', 'doubleOctave'} ModularScaleRatio */ export type ModularScaleRatio = | number | 'minorSecond' | 'majorSecond' | 'minorThird' | 'majorThird' | 'perfectFourth' | 'augFourth' | 'perfectFifth' | 'minorSixth' | 'goldenSection' | 'majorSixth' | 'minorSeventh' | 'majorSeventh' | 'octave' | 'majorTenth' | 'majorEleventh' | 'majorTwelfth' | 'doubleOctave' ================================================ FILE: src/types/radialGradientConfiguration.js ================================================ // @flow // Note: we define properties with JSdoc since documentation.js doesn't recognize // exported types yet. See https://github.com/documentationjs/documentation/issues/680 /** * @property {Array} colorStops * @property {?string} extent * @property {?string} fallback * @property {?string} position * @property {?string} shape */ export type RadialGradientConfiguration = { colorStops: Array, extent?: string, fallback?: string, position?: string, shape?: string, } ================================================ FILE: src/types/sideKeyword.js ================================================ // @flow // Note: we define properties with JSdoc since documentation.js doesn't recognize // exported types yet. See https://github.com/documentationjs/documentation/issues/680 /** * @property {top, topRight, right, bottomRight, bottom, bottomLeft, left, topLeft} SideKeyword */ export type SideKeyword = | 'top' | 'topRight' | 'right' | 'bottomRight' | 'bottom' | 'bottomLeft' | 'left' | 'topLeft' ================================================ FILE: src/types/style.js ================================================ // @flow /** * @property { string | number | Styles } [ruleOrSelector] */ export type Styles = { [ruleOrSelector: string]: string | number | Styles, } ================================================ FILE: src/types/timingFunction.js ================================================ // @flow // Note: we define properties with JSdoc since documentation.js doesn't recognize // exported types yet. See https://github.com/documentationjs/documentation/issues/680 /** * @property { 'easeInBack', 'easeInCirc', 'easeInCubic', 'easeInExpo', 'easeInQuad', 'easeInQuart', 'easeInQuint', 'easeInSine', 'easeOutBack', 'easeOutCubic', 'easeOutCirc', 'easeOutExpo', 'easeOutQuad', 'easeOutQuart', 'easeOutQuint', 'easeOutSine', 'easeInOutBack', 'easeInOutCirc', 'easeInOutCubic', 'easeInOutExpo', 'easeInOutQuad', 'easeInOutQuart', 'easeInOutQuint', 'easeInOutSine' } TimingFunction */ export type TimingFunction = | 'easeInBack' | 'easeInCirc' | 'easeInCubic' | 'easeInExpo' | 'easeInQuad' | 'easeInQuart' | 'easeInQuint' | 'easeInSine' | 'easeOutBack' | 'easeOutCubic' | 'easeOutCirc' | 'easeOutExpo' | 'easeOutQuad' | 'easeOutQuart' | 'easeOutQuint' | 'easeOutSine' | 'easeInOutBack' | 'easeInOutCirc' | 'easeInOutCubic' | 'easeInOutExpo' | 'easeInOutQuad' | 'easeInOutQuart' | 'easeInOutQuint' | 'easeInOutSine' ================================================ FILE: src/types/triangleConfiguration.js ================================================ // @flow import type { SideKeyword } from './sideKeyword' // Note: we define properties with JSdoc since documentation.js doesn't recognize // exported types yet. See https://github.com/documentationjs/documentation/issues/680 /** * @property {number} backgroundColor * @property {number} foregroundColor * @property {number} height * @property {number} height * @property {number} height */ export type TriangleConfiguration = { backgroundColor?: string, foregroundColor: string, height: number | string, width: number | string, pointingDirection: SideKeyword, } ================================================ FILE: typescript-test.ts ================================================ import * as polished from './lib/index' import { ENGINE_METHOD_NONE } from 'constants' /* * Math */ const math = polished.math('20px + 10px') /* * Mixins */ let between: string = polished.between('20px', '100px', '400px', '1000px') between = polished.between('20px', '100px') let clearFix: object = polished.clearFix() clearFix = polished.clearFix('&') let cover: object = polished.cover() cover = polished.cover('100px') let ellipsis: object = polished.ellipsis() ellipsis = polished.ellipsis('250px') let fluidRange: object = polished.fluidRange( { prop: 'padding', fromSize: '20px', toSize: '100px', }, '400px', '1000px' ) fluidRange = polished.fluidRange( [ { prop: 'padding', fromSize: '20px', toSize: '100px', }, { prop: 'margin', fromSize: '5px', toSize: '25px', }, ], '400px', '1000px' ) fluidRange = polished.fluidRange({ prop: 'padding', fromSize: '20px', toSize: '100px', }) const fontFace: object = polished.fontFace({ fontFamily: 'Sans-Pro', fontFilePath: 'path/to/file', fontStretch: '', fontStyle: '', fontVariant: '', fontWeight: '', fileFormats: [''], localFonts: [''], unicodeRange: '', }) const hideText: object = polished.hideText() const hideVisually: object = polished.hideVisually() let hiDPI: string = polished.hiDPI() hiDPI = polished.hiDPI(1.5) const normalize: object = polished.normalize() const radialGradient: object = polished.radialGradient({ colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], extent: 'farthest-corner at 45px 45px', position: 'center', shape: 'ellipse', fallback: '', }) const linearGradient: object = polished.linearGradient({ colorStops: ['#00FFFF 0%', 'rgba(0, 0, 255, 0) 50%', '#0000FF 95%'], toDirection: 'to top right', fallback: '#FFF', }) let retinaImage: object = polished.retinaImage('') retinaImage = polished.retinaImage('', '') retinaImage = polished.retinaImage('', '', '') retinaImage = polished.retinaImage('', '', '', '') retinaImage = polished.retinaImage('', '', '', '', '') const timingFunctions = polished.timingFunctions('easeInBack') const triangle = polished.triangle({ backgroundColor: 'red', foregroundColor: 'red', pointingDirection: 'right', width: 100, height: 100, }) let wordWrap: object = polished.wordWrap() wordWrap = polished.wordWrap('') /* * Colors */ const adjustHue: string = polished.adjustHue(180, '#448') const complement: string = polished.complement('#448') const darken: string = polished.darken(0.2, '#FFCD64') const desaturate: string = polished.desaturate(0.2, '#CCCD64') const getContrast: number = polished.getContrast('#444', '#fff') const getLuminance: number = polished.getLuminance('#6564CDB3') const grayscale: string = polished.grayscale('#CCCD64') let hsl: string = polished.hsl(359, 0.75, 0.4) hsl = polished.hsl({ hue: 360, saturation: 0.75, lightness: 0.4 }) let hsla: string = polished.hsla(359, 0.75, 0.4, 0.7) hsla = polished.hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.7 }) const invert: string = polished.invert('#CCCD64') const lighten: string = polished.lighten(0.2, '#CCCD64') const meetsContrastGuidelines: object = polished.meetsContrastGuidelines('#444', '#fff') const mix: string = polished.mix(0.5, '#f00', '#00f') const opacify: string = polished.opacify(0.1, 'rgba(255, 255, 255, 0.9)') const parseToHsl = polished.parseToHsl('rgb(255, 0, 0)') const parseToRgb = polished.parseToRgb('rgb(255, 0, 0)') const readableColor = polished.readableColor('rgb(255,0,0)') let rgb: string = polished.rgb(255, 205, 100) rgb = polished.rgb({ red: 255, green: 205, blue: 100 }) let rgba: string = polished.rgba(255, 205, 100, 0.7) rgba = polished.rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 }) const saturate: string = polished.saturate(0.2, '#CCCD64') const setHue: string = polished.setHue(42, '#CCCD64') const setLightness: string = polished.setLightness(0.2, '#CCCD64') const setSaturation: string = polished.setSaturation(0.2, '#CCCD64') const shade: string = polished.shade(0.25, '#00f') const tint: string = polished.tint(0.25, '#00f') let toColorString: string = polished.toColorString({ red: 255, green: 205, blue: 100 }) toColorString = polished.toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 }) toColorString = polished.toColorString({ hue: 240, saturation: 1, lightness: 0.5 }) toColorString = polished.toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 }) const transparentize: string = polished.transparentize(0.1, '#fff') /* * Shorthands */ const animation: object = polished.animation(['rotate', 1, 'ease-in-out'], ['colorchange', '2s']) const backgroundImages: object = polished.backgroundImages( 'url("/image/background.jpg")', 'linear-gradient(red, green)' ) const backgrounds: object = polished.backgrounds( 'url("/image/background.jpg")', 'linear-gradient(red, green)', 'center no-repeat' ) const border: object = polished.border('top', '1px', 'solid', 'red') const borderColor: object = polished.borderColor('red', null, undefined, 'green') const borderRadius: object = polished.borderRadius('top', '5px') const borderStyle: object = polished.borderStyle('solid', null, undefined, 'dashed') const borderWidth: object = polished.borderWidth('12px', null, undefined, '24px') const buttons: string = polished.buttons(null, undefined, 'active') const margin: object = polished.margin('12px', null, undefined, '24px') const padding: object = polished.padding('12px', null, undefined, '24px') let position: object = polished.position(null) polished.position('absolute', '12px', null, undefined, '24px') position = polished.position(null, '12px', null, undefined, '24px') position = polished.position(undefined, '12px', null, undefined, '24px') let size: object = polished.size('') size = polished.size('', '') const textInputs: string = polished.textInputs('active', null, undefined) const transitions: object = polished.transitions('opacity 1.0s ease-in 0s', 'width 2.0s ease-in 2s') /* * Helpers */ const directionalProperty: object = polished.directionalProperty( 'padding', '12px', null, undefined, '24px' ) let em: string = polished.em('12px') em = polished.em(12) const getValueAndUnit: [number | string, string | void] = polished.getValueAndUnit('100px') let modularScale: string = polished.modularScale(2) modularScale = polished.modularScale(2, 2) modularScale = polished.modularScale(2, '') modularScale = polished.modularScale(2, 2, 5) modularScale = polished.modularScale(2, 2, 'minorSecond') let rem: string = polished.rem('12px') rem = polished.rem(12) const remToPx: string = polished.remToPx('1.6rem', '10px') const stripUnit: number | string = polished.stripUnit('100px')