├── .eslintignore ├── .eslintrc.js ├── .githooks └── pre-commit ├── .github ├── dependabot.yml ├── release-drafter.yml └── workflows │ ├── ci.yml │ ├── dependabot-merge.yml │ ├── release-drafter.yml │ └── release.yml ├── .gitignore ├── .prettierignore ├── .prettierrc.js ├── LICENSE ├── README.md ├── jest.config.js ├── package-lock.json ├── package.json ├── src ├── index.ts ├── plugin.ts ├── utils.ts └── visitors │ ├── array_expression.ts │ └── object_expression.ts ├── test ├── __fixtures__ │ ├── array │ │ ├── input.js │ │ └── output.js │ └── object │ │ ├── array │ │ ├── input.js │ │ └── output.js │ │ ├── backslash │ │ ├── input.js │ │ └── output.js │ │ ├── bigJson │ │ ├── input.js │ │ └── output.js │ │ ├── boolean │ │ ├── input.js │ │ └── output.js │ │ ├── invalid │ │ ├── input.js │ │ └── output.js │ │ ├── null │ │ ├── input.js │ │ └── output.js │ │ ├── number │ │ ├── input.js │ │ └── output.js │ │ ├── object │ │ ├── input.js │ │ └── output.js │ │ └── string │ │ ├── input.js │ │ └── output.js ├── array_expression.test.ts ├── e2e.test.ts └── object_expression.test.ts └── tsconfig.json /.eslintignore: -------------------------------------------------------------------------------- 1 | example 2 | test 3 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: '@typescript-eslint/parser', 3 | plugins: ['@typescript-eslint'], 4 | extends: [ 5 | 'eslint:recommended', 6 | 'plugin:@typescript-eslint/recommended', 7 | 'prettier', 8 | ], 9 | rules: { 10 | '@typescript-eslint/ban-ts-comment': 'off', 11 | '@typescript-eslint/ban-types': 'off', 12 | }, 13 | env: { 14 | node: true, 15 | }, 16 | } 17 | -------------------------------------------------------------------------------- /.githooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | npx --no-install lint-staged 3 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: 'npm' # See documentation for possible values 9 | directory: '/' # Location of package manifests 10 | schedule: 11 | interval: 'monthly' 12 | ignore: 13 | - dependency-name: '*' 14 | update-types: ['version-update:semver-patch'] 15 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name-template: 'Release v$RESOLVED_VERSION 🌈' 2 | tag-template: 'v$RESOLVED_VERSION' 3 | categories: 4 | - title: '🚀 Features' 5 | label: 'feature' 6 | - title: '🐛 Bug Fixes' 7 | label: 'bug' 8 | - title: '♻️ Refactor' 9 | label: 'refactor' 10 | - title: '📝 Documentation' 11 | label: 'documentation' 12 | - title: '🧰 Maintenance' 13 | labels: 14 | - 'chore' 15 | - 'dependencies' 16 | change-template: '- $TITLE @$AUTHOR (#$NUMBER)' 17 | change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. 18 | version-resolver: 19 | major: 20 | labels: 21 | - 'major' 22 | minor: 23 | labels: 24 | - 'minor' 25 | patch: 26 | labels: 27 | - 'patch' 28 | default: patch 29 | template: | 30 | ## Changes 31 | 32 | $CHANGES 33 | autolabeler: 34 | - label: feature 35 | branch: 36 | - '/^feat(ure)?[/-].+/' 37 | - label: bug 38 | branch: 39 | - '/^fix[/-].+/' 40 | - label: refactor 41 | branch: 42 | - '/(refactor|refactoring)[/-].+/' 43 | - label: documentation 44 | branch: 45 | - '/doc(s|umentation)[/-].+/' 46 | - label: chore 47 | branch: 48 | - '/^chore[/-].+/' 49 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | on: [push] 3 | jobs: 4 | build: 5 | runs-on: ubuntu-latest 6 | strategy: 7 | matrix: 8 | node-version: [14.x, 16.x] 9 | steps: 10 | - uses: actions/checkout@v2 11 | - name: Use Node.js ${{ matrix.node-version }} 12 | uses: actions/setup-node@v1 13 | with: 14 | node-version: ${{ matrix.node-version }} 15 | - name: Install dependencies 16 | run: npm ci 17 | - name: Lint 18 | run: npm run lint 19 | - name: Test 20 | run: npm run test 21 | env: 22 | CI: true 23 | - name: Build 24 | run: npm run build 25 | -------------------------------------------------------------------------------- /.github/workflows/dependabot-merge.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/automating-dependabot-with-github-actions 2 | name: Dependabot auto-merge 3 | on: pull_request 4 | 5 | permissions: 6 | pull-requests: write 7 | contents: write 8 | 9 | jobs: 10 | dependabot: 11 | runs-on: ubuntu-latest 12 | if: ${{ github.actor == 'dependabot[bot]' }} 13 | steps: 14 | - name: Dependabot metadata 15 | id: metadata 16 | uses: dependabot/fetch-metadata@v1.1.1 17 | with: 18 | github-token: '${{ secrets.GITHUB_TOKEN }}' 19 | - name: Enable auto-merge for Dependabot PRs 20 | if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}} 21 | run: gh pr merge --auto --merge "$PR_URL" 22 | env: 23 | PR_URL: ${{github.event.pull_request.html_url}} 24 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 25 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name: Release Drafter 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | # pull_request event is required only for autolabeler 8 | pull_request: 9 | # Only following types are handled by the action, but one can default to all as well 10 | types: [opened, reopened, synchronize] 11 | # pull_request_target event is required for autolabeler to support PRs from forks 12 | # pull_request_target: 13 | # types: [opened, reopened, synchronize] 14 | 15 | jobs: 16 | update_release_draft: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: release-drafter/release-drafter@v5 20 | env: 21 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 22 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: automatic release 2 | on: 3 | release: 4 | types: [published] 5 | jobs: 6 | release: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: checkout 10 | uses: actions/checkout@v1 11 | - name: setup Node 12 | uses: actions/setup-node@v1 13 | with: 14 | node-version: 16.x 15 | registry-url: 'https://registry.npmjs.org' 16 | - name: install dependencies 17 | run: npm ci 18 | - name: test 19 | run: npm run test 20 | - name: build 21 | run: npm run build 22 | - name: release 23 | run: npm publish 24 | env: 25 | NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | example 2 | test 3 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | printWidth: 80, 3 | tabWidth: 2, 4 | singleQuote: true, 5 | semi: false, 6 | } 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Daiki Nishikawa 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # babel-plugin-object-to-json-parse 🚀 2 | 3 | ![release](https://github.com/nissy-dev/babel-plugin-remove-react-fc-and-vfc/actions/workflows/release.yml/badge.svg) 4 | [![License: MIT](https://img.shields.io/github/license/nd-02110114/babel-plugin-object-to-json-parse.svg)](https://opensource.org/licenses/MIT) 5 | [![npm version](https://badge.fury.io/js/babel-plugin-object-to-json-parse.svg)](https://badge.fury.io/js/babel-plugin-object-to-json-parse) 6 | 7 | 8 | This repository is inspired by [this article](https://v8.dev/blog/cost-of-javascript-2019#json) 9 | 10 | > As long as the JSON string is only evaluated once, the JSON.parse approach is much faster compared to the JavaScript object literal, especially for cold loads. 11 | 12 | ## Object to JSON.parse 13 | 14 | This plugin converts from object literal to JSON.parse 15 | 16 | ```js 17 | // before 18 | const data = { foo: 42, bar: 1337 }; 19 | 20 | // after 21 | const data = JSON.parse('{"foo":42,"bar":1337}'); 22 | ``` 23 | 24 | ## How to use 25 | 26 | ### Install 27 | 28 | ```sh 29 | $ npm install babel-plugin-object-to-json-parse -D 30 | or 31 | $ yarn add babel-plugin-object-to-json-parse -D 32 | ``` 33 | 34 | ### setup `.babelrc` 35 | 36 | ```json 37 | { 38 | "plugins": ["object-to-json-parse"] 39 | } 40 | ``` 41 | 42 | 43 | ### Options 44 | #### `minJSONStringSize` (`number`, defaults to `1024`) 45 | 46 | The `minJSONStringSize` option will prevent the plugin from replacing an expression if the length of the JSON string given to `JSON.parse` is smaller than `minJSONStringSize`. For example, the following ensures all replacements have a string size of at least 1kb. 47 | 48 | ```json 49 | { 50 | "plugins": [ 51 | ["object-to-json-parse", { 52 | "minJSONStringSize": 1024 53 | }] 54 | ] 55 | } 56 | ``` 57 | 58 | ## Caution!! 59 | ### this plugin may not be production ready 60 | I just made this plugin for my understanding about AST and babel plugin. 61 | 62 | ### this plugin doesn't support partially JSON expression 63 | 64 | I decided not to support partially JSON expression like below. 65 | 66 | > Partially JSON expressions such as [notValid, {isValid:true}] ensuring {isValid:true} is transformed. 67 | 68 | ``` 69 | const data = { bar: invalid_object, foo: 'foo' } 70 | ↓ 71 | const data = { bar: invalid_object, JSON.parse('{"foo": "foo"}')} 72 | ``` 73 | 74 | This is because I think most large objects are not partially JSON expressions. **JSON.parse() is much faster in the case that object is 10 kB or larger. Converting small object to JSON.parse expression is not meaningful.** 75 | 76 | ### this plugin produces output that only works in modern environments (e.g. Node.js v10+) 77 | 78 | I don't care about some backwards compatibilities like [this issue](https://github.com/nd-02110114/babel-plugin-object-to-json-parse/issues/12). 79 | 80 | ## Development 81 | 82 | Any contributions are welcomed from everyone!! 83 | 84 | ### Setup 85 | 86 | ```sh 87 | $ git clone git@github.com:nissy-dev/babel-plugin-object-to-json-parse.git 88 | $ cd babel-plugin-object-to-json-parse 89 | $ yarn install 90 | ``` 91 | 92 | ### Tips 93 | 94 | ```sh 95 | // build 96 | $ yarn build 97 | 98 | // test 99 | $ yarn test 100 | ``` 101 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ 2 | module.exports = { 3 | preset: 'ts-jest', 4 | testEnvironment: 'node', 5 | } 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "babel-plugin-object-to-json-parse", 3 | "version": "0.2.3", 4 | "main": "dist/index.js", 5 | "scripts": { 6 | "prepare": "git config --local core.hooksPath .githooks", 7 | "build": "rm -rf dist/** && tsc", 8 | "fmt": "prettier --write \"src/**/*.ts\"", 9 | "lint": "eslint 'src/**/*.ts' --fix", 10 | "test": "find test/__fixtures__ -name *.js | xargs -L1 node && jest" 11 | }, 12 | "dependencies": { 13 | "@babel/core": "^7.20.5", 14 | "@babel/types": "^7.20.0" 15 | }, 16 | "devDependencies": { 17 | "@babel/cli": "^7.20.7", 18 | "@types/babel-core": "^6.25.7", 19 | "@types/babel-plugin-tester": "^9.0.5", 20 | "@types/babel-types": "^7.0.11", 21 | "@types/jest": "^28.1.2", 22 | "@typescript-eslint/eslint-plugin": "^5.45.0", 23 | "@typescript-eslint/parser": "^5.47.1", 24 | "babel-plugin-tester": "^10.1.0", 25 | "eslint": "^8.31.0", 26 | "eslint-config-prettier": "^8.5.0", 27 | "jest": "^28.1.1", 28 | "lint-staged": "^13.1.0", 29 | "prettier": "^2.8.0", 30 | "ts-jest": "^28.0.5", 31 | "typescript": "^4.9.3" 32 | }, 33 | "lint-staged": { 34 | "*.{js,jsx,ts,tsx}": [ 35 | "npm run lint", 36 | "npm run fmt" 37 | ] 38 | }, 39 | "author": "nd-02110114 ", 40 | "license": "MIT", 41 | "files": [ 42 | "dist", 43 | "LICENSE", 44 | "README.md" 45 | ] 46 | } 47 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import { buildPlugin } from './plugin' 2 | import { ObjectExpression } from './visitors/object_expression' 3 | import { ArrayExpression } from './visitors/array_expression' 4 | 5 | export = buildPlugin([ObjectExpression, ArrayExpression]) 6 | -------------------------------------------------------------------------------- /src/plugin.ts: -------------------------------------------------------------------------------- 1 | export function buildPlugin(visitors: Function[]) { 2 | const visitorMap: { [name: string]: Function } = {} 3 | for (const visitor of visitors) { 4 | visitorMap[visitor.name] = visitor 5 | } 6 | 7 | return () => ({ 8 | name: 'babel-plugin-object-to-json-parse', 9 | visitor: visitorMap, 10 | }) 11 | } 12 | -------------------------------------------------------------------------------- /src/utils.ts: -------------------------------------------------------------------------------- 1 | import { 2 | isArrayExpression, 3 | isBooleanLiteral, 4 | isObjectExpression, 5 | isIdentifier, 6 | isNullLiteral, 7 | isNumericLiteral, 8 | isUnaryExpression, 9 | isStringLiteral, 10 | ObjectExpression, 11 | ObjectProperty, 12 | isObjectProperty, 13 | NumericLiteral, 14 | StringLiteral, 15 | BooleanLiteral, 16 | ArrayExpression, 17 | NullLiteral, 18 | } from '@babel/types' 19 | 20 | type ValidJsonValue = 21 | | NumericLiteral 22 | | StringLiteral 23 | | BooleanLiteral 24 | | NullLiteral 25 | | ArrayExpression 26 | | ObjectExpression 27 | 28 | const isValidJsonValue = ( 29 | node: object | null | undefined 30 | ): node is ValidJsonValue => { 31 | if ( 32 | isNumericLiteral(node) || 33 | isStringLiteral(node) || 34 | isBooleanLiteral(node) || 35 | isNullLiteral(node) || 36 | isArrayExpression(node) || 37 | isObjectExpression(node) 38 | ) { 39 | return true 40 | } 41 | 42 | return false 43 | } 44 | 45 | type ObjectExpressionWithOnlyObjectProperties = Omit< 46 | ObjectExpression, 47 | 'properties' 48 | > & { 49 | properties: ObjectProperty[] 50 | } 51 | 52 | /** 53 | * Check whether given ObjectExpression consists of only `ObjectProperty`s as its properties. 54 | */ 55 | const isObjectExpressionWithOnlyObjectProperties = ( 56 | node: ObjectExpression 57 | ): node is ObjectExpressionWithOnlyObjectProperties => { 58 | return node.properties.every((property) => isObjectProperty(property)) 59 | } 60 | 61 | const isConvertibleObjectProperty = (properties: ObjectProperty[]) => { 62 | return properties.every((node) => !node.computed) 63 | } 64 | 65 | const createSafeStringForJsonParse = (value: string) => { 66 | if (/\\/.test(value)) { 67 | value = value.replace(/\\/g, '\\\\') 68 | } 69 | 70 | if (/"/.test(value)) { 71 | value = value.replace(/"/g, '\\"') 72 | } 73 | 74 | if (/[\t\f\r\n\b]/g.test(value)) { 75 | const codes = ['\f', '\r', '\n', '\t', '\b'] 76 | const replaceCodes = ['\\f', '\\r', '\\n', '\\t', '\\b'] 77 | for (let i = 0; i < codes.length; i++) { 78 | value = value.replace(new RegExp(codes[i], 'g'), replaceCodes[i]) 79 | } 80 | } 81 | 82 | return value 83 | } 84 | 85 | export function converter(node: object | null | undefined): unknown { 86 | // for negative number, ex) -10 87 | if (isUnaryExpression(node)) { 88 | const { operator, argument } = node 89 | if (operator === '-' && isNumericLiteral(argument)) { 90 | return -argument.value 91 | } 92 | } 93 | 94 | if (!isValidJsonValue(node)) { 95 | throw new Error('Invalid value is included.') 96 | } 97 | 98 | if (isStringLiteral(node)) { 99 | const { value } = node 100 | const safeValue = createSafeStringForJsonParse(value) 101 | return safeValue 102 | } 103 | 104 | if (isNullLiteral(node)) { 105 | return null 106 | } 107 | 108 | if (isArrayExpression(node)) { 109 | const { elements } = node 110 | return elements.map((node) => converter(node)) 111 | } 112 | 113 | if (isObjectExpression(node)) { 114 | if (!isObjectExpressionWithOnlyObjectProperties(node)) { 115 | throw new Error('Invalid syntax is included.') 116 | } 117 | 118 | const { properties } = node 119 | if (!isConvertibleObjectProperty(properties)) { 120 | throw new Error('Invalid syntax is included.') 121 | } 122 | 123 | return properties.reduce((acc, cur) => { 124 | let key = '' 125 | if (isIdentifier(cur.key)) { 126 | key = createSafeStringForJsonParse(cur.key.name) 127 | } else if (isStringLiteral(cur.key)) { 128 | key = createSafeStringForJsonParse(cur.key.value) 129 | } else if (isNumericLiteral(cur.key)) { 130 | // see issues#10 131 | if (!Number.isSafeInteger(cur.key.value)) { 132 | throw new Error('Invalid syntax is included.') 133 | } 134 | key = cur.key.value.toString() 135 | } else { 136 | throw new Error('Invalid syntax is included.') 137 | } 138 | 139 | const value = converter(cur.value) 140 | return { ...acc, [key]: value } 141 | }, {}) 142 | } 143 | 144 | return node.value 145 | } 146 | -------------------------------------------------------------------------------- /src/visitors/array_expression.ts: -------------------------------------------------------------------------------- 1 | import { ArrayExpression } from '@babel/types' 2 | import { NodePath } from '@babel/traverse' 3 | import { converter } from '../utils' 4 | 5 | interface PluginState { 6 | opts: { 7 | minJSONStringSize: number 8 | } 9 | } 10 | 11 | const DEFAULT_THRESHOLD = 1024 12 | 13 | export function ArrayExpression( 14 | path: NodePath, 15 | state: PluginState 16 | ): void { 17 | try { 18 | const obj = converter(path.node) 19 | const json = JSON.stringify(obj) 20 | // escaping for single quotes 21 | const escapedJson = json.replace(/'/g, "\\'") 22 | // it simply isn't worth it to convert into the AST objects that are too small. 23 | // so, this plugin only convert large objects by default. 24 | const { minJSONStringSize } = state.opts 25 | const threshold = minJSONStringSize ?? DEFAULT_THRESHOLD 26 | if (escapedJson.length < threshold) { 27 | return 28 | } 29 | path.replaceWithSourceString(`JSON.parse('${escapedJson}')`) 30 | } catch (e) { 31 | // disable error message 32 | // const { loc } = path.parent 33 | // const line = loc && loc.start.line 34 | // console.error( 35 | // `At ${line} line (start) : The object wasn't converted (${e.message})` 36 | // ) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/visitors/object_expression.ts: -------------------------------------------------------------------------------- 1 | import { ObjectExpression } from '@babel/types' 2 | import { NodePath } from '@babel/traverse' 3 | import { converter } from '../utils' 4 | 5 | interface PluginState { 6 | opts: { 7 | minJSONStringSize: number 8 | } 9 | } 10 | 11 | const DEFAULT_THRESHOLD = 1024 12 | 13 | export function ObjectExpression( 14 | path: NodePath, 15 | state: PluginState 16 | ): void { 17 | try { 18 | const obj = converter(path.node) 19 | const json = JSON.stringify(obj) 20 | // escaping for single quotes 21 | const escapedJson = json.replace(/'/g, "\\'") 22 | // it simply isn't worth it to convert into the AST objects that are too small. 23 | // so, this plugin only convert large objects by default. 24 | const { minJSONStringSize } = state.opts 25 | const threshold = minJSONStringSize ?? DEFAULT_THRESHOLD 26 | if (escapedJson.length < threshold) { 27 | return 28 | } 29 | path.replaceWithSourceString(`JSON.parse('${escapedJson}')`) 30 | } catch (e) { 31 | // disable error message 32 | // const { loc } = path.parent 33 | // const line = loc && loc.start.line 34 | // console.error( 35 | // `At ${line} line (start) : The object wasn't converted (${e.message})` 36 | // ) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /test/__fixtures__/array/input.js: -------------------------------------------------------------------------------- 1 | const test1 = [1, "two", {three: 3}] 2 | const test2 = [{one: 1}, {two: 2}, {three: 3}] 3 | const res = [test1, test2] 4 | -------------------------------------------------------------------------------- /test/__fixtures__/array/output.js: -------------------------------------------------------------------------------- 1 | const test1 = JSON.parse('[1,"two",{"three":3}]') 2 | const test2 = JSON.parse('[{"one":1},{"two":2},{"three":3}]') 3 | const res = [test1, test2] 4 | -------------------------------------------------------------------------------- /test/__fixtures__/object/array/input.js: -------------------------------------------------------------------------------- 1 | const test1 = { foo: [null, 10, 'foo'] } 2 | const test2 = { foo: [null, [10, 2], [{ foo: 'foo' }]] } 3 | const res = [test1, test2] 4 | -------------------------------------------------------------------------------- /test/__fixtures__/object/array/output.js: -------------------------------------------------------------------------------- 1 | const test1 = JSON.parse('{"foo":[null,10,"foo"]}') 2 | const test2 = JSON.parse('{"foo":[null,[10,2],[{"foo":"foo"}]]}') 3 | const res = [test1, test2] 4 | -------------------------------------------------------------------------------- /test/__fixtures__/object/backslash/input.js: -------------------------------------------------------------------------------- 1 | const test1 = { foo: "fo\'o" } 2 | const test2 = { foo: "fo\"o" } 3 | const test3 = { foo: 'fo\"o' } 4 | const test4 = { foo: 'fo\'o' } 5 | const test5 = { foo: 'fo\to' } 6 | const test6 = { foo: 'fo\fo' } 7 | const test7 = { foo: 'fo\ro' } 8 | const test8 = { foo: 'fo\no' } 9 | const test9 = { foo: 'fo\bo' } 10 | const test10 = { foo: 'fo\r\no' } 11 | const test11 = { foo: 'fo\o' } 12 | const test12 = { foo: 'fo\\o' } 13 | const test13 = { foo: 'fo\\\o' } 14 | const test14 = { foo: 'fo\\\\o' } 15 | const test15 = { foo: '\\\\' } 16 | const test16 = { "fo\'o": "foo" } 17 | const test17 = { "fo\"o": "foo" } 18 | const test18 = { 'fo\"o': "foo" } 19 | const test19 = { 'fo\'o': "foo" } 20 | const test20 = { 'fo\no': "foo" } 21 | const test21 = { 'fo\r\no': "foo" } 22 | const test22 = { 'fo\\o': "foo" } 23 | const test23 = { 'fo\\\o': "foo" } 24 | const test24 = { 'fo\\\\o': "foo" } 25 | const test25 = { foo: 'foo\nbar\nhoge' } 26 | const res = [ 27 | test1, 28 | test2, 29 | test3, 30 | test4, 31 | test5, 32 | test6, 33 | test7, 34 | test8, 35 | test9, 36 | test10, 37 | test11, 38 | test12, 39 | test13, 40 | test14, 41 | test15, 42 | test16, 43 | test17, 44 | test18, 45 | test19, 46 | test20, 47 | test21, 48 | test22, 49 | test23, 50 | test24, 51 | ] 52 | -------------------------------------------------------------------------------- /test/__fixtures__/object/backslash/output.js: -------------------------------------------------------------------------------- 1 | const test1 = JSON.parse('{"foo":"fo\'o"}') 2 | const test2 = JSON.parse('{"foo":"fo\\"o"}') 3 | const test3 = JSON.parse('{"foo":"fo\\"o"}') 4 | const test4 = JSON.parse('{"foo":"fo\'o"}') 5 | const test5 = JSON.parse('{"foo":"fo\\to"}') 6 | const test6 = JSON.parse('{"foo":"fo\\fo"}') 7 | const test7 = JSON.parse('{"foo":"fo\\ro"}') 8 | const test8 = JSON.parse('{"foo":"fo\\no"}') 9 | const test9 = JSON.parse('{"foo":"fo\\bo"}') 10 | const test10 = JSON.parse('{"foo":"fo\\r\\no"}') 11 | const test11 = JSON.parse('{"foo":"foo"}') 12 | const test12 = JSON.parse('{"foo":"fo\\\\o"}') 13 | const test13 = JSON.parse('{"foo":"fo\\\\o"}') 14 | const test14 = JSON.parse('{"foo":"fo\\\\\\\\o"}') 15 | const test15 = JSON.parse('{"foo":"\\\\\\\\"}') 16 | const test16 = JSON.parse('{"fo\'o":"foo"}') 17 | const test17 = JSON.parse('{"fo\\"o":"foo"}') 18 | const test18 = JSON.parse('{"fo\\"o":"foo"}') 19 | const test19 = JSON.parse('{"fo\'o":"foo"}') 20 | const test20 = JSON.parse('{"fo\\no":"foo"}') 21 | const test21 = JSON.parse('{"fo\\r\\no":"foo"}') 22 | const test22 = JSON.parse('{"fo\\\\o":"foo"}') 23 | const test23 = JSON.parse('{"fo\\\\o":"foo"}') 24 | const test24 = JSON.parse('{"fo\\\\\\\\o":"foo"}') 25 | const test25 = JSON.parse('{"foo":"foo\\nbar\\nhoge"}') 26 | const res = [ 27 | test1, 28 | test2, 29 | test3, 30 | test4, 31 | test5, 32 | test6, 33 | test7, 34 | test8, 35 | test9, 36 | test10, 37 | test11, 38 | test12, 39 | test13, 40 | test14, 41 | test15, 42 | test16, 43 | test17, 44 | test18, 45 | test19, 46 | test20, 47 | test21, 48 | test22, 49 | test23, 50 | test24, 51 | ] 52 | -------------------------------------------------------------------------------- /test/__fixtures__/object/bigJson/input.js: -------------------------------------------------------------------------------- 1 | const test1 = { foo: [ 2 | true, 3 | true, 4 | 561350504.2555985, 5 | "7d", 6 | 235234520, 7 | [ 8 | true, 9 | true, 10 | " ", 11 | false, 12 | true, 13 | -578676640.9131117, 14 | [ 15 | { 16 | "NGo,qgq}At'z[e:": { 17 | "6": 240511945, 18 | "'dvv_dH?XaW(1": -1406766025, 19 | "Yb6}+[w": false, 20 | "w@k": 389892459.8743901, 21 | "bv9w}Gr&ll hM6Iq3": 390736766.4197445, 22 | " ;0G>h`": { 23 | "D8&vWr{0": "<\\>j\\t/", 24 | "3 dg]:~JabNi8X/": "pD?//^*i,?", 25 | "^hV": "cn": [ 30 | "7;rhRUz.{", 31 | false, 32 | true, 33 | 1530888719, 34 | 1120778516, 35 | -1647662768, 36 | 304445393, 37 | -1497596467.0832853, 38 | "iI.", 39 | "OYN$", 40 | false, 41 | -1593498074, 42 | true, 43 | 453146011, 44 | "%bY;b", 45 | "'-g&Ka", 46 | "*Bf--[`:", 47 | ".7M)'B.`:`hr:qj*%|Ec", 48 | 1243560964, 49 | -1997537772, 50 | "QckV&JIAy\\KB(%*En;o", 51 | false, 52 | "=q)0.A;", 53 | true, 54 | false, 55 | 1573166938, 56 | true, 57 | 1543635473, 58 | "", 59 | "9M7nx7r-EIg", 60 | 1262197729.6865578, 61 | "`kVfUwtzr:`", 62 | "c0IJ'hE_DfXP]@{GI", 63 | "!27@CCD/saoS|", 64 | true, 65 | 1589700137, 66 | true, 67 | 765160334, 68 | "pOi-V9", 69 | false, 70 | -1748712066, 71 | "a", 72 | "-e^/8", 73 | false, 74 | 1850088276, 75 | false, 76 | -196899795.45365286, 77 | -1901544277.4441395, 78 | true, 79 | false, 80 | -1353811796.3557587, 81 | -1432006958.4480567, 82 | true, 83 | -1796137801.3344026, 84 | true, 85 | "jsn~u%1n_", 86 | false, 87 | true, 88 | ">b7.[{7>", 89 | -335632008.8146963, 90 | false, 91 | 1199349663.6169996, 92 | "]M']9.u$pfCbf{%", 93 | 316504118.3236742, 94 | true, 95 | "9;+2#4&", 96 | 1052714704, 97 | -784714438, 98 | true, 99 | true, 100 | "eIi'_J~_k", 101 | false, 102 | "VV,|{B6VNpMPuT>QLRC2", 103 | 234032585, 104 | true, 105 | 914188591.8104987, 106 | true, 107 | true, 108 | -224655723, 109 | "-EL@DI\\", 110 | "+!QA?E864pfY)G3N,z]\"", 111 | "r)xU#'k0*F", 112 | "D", 113 | "eR`^B", 114 | true, 115 | true, 116 | "si92", 117 | -358969458, 118 | -903794349.8937321, 119 | false, 120 | 544492028, 121 | -1922636042.698503, 122 | -2043162200.0970883, 123 | "WZ", 124 | 2053463600, 125 | -14979231.69707489, 126 | "%f5CE-iE/P4]", 127 | 2091698969, 128 | 1506285420, 129 | -156906540 130 | ], 131 | "wBV.3e9FhB*OEi:YFGKw": -2143258572, 132 | "#9M@\"": false, 133 | "._": "", 134 | "74$!iXY": "g>;": ">>.)u^tR0@W", 145 | "\\D dTbI{5cl;eT": "Vz39icdKr", 146 | "K|a": "^5NOBEw{fK04A%8/h;j", 147 | "vIXP1Smp": false, 148 | " ZgMRcK]": ",b", 149 | ";/[": false, 150 | "D+kP+h6WM": 558954911, 151 | "zFD": 720965317, 152 | "": true, 153 | ">Lmn,cb'ky;J$'#F7": 1733198610, 154 | "JCM": 2112782886, 155 | "^iqKLay;C+\"bSZMoAht": "|.6tW@^t #z4dx$?": false, 159 | "F7sF": true, 160 | "_": true, 161 | "}Ez&2 ": 658548768, 162 | "&5V9": "8mh&I(QjNu", 163 | "*": 2114294081, 164 | "WA-rA": 1278584296.9972577, 165 | "(`)|E|&Tq2SF[|L.": false, 166 | ">": "KC;BC{Hol", 167 | "3md~7X\"{3\"h`:^[uM": "2Ne)XnKq\"7_![2Z0jg", 168 | "PbO\"9,j*F]|X=h[8NbwO": 862015237.5454164, 169 | "iR~R/": "`2/hRy=o-/i", 171 | "?*[W?{oXFk&": "AXJ'i", 172 | "4Def)kh": true, 173 | "XrSn44": true, 174 | "]Y3W<5vYrMS&Ny}m@+]": 368693572.922771, 175 | "`&,7DC*%e.k}T5>Z": false, 176 | "T,y1V": true, 177 | "2,Y@%asKr": 548402858, 178 | "bg46Y&q0oFXDf#": "l-3!:#eU`g#tp", 179 | "[O)IKAIz)>uJsDt$": -130680598, 180 | "fvFot(;l": false, 181 | "]_ER": "|L+tk|e|5)2oat\\", 182 | "27ZRgC|MBx!;oLsf*wq": "]/[2sYj76!eF{6X%0", 183 | "k[Kw,mV4vL": true, 184 | "^+(gqQyiPB": "L5fH9p#>8E 0r": 699088332, 187 | "qiJ\"`C`_gH+d$![sz": -1093537096.6177077, 188 | "ZS7s": "JR&DKY$_dZ!", 189 | "_\"L /p0": true, 190 | "bzRb-nf[#:V": "Qg8Na\\R", 197 | "b0gAeEWg)MDG": true, 198 | "fa*jgR ": true, 200 | "~O~-t": 1496956978, 201 | "4?KCYT": true, 202 | "len0:1;~-Df}>9!bo": -1272232599, 203 | "2y": -704984200.6987972, 204 | "\"0Sm'(": "F78)o?tZ9N$Z", 205 | "Z": " {[|$ro/\"61k2mO\"", 206 | "#": -320016052.6330447, 207 | " ]Fy}@F'l1pan.F38YW": 708293257, 208 | "APJX3[^#bbw": "5V$N`u-^_v$E(Lrl,$Pp", 209 | "7@_#\"A0EM": true, 216 | "LG:": true, 217 | "4`bE&R,Ho4&{": 1129148381.2492828, 218 | "5c -q.cl(/ eI#": true, 219 | ".|f9": "8Yu[^EmPT{Yu|=}", 220 | "So7-Op.^-e5J8B;": "u]]$xX($D>7", 221 | "aV0qI qZ5$,8R": "xoQu+[{0:J<\\y? %\"", 222 | "luj}GC|kz@(~,": "DI", 223 | "bp=pe@_": "E%gTUWed1Q3`b@wM", 224 | "x2 ", 227 | true, 228 | true, 229 | "^A-RO2QJ# =mHFh#j", 230 | true, 231 | -176685716.98329973, 232 | "y", 233 | "+k[e;lIk[JgtA98(4", 234 | true, 235 | "", 236 | false, 237 | "Rtu^B`i!kD)dO0)pxR:p", 238 | false, 239 | 1629867837, 240 | 31368788.0181818, 241 | 2070122836, 242 | "=dG.Jixn [ToIg@!Sf", 243 | "BWIKf8)kB2QjRgMJ'x$-", 244 | false, 245 | "LN5s85'cZ19xaw=", 246 | false, 247 | false, 248 | "pO>fA[93M\\t/lXh^Y~v", 249 | -1609199236, 250 | ";hGRF[$[3p>[}", 251 | "Q~8G.c5K1te7", 252 | false, 253 | 1411568188, 254 | -1265409008, 255 | true, 256 | -170555892.81859922, 257 | -1080383213, 258 | ".E", 259 | 1856430764.1774936, 260 | false, 261 | "5I F2;g9~+`_]", 262 | "W/^", 263 | -974472471, 264 | false, 265 | false, 266 | 1042718423, 267 | 929107938, 268 | -445207720.1859951, 269 | "V5<.Q[fD8[a=je$", 270 | false, 271 | 606439341, 272 | "9](_L~F\\xWAF(\"]:]", 273 | -390073752.0931673, 274 | false, 275 | true, 276 | false, 277 | "1/,", 278 | "eR[uN$j}", 279 | 702991713.3690443, 280 | true, 281 | "sXao8\\}Z2X~TblyT1", 282 | 1659468400, 283 | 1866065233, 284 | true, 285 | true, 286 | true, 287 | -711217809.0172701, 288 | "iN&.Z>8~Y4&_?jPy`z", 289 | true, 290 | true, 291 | "]L%", 292 | true, 293 | " ,;a>>>9!Jpq[W8~x", 294 | "", 295 | true, 296 | false, 297 | -1246966393.6908746, 298 | "4T=K:\"pS#A3r#oeJ{:H", 299 | "/QS5(6|Fjeno$4/g", 300 | -1138502425.3491654, 301 | false, 302 | ".?oQ$:m", 303 | -389276439, 304 | "s`^DmvGP", 305 | -477880744.1529622, 306 | 2093621902.80129, 307 | -1058153216, 308 | "", 309 | 22067803.88789463, 310 | 719930658.4701653, 311 | false, 312 | "qY $XXc}L;u/2", 313 | 304107476, 314 | "v)lZ-8T}]O5QV^~moes2", 315 | true, 316 | "Q-C{Q2", 317 | -383648038, 318 | true, 319 | 682870698, 320 | false, 321 | "C#I1T-( .c0", 327 | "96f1eL_yN$\\KUh1$fW": false, 338 | "@]Fk8sJ%AGM2": "yJwQtg;(", 339 | "Mo[\\EEm2eit<@^;c.rIf8D=": -1600329983, 352 | "4VC?&rR\\Ej": -530235487, 353 | "I.@mGiTSdwQ8DM f-Q": -441377950.33757067, 354 | "v": "*Fu|v#", 355 | "Bp": ",p%V>ItE0:c.VV!1>}.^", 356 | "lk=hoYIdFuhHW": false, 357 | " SgM-R!*]bTcA%S5,(:": true, 358 | "/\\jsjo?d9*%A1<": true, 359 | "O ~UIasd": "*[8LH2f*AF*omf!v", 360 | "QrUgza6AJqrS{l;~+kK": "7=}", 361 | "u,THiJ,+:Z\\ON=dV": "9", 362 | "<": true, 363 | "c": 263275248, 364 | "sh1q": -876630268.3314719, 365 | "]EJ&>:J=l+!&": true, 366 | "ho02Rp&,O": true, 367 | "9uy-l:gnR": 458927933.9498315, 368 | "?A": "5?ZZ,\\0]", 369 | "Ei.3]nf)Br4s>": false, 370 | "9!bdG{=5HFMA>E,3": "d", 371 | "yb$AmH[Sg8r0}(ZjjL": true, 372 | "H0J>ipSyf}h\\": -361530212, 373 | ".4rU[jU4+FEdim_4AL": true, 374 | "pwT10M_": "zVW{.lh+", 375 | "+Don>~L": false, 378 | "$SDjY]_TPnCH4ent": 300481053.49128485, 379 | "Z1pFqt\"D$[dg2hmhI:": "xhr{%Z", 380 | "MokcDx YA": true, 381 | " )Ryo": -887027596.3720288, 382 | "'Y7": false, 383 | "A$Te1?X[X/N77%7NHnZ": false, 384 | "G75m6LL[+\\Fd>5z3": false, 385 | "nRV)": "[j+Nrq9A7y'S>?x", 386 | "8*&/+3P~Jag": -1657631324.98392, 387 | "`": -730692200, 388 | "Zlb)x^[dfP{J%l:[@-": "T-)qNz cJ2Uzxp,[@", 389 | "s6b;R#5Wlu$hPjMBv@%": "PeLY/-\"+/x-`", 390 | "LBn~7Lo;l!PY'fL}": "Vz_PL a49#ZZ'H,", 391 | "JQpDyK": 2077707318, 392 | "AM3]~dzex": "+_@)\"": true, 427 | "l`HR.fFXu>/T": -1538643139, 428 | "DB(\"q|`L`L0>9QDvoO;": -592045514.7906284, 429 | "}0(": "F>R8Y;,tZuap!Q", 430 | "": "#V,m4ZA", 431 | "Lg:s*)2HN,YYq>I3:Q=;": true, 432 | "aR=m%R[7+[W ?+LkjlC2": "-f;", 433 | ":": "^|[y>i/&H%d>", 447 | "BOi": -287062272, 448 | "2+e(y$W>IQ4g#": true, 449 | "{KaZ?B#QP^Q": 541481264.255157, 450 | "F`yT": -295204788.8712683, 451 | "teeFh_0C": true, 452 | ",F[CnaOXAQ": "[XVd", 453 | "O!D1jKvLR?F=@kw": 1637882721, 454 | "9Q": true, 455 | "*A+P/'}5^Sb^CH": "i{\"4c]Li", 456 | "%\\yCJ7F+&|Rn": 1212304384, 462 | "$wF;j,~;l7W}QUd)Q`": "7=}V!5b\"/`D7b", 463 | "-u}TV4B": "Hs:w,(>+U'!Nm", 464 | "*Zf%d/n": true, 465 | "|r+;Ng}ygKf": "pV-MB+RiKQZV\"^`8Qct", 468 | "?qBq3\".O^( 7w!": -1290719451, 469 | "`@s*sg.kw%8aU@VBc0": "*su9KRqjIAlS", 470 | "xm,Q": false, 471 | "$ebbb(-4E'^l=#hnc": -610985675.8739867, 472 | "S\\nl": false, 473 | " B@Az/$Vm&tEtO@y\"$5": true, 474 | "*A6~\"": true, 475 | "KJ": "%WDR\" er=i_", 476 | "}hDv wb'!T": 943989097.1357074, 484 | "U CTLq": false, 485 | "F": false, 486 | "n[M|*%!*H*F3#]9o+": 660976422.0376172, 487 | "4U+#Bv;GBAG{s!qh`": false, 488 | ";.": 28976961.07870245, 489 | "T_*9\\rH=aDenmW7": "U<", 490 | "TeIPy{wc?Ke..R$t*3JV": 1667096028.759397, 491 | "d)^^B_|%L\"2E'yY?'~]": "", 492 | "W-!": false, 493 | "mA]": true, 494 | "`U{m'cJUdR#": "o%NIyjyiA)R&i`W82(e", 495 | "in)mU'": false, 496 | "c": "FoYsJ=W7uO1tC-?'wlLW", 497 | "{r>;Pj]Qsd_": false, 498 | "Nx<~U4{{lpD]e?dim\\V": false, 499 | "&Ae`)ep*f": 1353998914, 500 | "V#&@JjR=qV4](@lj": "AAKVmzksdm", 501 | "ER t", 515 | "\\x.Zm0#h;W!E!>KbP": "L2jt6otZ&:j", 516 | "RB_Fl{": -1444661754, 517 | "e},WL^92eVT9n%": false, 518 | "yO&|7": true, 519 | "": "B1euCiiMZWt.>1JLz;.", 520 | "4IO7#$Txf#ysVTlRtD|j": false, 521 | "rL@L": 761559906.800487, 522 | "5.CSUutvK<{r6\\QU/": "0(aAy(H-$N=X.f", 523 | "c_Am#T\\bCF8v": true, 524 | "aR)64{tzXN1;50gWkXP": "", 525 | "lh^2{i-l\"1": 257240412.69731808, 526 | "t]H6K)": -1521752699.1175818, 527 | "o$~Y", 530 | "B,7k;l%jXFde: XjmU": "(k41S,GBA*:45l", 531 | "jjxI]l%;@KYIw;q=[w": ">'#|", 532 | "I)b": 1984201456.3032427, 533 | "/O!^TXJ": 325633214, 534 | "L": 614021757.508666, 535 | "V' Hu": true, 536 | "h89j)*RH(x~r": false, 537 | "v L\"b;K(1[u": "a{WeZ\\OSBY:@Y}", 538 | "Zxa;HEke\"I.[s^||1": "kU5)(DK+wUG;", 555 | "|rPyO}2c": -1116909939.2247696, 556 | "fqU$\".SS#PI ": -1966571397, 557 | "],Ek;/EByV9\"g=|": false, 558 | "OhQ\\1T": 1318533823.3176675, 559 | "_51shX;lhI_7:3c..:R": false, 574 | "aF&=": ", )k", 575 | "\\:58;AlJa": false, 576 | "1@4cTzMlk": 1681268726.513681, 577 | ".n:] nCqy7\\?iU": true, 578 | "\"+EtP308}j": "Nw", 579 | "eSQ?": 303399774.68077993, 580 | "r'R/9{T39Q2|1KZnn;": "~", 581 | "e]`3JR0cfx.G[,#l": "*6jlg||62f')}pO.", 582 | "wG5pw+K^HEEI.": false, 583 | "X`*p5\"%vtOhsBIg": "e", 584 | "X": "4]S`.u+O&Ak_2y'9j*", 585 | "u:e2mr7y'swqAn&k1": false, 586 | "-+Anc0Ab(C7)": -1094337852.8687897, 587 | "uuJGt>ajL": false, 588 | "gHaD:s:": "n/Asq@L<(@p`F", 589 | ":9m%.j7tq!KU]%yP~PR": -1730191736.9091058, 590 | "$PLmf7U*pD}-q2w": -894383944, 591 | "w4+dJ# NHtu\\Eik|h": -648825645, 592 | "Sb_YSu2": false, 593 | "Qk": "+M9U@ebg1vc-eB#S'L", 594 | "c# ($:|X,L9^lWS.Zv": "Tp0>..<", 595 | "`['[8": -591939664, 596 | "xgS{Lq)Xq": -596886697.5499353, 597 | "@r/ko": -2050373221.7872305, 598 | "BS6v`lZcA;%tq5*,f!:": "P#a(,\\.>,n=E+C", 599 | "2@:?4-$NEH7": false, 600 | "2*fScm)bD~": true, 601 | "Xl": false 602 | }, 603 | "QsUN+aJ~Nf-E(": "<0c.h*", 604 | "I}ta": false, 605 | "<:eG8^2@z\"l`cOU7^6w`": 1213179192, 606 | "u(w*1a j": 559227709.2696457, 607 | "qJFT9:aIh}NK(Pw": 109877510.17345953, 608 | "": "V|s1i.[gM", 609 | "_[90n": "y", 610 | "CuQT7gf%5-\\B0R7ccvC": "CttKs6{V6TU", 618 | "QWbiIW": 1903494252, 619 | "25j-}9Gx|y}": 642804069.2403603, 620 | "<|": true, 621 | "cnM*:x?2W FA(Em`$s": -366725094.16807413, 622 | "([%-k)m-Zd&?'a": true, 623 | "\\Z\"F3@N0": true, 624 | "6_c##w4JU:447WKZ@aO": false, 625 | "MA#>aBHE#3": "SA49+hM\"rd7d_tsk.", 626 | "x},]JyWz": -2116616116, 627 | "yVA|X&$(0 U1fpc": -1594696869, 628 | "b\">i';=Y4a": 1229737818, 629 | "}&p|+YPg&&MoD#": -1207399959.0754328, 630 | "X;=L}!SiX|": -1833836174, 631 | "PC65,": true, 632 | "$": false, 633 | "}Xn": true, 634 | "J|W!P`z": -1090694218.6283555, 635 | "c<^jv!uRT+LE`": "|[=I4LGgB,An/'4", 636 | "LH}{@": 1604481070, 637 | "Vm#'3Yn'R]Uha$": 897839121.5230489, 638 | "aRA": "}T<_|\"+|gg#39ci", 639 | "~]|S'W:zmjT=`NlLh": false, 640 | "Jv=#\" qXee0I5g+BU9,U": false, 641 | "fSl`^XquBfeg?&K%": 1173975312, 642 | "Uu{Hmt<}4\\w'kK!": 35508288.723332405, 643 | "L?Z_4g*%(I%:": 480876245, 644 | "T3oloK": "1/P +/Y9*PYSE", 645 | "ssSlkej4@v\"S": true, 646 | "lHAP|\\YR;}": 418326778, 647 | "..G'": "D3%!vWvr", 648 | "fm": "#}", 649 | "c|*w+4\"qcEm\"ci6hRpu": ">J\\ ^D#bT\\wST6w'", 650 | "v0zS": "+%R/0$dO", 651 | "~_6]^|H": true, 652 | "#^Th.eQv^UZ": false, 653 | "36CKP&*\"a^1bGEw1": true, 673 | "4r]cl;f": -1086475144, 674 | "<\"s^OFhs#(#": -812277801, 675 | "r}^n|==[8": "lmI9T", 676 | "YXX,9O{_rW0V": 1780540820.07868, 677 | "u}J": true, 678 | "iDj3).@`rKP>@G'": false, 679 | "Pci'": true, 680 | "L[!": "ATW&%6g}", 681 | "/CB": true, 682 | "qh": ")^fCc_ar", 683 | ".": true, 684 | "6:e[628|}": ">M\\AT7tB$Az^Fz", 685 | "FCaejE?N>T)rc": -715265075, 686 | "Lx5\\?7->Hq{^D ": -1416616840, 687 | ",v^x.Nk~J.a=3/'\"": -1805919112, 688 | "9hSUc(]": "Ofo}eM|G]~b6pB%", 689 | "o9CFjqdMh\"#A;:{Z>MG": 1003067643, 690 | "YmCWv~]h[RePGsw[>9": "W-F%W Qf*?Q1\\x>*s*k", 691 | "_lRGLz6{0g*QFZ'8U": false, 692 | "0_pdZ6)": 1948818550, 693 | "+ArfABtq6C{7pIG": -1662127134.6857338, 694 | "?H8+8ov+x;+IDiS": "`", 697 | "~AL": false 698 | }, 699 | true, 700 | 1945154188.3023653, 701 | "d5Tw", 702 | "V |`L KI@Y+Zbr<}W", 703 | -492408046.1538105, 704 | "aQ0X{)_h'Y2V@n~N", 705 | -2006246427.5010772, 706 | false, 707 | 217740087.2728815, 708 | 2030846122.8145251, 709 | true, 710 | false, 711 | ".k4g>:DbJ", 712 | "B42n(d[F?isOjhH?0T", 713 | "~0#uRR", 714 | -2103807195, 715 | "00c", 716 | false, 717 | "IWBF#YY/J<$jby&", 718 | false, 719 | 290287126.3573084, 720 | 423533895.0985074, 721 | ":8X{[M", 722 | ".W#_&~\\?uiGzM3yV", 723 | false, 724 | true, 725 | true, 726 | 560708398.7040653, 727 | "eZ4o8G=]8y", 728 | "$xN\\z,vl{`ek)x4 NV_%", 755 | true, 756 | 1334425478.7038083, 757 | true, 758 | 1273737518, 759 | -1139956950, 760 | true, 761 | false, 762 | -305110228.86200047, 763 | true, 764 | false, 765 | true, 766 | ";0>\\h)$y%+oJDz&", 767 | "U[(k", 768 | "Wo?xjb,", 769 | 1905854631.2208996, 770 | -1817388281, 771 | false, 772 | "g!~95\\dbh)E#w4+U", 773 | "J;c*Cj`;Ze-u4K5", 774 | true, 775 | 185245383, 776 | false, 777 | 2056813945.6557035, 778 | -1058652204, 779 | ".,muh`P[fcSH", 780 | true, 781 | "f[m-Z2k^j:G#q", 782 | "#", 783 | 705731354.5356464, 784 | -935112122.5473485, 785 | -430631958, 786 | false, 787 | -959573513, 788 | " /s}%#1P]4^[RK:\"v!K", 789 | 1301137731, 790 | 1174006910, 791 | -270313681.3349371, 792 | "H}ggX]mx{|{Tv9?SD-", 793 | -1970153752.8408484, 794 | "@d\\bR1y~sl6a{", 795 | "RhUG", 796 | "QqJ", 797 | -1495535652.311458 798 | ], 799 | 1678644723.1369023, 800 | false, 801 | "cWO|", 840 | false, 841 | "*R$z'cjzuHsMRLxf$.TZ", 842 | true, 843 | false, 844 | 1908795491, 845 | "@,Tog)", 846 | true, 847 | false, 848 | 707071638, 849 | "(", 850 | "Ut'", 887 | true, 888 | true, 889 | -323507773, 890 | "fmK_$Q", 891 | "\\;1 " 892 | ], 893 | true, 894 | -1152664142.459044, 895 | "a\"Y", 896 | false, 897 | 1751463356.8547907, 898 | false, 899 | true, 900 | -1906716298, 901 | "El}W", 902 | "iK`*[O", 903 | false, 904 | "|]Fk#'HO%g2tB|", 905 | "qj:pL", 906 | "2a)CH{", 907 | "f_}aR$J$`'pw", 908 | -1120211376, 909 | 1219480024.8352237, 910 | 1621102569.9027991, 911 | true, 912 | false, 913 | 55180274, 914 | "4\\gj] C", 915 | -387822363, 916 | 1565613270.8767428, 917 | 1525598339.7768378, 918 | 51097395.26150608, 919 | 1322498942, 920 | false, 921 | false, 922 | false, 923 | false, 924 | false, 925 | "1&JM1bx;>Bt", 926 | -1073466798.2114654, 927 | 291640574, 928 | true, 929 | false, 930 | true, 931 | false, 932 | false, 933 | "j{4lI_", 934 | true, 935 | ":M'kcG'\\y-RM&", 936 | false, 937 | -761521384.1747842, 938 | false, 939 | -1250866618, 940 | "A&e.", 941 | false, 942 | "/CZf", 943 | "ayT*> t~IQyvIYXcz)]n", 944 | -352038507, 945 | false, 946 | -396718250.9928031, 947 | 1524550515, 948 | 1615855857.4566226, 949 | "", 950 | false, 951 | -1003493136, 952 | true, 953 | "", 954 | "*gCG<7w6KM", 955 | ")f34+>,So^w^7ao", 956 | -1359249495.6085668, 957 | -1809203961, 958 | "6b'n3", 959 | "l)Sh", 960 | ";NM+:)", 961 | true, 962 | "2~?o>*}m@:9", 963 | 1325629574.6127772, 964 | true, 965 | false, 966 | true, 967 | false, 968 | "T+5m8xkQKC#:$V1h`":{"D8&vWr{0":"<\\\\>j\\\\t/","3 dg]:~JabNi8X/":"pD?//^*i,?","^hV":"cn":["7;rhRUz.{",false,true,1530888719,1120778516,-1647662768,304445393,-1497596467.0832853,"iI.","OYN$",false,-1593498074,true,453146011,"%bY;b","\'-g&Ka","*Bf--[`:",".7M)\'B.`:`hr:qj*%|Ec",1243560964,-1997537772,"QckV&JIAy\\\\KB(%*En;o",false,"=q)0.A;",true,false,1573166938,true,1543635473,"","9M7nx7r-EIg",1262197729.6865578,"`kVfUwtzr:`","c0IJ\'hE_DfXP]@{GI","!27@CCD/saoS|",true,1589700137,true,765160334,"pOi-V9",false,-1748712066,"a","-e^/8",false,1850088276,false,-196899795.45365286,-1901544277.4441395,true,false,-1353811796.3557587,-1432006958.4480567,true,-1796137801.3344026,true,"jsn~u%1n_",false,true,">b7.[{7>",-335632008.8146963,false,1199349663.6169996,"]M\']9.u$pfCbf{%",316504118.3236742,true,"9;+2#4&",1052714704,-784714438,true,true,"eIi\'_J~_k",false,"VV,|{B6VNpMPuT>QLRC2",234032585,true,914188591.8104987,true,true,-224655723,"-EL@DI\\\\","+!QA?E864pfY)G3N,z]\\"","r)xU#\'k0*F","D","eR`^B",true,true,"si92",-358969458,-903794349.8937321,false,544492028,-1922636042.698503,-2043162200.0970883,"WZ",2053463600,-14979231.69707489,"%f5CE-iE/P4]",2091698969,1506285420,-156906540],"wBV.3e9FhB*OEi:YFGKw":-2143258572,"#9M@\\"":false,"._":"","74$!iXY":"g>;":">>.)u^tR0@W","\\\\D dTbI{5cl;eT":"Vz39icdKr","K|a":"^5NOBEw{fK04A%8/h;j","vIXP1Smp":false," ZgMRcK]":",b",";/[":false,"D+kP+h6WM":558954911,"zFD":720965317,"":true,">Lmn,cb\'ky;J$\'#F7":1733198610,"JCM":2112782886,"^iqKLay;C+\\"bSZMoAht":"|.6tW@^t #z4dx$?":false,"F7sF":true,"_":true,"}Ez&2 ":658548768,"&5V9":"8mh&I(QjNu","*":2114294081,"WA-rA":1278584296.9972577,"(`)|E|&Tq2SF[|L.":false,">":"KC;BC{Hol","3md~7X\\"{3\\"h`:^[uM":"2Ne)XnKq\\"7_![2Z0jg","PbO\\"9,j*F]|X=h[8NbwO":862015237.5454164,"iR~R/":"`2/hRy=o-/i","?*[W?{oXFk&":"AXJ\'i","4Def)kh":true,"XrSn44":true,"]Y3W<5vYrMS&Ny}m@+]":368693572.922771,"`&,7DC*%e.k}T5>Z":false,"T,y1V":true,"2,Y@%asKr":548402858,"bg46Y&q0oFXDf#":"l-3!:#eU`g#tp","[O)IKAIz)>uJsDt$":-130680598,"fvFot(;l":false,"]_ER":"|L+tk|e|5)2oat\\\\","27ZRgC|MBx!;oLsf*wq":"]/[2sYj76!eF{6X%0","k[Kw,mV4vL":true,"^+(gqQyiPB":"L5fH9p#>8E 0r":699088332,"qiJ\\"`C`_gH+d$![sz":-1093537096.6177077,"ZS7s":"JR&DKY$_dZ!","_\\"L /p0":true,"bzRb-nf[#:V":"Qg8Na\\\\R","b0gAeEWg)MDG":true,"fa*jgR ":true,"~O~-t":1496956978,"4?KCYT":true,"len0:1;~-Df}>9!bo":-1272232599,"2y":-704984200.6987972,"\\"0Sm\'(":"F78)o?tZ9N$Z","Z":" {[|$ro/\\"61k2mO\\"","#":-320016052.6330447," ]Fy}@F\'l1pan.F38YW":708293257,"APJX3[^#bbw":"5V$N`u-^_v$E(Lrl,$Pp","7@_#\\"A0EM":true,"LG:":true,"4`bE&R,Ho4&{":1129148381.2492828,"5c -q.cl(/ eI#":true,".|f9":"8Yu[^EmPT{Yu|=}","So7-Op.^-e5J8B;":"u]]$xX($D>7","aV0qI qZ5$,8R":"xoQu+[{0:J<\\\\y? %\\"","luj}GC|kz@(~,":"DI","bp=pe@_":"E%gTUWed1Q3`b@wM","x2 ",true,true,"^A-RO2QJ# =mHFh#j",true,-176685716.98329973,"y","+k[e;lIk[JgtA98(4",true,"",false,"Rtu^B`i!kD)dO0)pxR:p",false,1629867837,31368788.0181818,2070122836,"=dG.Jixn [ToIg@!Sf","BWIKf8)kB2QjRgMJ\'x$-",false,"LN5s85\'cZ19xaw=",false,false,"pO>fA[93M\\\\t/lXh^Y~v",-1609199236,";hGRF[$[3p>[}","Q~8G.c5K1te7",false,1411568188,-1265409008,true,-170555892.81859922,-1080383213,".E",1856430764.1774936,false,"5I F2;g9~+`_]","W/^",-974472471,false,false,1042718423,929107938,-445207720.1859951,"V5<.Q[fD8[a=je$",false,606439341,"9](_L~F\\\\xWAF(\\"]:]",-390073752.0931673,false,true,false,"1/,","eR[uN$j}",702991713.3690443,true,"sXao8\\\\}Z2X~TblyT1",1659468400,1866065233,true,true,true,-711217809.0172701,"iN&.Z>8~Y4&_?jPy`z",true,true,"]L%",true," ,;a>>>9!Jpq[W8~x","",true,false,-1246966393.6908746,"4T=K:\\"pS#A3r#oeJ{:H","/QS5(6|Fjeno$4/g",-1138502425.3491654,false,".?oQ$:m",-389276439,"s`^DmvGP",-477880744.1529622,2093621902.80129,-1058153216,"",22067803.88789463,719930658.4701653,false,"qY $XXc}L;u/2",304107476,"v)lZ-8T}]O5QV^~moes2",true,"Q-C{Q2",-383648038,true,682870698,false,"C#I1T-( .c0","96f1eL_yN$\\\\KUh1$fW":false,"@]Fk8sJ%AGM2":"yJwQtg;(","Mo[\\\\EEm2eit<@^;c.rIf8D=":-1600329983,"4VC?&rR\\\\Ej":-530235487,"I.@mGiTSdwQ8DM f-Q":-441377950.33757067,"v":"*Fu|v#","Bp":",p%V>ItE0:c.VV!1>}.^","lk=hoYIdFuhHW":false," SgM-R!*]bTcA%S5,(:":true,"/\\\\jsjo?d9*%A1<":true,"O ~UIasd":"*[8LH2f*AF*omf!v","QrUgza6AJqrS{l;~+kK":"7=}","u,THiJ,+:Z\\\\ON=dV":"9","<":true,"c":263275248,"sh1q":-876630268.3314719,"]EJ&>:J=l+!&":true,"ho02Rp&,O":true,"9uy-l:gnR":458927933.9498315,"?A":"5?ZZ,\\\\0]","Ei.3]nf)Br4s>":false,"9!bdG{=5HFMA>E,3":"d","yb$AmH[Sg8r0}(ZjjL":true,"H0J>ipSyf}h\\\\":-361530212,".4rU[jU4+FEdim_4AL":true,"pwT10M_":"zVW{.lh+","+Don>~L":false,"$SDjY]_TPnCH4ent":300481053.49128485,"Z1pFqt\\"D$[dg2hmhI:":"xhr{%Z","MokcDx YA":true," )Ryo":-887027596.3720288,"\'Y7":false,"A$Te1?X[X/N77%7NHnZ":false,"G75m6LL[+\\\\Fd>5z3":false,"nRV)":"[j+Nrq9A7y\'S>?x","8*&/+3P~Jag":-1657631324.98392,"`":-730692200,"Zlb)x^[dfP{J%l:[@-":"T-)qNz cJ2Uzxp,[@","s6b;R#5Wlu$hPjMBv@%":"PeLY/-\\"+/x-`","LBn~7Lo;l!PY\'fL}":"Vz_PL a49#ZZ\'H,","JQpDyK":2077707318,"AM3]~dzex":"+_@)\\"":true,"l`HR.fFXu>/T":-1538643139,"DB(\\"q|`L`L0>9QDvoO;":-592045514.7906284,"}0(":"F>R8Y;,tZuap!Q","":"#V,m4ZA","Lg:s*)2HN,YYq>I3:Q=;":true,"aR=m%R[7+[W ?+LkjlC2":"-f;",":":"^|[y>i/&H%d>","BOi":-287062272,"2+e(y$W>IQ4g#":true,"{KaZ?B#QP^Q":541481264.255157,"F`yT":-295204788.8712683,"teeFh_0C":true,",F[CnaOXAQ":"[XVd","O!D1jKvLR?F=@kw":1637882721,"9Q":true,"*A+P/\'}5^Sb^CH":"i{\\"4c]Li","%\\\\yCJ7F+&|Rn":1212304384,"$wF;j,~;l7W}QUd)Q`":"7=}V!5b\\"/`D7b","-u}TV4B":"Hs:w,(>+U\'!Nm","*Zf%d/n":true,"|r+;Ng}ygKf":"pV-MB+RiKQZV\\"^`8Qct","?qBq3\\".O^( 7w!":-1290719451,"`@s*sg.kw%8aU@VBc0":"*su9KRqjIAlS","xm,Q":false,"$ebbb(-4E\'^l=#hnc":-610985675.8739867,"S\\\\nl":false," B@Az/$Vm&tEtO@y\\"$5":true,"*A6~\\"":true,"KJ":"%WDR\\" er=i_","}hDv wb\'!T":943989097.1357074,"U CTLq":false,"F":false,"n[M|*%!*H*F3#]9o+":660976422.0376172,"4U+#Bv;GBAG{s!qh`":false,";.":28976961.07870245,"T_*9\\\\rH=aDenmW7":"U<","TeIPy{wc?Ke..R$t*3JV":1667096028.759397,"d)^^B_|%L\\"2E\'yY?\'~]":"","W-!":false,"mA]":true,"`U{m\'cJUdR#":"o%NIyjyiA)R&i`W82(e","in)mU\'":false,"c":"FoYsJ=W7uO1tC-?\'wlLW","{r>;Pj]Qsd_":false,"Nx<~U4{{lpD]e?dim\\\\V":false,"&Ae`)ep*f":1353998914,"V#&@JjR=qV4](@lj":"AAKVmzksdm","ER t","\\\\x.Zm0#h;W!E!>KbP":"L2jt6otZ&:j","RB_Fl{":-1444661754,"e},WL^92eVT9n%":false,"yO&|7":true,"":"B1euCiiMZWt.>1JLz;.","4IO7#$Txf#ysVTlRtD|j":false,"rL@L":761559906.800487,"5.CSUutvK<{r6\\\\QU/":"0(aAy(H-$N=X.f","c_Am#T\\\\bCF8v":true,"aR)64{tzXN1;50gWkXP":"","lh^2{i-l\\"1":257240412.69731808,"t]H6K)":-1521752699.1175818,"o$~Y","B,7k;l%jXFde: XjmU":"(k41S,GBA*:45l","jjxI]l%;@KYIw;q=[w":">\'#|","I)b":1984201456.3032427,"/O!^TXJ":325633214,"L":614021757.508666,"V\' Hu":true,"h89j)*RH(x~r":false,"v L\\"b;K(1[u":"a{WeZ\\\\OSBY:@Y}","Zxa;HEke\\"I.[s^||1":"kU5)(DK+wUG;","|rPyO}2c":-1116909939.2247696,"fqU$\\".SS#PI ":-1966571397,"],Ek;/EByV9\\"g=|":false,"OhQ\\\\1T":1318533823.3176675,"_51shX;lhI_7:3c..:R":false,"aF&=":", )k","\\\\:58;AlJa":false,"1@4cTzMlk":1681268726.513681,".n:] nCqy7\\\\?iU":true,"\\"+EtP308}j":"Nw","eSQ?":303399774.68077993,"r\'R/9{T39Q2|1KZnn;":"~","e]`3JR0cfx.G[,#l":"*6jlg||62f\')}pO.","wG5pw+K^HEEI.":false,"X`*p5\\"%vtOhsBIg":"e","X":"4]S`.u+O&Ak_2y\'9j*","u:e2mr7y\'swqAn&k1":false,"-+Anc0Ab(C7)":-1094337852.8687897,"uuJGt>ajL":false,"gHaD:s:":"n/Asq@L<(@p`F",":9m%.j7tq!KU]%yP~PR":-1730191736.9091058,"$PLmf7U*pD}-q2w":-894383944,"w4+dJ# NHtu\\\\Eik|h":-648825645,"Sb_YSu2":false,"Qk":"+M9U@ebg1vc-eB#S\'L","c# ($:|X,L9^lWS.Zv":"Tp0>..<","`[\'[8":-591939664,"xgS{Lq)Xq":-596886697.5499353,"@r/ko":-2050373221.7872305,"BS6v`lZcA;%tq5*,f!:":"P#a(,\\\\.>,n=E+C","2@:?4-$NEH7":false,"2*fScm)bD~":true,"Xl":false},"QsUN+aJ~Nf-E(":"<0c.h*","I}ta":false,"<:eG8^2@z\\"l`cOU7^6w`":1213179192,"u(w*1a j":559227709.2696457,"qJFT9:aIh}NK(Pw":109877510.17345953,"":"V|s1i.[gM","_[90n":"y","CuQT7gf%5-\\\\B0R7ccvC":"CttKs6{V6TU","QWbiIW":1903494252,"25j-}9Gx|y}":642804069.2403603,"<|":true,"cnM*:x?2W FA(Em`$s":-366725094.16807413,"([%-k)m-Zd&?\'a":true,"\\\\Z\\"F3@N0":true,"6_c##w4JU:447WKZ@aO":false,"MA#>aBHE#3":"SA49+hM\\"rd7d_tsk.","x},]JyWz":-2116616116,"yVA|X&$(0 U1fpc":-1594696869,"b\\">i\';=Y4a":1229737818,"}&p|+YPg&&MoD#":-1207399959.0754328,"X;=L}!SiX|":-1833836174,"PC65,":true,"$":false,"}Xn":true,"J|W!P`z":-1090694218.6283555,"c<^jv!uRT+LE`":"|[=I4LGgB,An/\'4","LH}{@":1604481070,"Vm#\'3Yn\'R]Uha$":897839121.5230489,"aRA":"}T<_|\\"+|gg#39ci","~]|S\'W:zmjT=`NlLh":false,"Jv=#\\" qXee0I5g+BU9,U":false,"fSl`^XquBfeg?&K%":1173975312,"Uu{Hmt<}4\\\\w\'kK!":35508288.723332405,"L?Z_4g*%(I%:":480876245,"T3oloK":"1/P +/Y9*PYSE","ssSlkej4@v\\"S":true,"lHAP|\\\\YR;}":418326778,"..G\'":"D3%!vWvr","fm":"#}","c|*w+4\\"qcEm\\"ci6hRpu":">J\\\\ ^D#bT\\\\wST6w\'","v0zS":"+%R/0$dO","~_6]^|H":true,"#^Th.eQv^UZ":false,"36CKP&*\\"a^1bGEw1":true,"4r]cl;f":-1086475144,"<\\"s^OFhs#(#":-812277801,"r}^n|==[8":"lmI9T","YXX,9O{_rW0V":1780540820.07868,"u}J":true,"iDj3).@`rKP>@G\'":false,"Pci\'":true,"L[!":"ATW&%6g}","/CB":true,"qh":")^fCc_ar",".":true,"6:e[628|}":">M\\\\AT7tB$Az^Fz","FCaejE?N>T)rc":-715265075,"Lx5\\\\?7->Hq{^D ":-1416616840,",v^x.Nk~J.a=3/\'\\"":-1805919112,"9hSUc(]":"Ofo}eM|G]~b6pB%","o9CFjqdMh\\"#A;:{Z>MG":1003067643,"YmCWv~]h[RePGsw[>9":"W-F%W Qf*?Q1\\\\x>*s*k","_lRGLz6{0g*QFZ\'8U":false,"0_pdZ6)":1948818550,"+ArfABtq6C{7pIG":-1662127134.6857338,"?H8+8ov+x;+IDiS":"`","~AL":false},true,1945154188.3023653,"d5Tw","V |`L KI@Y+Zbr<}W",-492408046.1538105,"aQ0X{)_h\'Y2V@n~N",-2006246427.5010772,false,217740087.2728815,2030846122.8145251,true,false,".k4g>:DbJ","B42n(d[F?isOjhH?0T","~0#uRR",-2103807195,"00c",false,"IWBF#YY/J<$jby&",false,290287126.3573084,423533895.0985074,":8X{[M",".W#_&~\\\\?uiGzM3yV",false,true,true,560708398.7040653,"eZ4o8G=]8y","$xN\\\\z,vl{`ek)x4 NV_%",true,1334425478.7038083,true,1273737518,-1139956950,true,false,-305110228.86200047,true,false,true,";0>\\\\h)$y%+oJDz&","U[(k","Wo?xjb,",1905854631.2208996,-1817388281,false,"g!~95\\\\dbh)E#w4+U","J;c*Cj`;Ze-u4K5",true,185245383,false,2056813945.6557035,-1058652204,".,muh`P[fcSH",true,"f[m-Z2k^j:G#q","#",705731354.5356464,-935112122.5473485,-430631958,false,-959573513," /s}%#1P]4^[RK:\\"v!K",1301137731,1174006910,-270313681.3349371,"H}ggX]mx{|{Tv9?SD-",-1970153752.8408484,"@d\\\\bR1y~sl6a{","RhUG","QqJ",-1495535652.311458],1678644723.1369023,false,"cWO|",false,"*R$z\'cjzuHsMRLxf$.TZ",true,false,1908795491,"@,Tog)",true,false,707071638,"(","Ut\'",true,true,-323507773,"fmK_$Q","\\\\;1 "],true,-1152664142.459044,"a\\"Y",false,1751463356.8547907,false,true,-1906716298,"El}W","iK`*[O",false,"|]Fk#\'HO%g2tB|","qj:pL","2a)CH{","f_}aR$J$`\'pw",-1120211376,1219480024.8352237,1621102569.9027991,true,false,55180274,"4\\\\gj] C",-387822363,1565613270.8767428,1525598339.7768378,51097395.26150608,1322498942,false,false,false,false,false,"1&JM1bx;>Bt",-1073466798.2114654,291640574,true,false,true,false,false,"j{4lI_",true,":M\'kcG\'\\\\y-RM&",false,-761521384.1747842,false,-1250866618,"A&e.",false,"/CZf","ayT*> t~IQyvIYXcz)]n",-352038507,false,-396718250.9928031,1524550515,1615855857.4566226,"",false,-1003493136,true,"","*gCG<7w6KM",")f34+>,So^w^7ao",-1359249495.6085668,-1809203961,"6b\'n3","l)Sh",";NM+:)",true,"2~?o>*}m@:9",1325629574.6127772,true,false,true,false,"T+5m8xkQKC#:$V1 new Function(` 15 | ${code} 16 | return res 17 | `) 18 | 19 | const pathToFixtures = { 20 | 'string': '__fixtures__/object/string/input.js', 21 | 'number': '__fixtures__/object/number/input.js', 22 | 'boolean': '__fixtures__/object/boolean/input.js', 23 | 'null': '__fixtures__/object/null/input.js', 24 | 'object': '__fixtures__/object/object/input.js', 25 | 'array': '__fixtures__/object/array/input.js', 26 | 'backslash': '__fixtures__/object/backslash/input.js', 27 | 'bigJson': '__fixtures__/object/bigJson/input.js' 28 | } 29 | 30 | // see: https://github.com/jamiebuilds/babel-handbook/blob/master/translations/en/plugin-handbook.md#exec-tests 31 | describe('This is end to end test (runtime checking)', () => { 32 | it('string', () => { 33 | const input = fs.readFileSync(path.join(__dirname, pathToFixtures['string']), {encoding: 'utf-8'}); 34 | const result = babel.transform(input, options) 35 | expect(getter(input)()).toEqual(getter(result?.code)()) 36 | }); 37 | it('number', () => { 38 | const input = fs.readFileSync(path.join(__dirname, pathToFixtures['number']), {encoding: 'utf-8'}); 39 | const result = babel.transform(input, options) 40 | expect(getter(input)()).toEqual(getter(result?.code)()) 41 | }); 42 | it('boolean', () => { 43 | const input = fs.readFileSync(path.join(__dirname, pathToFixtures['boolean']), {encoding: 'utf-8'}); 44 | const result = babel.transform(input, options) 45 | expect(getter(input)()).toEqual(getter(result?.code)()) 46 | }); 47 | it('null', () => { 48 | const input = fs.readFileSync(path.join(__dirname, pathToFixtures['null']), {encoding: 'utf-8'}); 49 | const result = babel.transform(input, options) 50 | expect(getter(input)()).toEqual(getter(result?.code)()) 51 | }); 52 | it('object', () => { 53 | const input = fs.readFileSync(path.join(__dirname, pathToFixtures['object']), {encoding: 'utf-8'}); 54 | const result = babel.transform(input, options) 55 | expect(getter(input)()).toEqual(getter(result?.code)()) 56 | }); 57 | it('array', () => { 58 | const input = fs.readFileSync(path.join(__dirname, pathToFixtures['array']), {encoding: 'utf-8'}); 59 | const result = babel.transform(input, options) 60 | expect(getter(input)()).toEqual(getter(result?.code)()) 61 | }); 62 | it('backslash', () => { 63 | const input = fs.readFileSync(path.join(__dirname, pathToFixtures['backslash']), {encoding: 'utf-8'}); 64 | const result = babel.transform(input, options) 65 | expect(getter(input)()).toEqual(getter(result?.code)()) 66 | }); 67 | it('big json', () => { 68 | const input = fs.readFileSync(path.join(__dirname, pathToFixtures['bigJson']), {encoding: 'utf-8'}); 69 | const result = babel.transform(input, options) 70 | expect(getter(input)()).toEqual(getter(result?.code)()) 71 | }); 72 | }) 73 | -------------------------------------------------------------------------------- /test/object_expression.test.ts: -------------------------------------------------------------------------------- 1 | import pluginTester from 'babel-plugin-tester' 2 | import { buildPlugin } from '../src/plugin' 3 | import { ObjectExpression } from '../src/visitors/object_expression' 4 | 5 | pluginTester({ 6 | plugin: buildPlugin([ObjectExpression]), 7 | filename: __filename, 8 | pluginOptions: { 9 | minJSONStringSize: 0, 10 | }, 11 | tests: [ 12 | { 13 | title: 'string', 14 | fixture: '__fixtures__/object/string/input.js', 15 | outputFixture: '__fixtures__/object/string/output.js', 16 | }, 17 | { 18 | title: 'big json', 19 | fixture: '__fixtures__/object/bigJson/input.js', 20 | outputFixture: '__fixtures__/object/bigJson/output.js', 21 | }, 22 | { 23 | title: 'number', 24 | fixture: '__fixtures__/object/number/input.js', 25 | outputFixture: '__fixtures__/object/number/output.js', 26 | }, 27 | { 28 | title: 'boolean', 29 | fixture: '__fixtures__/object/boolean/input.js', 30 | outputFixture: '__fixtures__/object/boolean/output.js', 31 | }, 32 | { 33 | title: 'null', 34 | fixture: '__fixtures__/object/null/input.js', 35 | outputFixture: '__fixtures__/object/null/output.js', 36 | }, 37 | { 38 | title: 'object', 39 | fixture: '__fixtures__/object/object/input.js', 40 | outputFixture: '__fixtures__/object/object/output.js', 41 | }, 42 | { 43 | title: 'array', 44 | fixture: '__fixtures__/object/array/input.js', 45 | outputFixture: '__fixtures__/object/array/output.js', 46 | }, 47 | { 48 | title: 'backslash', 49 | fixture: '__fixtures__/object/backslash/input.js', 50 | outputFixture: '__fixtures__/object/backslash/output.js', 51 | }, 52 | { 53 | title: 'invalid (expect not to transform)', 54 | fixture: '__fixtures__/object/invalid/input.js', 55 | outputFixture: '__fixtures__/object/invalid/output.js', 56 | }, 57 | { 58 | title: 'empty object', 59 | code: `const a = {}`, 60 | output: `const a = JSON.parse('{}')` 61 | }, 62 | { 63 | title: 'respects minJSONStringSize (default : 1024)', 64 | code: `const a = { b: 1, c: 2 }`, 65 | pluginOptions: { 66 | minJSONStringSize: 1024 67 | }, 68 | output: ` 69 | const a = { 70 | b: 1, 71 | c: 2, 72 | } 73 | ` 74 | }, 75 | { 76 | title: 'respects minJSONStringSize', 77 | code: `const a = { b: 1, c: 2 }`, 78 | pluginOptions: { 79 | minJSONStringSize: 1024 80 | }, 81 | output: ` 82 | const a = { 83 | b: 1, 84 | c: 2, 85 | } 86 | ` 87 | }, 88 | { 89 | title: 'respects minJSONStringSize', 90 | code: `const a = { b: 1, c: 2 }`, 91 | output: ` 92 | const a = JSON.parse('{"b":1,"c":2}') 93 | ` 94 | }, 95 | { 96 | title: 'does not convert objects which include the spread syntax', 97 | code: `const a = { ...a, b: 1 }`, 98 | output: ` 99 | const a = { ...a, b: 1 } 100 | ` 101 | }, 102 | { 103 | title: 'does not convert objects which include the object method', 104 | code: ` 105 | const a = { 106 | method(arg) { 107 | return arg 108 | }, 109 | b: 1 110 | } 111 | `, 112 | output: ` 113 | const a = { 114 | method(arg) { 115 | return arg 116 | }, 117 | 118 | b: 1, 119 | } 120 | ` 121 | }, 122 | { 123 | title: 'does not convert objects which include the invalid value', 124 | code: `const a = { b: () => console.log('b') }`, 125 | output: ` 126 | const a = { 127 | b: () => console.log('b'), 128 | } 129 | ` 130 | }, 131 | { 132 | title: 'does not convert objects which have computed property names', 133 | code: `const a = { b : 'b_val', ['c']: 'c_val' }`, 134 | output: ` 135 | const a = { 136 | b: 'b_val', 137 | ['c']: 'c_val', 138 | } 139 | ` 140 | }, 141 | { 142 | title: 'does not convert objects which have invalid numeric key', 143 | code: `const a ={ 77777777777777777.1: 'foo' }`, 144 | output: ` 145 | const a = { 146 | 77777777777777777.1: 'foo', 147 | } 148 | ` 149 | }, 150 | { 151 | title: 'string', 152 | code: `const a = { b: "b_val" }`, 153 | output: `const a = JSON.parse('{"b":"b_val"}')` 154 | }, 155 | { 156 | title: 'string (include single quote)', 157 | code: `const a = { b: "'abc'" }`, 158 | output: `const a = JSON.parse('{"b":"\\'abc\\'"}')` 159 | }, 160 | { 161 | title: 'string (include single quote)', 162 | code: `const a = { b: "ab\'c" }`, 163 | output: `const a = JSON.parse('{"b":"ab\\'c"}')` 164 | }, 165 | { 166 | title: 'string (include double quote)', 167 | code: `const a = { b: 'ab"c' }`, 168 | output: `const a = JSON.parse('{"b":"ab\\\\\"c"}')` 169 | }, 170 | { 171 | title: 'number', 172 | code: `const a = { b: 1 }`, 173 | output: `const a = JSON.parse('{"b":1}')` 174 | }, 175 | { 176 | title: 'null', 177 | code: `const a = { b: null }`, 178 | output: `const a = JSON.parse('{"b":null}')` 179 | }, 180 | { 181 | title: 'boolean', 182 | code: `const a = { b: false }`, 183 | output: `const a = JSON.parse('{"b":false}')` 184 | }, 185 | { 186 | title: 'Object (with Array)', 187 | code: `const a = { b: [1, 'b_val', null] }`, 188 | output: `const a = JSON.parse('{"b":[1,"b_val",null]}')` 189 | }, 190 | { 191 | title: 'Nested Array', 192 | code: `const a = { b: [1, ['b_val', { a: 1 }], null] }`, 193 | output: `const a = JSON.parse('{"b":[1,["b_val",{"a":1}],null]}')` 194 | }, 195 | { 196 | title: 'Object', 197 | code: `const a = { b: { c: 1 } }`, 198 | output: `const a = JSON.parse('{"b":{"c":1}}')` 199 | }, 200 | { 201 | title: 'Object (having numeric keys)', 202 | code: `const a = { 1: "123", 23: 45, b: "b_val" }`, 203 | output: `const a = JSON.parse('{"1":"123","23":45,"b":"b_val"}')` 204 | } 205 | ] 206 | }) 207 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es6", 4 | "module": "commonjs", 5 | "strict": true, 6 | "esModuleInterop": true, 7 | "forceConsistentCasingInFileNames": true, 8 | "resolveJsonModule": true, 9 | "moduleResolution": "node", 10 | "isolatedModules": true, 11 | "baseUrl": "./", 12 | "outDir": "./dist" 13 | }, 14 | "include": ["src"], 15 | "exclude": ["node_modules", "tests"] 16 | } 17 | --------------------------------------------------------------------------------