webext-schema
Advanced tools
Comparing version 5.1.3 to 5.1.4
@@ -10,5 +10,5 @@ /*! | ||
/* api */ | ||
import process from 'node:process'; | ||
import { logErr, throwErr } from './modules/common.js'; | ||
import { parseCommand } from './modules/update.js'; | ||
import process from 'node:process'; | ||
export { Schema } from './modules/schema.js'; | ||
@@ -15,0 +15,0 @@ |
@@ -6,6 +6,6 @@ /** | ||
/* api */ | ||
import fs, { promises as fsPromise } from 'node:fs'; | ||
import path from 'node:path'; | ||
import { fileURLToPath } from 'node:url'; | ||
import { getType, isString } from './common.js'; | ||
import fs, { promises as fsPromise } from 'node:fs'; | ||
import path from 'node:path'; | ||
import { IS_WIN } from './constant.js'; | ||
@@ -12,0 +12,0 @@ |
@@ -6,12 +6,15 @@ /** | ||
/* api */ | ||
import { CHAR } from './constant.js'; | ||
import { convertUriToFilePath } from './file-util.js'; | ||
import { getType, isObjectNotEmpty, isString } from './common.js'; | ||
import fs from 'node:fs'; | ||
import path from 'node:path'; | ||
import camelize from 'camelize'; | ||
import decamelize from 'decamelize'; | ||
import fs from 'node:fs'; | ||
import path from 'node:path'; | ||
import sinon from 'sinon'; | ||
import { getType, isObjectNotEmpty, isString } from './common.js'; | ||
import { convertUriToFilePath } from './file-util.js'; | ||
import { CHAR } from './constant.js'; | ||
export class Schema { | ||
/* private */ | ||
#channel; | ||
/** | ||
@@ -28,3 +31,3 @@ * construct | ||
const [arg1, arg2] = args; | ||
this._channel = | ||
this.#channel = | ||
isString(arg1) && /(?:(?:centra|mai)l|beta|esr|release)/.test(arg1) | ||
@@ -45,3 +48,3 @@ ? arg1 | ||
get channel() { | ||
return this._channel; | ||
return this.#channel; | ||
} | ||
@@ -51,3 +54,3 @@ | ||
if (isString(ch) && /(?:(?:centra|mai)l|beta|esr|release)/.test(ch)) { | ||
this._channel = ch; | ||
this.#channel = ch; | ||
} | ||
@@ -271,5 +274,5 @@ } | ||
_parseSchemaContent() { | ||
const fileName = this._channel === 'mail' ? 'mailext.json' : 'webext.json'; | ||
const fileName = this.#channel === 'mail' ? 'mailext.json' : 'webext.json'; | ||
const dirName = path.dirname(convertUriToFilePath(import.meta.url)); | ||
const file = path.join(dirName, '../', 'schemas', this._channel, fileName); | ||
const file = path.join(dirName, '../', 'schemas', this.#channel, fileName); | ||
const content = fs.readFileSync(file, { | ||
@@ -276,0 +279,0 @@ encoding: CHAR, |
@@ -6,9 +6,9 @@ /** | ||
/* api */ | ||
import { CHAR, INDENT } from './constant.js'; | ||
import path from 'node:path'; | ||
import process from 'node:process'; | ||
import JSON5 from 'json5'; | ||
import { program as commander } from 'commander'; | ||
import { getType, isString } from './common.js'; | ||
import { createFile } from './file-util.js'; | ||
import { getType, isString } from './common.js'; | ||
import { program as commander } from 'commander'; | ||
import path from 'node:path'; | ||
import process from 'node:process'; | ||
import { CHAR, INDENT } from './constant.js'; | ||
@@ -15,0 +15,0 @@ /* constants */ |
@@ -14,3 +14,6 @@ { | ||
"main": "index.js", | ||
"types": "types/index.d.ts", | ||
"dependencies": { | ||
"@types/node": "^18.14.0", | ||
"@types/sinon": "^10.0.13", | ||
"camelize": "^1.0.1", | ||
@@ -34,5 +37,7 @@ "commander": "^10.0.0", | ||
"npm-run-all": "^4.1.5", | ||
"typescript": "^4.9.5", | ||
"undici": "^5.19.1" | ||
}, | ||
"scripts": { | ||
"build": "npm run tsc && npm run lint && npm run test", | ||
"lint": "eslint --fix .", | ||
@@ -46,2 +51,3 @@ "start": "node index", | ||
"test_all": "npm-run-all -s test-*", | ||
"tsc": "node -e \"fs.rmSync('types',{recursive:true,force:true})\" && npx tsc", | ||
"update": "node index update -i", | ||
@@ -54,3 +60,3 @@ "update-beta": "node index update --channel=beta -i", | ||
}, | ||
"version": "5.1.3" | ||
"version": "5.1.4" | ||
} |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3540225
22
99533
7
13
+ Added@types/node@^18.14.0
+ Added@types/sinon@^10.0.13
+ Added@types/node@18.19.68(transitive)
+ Added@types/sinon@10.0.20(transitive)
+ Added@types/sinonjs__fake-timers@8.1.5(transitive)
+ Addedundici-types@5.26.5(transitive)