From 9eb6d4c3f2b764e8682829062a6898009e26561d Mon Sep 17 00:00:00 2001 From: bossgeekgo Date: Sun, 11 Feb 2024 23:51:47 +0800 Subject: [PATCH] refactor json parser to json5 --- packages/geek-auto-start-chat-with-boss/index.mjs | 5 +++-- .../run-core-of-geek-auto-start-chat-with-boss/index.mjs | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/geek-auto-start-chat-with-boss/index.mjs b/packages/geek-auto-start-chat-with-boss/index.mjs index 6672900..060e9e7 100644 --- a/packages/geek-auto-start-chat-with-boss/index.mjs +++ b/packages/geek-auto-start-chat-with-boss/index.mjs @@ -9,10 +9,11 @@ import { import fs from 'node:fs' import { get__dirname } from '@bossgeekgo/utils/legacy-path.mjs'; import path from 'node:path'; +import JSON5 from 'json5' puppeteer.use(StealthPlugin()) -const { cookies: bossCookies } = JSON.parse( +const { cookies: bossCookies } = JSON5.parse( fs.readFileSync( path.join( get__dirname(), @@ -21,7 +22,7 @@ const { cookies: bossCookies } = JSON.parse( ) ) -const targetCompanyList = JSON.parse( +const targetCompanyList = JSON5.parse( fs.readFileSync( path.join( get__dirname(), diff --git a/packages/run-core-of-geek-auto-start-chat-with-boss/index.mjs b/packages/run-core-of-geek-auto-start-chat-with-boss/index.mjs index 91dd5c1..4a9e9ac 100644 --- a/packages/run-core-of-geek-auto-start-chat-with-boss/index.mjs +++ b/packages/run-core-of-geek-auto-start-chat-with-boss/index.mjs @@ -7,8 +7,9 @@ import { import fs from 'node:fs' import path from 'node:path' import { get__dirname } from '@bossgeekgo/utils/legacy-path.mjs'; +import JSON5 from 'json5' -const { groupRobotAccessToken: dingTalkAccessToken } = JSON.parse( +const { groupRobotAccessToken: dingTalkAccessToken } = JSON5.parse( fs.readFileSync( path.join( get__dirname(),