diff --git a/.npmignore b/.npmignore index 82224bf..9f655bf 100644 --- a/.npmignore +++ b/.npmignore @@ -18,3 +18,5 @@ .* coverage test +eslint.config.js +licence_checker.yml diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..1453025 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,33 @@ +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you 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 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*/ + +const { defineConfig, globalIgnores } = require('eslint/config'); +const nodeConfig = require('@cordova/eslint-config/node'); +const nodeTestConfig = require('@cordova/eslint-config/node-tests'); + +module.exports = defineConfig([ + globalIgnores([ + 'lib/parser/pbxproj.js' + ]), + ...nodeConfig, + ...nodeTestConfig.map(config => ({ + files: ['test/**/*.js'], + ...config + })) +]); diff --git a/index.js b/index.js index 464f7d6..78e2cee 100644 --- a/index.js +++ b/index.js @@ -17,4 +17,4 @@ under the License. */ -exports.project = require('./lib/pbxProject') +exports.project = require('./lib/pbxProject'); diff --git a/lib/parseJob.js b/lib/parseJob.js index 45cbe9d..3b2040b 100644 --- a/lib/parseJob.js +++ b/lib/parseJob.js @@ -19,10 +19,11 @@ // parsing is slow and blocking right now // so we do it in a separate process -var fs = require('fs'), - parser = require('./parser/pbxproj'), - path = process.argv[2], - fileContents, obj; +const fs = require('fs'); +const parser = require('./parser/pbxproj'); +const path = process.argv[2]; +let fileContents; +let obj; try { fileContents = fs.readFileSync(path, 'utf-8'); diff --git a/lib/pbxFile.js b/lib/pbxFile.js index 60e09ff..e6072c7 100644 --- a/lib/pbxFile.js +++ b/lib/pbxFile.js @@ -17,80 +17,77 @@ under the License. */ -var path = require('path'), - util = require('util'); - -var DEFAULT_SOURCETREE = '""', - DEFAULT_PRODUCT_SOURCETREE = 'BUILT_PRODUCTS_DIR', - DEFAULT_FILEENCODING = 4, - DEFAULT_GROUP = 'Resources', - DEFAULT_FILETYPE = 'unknown'; - -var FILETYPE_BY_EXTENSION = { - a: 'archive.ar', - app: 'wrapper.application', - appex: 'wrapper.app-extension', - bundle: 'wrapper.plug-in', - dylib: 'compiled.mach-o.dylib', - framework: 'wrapper.framework', - h: 'sourcecode.c.h', - m: 'sourcecode.c.objc', - markdown: 'text', - mdimporter: 'wrapper.cfbundle', - octest: 'wrapper.cfbundle', - pch: 'sourcecode.c.h', - plist: 'text.plist.xml', - sh: 'text.script.sh', - swift: 'sourcecode.swift', - tbd: 'sourcecode.text-based-dylib-definition', - xcassets: 'folder.assetcatalog', - xcconfig: 'text.xcconfig', - xcdatamodel: 'wrapper.xcdatamodel', - xcodeproj: 'wrapper.pb-project', - xctest: 'wrapper.cfbundle', - xib: 'file.xib', - strings: 'text.plist.strings' - }, - GROUP_BY_FILETYPE = { - 'archive.ar': 'Frameworks', - 'compiled.mach-o.dylib': 'Frameworks', - 'sourcecode.text-based-dylib-definition': 'Frameworks', - 'wrapper.framework': 'Frameworks', - 'embedded.framework': 'Embed Frameworks', - 'sourcecode.c.h': 'Resources', - 'sourcecode.c.objc': 'Sources', - 'sourcecode.swift': 'Sources' - }, - PATH_BY_FILETYPE = { - 'compiled.mach-o.dylib': 'usr/lib/', - 'sourcecode.text-based-dylib-definition': 'usr/lib/', - 'wrapper.framework': 'System/Library/Frameworks/' - }, - SOURCETREE_BY_FILETYPE = { - 'compiled.mach-o.dylib': 'SDKROOT', - 'sourcecode.text-based-dylib-definition': 'SDKROOT', - 'wrapper.framework': 'SDKROOT' - }, - ENCODING_BY_FILETYPE = { - 'sourcecode.c.h': 4, - 'sourcecode.c.h': 4, - 'sourcecode.c.objc': 4, - 'sourcecode.swift': 4, - 'text': 4, - 'text.plist.xml': 4, - 'text.script.sh': 4, - 'text.xcconfig': 4, - 'text.plist.strings': 4 - }; - - -function unquoted(text){ - return text == null ? '' : text.replace (/(^")|("$)/g, '') +const path = require('path'); +const util = require('util'); + +const DEFAULT_SOURCETREE = '""'; +const DEFAULT_PRODUCT_SOURCETREE = 'BUILT_PRODUCTS_DIR'; +const DEFAULT_GROUP = 'Resources'; +const DEFAULT_FILETYPE = 'unknown'; + +const FILETYPE_BY_EXTENSION = { + a: 'archive.ar', + app: 'wrapper.application', + appex: 'wrapper.app-extension', + bundle: 'wrapper.plug-in', + dylib: 'compiled.mach-o.dylib', + framework: 'wrapper.framework', + h: 'sourcecode.c.h', + m: 'sourcecode.c.objc', + markdown: 'text', + mdimporter: 'wrapper.cfbundle', + octest: 'wrapper.cfbundle', + pch: 'sourcecode.c.h', + plist: 'text.plist.xml', + sh: 'text.script.sh', + swift: 'sourcecode.swift', + tbd: 'sourcecode.text-based-dylib-definition', + xcassets: 'folder.assetcatalog', + xcconfig: 'text.xcconfig', + xcdatamodel: 'wrapper.xcdatamodel', + xcodeproj: 'wrapper.pb-project', + xctest: 'wrapper.cfbundle', + xib: 'file.xib', + strings: 'text.plist.strings' +}; +const GROUP_BY_FILETYPE = { + 'archive.ar': 'Frameworks', + 'compiled.mach-o.dylib': 'Frameworks', + 'sourcecode.text-based-dylib-definition': 'Frameworks', + 'wrapper.framework': 'Frameworks', + 'embedded.framework': 'Embed Frameworks', + 'sourcecode.c.h': 'Resources', + 'sourcecode.c.objc': 'Sources', + 'sourcecode.swift': 'Sources' +}; +const PATH_BY_FILETYPE = { + 'compiled.mach-o.dylib': 'usr/lib/', + 'sourcecode.text-based-dylib-definition': 'usr/lib/', + 'wrapper.framework': 'System/Library/Frameworks/' +}; +const SOURCETREE_BY_FILETYPE = { + 'compiled.mach-o.dylib': 'SDKROOT', + 'sourcecode.text-based-dylib-definition': 'SDKROOT', + 'wrapper.framework': 'SDKROOT' +}; +const ENCODING_BY_FILETYPE = { + 'sourcecode.c.h': 4, + 'sourcecode.c.objc': 4, + 'sourcecode.swift': 4, + text: 4, + 'text.plist.xml': 4, + 'text.script.sh': 4, + 'text.xcconfig': 4, + 'text.plist.strings': 4 +}; + +function unquoted (text) { + return text == null ? '' : text.replace(/(^")|("$)/g, ''); } -function detectType(filePath) { - var extension = path.extname(filePath).substring(1), - filetype = FILETYPE_BY_EXTENSION[unquoted(extension)]; +function detectType (filePath) { + const extension = path.extname(filePath).substring(1); + const filetype = FILETYPE_BY_EXTENSION[unquoted(extension)]; if (!filetype) { return DEFAULT_FILETYPE; @@ -99,31 +96,31 @@ function detectType(filePath) { return filetype; } -function defaultExtension(fileRef) { - var filetype = fileRef.lastKnownFileType && fileRef.lastKnownFileType != DEFAULT_FILETYPE ? - fileRef.lastKnownFileType : fileRef.explicitFileType; +function defaultExtension (fileRef) { + const filetype = fileRef.lastKnownFileType && fileRef.lastKnownFileType !== DEFAULT_FILETYPE + ? fileRef.lastKnownFileType + : fileRef.explicitFileType; - for(var extension in FILETYPE_BY_EXTENSION) { - if(FILETYPE_BY_EXTENSION.hasOwnProperty(unquoted(extension)) ) { - if(FILETYPE_BY_EXTENSION[unquoted(extension)] === unquoted(filetype) ) - return extension; + for (const extension in FILETYPE_BY_EXTENSION) { + if (Object.prototype.hasOwnProperty.call(FILETYPE_BY_EXTENSION, unquoted(extension))) { + if (FILETYPE_BY_EXTENSION[unquoted(extension)] === unquoted(filetype)) { return extension; } } } } -function defaultEncoding(fileRef) { - var filetype = fileRef.lastKnownFileType || fileRef.explicitFileType, - encoding = ENCODING_BY_FILETYPE[unquoted(filetype)]; +function defaultEncoding (fileRef) { + const filetype = fileRef.lastKnownFileType || fileRef.explicitFileType; + const encoding = ENCODING_BY_FILETYPE[unquoted(filetype)]; if (encoding) { return encoding; } } -function detectGroup(fileRef, opt) { - var extension = path.extname(fileRef.basename).substring(1), - filetype = fileRef.lastKnownFileType || fileRef.explicitFileType, - groupName = GROUP_BY_FILETYPE[unquoted(filetype)]; +function detectGroup (fileRef, opt) { + const extension = path.extname(fileRef.basename).substring(1); + const filetype = fileRef.lastKnownFileType || fileRef.explicitFileType; + const groupName = GROUP_BY_FILETYPE[unquoted(filetype)]; if (extension === 'xcdatamodeld') { return 'Sources'; @@ -140,10 +137,9 @@ function detectGroup(fileRef, opt) { return groupName; } -function detectSourcetree(fileRef) { - - var filetype = fileRef.lastKnownFileType || fileRef.explicitFileType, - sourcetree = SOURCETREE_BY_FILETYPE[unquoted(filetype)]; +function detectSourcetree (fileRef) { + const filetype = fileRef.lastKnownFileType || fileRef.explicitFileType; + const sourcetree = SOURCETREE_BY_FILETYPE[unquoted(filetype)]; if (fileRef.explicitFileType) { return DEFAULT_PRODUCT_SOURCETREE; @@ -160,9 +156,9 @@ function detectSourcetree(fileRef) { return sourcetree; } -function defaultPath(fileRef, filePath) { - var filetype = fileRef.lastKnownFileType || fileRef.explicitFileType, - defaultPath = PATH_BY_FILETYPE[unquoted(filetype)]; +function defaultPath (fileRef, filePath) { + const filetype = fileRef.lastKnownFileType || fileRef.explicitFileType; + const defaultPath = PATH_BY_FILETYPE[unquoted(filetype)]; if (fileRef.customFramework) { return filePath; @@ -175,25 +171,15 @@ function defaultPath(fileRef, filePath) { return filePath; } -function defaultGroup(fileRef) { - var groupName = GROUP_BY_FILETYPE[fileRef.lastKnownFileType]; - - if (!groupName) { - return DEFAULT_GROUP; - } - - return defaultGroup; -} - -function pbxFile(filepath, opt) { - var opt = opt || {}; +function pbxFile (filepath, opt) { + opt = opt || {}; this.basename = path.basename(filepath); this.lastKnownFileType = opt.lastKnownFileType || detectType(filepath); this.group = detectGroup(this, opt); // for custom frameworks - if (opt.customFramework == true) { + if (opt.customFramework === true) { this.customFramework = true; this.dirname = path.dirname(filepath).replace(/\\/g, '/'); } @@ -214,21 +200,17 @@ function pbxFile(filepath, opt) { this.sourceTree = opt.sourceTree || detectSourcetree(this); this.includeInIndex = 0; - if (opt.weak && opt.weak === true) - this.settings = { ATTRIBUTES: ['Weak'] }; + if (opt.weak && opt.weak === true) { this.settings = { ATTRIBUTES: ['Weak'] }; } if (opt.compilerFlags) { - if (!this.settings) - this.settings = {}; + if (!this.settings) { this.settings = {}; } this.settings.COMPILER_FLAGS = util.format('"%s"', opt.compilerFlags); } if (opt.embed && opt.sign) { - if (!this.settings) - this.settings = {}; - if (!this.settings.ATTRIBUTES) - this.settings.ATTRIBUTES = []; - this.settings.ATTRIBUTES.push('CodeSignOnCopy'); + if (!this.settings) { this.settings = {}; } + if (!this.settings.ATTRIBUTES) { this.settings.ATTRIBUTES = []; } + this.settings.ATTRIBUTES.push('CodeSignOnCopy'); } } diff --git a/lib/pbxProject.js b/lib/pbxProject.js index 1d53a3e..c711fa2 100644 --- a/lib/pbxProject.js +++ b/lib/pbxProject.js @@ -17,37 +17,36 @@ under the License. */ -var util = require('util'), - f = util.format, - EventEmitter = require('events').EventEmitter, - path = require('path'), - uuid = require('uuid'), - fork = require('child_process').fork, - pbxWriter = require('./pbxWriter'), - pbxFile = require('./pbxFile'), - fs = require('fs'), - parser = require('./parser/pbxproj'), - plist = require('simple-plist'), - COMMENT_KEY = /_comment$/ - -function pbxProject(filename) { - if (!(this instanceof pbxProject)) - return new pbxProject(filename); - - this.filepath = path.resolve(filename) +const util = require('util'); +const f = util.format; +const EventEmitter = require('events').EventEmitter; +const path = require('path'); +const uuid = require('uuid'); +const fork = require('child_process').fork; +const PBXWriter = require('./pbxWriter'); +const PBXFile = require('./pbxFile'); +const fs = require('fs'); +const parser = require('./parser/pbxproj'); +const plist = require('simple-plist'); +const COMMENT_KEY = /_comment$/; + +function PBXProject (filename) { + if (!(this instanceof PBXProject)) { return new PBXProject(filename); } + + this.filepath = path.resolve(filename); } -util.inherits(pbxProject, EventEmitter) +util.inherits(PBXProject, EventEmitter); -pbxProject.prototype.parse = function(cb) { - var worker = fork(__dirname + '/parseJob.js', [this.filepath]) +PBXProject.prototype.parse = function (cb) { + const worker = fork(path.join(__dirname, '/parseJob.js'), [this.filepath]); - worker.on('message', function(msg) { - if (msg.name == 'SyntaxError' || msg.code) { + worker.on('message', function (msg) { + if (msg.name === 'SyntaxError' || msg.code) { this.emit('error', msg); } else { this.hash = msg; - this.emit('end', null, msg) + this.emit('end', null, msg); } }.bind(this)); @@ -57,52 +56,52 @@ pbxProject.prototype.parse = function(cb) { } return this; -} +}; -pbxProject.prototype.parseSync = function() { - var file_contents = fs.readFileSync(this.filepath, 'utf-8'); +PBXProject.prototype.parseSync = function () { + const file_contents = fs.readFileSync(this.filepath, 'utf-8'); this.hash = parser.parse(file_contents); return this; -} +}; -pbxProject.prototype.writeSync = function(options) { - this.writer = new pbxWriter(this.hash, options); +PBXProject.prototype.writeSync = function (options) { + this.writer = new PBXWriter(this.hash, options); return this.writer.writeSync(); -} +}; -pbxProject.prototype.allUuids = function() { - var sections = this.hash.project.objects, - uuids = [], - section; +PBXProject.prototype.allUuids = function () { + const sections = this.hash.project.objects; + let uuids = []; + let section; - for (key in sections) { - section = sections[key] - uuids = uuids.concat(Object.keys(section)) + for (const key in sections) { + section = sections[key]; + uuids = uuids.concat(Object.keys(section)); } - uuids = uuids.filter(function(str) { - return !COMMENT_KEY.test(str) && str.length == 24; + uuids = uuids.filter(function (str) { + return !COMMENT_KEY.test(str) && str.length === 24; }); return uuids; -} +}; -pbxProject.prototype.generateUuid = function() { - var id = uuid.v4() +PBXProject.prototype.generateUuid = function () { + const id = uuid.v4() .replace(/-/g, '') .substr(0, 24) - .toUpperCase() + .toUpperCase(); if (this.allUuids().indexOf(id) >= 0) { return this.generateUuid(); } else { return id; } -} +}; -pbxProject.prototype.addPluginFile = function(path, opt) { - var file = new pbxFile(path, opt); +PBXProject.prototype.addPluginFile = function (path, opt) { + const file = new PBXFile(path, opt); file.plugin = true; // durr correctForPluginsPath(file, this); @@ -112,24 +111,24 @@ pbxProject.prototype.addPluginFile = function(path, opt) { file.fileRef = this.generateUuid(); - this.addToPbxFileReferenceSection(file); // PBXFileReference - this.addToPluginsPbxGroup(file); // PBXGroup + this.addToPbxFileReferenceSection(file); // PBXFileReference + this.addToPluginsPbxGroup(file); // PBXGroup return file; -} +}; -pbxProject.prototype.removePluginFile = function(path, opt) { - var file = new pbxFile(path, opt); +PBXProject.prototype.removePluginFile = function (path, opt) { + const file = new PBXFile(path, opt); correctForPluginsPath(file, this); - this.removeFromPbxFileReferenceSection(file); // PBXFileReference - this.removeFromPluginsPbxGroup(file); // PBXGroup + this.removeFromPbxFileReferenceSection(file); // PBXFileReference + this.removeFromPluginsPbxGroup(file); // PBXGroup return file; -} +}; -pbxProject.prototype.addProductFile = function(targetPath, opt) { - var file = new pbxFile(targetPath, opt); +PBXProject.prototype.addProductFile = function (targetPath, opt) { + const file = new PBXFile(targetPath, opt); file.includeInIndex = 0; file.fileRef = this.generateUuid(); @@ -139,18 +138,18 @@ pbxProject.prototype.addProductFile = function(targetPath, opt) { file.path = file.basename; this.addToPbxFileReferenceSection(file); - this.addToProductsPbxGroup(file); // PBXGroup + this.addToProductsPbxGroup(file); // PBXGroup return file; -} +}; -pbxProject.prototype.removeProductFile = function(path, opt) { - var file = new pbxFile(path, opt); +PBXProject.prototype.removeProductFile = function (path, opt) { + const file = new PBXFile(path, opt); - this.removeFromProductsPbxGroup(file); // PBXGroup + this.removeFromProductsPbxGroup(file); // PBXGroup return file; -} +}; /** * @@ -159,12 +158,11 @@ pbxProject.prototype.removeProductFile = function(path, opt) { * @param group {String} group key * @returns {Object} file; see pbxFile */ -pbxProject.prototype.addSourceFile = function (path, opt, group) { - var file; +PBXProject.prototype.addSourceFile = function (path, opt, group) { + let file; if (group) { file = this.addFile(path, group, opt); - } - else { + } else { file = this.addPluginFile(path, opt); } @@ -173,11 +171,11 @@ pbxProject.prototype.addSourceFile = function (path, opt, group) { file.target = opt ? opt.target : undefined; file.uuid = this.generateUuid(); - this.addToPbxBuildFileSection(file); // PBXBuildFile - this.addToPbxSourcesBuildPhase(file); // PBXSourcesBuildPhase + this.addToPbxBuildFileSection(file); // PBXBuildFile + this.addToPbxSourcesBuildPhase(file); // PBXSourcesBuildPhase return file; -} +}; /** * @@ -186,20 +184,19 @@ pbxProject.prototype.addSourceFile = function (path, opt, group) { * @param group {String} group key * @returns {Object} file; see pbxFile */ -pbxProject.prototype.removeSourceFile = function (path, opt, group) { - var file; +PBXProject.prototype.removeSourceFile = function (path, opt, group) { + let file; if (group) { file = this.removeFile(path, group, opt); - } - else { + } else { file = this.removePluginFile(path, opt); } file.target = opt ? opt.target : undefined; - this.removeFromPbxBuildFileSection(file); // PBXBuildFile - this.removeFromPbxSourcesBuildPhase(file); // PBXSourcesBuildPhase + this.removeFromPbxBuildFileSection(file); // PBXBuildFile + this.removeFromPbxSourcesBuildPhase(file); // PBXSourcesBuildPhase return file; -} +}; /** * @@ -208,14 +205,13 @@ pbxProject.prototype.removeSourceFile = function (path, opt, group) { * @param group {String} group key * @returns {Object} file; see pbxFile */ -pbxProject.prototype.addHeaderFile = function (path, opt, group) { +PBXProject.prototype.addHeaderFile = function (path, opt, group) { if (group) { return this.addFile(path, group, opt); - } - else { + } else { return this.addPluginFile(path, opt); } -} +}; /** * @@ -224,14 +220,13 @@ pbxProject.prototype.addHeaderFile = function (path, opt, group) { * @param group {String} group key * @returns {Object} file; see pbxFile */ -pbxProject.prototype.removeHeaderFile = function (path, opt, group) { +PBXProject.prototype.removeHeaderFile = function (path, opt, group) { if (group) { return this.removeFile(path, group, opt); - } - else { + } else { return this.removePluginFile(path, opt); } -} +}; /** * @@ -240,16 +235,16 @@ pbxProject.prototype.removeHeaderFile = function (path, opt, group) { * @param group {String} group key * @returns {Object} file; see pbxFile */ -pbxProject.prototype.addResourceFile = function(path, opt, group) { +PBXProject.prototype.addResourceFile = function (path, opt, group) { opt = opt || {}; - var file; + let file; if (opt.plugin) { file = this.addPluginFile(path, opt); if (!file) return false; } else { - file = new pbxFile(path, opt); + file = new PBXFile(path, opt); if (this.hasFile(file.path)) return false; } @@ -262,28 +257,25 @@ pbxProject.prototype.addResourceFile = function(path, opt, group) { } if (!opt.variantGroup) { - this.addToPbxBuildFileSection(file); // PBXBuildFile - this.addToPbxResourcesBuildPhase(file); // PBXResourcesBuildPhase + this.addToPbxBuildFileSection(file); // PBXBuildFile + this.addToPbxResourcesBuildPhase(file); // PBXResourcesBuildPhase } if (!opt.plugin) { - this.addToPbxFileReferenceSection(file); // PBXFileReference + this.addToPbxFileReferenceSection(file); // PBXFileReference if (group) { if (this.getPBXGroupByKey(group)) { - this.addToPbxGroup(file, group); //Group other than Resources (i.e. 'splash') + this.addToPbxGroup(file, group); // Group other than Resources (i.e. 'splash') + } else if (this.getPBXVariantGroupByKey(group)) { + this.addToPbxVariantGroup(file, group); // PBXVariantGroup } - else if (this.getPBXVariantGroupByKey(group)) { - this.addToPbxVariantGroup(file, group); // PBXVariantGroup - } - } - else { - this.addToResourcesPbxGroup(file); // PBXGroup + } else { + this.addToResourcesPbxGroup(file); // PBXGroup } - } return file; -} +}; /** * @@ -292,40 +284,38 @@ pbxProject.prototype.addResourceFile = function(path, opt, group) { * @param group {String} group key * @returns {Object} file; see pbxFile */ -pbxProject.prototype.removeResourceFile = function(path, opt, group) { - var file = new pbxFile(path, opt); +PBXProject.prototype.removeResourceFile = function (path, opt, group) { + const file = new PBXFile(path, opt); file.target = opt ? opt.target : undefined; correctForResourcesPath(file, this); - this.removeFromPbxBuildFileSection(file); // PBXBuildFile - this.removeFromPbxFileReferenceSection(file); // PBXFileReference + this.removeFromPbxBuildFileSection(file); // PBXBuildFile + this.removeFromPbxFileReferenceSection(file); // PBXFileReference if (group) { if (this.getPBXGroupByKey(group)) { - this.removeFromPbxGroup(file, group); //Group other than Resources (i.e. 'splash') - } - else if (this.getPBXVariantGroupByKey(group)) { - this.removeFromPbxVariantGroup(file, group); // PBXVariantGroup + this.removeFromPbxGroup(file, group); // Group other than Resources (i.e. 'splash') + } else if (this.getPBXVariantGroupByKey(group)) { + this.removeFromPbxVariantGroup(file, group); // PBXVariantGroup } + } else { + this.removeFromResourcesPbxGroup(file); // PBXGroup } - else { - this.removeFromResourcesPbxGroup(file); // PBXGroup - } - this.removeFromPbxResourcesBuildPhase(file); // PBXResourcesBuildPhase + this.removeFromPbxResourcesBuildPhase(file); // PBXResourcesBuildPhase return file; -} +}; -pbxProject.prototype.addFramework = function(fpath, opt) { - var customFramework = opt && opt.customFramework == true; - var link = !opt || (opt.link == undefined || opt.link); //defaults to true if not specified - var embed = opt && opt.embed; //defaults to false if not specified +PBXProject.prototype.addFramework = function (fpath, opt) { + const customFramework = opt && opt.customFramework === true; + const link = !opt || (opt.link === undefined || opt.link); // defaults to true if not specified + const embed = opt && opt.embed; // defaults to false if not specified if (opt) { - delete opt.embed; + delete opt.embed; } - var file = new pbxFile(fpath, opt); + const file = new PBXFile(fpath, opt); file.uuid = this.generateUuid(); file.fileRef = this.generateUuid(); @@ -333,50 +323,48 @@ pbxProject.prototype.addFramework = function(fpath, opt) { if (this.hasFile(file.path)) return false; - this.addToPbxBuildFileSection(file); // PBXBuildFile - this.addToPbxFileReferenceSection(file); // PBXFileReference - this.addToFrameworksPbxGroup(file); // PBXGroup + this.addToPbxBuildFileSection(file); // PBXBuildFile + this.addToPbxFileReferenceSection(file); // PBXFileReference + this.addToFrameworksPbxGroup(file); // PBXGroup if (link) { - this.addToPbxFrameworksBuildPhase(file); // PBXFrameworksBuildPhase + this.addToPbxFrameworksBuildPhase(file); // PBXFrameworksBuildPhase } if (customFramework) { this.addToFrameworkSearchPaths(file); if (embed) { - opt.embed = embed; - var embeddedFile = new pbxFile(fpath, opt); + opt.embed = embed; + const embeddedFile = new PBXFile(fpath, opt); - embeddedFile.uuid = this.generateUuid(); - embeddedFile.fileRef = file.fileRef; + embeddedFile.uuid = this.generateUuid(); + embeddedFile.fileRef = file.fileRef; - //keeping a separate PBXBuildFile entry for Embed Frameworks - this.addToPbxBuildFileSection(embeddedFile); // PBXBuildFile + // keeping a separate PBXBuildFile entry for Embed Frameworks + this.addToPbxBuildFileSection(embeddedFile); // PBXBuildFile - this.addToPbxEmbedFrameworksBuildPhase(embeddedFile); // PBXCopyFilesBuildPhase + this.addToPbxEmbedFrameworksBuildPhase(embeddedFile); // PBXCopyFilesBuildPhase - return embeddedFile; + return embeddedFile; } } return file; -} - -pbxProject.prototype.removeFramework = function(fpath, opt) { - var embed = opt && opt.embed; +}; +PBXProject.prototype.removeFramework = function (fpath, opt) { if (opt) { - delete opt.embed; + delete opt.embed; } - var file = new pbxFile(fpath, opt); + const file = new PBXFile(fpath, opt); file.target = opt ? opt.target : undefined; - this.removeFromPbxBuildFileSection(file); // PBXBuildFile - this.removeFromPbxFileReferenceSection(file); // PBXFileReference - this.removeFromFrameworksPbxGroup(file); // PBXGroup - this.removeFromPbxFrameworksBuildPhase(file); // PBXFrameworksBuildPhase + this.removeFromPbxBuildFileSection(file); // PBXBuildFile + this.removeFromPbxFileReferenceSection(file); // PBXFileReference + this.removeFromFrameworksPbxGroup(file); // PBXGroup + this.removeFromPbxFrameworksBuildPhase(file); // PBXFrameworksBuildPhase if (opt && opt.customFramework) { this.removeFromFrameworkSearchPaths(file); @@ -384,19 +372,18 @@ pbxProject.prototype.removeFramework = function(fpath, opt) { opt = opt || {}; opt.embed = true; - var embeddedFile = new pbxFile(fpath, opt); + const embeddedFile = new PBXFile(fpath, opt); embeddedFile.fileRef = file.fileRef; - this.removeFromPbxBuildFileSection(embeddedFile); // PBXBuildFile + this.removeFromPbxBuildFileSection(embeddedFile); // PBXBuildFile this.removeFromPbxEmbedFrameworksBuildPhase(embeddedFile); // PBXCopyFilesBuildPhase return file; -} - +}; -pbxProject.prototype.addCopyfile = function(fpath, opt) { - var file = new pbxFile(fpath, opt); +PBXProject.prototype.addCopyfile = function (fpath, opt) { + let file = new PBXFile(fpath, opt); // catch duplicates if (this.hasFile(file.path)) { @@ -406,53 +393,53 @@ pbxProject.prototype.addCopyfile = function(fpath, opt) { file.fileRef = file.uuid = this.generateUuid(); file.target = opt ? opt.target : undefined; - this.addToPbxBuildFileSection(file); // PBXBuildFile - this.addToPbxFileReferenceSection(file); // PBXFileReference - this.addToPbxCopyfilesBuildPhase(file); // PBXCopyFilesBuildPhase + this.addToPbxBuildFileSection(file); // PBXBuildFile + this.addToPbxFileReferenceSection(file); // PBXFileReference + this.addToPbxCopyfilesBuildPhase(file); // PBXCopyFilesBuildPhase return file; -} +}; -pbxProject.prototype.pbxCopyfilesBuildPhaseObj = function(target) { +PBXProject.prototype.pbxCopyfilesBuildPhaseObj = function (target) { return this.buildPhaseObject('PBXCopyFilesBuildPhase', 'Copy Files', target); -} +}; -pbxProject.prototype.addToPbxCopyfilesBuildPhase = function(file) { - var sources = this.buildPhaseObject('PBXCopyFilesBuildPhase', 'Copy Files', file.target); +PBXProject.prototype.addToPbxCopyfilesBuildPhase = function (file) { + const sources = this.buildPhaseObject('PBXCopyFilesBuildPhase', 'Copy Files', file.target); sources.files.push(pbxBuildPhaseObj(file)); -} +}; -pbxProject.prototype.removeCopyfile = function(fpath, opt) { - var file = new pbxFile(fpath, opt); +PBXProject.prototype.removeCopyfile = function (fpath, opt) { + const file = new PBXFile(fpath, opt); file.target = opt ? opt.target : undefined; - this.removeFromPbxBuildFileSection(file); // PBXBuildFile - this.removeFromPbxFileReferenceSection(file); // PBXFileReference - this.removeFromPbxCopyfilesBuildPhase(file); // PBXFrameworksBuildPhase + this.removeFromPbxBuildFileSection(file); // PBXBuildFile + this.removeFromPbxFileReferenceSection(file); // PBXFileReference + this.removeFromPbxCopyfilesBuildPhase(file); // PBXFrameworksBuildPhase return file; -} +}; -pbxProject.prototype.removeFromPbxCopyfilesBuildPhase = function(file) { - var sources = this.pbxCopyfilesBuildPhaseObj(file.target); - for (i in sources.files) { - if (sources.files[i].comment == longComment(file)) { +PBXProject.prototype.removeFromPbxCopyfilesBuildPhase = function (file) { + const sources = this.pbxCopyfilesBuildPhaseObj(file.target); + for (const i in sources.files) { + if (sources.files[i].comment === longComment(file)) { sources.files.splice(i, 1); break; } } -} +}; -pbxProject.prototype.addStaticLibrary = function(path, opt) { +PBXProject.prototype.addStaticLibrary = function (path, opt) { opt = opt || {}; - var file; + let file; if (opt.plugin) { file = this.addPluginFile(path, opt); if (!file) return false; } else { - file = new pbxFile(path, opt); + file = new PBXFile(path, opt); if (this.hasFile(file.path)) return false; } @@ -461,65 +448,65 @@ pbxProject.prototype.addStaticLibrary = function(path, opt) { if (!opt.plugin) { file.fileRef = this.generateUuid(); - this.addToPbxFileReferenceSection(file); // PBXFileReference + this.addToPbxFileReferenceSection(file); // PBXFileReference } - this.addToPbxBuildFileSection(file); // PBXBuildFile - this.addToPbxFrameworksBuildPhase(file); // PBXFrameworksBuildPhase - this.addToLibrarySearchPaths(file); // make sure it gets built! + this.addToPbxBuildFileSection(file); // PBXBuildFile + this.addToPbxFrameworksBuildPhase(file); // PBXFrameworksBuildPhase + this.addToLibrarySearchPaths(file); // make sure it gets built! return file; -} +}; // helper addition functions -pbxProject.prototype.addToPbxBuildFileSection = function(file) { - var commentKey = f("%s_comment", file.uuid); +PBXProject.prototype.addToPbxBuildFileSection = function (file) { + const commentKey = f('%s_comment', file.uuid); this.pbxBuildFileSection()[file.uuid] = pbxBuildFileObj(file); this.pbxBuildFileSection()[commentKey] = pbxBuildFileComment(file); -} +}; -pbxProject.prototype.removeFromPbxBuildFileSection = function(file) { - var uuid; +PBXProject.prototype.removeFromPbxBuildFileSection = function (file) { + let uuid; for (uuid in this.pbxBuildFileSection()) { - if (this.pbxBuildFileSection()[uuid].fileRef_comment == file.basename) { + if (this.pbxBuildFileSection()[uuid].fileRef_comment === file.basename) { file.uuid = uuid; delete this.pbxBuildFileSection()[uuid]; - var commentKey = f("%s_comment", uuid); + const commentKey = f('%s_comment', uuid); delete this.pbxBuildFileSection()[commentKey]; } } -} +}; -pbxProject.prototype.addPbxGroup = function(filePathsArray, name, path, sourceTree) { - var groups = this.hash.project.objects['PBXGroup'], - pbxGroupUuid = this.generateUuid(), - commentKey = f("%s_comment", pbxGroupUuid), - pbxGroup = { - isa: 'PBXGroup', - children: [], - name: name, - path: path, - sourceTree: sourceTree ? sourceTree : '""' - }, - fileReferenceSection = this.pbxFileReferenceSection(), - filePathToReference = {}; +PBXProject.prototype.addPbxGroup = function (filePathsArray, name, path, sourceTree) { + const groups = this.hash.project.objects.PBXGroup; + const pbxGroupUuid = this.generateUuid(); + const commentKey = f('%s_comment', pbxGroupUuid); + const pbxGroup = { + isa: 'PBXGroup', + children: [], + name, + path, + sourceTree: sourceTree || '""' + }; + const fileReferenceSection = this.pbxFileReferenceSection(); + const filePathToReference = {}; - for (var key in fileReferenceSection) { + for (const key in fileReferenceSection) { // only look for comments if (!COMMENT_KEY.test(key)) continue; - var fileReferenceKey = key.split(COMMENT_KEY)[0], - fileReference = fileReferenceSection[fileReferenceKey]; + const fileReferenceKey = key.split(COMMENT_KEY)[0]; + const fileReference = fileReferenceSection[fileReferenceKey]; filePathToReference[fileReference.path] = { fileRef: fileReferenceKey, basename: fileReferenceSection[key] }; } - for (var index = 0; index < filePathsArray.length; index++) { - var filePath = filePathsArray[index], - filePathQuoted = "\"" + filePath + "\""; + for (let index = 0; index < filePathsArray.length; index++) { + const filePath = filePathsArray[index]; + const filePathQuoted = '"' + filePath + '"'; if (filePathToReference[filePath]) { pbxGroup.children.push(pbxGroupChild(filePathToReference[filePath])); continue; @@ -528,11 +515,11 @@ pbxProject.prototype.addPbxGroup = function(filePathsArray, name, path, sourceTr continue; } - var file = new pbxFile(filePath); + const file = new PBXFile(filePath); file.uuid = this.generateUuid(); file.fileRef = this.generateUuid(); - this.addToPbxFileReferenceSection(file); // PBXFileReference - this.addToPbxBuildFileSection(file); // PBXBuildFile + this.addToPbxFileReferenceSection(file); // PBXFileReference + this.addToPbxBuildFileSection(file); // PBXBuildFile pbxGroup.children.push(pbxGroupChild(file)); } @@ -541,76 +528,73 @@ pbxProject.prototype.addPbxGroup = function(filePathsArray, name, path, sourceTr groups[commentKey] = name; } - return { uuid: pbxGroupUuid, pbxGroup: pbxGroup }; -} + return { uuid: pbxGroupUuid, pbxGroup }; +}; -pbxProject.prototype.removePbxGroup = function (groupName) { - var section = this.hash.project.objects['PBXGroup'], - key, itemKey; +PBXProject.prototype.removePbxGroup = function (groupName) { + const section = this.hash.project.objects.PBXGroup; + let itemKey; - for (key in section) { + for (const key in section) { // only look for comments if (!COMMENT_KEY.test(key)) continue; - if (section[key] == groupName) { + if (section[key] === groupName) { itemKey = key.split(COMMENT_KEY)[0]; delete section[itemKey]; } } -} - -pbxProject.prototype.addToPbxProjectSection = function(target) { +}; - var newTarget = { - value: target.uuid, - comment: pbxNativeTargetComment(target.pbxNativeTarget) - }; +PBXProject.prototype.addToPbxProjectSection = function (target) { + const newTarget = { + value: target.uuid, + comment: pbxNativeTargetComment(target.pbxNativeTarget) + }; - this.pbxProjectSection()[this.getFirstProject()['uuid']]['targets'].push(newTarget); -} + this.pbxProjectSection()[this.getFirstProject().uuid].targets.push(newTarget); +}; -pbxProject.prototype.addToPbxNativeTargetSection = function(target) { - var commentKey = f("%s_comment", target.uuid); +PBXProject.prototype.addToPbxNativeTargetSection = function (target) { + const commentKey = f('%s_comment', target.uuid); this.pbxNativeTargetSection()[target.uuid] = target.pbxNativeTarget; this.pbxNativeTargetSection()[commentKey] = target.pbxNativeTarget.name; -} +}; -pbxProject.prototype.addToPbxFileReferenceSection = function(file) { - var commentKey = f("%s_comment", file.fileRef); +PBXProject.prototype.addToPbxFileReferenceSection = function (file) { + const commentKey = f('%s_comment', file.fileRef); this.pbxFileReferenceSection()[file.fileRef] = pbxFileReferenceObj(file); this.pbxFileReferenceSection()[commentKey] = pbxFileReferenceComment(file); -} - -pbxProject.prototype.removeFromPbxFileReferenceSection = function(file) { +}; - var i; - var refObj = pbxFileReferenceObj(file); - for (i in this.pbxFileReferenceSection()) { - if (this.pbxFileReferenceSection()[i].name == refObj.name || - ('"' + this.pbxFileReferenceSection()[i].name + '"') == refObj.name || - this.pbxFileReferenceSection()[i].path == refObj.path || - ('"' + this.pbxFileReferenceSection()[i].path + '"') == refObj.path) { +PBXProject.prototype.removeFromPbxFileReferenceSection = function (file) { + const refObj = pbxFileReferenceObj(file); + for (const i in this.pbxFileReferenceSection()) { + if (this.pbxFileReferenceSection()[i].name === refObj.name || + ('"' + this.pbxFileReferenceSection()[i].name + '"') === refObj.name || + this.pbxFileReferenceSection()[i].path === refObj.path || + ('"' + this.pbxFileReferenceSection()[i].path + '"') === refObj.path) { file.fileRef = file.uuid = i; delete this.pbxFileReferenceSection()[i]; break; } } - var commentKey = f("%s_comment", file.fileRef); - if (this.pbxFileReferenceSection()[commentKey] != undefined) { + const commentKey = f('%s_comment', file.fileRef); + if (this.pbxFileReferenceSection()[commentKey] !== undefined) { delete this.pbxFileReferenceSection()[commentKey]; } return file; -} +}; -pbxProject.prototype.addToXcVersionGroupSection = function(file) { +PBXProject.prototype.addToXcVersionGroupSection = function (file) { if (!file.models || !file.currentModel) { - throw new Error("Cannot create a XCVersionGroup section from not a data model document file"); + throw new Error('Cannot create a XCVersionGroup section from not a data model document file'); } - var commentKey = f("%s_comment", file.fileRef); + const commentKey = f('%s_comment', file.fileRef); if (!this.xcVersionGroupSection()[file.fileRef]) { this.xcVersionGroupSection()[file.fileRef] = { @@ -624,184 +608,183 @@ pbxProject.prototype.addToXcVersionGroupSection = function(file) { }; this.xcVersionGroupSection()[commentKey] = path.basename(file.path); } -} +}; -pbxProject.prototype.addToPluginsPbxGroup = function(file) { - var pluginsGroup = this.pbxGroupByName('Plugins'); +PBXProject.prototype.addToPluginsPbxGroup = function (file) { + const pluginsGroup = this.pbxGroupByName('Plugins'); if (!pluginsGroup) { this.addPbxGroup([file.path], 'Plugins'); } else { pluginsGroup.children.push(pbxGroupChild(file)); } -} +}; -pbxProject.prototype.removeFromPluginsPbxGroup = function(file) { +PBXProject.prototype.removeFromPluginsPbxGroup = function (file) { if (!this.pbxGroupByName('Plugins')) { return null; } - var pluginsGroupChildren = this.pbxGroupByName('Plugins').children, i; - for (i in pluginsGroupChildren) { - if (pbxGroupChild(file).value == pluginsGroupChildren[i].value && - pbxGroupChild(file).comment == pluginsGroupChildren[i].comment) { + const pluginsGroupChildren = this.pbxGroupByName('Plugins').children; + for (const i in pluginsGroupChildren) { + if (pbxGroupChild(file).value === pluginsGroupChildren[i].value && + pbxGroupChild(file).comment === pluginsGroupChildren[i].comment) { pluginsGroupChildren.splice(i, 1); break; } } -} +}; -pbxProject.prototype.addToResourcesPbxGroup = function(file) { - var pluginsGroup = this.pbxGroupByName('Resources'); +PBXProject.prototype.addToResourcesPbxGroup = function (file) { + const pluginsGroup = this.pbxGroupByName('Resources'); if (!pluginsGroup) { this.addPbxGroup([file.path], 'Resources'); } else { pluginsGroup.children.push(pbxGroupChild(file)); } -} +}; -pbxProject.prototype.removeFromResourcesPbxGroup = function(file) { +PBXProject.prototype.removeFromResourcesPbxGroup = function (file) { if (!this.pbxGroupByName('Resources')) { return null; } - var pluginsGroupChildren = this.pbxGroupByName('Resources').children, i; - for (i in pluginsGroupChildren) { - if (pbxGroupChild(file).value == pluginsGroupChildren[i].value && - pbxGroupChild(file).comment == pluginsGroupChildren[i].comment) { + const pluginsGroupChildren = this.pbxGroupByName('Resources').children; + for (const i in pluginsGroupChildren) { + if (pbxGroupChild(file).value === pluginsGroupChildren[i].value && + pbxGroupChild(file).comment === pluginsGroupChildren[i].comment) { pluginsGroupChildren.splice(i, 1); break; } } -} +}; -pbxProject.prototype.addToFrameworksPbxGroup = function(file) { - var pluginsGroup = this.pbxGroupByName('Frameworks'); +PBXProject.prototype.addToFrameworksPbxGroup = function (file) { + const pluginsGroup = this.pbxGroupByName('Frameworks'); if (!pluginsGroup) { this.addPbxGroup([file.path], 'Frameworks'); } else { pluginsGroup.children.push(pbxGroupChild(file)); } -} +}; -pbxProject.prototype.removeFromFrameworksPbxGroup = function(file) { +PBXProject.prototype.removeFromFrameworksPbxGroup = function (file) { if (!this.pbxGroupByName('Frameworks')) { return null; } - var pluginsGroupChildren = this.pbxGroupByName('Frameworks').children; + const pluginsGroupChildren = this.pbxGroupByName('Frameworks').children; - for (i in pluginsGroupChildren) { - if (pbxGroupChild(file).value == pluginsGroupChildren[i].value && - pbxGroupChild(file).comment == pluginsGroupChildren[i].comment) { + for (const i in pluginsGroupChildren) { + if (pbxGroupChild(file).value === pluginsGroupChildren[i].value && + pbxGroupChild(file).comment === pluginsGroupChildren[i].comment) { pluginsGroupChildren.splice(i, 1); break; } } -} +}; -pbxProject.prototype.addToPbxEmbedFrameworksBuildPhase = function (file) { - var sources = this.pbxEmbedFrameworksBuildPhaseObj(file.target); +PBXProject.prototype.addToPbxEmbedFrameworksBuildPhase = function (file) { + const sources = this.pbxEmbedFrameworksBuildPhaseObj(file.target); if (sources) { sources.files.push(pbxBuildPhaseObj(file)); } -} +}; -pbxProject.prototype.removeFromPbxEmbedFrameworksBuildPhase = function (file) { - var sources = this.pbxEmbedFrameworksBuildPhaseObj(file.target); +PBXProject.prototype.removeFromPbxEmbedFrameworksBuildPhase = function (file) { + const sources = this.pbxEmbedFrameworksBuildPhaseObj(file.target); if (sources) { - var files = []; - for (i in sources.files) { - if (sources.files[i].comment != longComment(file)) { + const files = []; + for (const i in sources.files) { + if (sources.files[i].comment !== longComment(file)) { files.push(sources.files[i]); } } sources.files = files; } -} +}; -pbxProject.prototype.addToProductsPbxGroup = function(file) { - var productsGroup = this.pbxGroupByName('Products'); +PBXProject.prototype.addToProductsPbxGroup = function (file) { + const productsGroup = this.pbxGroupByName('Products'); if (!productsGroup) { this.addPbxGroup([file.path], 'Products'); } else { productsGroup.children.push(pbxGroupChild(file)); } -} +}; -pbxProject.prototype.removeFromProductsPbxGroup = function(file) { +PBXProject.prototype.removeFromProductsPbxGroup = function (file) { if (!this.pbxGroupByName('Products')) { return null; } - var productsGroupChildren = this.pbxGroupByName('Products').children, i; - for (i in productsGroupChildren) { - if (pbxGroupChild(file).value == productsGroupChildren[i].value && - pbxGroupChild(file).comment == productsGroupChildren[i].comment) { + const productsGroupChildren = this.pbxGroupByName('Products').children; + for (const i in productsGroupChildren) { + if (pbxGroupChild(file).value === productsGroupChildren[i].value && + pbxGroupChild(file).comment === productsGroupChildren[i].comment) { productsGroupChildren.splice(i, 1); break; } } -} +}; -pbxProject.prototype.addToPbxSourcesBuildPhase = function(file) { - var sources = this.pbxSourcesBuildPhaseObj(file.target); +PBXProject.prototype.addToPbxSourcesBuildPhase = function (file) { + const sources = this.pbxSourcesBuildPhaseObj(file.target); sources.files.push(pbxBuildPhaseObj(file)); -} - -pbxProject.prototype.removeFromPbxSourcesBuildPhase = function(file) { +}; - var sources = this.pbxSourcesBuildPhaseObj(file.target), i; - for (i in sources.files) { - if (sources.files[i].comment == longComment(file)) { +PBXProject.prototype.removeFromPbxSourcesBuildPhase = function (file) { + const sources = this.pbxSourcesBuildPhaseObj(file.target); + for (const i in sources.files) { + if (sources.files[i].comment === longComment(file)) { sources.files.splice(i, 1); break; } } -} +}; -pbxProject.prototype.addToPbxResourcesBuildPhase = function(file) { - var sources = this.pbxResourcesBuildPhaseObj(file.target); +PBXProject.prototype.addToPbxResourcesBuildPhase = function (file) { + const sources = this.pbxResourcesBuildPhaseObj(file.target); sources.files.push(pbxBuildPhaseObj(file)); -} +}; -pbxProject.prototype.removeFromPbxResourcesBuildPhase = function(file) { - var sources = this.pbxResourcesBuildPhaseObj(file.target), i; +PBXProject.prototype.removeFromPbxResourcesBuildPhase = function (file) { + const sources = this.pbxResourcesBuildPhaseObj(file.target); - for (i in sources.files) { - if (sources.files[i].comment == longComment(file)) { + for (const i in sources.files) { + if (sources.files[i].comment === longComment(file)) { sources.files.splice(i, 1); break; } } -} +}; -pbxProject.prototype.addToPbxFrameworksBuildPhase = function(file) { - var sources = this.pbxFrameworksBuildPhaseObj(file.target); +PBXProject.prototype.addToPbxFrameworksBuildPhase = function (file) { + const sources = this.pbxFrameworksBuildPhaseObj(file.target); sources.files.push(pbxBuildPhaseObj(file)); -} +}; -pbxProject.prototype.removeFromPbxFrameworksBuildPhase = function(file) { - var sources = this.pbxFrameworksBuildPhaseObj(file.target); - for (i in sources.files) { - if (sources.files[i].comment == longComment(file)) { +PBXProject.prototype.removeFromPbxFrameworksBuildPhase = function (file) { + const sources = this.pbxFrameworksBuildPhaseObj(file.target); + for (const i in sources.files) { + if (sources.files[i].comment === longComment(file)) { sources.files.splice(i, 1); break; } } -} +}; -pbxProject.prototype.addXCConfigurationList = function(configurationObjectsArray, defaultConfigurationName, comment) { - var pbxBuildConfigurationSection = this.pbxXCBuildConfigurationSection(), - pbxXCConfigurationListSection = this.pbxXCConfigurationList(), - xcConfigurationListUuid = this.generateUuid(), - commentKey = f("%s_comment", xcConfigurationListUuid), - xcConfigurationList = { - isa: 'XCConfigurationList', - buildConfigurations: [], - defaultConfigurationIsVisible: 0, - defaultConfigurationName: defaultConfigurationName - }; +PBXProject.prototype.addXCConfigurationList = function (configurationObjectsArray, defaultConfigurationName, comment) { + const pbxBuildConfigurationSection = this.pbxXCBuildConfigurationSection(); + const pbxXCConfigurationListSection = this.pbxXCConfigurationList(); + const xcConfigurationListUuid = this.generateUuid(); + const commentKey = f('%s_comment', xcConfigurationListUuid); + const xcConfigurationList = { + isa: 'XCConfigurationList', + buildConfigurations: [], + defaultConfigurationIsVisible: 0, + defaultConfigurationName + }; - for (var index = 0; index < configurationObjectsArray.length; index++) { - var configuration = configurationObjectsArray[index], - configurationUuid = this.generateUuid(), - configurationCommentKey = f("%s_comment", configurationUuid); + for (let index = 0; index < configurationObjectsArray.length; index++) { + const configuration = configurationObjectsArray[index]; + const configurationUuid = this.generateUuid(); + const configurationCommentKey = f('%s_comment', configurationUuid); pbxBuildConfigurationSection[configurationUuid] = configuration; pbxBuildConfigurationSection[configurationCommentKey] = configuration.name; @@ -813,87 +796,84 @@ pbxProject.prototype.addXCConfigurationList = function(configurationObjectsArray pbxXCConfigurationListSection[commentKey] = comment; } - return { uuid: xcConfigurationListUuid, xcConfigurationList: xcConfigurationList }; -} - -pbxProject.prototype.addTargetDependency = function(target, dependencyTargets) { - if (!target) - return undefined; - - var nativeTargets = this.pbxNativeTargetSection(); - - if (typeof nativeTargets[target] == "undefined") - throw new Error("Invalid target: " + target); - - for (var index = 0; index < dependencyTargets.length; index++) { - var dependencyTarget = dependencyTargets[index]; - if (typeof nativeTargets[dependencyTarget] == "undefined") - throw new Error("Invalid target: " + dependencyTarget); - } + return { uuid: xcConfigurationListUuid, xcConfigurationList }; +}; - var pbxTargetDependency = 'PBXTargetDependency', - pbxContainerItemProxy = 'PBXContainerItemProxy', - pbxTargetDependencySection = this.hash.project.objects[pbxTargetDependency], - pbxContainerItemProxySection = this.hash.project.objects[pbxContainerItemProxy]; - - for (var index = 0; index < dependencyTargets.length; index++) { - var dependencyTargetUuid = dependencyTargets[index], - dependencyTargetCommentKey = f("%s_comment", dependencyTargetUuid), - targetDependencyUuid = this.generateUuid(), - targetDependencyCommentKey = f("%s_comment", targetDependencyUuid), - itemProxyUuid = this.generateUuid(), - itemProxyCommentKey = f("%s_comment", itemProxyUuid), - itemProxy = { - isa: pbxContainerItemProxy, - containerPortal: this.hash.project['rootObject'], - containerPortal_comment: this.hash.project['rootObject_comment'], - proxyType: 1, - remoteGlobalIDString: dependencyTargetUuid, - remoteInfo: nativeTargets[dependencyTargetUuid].name - }, - targetDependency = { - isa: pbxTargetDependency, - target: dependencyTargetUuid, - target_comment: nativeTargets[dependencyTargetCommentKey], - targetProxy: itemProxyUuid, - targetProxy_comment: pbxContainerItemProxy - }; +PBXProject.prototype.addTargetDependency = function (target, dependencyTargets) { + if (!target) { return undefined; } + + const nativeTargets = this.pbxNativeTargetSection(); + + if (typeof nativeTargets[target] === 'undefined') { throw new Error('Invalid target: ' + target); } + + for (let index = 0; index < dependencyTargets.length; index++) { + const dependencyTarget = dependencyTargets[index]; + if (typeof nativeTargets[dependencyTarget] === 'undefined') { throw new Error('Invalid target: ' + dependencyTarget); } + } + + const pbxTargetDependency = 'PBXTargetDependency'; + const pbxContainerItemProxy = 'PBXContainerItemProxy'; + const pbxTargetDependencySection = this.hash.project.objects[pbxTargetDependency]; + const pbxContainerItemProxySection = this.hash.project.objects[pbxContainerItemProxy]; + + for (let index = 0; index < dependencyTargets.length; index++) { + const dependencyTargetUuid = dependencyTargets[index]; + const dependencyTargetCommentKey = f('%s_comment', dependencyTargetUuid); + const targetDependencyUuid = this.generateUuid(); + const targetDependencyCommentKey = f('%s_comment', targetDependencyUuid); + const itemProxyUuid = this.generateUuid(); + const itemProxyCommentKey = f('%s_comment', itemProxyUuid); + const itemProxy = { + isa: pbxContainerItemProxy, + containerPortal: this.hash.project.rootObject, + containerPortal_comment: this.hash.project.rootObject_comment, + proxyType: 1, + remoteGlobalIDString: dependencyTargetUuid, + remoteInfo: nativeTargets[dependencyTargetUuid].name + }; + const targetDependency = { + isa: pbxTargetDependency, + target: dependencyTargetUuid, + target_comment: nativeTargets[dependencyTargetCommentKey], + targetProxy: itemProxyUuid, + targetProxy_comment: pbxContainerItemProxy + }; if (pbxContainerItemProxySection && pbxTargetDependencySection) { pbxContainerItemProxySection[itemProxyUuid] = itemProxy; pbxContainerItemProxySection[itemProxyCommentKey] = pbxContainerItemProxy; pbxTargetDependencySection[targetDependencyUuid] = targetDependency; pbxTargetDependencySection[targetDependencyCommentKey] = pbxTargetDependency; - nativeTargets[target].dependencies.push({ value: targetDependencyUuid, comment: pbxTargetDependency }) + nativeTargets[target].dependencies.push({ value: targetDependencyUuid, comment: pbxTargetDependency }); } } return { uuid: target, target: nativeTargets[target] }; -} +}; -pbxProject.prototype.addBuildPhase = function(filePathsArray, buildPhaseType, comment, target, optionsOrFolderType, subfolderPath) { - var buildPhaseSection, - fileReferenceSection = this.pbxFileReferenceSection(), - buildFileSection = this.pbxBuildFileSection(), - buildPhaseUuid = this.generateUuid(), - buildPhaseTargetUuid = target || this.getFirstTarget().uuid, - commentKey = f("%s_comment", buildPhaseUuid), - buildPhase = { - isa: buildPhaseType, - buildActionMask: 2147483647, - files: [], - runOnlyForDeploymentPostprocessing: 0 - }, - filePathToBuildFile = {}; +PBXProject.prototype.addBuildPhase = function (filePathsArray, buildPhaseType, comment, target, optionsOrFolderType, subfolderPath) { + let buildPhaseSection; + const fileReferenceSection = this.pbxFileReferenceSection(); + const buildFileSection = this.pbxBuildFileSection(); + const buildPhaseUuid = this.generateUuid(); + const buildPhaseTargetUuid = target || this.getFirstTarget().uuid; + const commentKey = f('%s_comment', buildPhaseUuid); + let buildPhase = { + isa: buildPhaseType, + buildActionMask: 2147483647, + files: [], + runOnlyForDeploymentPostprocessing: 0 + }; + const filePathToBuildFile = {}; if (buildPhaseType === 'PBXCopyFilesBuildPhase') { buildPhase = pbxCopyFilesBuildPhaseObj(buildPhase, optionsOrFolderType, subfolderPath, comment); } else if (buildPhaseType === 'PBXShellScriptBuildPhase') { - buildPhase = pbxShellScriptBuildPhaseObj(buildPhase, optionsOrFolderType, comment) + buildPhase = pbxShellScriptBuildPhaseObj(buildPhase, optionsOrFolderType, comment); } if (!this.hash.project.objects[buildPhaseType]) { - this.hash.project.objects[buildPhaseType] = new Object(); + this.hash.project.objects[buildPhaseType] = {}; } if (!this.hash.project.objects[buildPhaseType][buildPhaseUuid]) { @@ -901,34 +881,32 @@ pbxProject.prototype.addBuildPhase = function(filePathsArray, buildPhaseType, co this.hash.project.objects[buildPhaseType][commentKey] = comment; } - if (this.hash.project.objects['PBXNativeTarget'][buildPhaseTargetUuid]['buildPhases']) { - this.hash.project.objects['PBXNativeTarget'][buildPhaseTargetUuid]['buildPhases'].push({ + if (this.hash.project.objects.PBXNativeTarget[buildPhaseTargetUuid].buildPhases) { + this.hash.project.objects.PBXNativeTarget[buildPhaseTargetUuid].buildPhases.push({ value: buildPhaseUuid, - comment: comment - }) - + comment + }); } - - for (var key in buildFileSection) { + for (const key in buildFileSection) { // only look for comments if (!COMMENT_KEY.test(key)) continue; - var buildFileKey = key.split(COMMENT_KEY)[0], - buildFile = buildFileSection[buildFileKey]; - fileReference = fileReferenceSection[buildFile.fileRef]; + const buildFileKey = key.split(COMMENT_KEY)[0]; + const buildFile = buildFileSection[buildFileKey]; + const fileReference = fileReferenceSection[buildFile.fileRef]; if (!fileReference) continue; - var pbxFileObj = new pbxFile(fileReference.path); + const pbxFileObj = new PBXFile(fileReference.path); filePathToBuildFile[fileReference.path] = { uuid: buildFileKey, basename: pbxFileObj.basename, group: pbxFileObj.group }; } - for (var index = 0; index < filePathsArray.length; index++) { - var filePath = filePathsArray[index], - filePathQuoted = "\"" + filePath + "\"", - file = new pbxFile(filePath); + for (let index = 0; index < filePathsArray.length; index++) { + const filePath = filePathsArray[index]; + const filePathQuoted = '"' + filePath + '"'; + const file = new PBXFile(filePath); if (filePathToBuildFile[filePath]) { buildPhase.files.push(pbxBuildPhaseObj(filePathToBuildFile[filePath])); @@ -940,8 +918,8 @@ pbxProject.prototype.addBuildPhase = function(filePathsArray, buildPhaseType, co file.uuid = this.generateUuid(); file.fileRef = this.generateUuid(); - this.addToPbxFileReferenceSection(file); // PBXFileReference - this.addToPbxBuildFileSection(file); // PBXBuildFile + this.addToPbxFileReferenceSection(file); // PBXFileReference + this.addToPbxBuildFileSection(file); // PBXBuildFile buildPhase.files.push(pbxBuildPhaseObj(file)); } @@ -950,176 +928,171 @@ pbxProject.prototype.addBuildPhase = function(filePathsArray, buildPhaseType, co buildPhaseSection[commentKey] = comment; } - return { uuid: buildPhaseUuid, buildPhase: buildPhase }; -} + return { uuid: buildPhaseUuid, buildPhase }; +}; // helper access functions -pbxProject.prototype.pbxProjectSection = function() { - return this.hash.project.objects['PBXProject']; -} -pbxProject.prototype.pbxBuildFileSection = function() { - return this.hash.project.objects['PBXBuildFile']; -} +PBXProject.prototype.pbxProjectSection = function () { + return this.hash.project.objects.PBXProject; +}; +PBXProject.prototype.pbxBuildFileSection = function () { + return this.hash.project.objects.PBXBuildFile; +}; -pbxProject.prototype.pbxXCBuildConfigurationSection = function() { - return this.hash.project.objects['XCBuildConfiguration']; -} +PBXProject.prototype.pbxXCBuildConfigurationSection = function () { + return this.hash.project.objects.XCBuildConfiguration; +}; -pbxProject.prototype.pbxFileReferenceSection = function() { - return this.hash.project.objects['PBXFileReference']; -} +PBXProject.prototype.pbxFileReferenceSection = function () { + return this.hash.project.objects.PBXFileReference; +}; -pbxProject.prototype.pbxNativeTargetSection = function() { - return this.hash.project.objects['PBXNativeTarget']; -} +PBXProject.prototype.pbxNativeTargetSection = function () { + return this.hash.project.objects.PBXNativeTarget; +}; -pbxProject.prototype.xcVersionGroupSection = function () { - if (typeof this.hash.project.objects['XCVersionGroup'] !== 'object') { - this.hash.project.objects['XCVersionGroup'] = {}; +PBXProject.prototype.xcVersionGroupSection = function () { + if (typeof this.hash.project.objects.XCVersionGroup !== 'object') { + this.hash.project.objects.XCVersionGroup = {}; } - return this.hash.project.objects['XCVersionGroup']; -} + return this.hash.project.objects.XCVersionGroup; +}; -pbxProject.prototype.pbxXCConfigurationList = function() { - return this.hash.project.objects['XCConfigurationList']; -} +PBXProject.prototype.pbxXCConfigurationList = function () { + return this.hash.project.objects.XCConfigurationList; +}; -pbxProject.prototype.pbxGroupByName = function(name) { - var groups = this.hash.project.objects['PBXGroup'], - key, groupKey; +PBXProject.prototype.pbxGroupByName = function (name) { + const groups = this.hash.project.objects.PBXGroup; + let groupKey; - for (key in groups) { + for (const key in groups) { // only look for comments if (!COMMENT_KEY.test(key)) continue; - if (groups[key] == name) { + if (groups[key] === name) { groupKey = key.split(COMMENT_KEY)[0]; return groups[groupKey]; } } return null; -} +}; -pbxProject.prototype.pbxTargetByName = function(name) { +PBXProject.prototype.pbxTargetByName = function (name) { return this.pbxItemByComment(name, 'PBXNativeTarget'); -} +}; -pbxProject.prototype.findTargetKey = function(name) { - var targets = this.hash.project.objects['PBXNativeTarget']; +PBXProject.prototype.findTargetKey = function (name) { + const targets = this.hash.project.objects.PBXNativeTarget; - for (var key in targets) { + for (const key in targets) { // only look for comments if (COMMENT_KEY.test(key)) continue; - var target = targets[key]; + const target = targets[key]; if (target.name === name) { return key; } } return null; -} +}; -pbxProject.prototype.pbxItemByComment = function(name, pbxSectionName) { - var section = this.hash.project.objects[pbxSectionName], - key, itemKey; +PBXProject.prototype.pbxItemByComment = function (name, pbxSectionName) { + const section = this.hash.project.objects[pbxSectionName]; + let itemKey; - for (key in section) { + for (const key in section) { // only look for comments if (!COMMENT_KEY.test(key)) continue; - if (section[key] == name) { + if (section[key] === name) { itemKey = key.split(COMMENT_KEY)[0]; return section[itemKey]; } } return null; -} +}; -pbxProject.prototype.pbxSourcesBuildPhaseObj = function(target) { +PBXProject.prototype.pbxSourcesBuildPhaseObj = function (target) { return this.buildPhaseObject('PBXSourcesBuildPhase', 'Sources', target); -} +}; -pbxProject.prototype.pbxResourcesBuildPhaseObj = function(target) { +PBXProject.prototype.pbxResourcesBuildPhaseObj = function (target) { return this.buildPhaseObject('PBXResourcesBuildPhase', 'Resources', target); -} +}; -pbxProject.prototype.pbxFrameworksBuildPhaseObj = function(target) { +PBXProject.prototype.pbxFrameworksBuildPhaseObj = function (target) { return this.buildPhaseObject('PBXFrameworksBuildPhase', 'Frameworks', target); -} +}; -pbxProject.prototype.pbxEmbedFrameworksBuildPhaseObj = function (target) { +PBXProject.prototype.pbxEmbedFrameworksBuildPhaseObj = function (target) { return this.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed Frameworks', target); }; // Find Build Phase from group/target -pbxProject.prototype.buildPhase = function(group, target) { - - if (!target) - return undefined; - - var nativeTargets = this.pbxNativeTargetSection(); - if (typeof nativeTargets[target] == "undefined") - throw new Error("Invalid target: " + target); - - var nativeTarget = nativeTargets[target]; - var buildPhases = nativeTarget.buildPhases; - for(var i in buildPhases) - { - var buildPhase = buildPhases[i]; - if (buildPhase.comment==group) - return buildPhase.value + "_comment"; - } - } +PBXProject.prototype.buildPhase = function (group, target) { + if (!target) { return undefined; } + + const nativeTargets = this.pbxNativeTargetSection(); + if (typeof nativeTargets[target] === 'undefined') { throw new Error('Invalid target: ' + target); } -pbxProject.prototype.buildPhaseObject = function(name, group, target) { - var section = this.hash.project.objects[name], - obj, sectionKey, key; - var buildPhase = this.buildPhase(group, target); + const nativeTarget = nativeTargets[target]; + const buildPhases = nativeTarget.buildPhases; + for (const i in buildPhases) { + const buildPhase = buildPhases[i]; + if (buildPhase.comment === group) { return buildPhase.value + '_comment'; } + } +}; - for (key in section) { +PBXProject.prototype.buildPhaseObject = function (name, group, target) { + const section = this.hash.project.objects[name]; + let sectionKey; + const buildPhase = this.buildPhase(group, target); + for (const key in section) { // only look for comments if (!COMMENT_KEY.test(key)) continue; // select the proper buildPhase - if (buildPhase && buildPhase!=key) - continue; - if (section[key] == group) { + if (buildPhase && buildPhase !== key) { continue; } + if (section[key] === group) { sectionKey = key.split(COMMENT_KEY)[0]; return section[sectionKey]; } } return null; -} +}; -pbxProject.prototype.addBuildProperty = function(prop, value, build_name) { - var configurations = nonComments(this.pbxXCBuildConfigurationSection()), - key, configuration; +PBXProject.prototype.addBuildProperty = function (prop, value, build_name) { + const configurations = nonComments(this.pbxXCBuildConfigurationSection()); + let configuration; - for (key in configurations){ + for (const key in configurations) { configuration = configurations[key]; - if (!build_name || configuration.name === build_name){ + if (!build_name || configuration.name === build_name) { configuration.buildSettings[prop] = value; } } -} +}; -pbxProject.prototype.removeBuildProperty = function(prop, build_name) { - var configurations = nonComments(this.pbxXCBuildConfigurationSection()), - key, configuration; +PBXProject.prototype.removeBuildProperty = function (prop, build_name) { + const configurations = nonComments(this.pbxXCBuildConfigurationSection()); + let configuration; - for (key in configurations){ + for (const key in configurations) { configuration = configurations[key]; - if (configuration.buildSettings[prop] && - !build_name || configuration.name === build_name){ + if ( + configuration.buildSettings[prop] && + (!build_name || configuration.name === build_name) + ) { delete configuration.buildSettings[prop]; } } -} +}; /** * @@ -1128,10 +1101,10 @@ pbxProject.prototype.removeBuildProperty = function(prop, build_name) { * @param build {String} Release or Debug * @param targetName {String} the target which will be updated */ -pbxProject.prototype.updateBuildProperty = function(prop, value, build, targetName) { - let validConfigs = []; +PBXProject.prototype.updateBuildProperty = function (prop, value, build, targetName) { + const validConfigs = []; - if(targetName) { + if (targetName) { const target = this.pbxTargetByName(targetName); const targetBuildConfigs = target && target.buildConfigurationList; @@ -1150,230 +1123,230 @@ pbxProject.prototype.updateBuildProperty = function(prop, value, build, targetNa } } } - - var configs = this.pbxXCBuildConfigurationSection(); - for (var configName in configs) { + + const configs = this.pbxXCBuildConfigurationSection(); + for (const configName in configs) { if (!COMMENT_KEY.test(configName)) { if (targetName && !validConfigs.includes(configName)) continue; - var config = configs[configName]; - if ( (build && config.name === build) || (!build) ) { + const config = configs[configName]; + if ((build && config.name === build) || (!build)) { config.buildSettings[prop] = value; } } } -} +}; -pbxProject.prototype.updateProductName = function(name) { +PBXProject.prototype.updateProductName = function (name) { this.updateBuildProperty('PRODUCT_NAME', '"' + name + '"'); -} +}; -pbxProject.prototype.removeFromFrameworkSearchPaths = function(file) { - var configurations = nonComments(this.pbxXCBuildConfigurationSection()), - INHERITED = '"$(inherited)"', - SEARCH_PATHS = 'FRAMEWORK_SEARCH_PATHS', - config, buildSettings, searchPaths; - var new_path = searchPathForFile(file, this); +PBXProject.prototype.removeFromFrameworkSearchPaths = function (file) { + const configurations = nonComments(this.pbxXCBuildConfigurationSection()); + const SEARCH_PATHS = 'FRAMEWORK_SEARCH_PATHS'; + let config; + let buildSettings; + let searchPaths; + const new_path = searchPathForFile(file, this); for (config in configurations) { buildSettings = configurations[config].buildSettings; - if (unquote(buildSettings['PRODUCT_NAME']) != this.productName) - continue; + if (unquote(buildSettings.PRODUCT_NAME) !== this.productName) { continue; } searchPaths = buildSettings[SEARCH_PATHS]; if (searchPaths && Array.isArray(searchPaths)) { - var matches = searchPaths.filter(function(p) { + const matches = searchPaths.filter(function (p) { return p.indexOf(new_path) > -1; }); - matches.forEach(function(m) { - var idx = searchPaths.indexOf(m); + matches.forEach(function (m) { + const idx = searchPaths.indexOf(m); searchPaths.splice(idx, 1); }); } } -} +}; -pbxProject.prototype.addToFrameworkSearchPaths = function(file) { - var configurations = nonComments(this.pbxXCBuildConfigurationSection()), - INHERITED = '"$(inherited)"', - config, buildSettings, searchPaths; +PBXProject.prototype.addToFrameworkSearchPaths = function (file) { + const configurations = nonComments(this.pbxXCBuildConfigurationSection()); + const INHERITED = '"$(inherited)"'; + let config; + let buildSettings; for (config in configurations) { buildSettings = configurations[config].buildSettings; - if (unquote(buildSettings['PRODUCT_NAME']) != this.productName) - continue; + if (unquote(buildSettings.PRODUCT_NAME) !== this.productName) { continue; } - if (!buildSettings['FRAMEWORK_SEARCH_PATHS'] - || buildSettings['FRAMEWORK_SEARCH_PATHS'] === INHERITED) { - buildSettings['FRAMEWORK_SEARCH_PATHS'] = [INHERITED]; + if (!buildSettings.FRAMEWORK_SEARCH_PATHS || + buildSettings.FRAMEWORK_SEARCH_PATHS === INHERITED) { + buildSettings.FRAMEWORK_SEARCH_PATHS = [INHERITED]; } - buildSettings['FRAMEWORK_SEARCH_PATHS'].push(searchPathForFile(file, this)); + buildSettings.FRAMEWORK_SEARCH_PATHS.push(searchPathForFile(file, this)); } -} +}; -pbxProject.prototype.removeFromLibrarySearchPaths = function(file) { - var configurations = nonComments(this.pbxXCBuildConfigurationSection()), - INHERITED = '"$(inherited)"', - SEARCH_PATHS = 'LIBRARY_SEARCH_PATHS', - config, buildSettings, searchPaths; - var new_path = searchPathForFile(file, this); +PBXProject.prototype.removeFromLibrarySearchPaths = function (file) { + const configurations = nonComments(this.pbxXCBuildConfigurationSection()); + const SEARCH_PATHS = 'LIBRARY_SEARCH_PATHS'; + let config; + let buildSettings; + let searchPaths; + const new_path = searchPathForFile(file, this); for (config in configurations) { buildSettings = configurations[config].buildSettings; - if (unquote(buildSettings['PRODUCT_NAME']) != this.productName) - continue; + if (unquote(buildSettings.PRODUCT_NAME) !== this.productName) { continue; } searchPaths = buildSettings[SEARCH_PATHS]; if (searchPaths && Array.isArray(searchPaths)) { - var matches = searchPaths.filter(function(p) { + const matches = searchPaths.filter(function (p) { return p.indexOf(new_path) > -1; }); - matches.forEach(function(m) { - var idx = searchPaths.indexOf(m); + matches.forEach(function (m) { + const idx = searchPaths.indexOf(m); searchPaths.splice(idx, 1); }); } - } -} +}; -pbxProject.prototype.addToLibrarySearchPaths = function(file) { - var configurations = nonComments(this.pbxXCBuildConfigurationSection()), - INHERITED = '"$(inherited)"', - config, buildSettings, searchPaths; +PBXProject.prototype.addToLibrarySearchPaths = function (file) { + const configurations = nonComments(this.pbxXCBuildConfigurationSection()); + const INHERITED = '"$(inherited)"'; + let config; + let buildSettings; for (config in configurations) { buildSettings = configurations[config].buildSettings; - if (unquote(buildSettings['PRODUCT_NAME']) != this.productName) - continue; + if (unquote(buildSettings.PRODUCT_NAME) !== this.productName) { continue; } - if (!buildSettings['LIBRARY_SEARCH_PATHS'] - || buildSettings['LIBRARY_SEARCH_PATHS'] === INHERITED) { - buildSettings['LIBRARY_SEARCH_PATHS'] = [INHERITED]; + if (!buildSettings.LIBRARY_SEARCH_PATHS || + buildSettings.LIBRARY_SEARCH_PATHS === INHERITED) { + buildSettings.LIBRARY_SEARCH_PATHS = [INHERITED]; } if (typeof file === 'string') { - buildSettings['LIBRARY_SEARCH_PATHS'].push(file); + buildSettings.LIBRARY_SEARCH_PATHS.push(file); } else { - buildSettings['LIBRARY_SEARCH_PATHS'].push(searchPathForFile(file, this)); + buildSettings.LIBRARY_SEARCH_PATHS.push(searchPathForFile(file, this)); } } -} +}; -pbxProject.prototype.removeFromHeaderSearchPaths = function(file) { - var configurations = nonComments(this.pbxXCBuildConfigurationSection()), - INHERITED = '"$(inherited)"', - SEARCH_PATHS = 'HEADER_SEARCH_PATHS', - config, buildSettings, searchPaths; - var new_path = searchPathForFile(file, this); +PBXProject.prototype.removeFromHeaderSearchPaths = function (file) { + const configurations = nonComments(this.pbxXCBuildConfigurationSection()); + const SEARCH_PATHS = 'HEADER_SEARCH_PATHS'; + let config; + let buildSettings; + const new_path = searchPathForFile(file, this); for (config in configurations) { buildSettings = configurations[config].buildSettings; - if (unquote(buildSettings['PRODUCT_NAME']) != this.productName) - continue; + if (unquote(buildSettings.PRODUCT_NAME) !== this.productName) { continue; } if (buildSettings[SEARCH_PATHS]) { - var matches = buildSettings[SEARCH_PATHS].filter(function(p) { + const matches = buildSettings[SEARCH_PATHS].filter(function (p) { return p.indexOf(new_path) > -1; }); - matches.forEach(function(m) { - var idx = buildSettings[SEARCH_PATHS].indexOf(m); + matches.forEach(function (m) { + const idx = buildSettings[SEARCH_PATHS].indexOf(m); buildSettings[SEARCH_PATHS].splice(idx, 1); }); } - } -} -pbxProject.prototype.addToHeaderSearchPaths = function(file) { - var configurations = nonComments(this.pbxXCBuildConfigurationSection()), - INHERITED = '"$(inherited)"', - config, buildSettings, searchPaths; +}; +PBXProject.prototype.addToHeaderSearchPaths = function (file) { + const configurations = nonComments(this.pbxXCBuildConfigurationSection()); + const INHERITED = '"$(inherited)"'; + let config; + let buildSettings; for (config in configurations) { buildSettings = configurations[config].buildSettings; - if (unquote(buildSettings['PRODUCT_NAME']) != this.productName) - continue; + if (unquote(buildSettings.PRODUCT_NAME) !== this.productName) { continue; } - if (!buildSettings['HEADER_SEARCH_PATHS']) { - buildSettings['HEADER_SEARCH_PATHS'] = [INHERITED]; + if (!buildSettings.HEADER_SEARCH_PATHS) { + buildSettings.HEADER_SEARCH_PATHS = [INHERITED]; } if (typeof file === 'string') { - buildSettings['HEADER_SEARCH_PATHS'].push(file); + buildSettings.HEADER_SEARCH_PATHS.push(file); } else { - buildSettings['HEADER_SEARCH_PATHS'].push(searchPathForFile(file, this)); + buildSettings.HEADER_SEARCH_PATHS.push(searchPathForFile(file, this)); } } -} +}; -pbxProject.prototype.addToOtherLinkerFlags = function (flag) { - var configurations = nonComments(this.pbxXCBuildConfigurationSection()), - INHERITED = '"$(inherited)"', - OTHER_LDFLAGS = 'OTHER_LDFLAGS', - config, buildSettings; +PBXProject.prototype.addToOtherLinkerFlags = function (flag) { + const configurations = nonComments(this.pbxXCBuildConfigurationSection()); + const INHERITED = '"$(inherited)"'; + const OTHER_LDFLAGS = 'OTHER_LDFLAGS'; + let config; + let buildSettings; for (config in configurations) { buildSettings = configurations[config].buildSettings; - if (unquote(buildSettings['PRODUCT_NAME']) != this.productName) - continue; + if (unquote(buildSettings.PRODUCT_NAME) !== this.productName) { continue; } - if (!buildSettings[OTHER_LDFLAGS] - || buildSettings[OTHER_LDFLAGS] === INHERITED) { + if (!buildSettings[OTHER_LDFLAGS] || + buildSettings[OTHER_LDFLAGS] === INHERITED) { buildSettings[OTHER_LDFLAGS] = [INHERITED]; } buildSettings[OTHER_LDFLAGS].push(flag); } -} +}; -pbxProject.prototype.removeFromOtherLinkerFlags = function (flag) { - var configurations = nonComments(this.pbxXCBuildConfigurationSection()), - OTHER_LDFLAGS = 'OTHER_LDFLAGS', - config, buildSettings; +PBXProject.prototype.removeFromOtherLinkerFlags = function (flag) { + const configurations = nonComments(this.pbxXCBuildConfigurationSection()); + const OTHER_LDFLAGS = 'OTHER_LDFLAGS'; + let config; + let buildSettings; for (config in configurations) { buildSettings = configurations[config].buildSettings; - if (unquote(buildSettings['PRODUCT_NAME']) != this.productName) { + if (unquote(buildSettings.PRODUCT_NAME) !== this.productName) { continue; } if (buildSettings[OTHER_LDFLAGS]) { - var matches = buildSettings[OTHER_LDFLAGS].filter(function (p) { + const matches = buildSettings[OTHER_LDFLAGS].filter(function (p) { return p.indexOf(flag) > -1; }); matches.forEach(function (m) { - var idx = buildSettings[OTHER_LDFLAGS].indexOf(m); + const idx = buildSettings[OTHER_LDFLAGS].indexOf(m); buildSettings[OTHER_LDFLAGS].splice(idx, 1); }); } } -} +}; -pbxProject.prototype.addToBuildSettings = function (buildSetting, value) { - var configurations = nonComments(this.pbxXCBuildConfigurationSection()), - config, buildSettings; +PBXProject.prototype.addToBuildSettings = function (buildSetting, value) { + const configurations = nonComments(this.pbxXCBuildConfigurationSection()); + let config; + let buildSettings; for (config in configurations) { buildSettings = configurations[config].buildSettings; buildSettings[buildSetting] = value; } -} +}; -pbxProject.prototype.removeFromBuildSettings = function (buildSetting) { - var configurations = nonComments(this.pbxXCBuildConfigurationSection()), - config, buildSettings; +PBXProject.prototype.removeFromBuildSettings = function (buildSetting) { + const configurations = nonComments(this.pbxXCBuildConfigurationSection()); + let config; + let buildSettings; for (config in configurations) { buildSettings = configurations[config].buildSettings; @@ -1382,15 +1355,16 @@ pbxProject.prototype.removeFromBuildSettings = function (buildSetting) { delete buildSettings[buildSetting]; } } -} +}; // a JS getter. hmmm -pbxProject.prototype.__defineGetter__("productName", function() { - var configurations = nonComments(this.pbxXCBuildConfigurationSection()), - config, productName; +PBXProject.prototype.__defineGetter__('productName', function () { + const configurations = nonComments(this.pbxXCBuildConfigurationSection()); + let config; + let productName; for (config in configurations) { - productName = configurations[config].buildSettings['PRODUCT_NAME']; + productName = configurations[config].buildSettings.PRODUCT_NAME; if (productName) { return unquote(productName); @@ -1399,45 +1373,46 @@ pbxProject.prototype.__defineGetter__("productName", function() { }); // check if file is present -pbxProject.prototype.hasFile = function(filePath) { - var files = nonComments(this.pbxFileReferenceSection()), - file, id; +PBXProject.prototype.hasFile = function (filePath) { + const files = nonComments(this.pbxFileReferenceSection()); + let file; + let id; + for (id in files) { file = files[id]; - if (file.path == filePath || file.path == ('"' + filePath + '"')) { + if (file.path === filePath || file.path === ('"' + filePath + '"')) { return file; } } return false; -} - -pbxProject.prototype.addTarget = function(name, type, subfolder, bundleId) { +}; +PBXProject.prototype.addTarget = function (name, type, subfolder, bundleId) { // Setup uuid and name of new target - var targetUuid = this.generateUuid(), - targetType = type, - targetSubfolder = subfolder || name, - targetName = name.trim(), - targetBundleId = bundleId; + const targetUuid = this.generateUuid(); + const targetType = type; + const targetSubfolder = subfolder || name; + const targetName = name.trim(); + const targetBundleId = bundleId; // Check type against list of allowed target types if (!targetName) { - throw new Error("Target name missing."); + throw new Error('Target name missing.'); } // Check type against list of allowed target types if (!targetType) { - throw new Error("Target type missing."); + throw new Error('Target type missing.'); } // Check type against list of allowed target types if (!producttypeForTargettype(targetType)) { - throw new Error("Target type invalid: " + targetType); + throw new Error('Target type invalid: ' + targetType); } // Build Configuration: Create - var buildConfigurationsList = [ + let buildConfigurationsList = [ { name: 'Debug', isa: 'XCBuildConfiguration', @@ -1470,48 +1445,45 @@ pbxProject.prototype.addTarget = function(name, type, subfolder, bundleId) { } // Build Configuration: Add - var buildConfigurations = this.addXCConfigurationList(buildConfigurationsList, 'Release', 'Build configuration list for PBXNativeTarget "' + targetName +'"'); + const buildConfigurations = this.addXCConfigurationList(buildConfigurationsList, 'Release', 'Build configuration list for PBXNativeTarget "' + targetName + '"'); // Product: Create - var productName = targetName, - productType = producttypeForTargettype(targetType), - productFileType = filetypeForProducttype(productType), - productFile = this.addProductFile(productName, { group: 'Copy Files', 'target': targetUuid, 'explicitFileType': productFileType}), - productFileName = productFile.basename; - + const productName = targetName; + const productType = producttypeForTargettype(targetType); + const productFileType = filetypeForProducttype(productType); + const productFile = this.addProductFile(productName, { group: 'Copy Files', target: targetUuid, explicitFileType: productFileType }); // Product: Add to build file list this.addToPbxBuildFileSection(productFile); // Target: Create - var target = { - uuid: targetUuid, - pbxNativeTarget: { - isa: 'PBXNativeTarget', - name: '"' + targetName + '"', - productName: '"' + targetName + '"', - productReference: productFile.fileRef, - productType: '"' + producttypeForTargettype(targetType) + '"', - buildConfigurationList: buildConfigurations.uuid, - buildPhases: [], - buildRules: [], - dependencies: [] - } + const target = { + uuid: targetUuid, + pbxNativeTarget: { + isa: 'PBXNativeTarget', + name: '"' + targetName + '"', + productName: '"' + targetName + '"', + productReference: productFile.fileRef, + productType: '"' + producttypeForTargettype(targetType) + '"', + buildConfigurationList: buildConfigurations.uuid, + buildPhases: [], + buildRules: [], + dependencies: [] + } }; // Target: Add to PBXNativeTarget section - this.addToPbxNativeTargetSection(target) + this.addToPbxNativeTargetSection(target); // Product: Embed (only for "extension"-type targets) if (targetType === 'app_extension') { - // Create CopyFiles phase in first target - this.addBuildPhase([], 'PBXCopyFilesBuildPhase', 'Copy Files', this.getFirstTarget().uuid, targetType) + this.addBuildPhase([], 'PBXCopyFilesBuildPhase', 'Copy Files', this.getFirstTarget().uuid, targetType); // Add product to CopyFiles phase - this.addToPbxCopyfilesBuildPhase(productFile) + this.addToPbxCopyfilesBuildPhase(productFile); - // this.addBuildPhaseToTarget(newPhase.buildPhase, this.getFirstTarget().uuid) + // this.addBuildPhaseToTarget(newPhase.buildPhase, this.getFirstTarget().uuid) } else if (targetType === 'watch2_app') { // Create CopyFiles phase in first target this.addBuildPhase( @@ -1524,7 +1496,7 @@ pbxProject.prototype.addTarget = function(name, type, subfolder, bundleId) { ); } else if (targetType === 'watch2_extension') { // Create CopyFiles phase in watch target (if exists) - var watch2Target = this.getTarget(producttypeForTargettype('watch2_app')); + const watch2Target = this.getTarget(producttypeForTargettype('watch2_app')); if (watch2Target) { this.addBuildPhase( [targetName + '.appex'], @@ -1541,7 +1513,7 @@ pbxProject.prototype.addTarget = function(name, type, subfolder, bundleId) { // Target: Add dependency for this target to other targets if (targetType === 'watch2_extension') { - var watch2Target = this.getTarget(producttypeForTargettype('watch2_app')); + const watch2Target = this.getTarget(producttypeForTargettype('watch2_app')); if (watch2Target) { this.addTargetDependency(watch2Target.uuid, [target.uuid]); } @@ -1549,15 +1521,13 @@ pbxProject.prototype.addTarget = function(name, type, subfolder, bundleId) { this.addTargetDependency(this.getFirstTarget().uuid, [target.uuid]); } - // Return target on success return target; - }; // helper object creation functions -function pbxBuildFileObj(file) { - var obj = Object.create(null); +function pbxBuildFileObj (file) { + const obj = Object.create(null); obj.isa = 'PBXBuildFile'; obj.fileRef = file.fileRef; @@ -1567,11 +1537,11 @@ function pbxBuildFileObj(file) { return obj; } -function pbxFileReferenceObj(file) { - var fileObject = { - isa: "PBXFileReference", - name: "\"" + file.basename + "\"", - path: "\"" + file.path.replace(/\\/g, '/') + "\"", +function pbxFileReferenceObj (file) { + const fileObject = { + isa: 'PBXFileReference', + name: '"' + file.basename + '"', + path: '"' + file.path.replace(/\\/g, '/') + '"', sourceTree: file.sourceTree, fileEncoding: file.fileEncoding, lastKnownFileType: file.lastKnownFileType, @@ -1582,8 +1552,8 @@ function pbxFileReferenceObj(file) { return fileObject; } -function pbxGroupChild(file) { - var obj = Object.create(null); +function pbxGroupChild (file) { + const obj = Object.create(null); obj.value = file.fileRef; obj.comment = file.basename; @@ -1591,8 +1561,8 @@ function pbxGroupChild(file) { return obj; } -function pbxBuildPhaseObj(file) { - var obj = Object.create(null); +function pbxBuildPhaseObj (file) { + const obj = Object.create(null); obj.value = file.uuid; obj.comment = longComment(file); @@ -1600,10 +1570,9 @@ function pbxBuildPhaseObj(file) { return obj; } -function pbxCopyFilesBuildPhaseObj(obj, folderType, subfolderPath, phaseName) { - - // Add additional properties for 'CopyFiles' build phase - var DESTINATION_BY_TARGETTYPE = { +function pbxCopyFilesBuildPhaseObj (obj, folderType, subfolderPath, phaseName) { + // Add additional properties for 'CopyFiles' build phase + const DESTINATION_BY_TARGETTYPE = { application: 'wrapper', app_extension: 'plugins', bundle: 'wrapper', @@ -1617,8 +1586,8 @@ function pbxCopyFilesBuildPhaseObj(obj, folderType, subfolderPath, phaseName) { watch2_app: 'products_directory', watch_extension: 'plugins', watch2_extension: 'plugins' - } - var SUBFOLDERSPEC_BY_DESTINATION = { + }; + const SUBFOLDERSPEC_BY_DESTINATION = { absolute_path: 0, executables: 6, frameworks: 10, @@ -1630,7 +1599,7 @@ function pbxCopyFilesBuildPhaseObj(obj, folderType, subfolderPath, phaseName) { shared_support: 12, wrapper: 1, xpc_services: 0 - } + }; obj.name = '"' + phaseName + '"'; obj.dstPath = subfolderPath || '""'; @@ -1639,7 +1608,7 @@ function pbxCopyFilesBuildPhaseObj(obj, folderType, subfolderPath, phaseName) { return obj; } -function pbxShellScriptBuildPhaseObj(obj, options, phaseName) { +function pbxShellScriptBuildPhaseObj (obj, options, phaseName) { obj.name = '"' + phaseName + '"'; obj.inputPaths = options.inputPaths || []; obj.outputPaths = options.outputPaths || []; @@ -1649,50 +1618,45 @@ function pbxShellScriptBuildPhaseObj(obj, options, phaseName) { return obj; } -function pbxBuildFileComment(file) { +function pbxBuildFileComment (file) { return longComment(file); } -function pbxFileReferenceComment(file) { +function pbxFileReferenceComment (file) { return file.basename || path.basename(file.path); } -function pbxNativeTargetComment(target) { +function pbxNativeTargetComment (target) { return target.name; } -function longComment(file) { - return f("%s in %s", file.basename, file.group); +function longComment (file) { + return f('%s in %s', file.basename, file.group); } // respect path -function correctForPluginsPath(file, project) { +function correctForPluginsPath (file, project) { return correctForPath(file, project, 'Plugins'); } -function correctForResourcesPath(file, project) { +function correctForResourcesPath (file, project) { return correctForPath(file, project, 'Resources'); } -function correctForFrameworksPath(file, project) { - return correctForPath(file, project, 'Frameworks'); -} - -function correctForPath(file, project, group) { - var r_group_dir = new RegExp('^' + group + '[\\\\/]'); +function correctForPath (file, project, group) { + const r_group_dir = new RegExp('^' + group + '[\\\\/]'); - if (project.pbxGroupByName(group) && project.pbxGroupByName(group).path) - file.path = file.path.replace(r_group_dir, ''); + if (project.pbxGroupByName(group) && project.pbxGroupByName(group).path) { file.path = file.path.replace(r_group_dir, ''); } return file; } -function searchPathForFile(file, proj) { - var plugins = proj.pbxGroupByName('Plugins'), - pluginsPath = plugins ? plugins.path : null, - fileDir = path.dirname(file.path); +function searchPathForFile (file, proj) { + const plugins = proj.pbxGroupByName('Plugins'); + const pluginsPath = plugins ? plugins.path : null; + let fileDir = path.dirname(file.path); - if (fileDir == '.') { + if (fileDir === '.') { fileDir = ''; } else { fileDir = '/' + fileDir; @@ -1707,9 +1671,10 @@ function searchPathForFile(file, proj) { } } -function nonComments(obj) { - var keys = Object.keys(obj), - newObj = {}, i = 0; +function nonComments (obj) { + const keys = Object.keys(obj); + const newObj = {}; + let i = 0; for (i; i < keys.length; i++) { if (!COMMENT_KEY.test(keys[i])) { @@ -1720,103 +1685,87 @@ function nonComments(obj) { return newObj; } -function unquote(str) { - if (str) return str.replace(/^"(.*)"$/, "$1"); -} - - -function buildPhaseNameForIsa (isa) { - - BUILDPHASENAME_BY_ISA = { - PBXCopyFilesBuildPhase: 'Copy Files', - PBXResourcesBuildPhase: 'Resources', - PBXSourcesBuildPhase: 'Sources', - PBXFrameworksBuildPhase: 'Frameworks' - } - - return BUILDPHASENAME_BY_ISA[isa] +function unquote (str) { + if (str) return str.replace(/^"(.*)"$/, '$1'); } function producttypeForTargettype (targetType) { + const PRODUCTTYPE_BY_TARGETTYPE = { + application: 'com.apple.product-type.application', + app_extension: 'com.apple.product-type.app-extension', + bundle: 'com.apple.product-type.bundle', + command_line_tool: 'com.apple.product-type.tool', + dynamic_library: 'com.apple.product-type.library.dynamic', + framework: 'com.apple.product-type.framework', + static_library: 'com.apple.product-type.library.static', + unit_test_bundle: 'com.apple.product-type.bundle.unit-test', + watch_app: 'com.apple.product-type.application.watchapp', + watch2_app: 'com.apple.product-type.application.watchapp2', + watch_extension: 'com.apple.product-type.watchkit-extension', + watch2_extension: 'com.apple.product-type.watchkit2-extension' + }; - PRODUCTTYPE_BY_TARGETTYPE = { - application: 'com.apple.product-type.application', - app_extension: 'com.apple.product-type.app-extension', - bundle: 'com.apple.product-type.bundle', - command_line_tool: 'com.apple.product-type.tool', - dynamic_library: 'com.apple.product-type.library.dynamic', - framework: 'com.apple.product-type.framework', - static_library: 'com.apple.product-type.library.static', - unit_test_bundle: 'com.apple.product-type.bundle.unit-test', - watch_app: 'com.apple.product-type.application.watchapp', - watch2_app: 'com.apple.product-type.application.watchapp2', - watch_extension: 'com.apple.product-type.watchkit-extension', - watch2_extension: 'com.apple.product-type.watchkit2-extension' - }; - - return PRODUCTTYPE_BY_TARGETTYPE[targetType] + return PRODUCTTYPE_BY_TARGETTYPE[targetType]; } function filetypeForProducttype (productType) { + const FILETYPE_BY_PRODUCTTYPE = { + 'com.apple.product-type.application': '"wrapper.application"', + 'com.apple.product-type.app-extension': '"wrapper.app-extension"', + 'com.apple.product-type.bundle': '"wrapper.plug-in"', + 'com.apple.product-type.tool': '"compiled.mach-o.dylib"', + 'com.apple.product-type.library.dynamic': '"compiled.mach-o.dylib"', + 'com.apple.product-type.framework': '"wrapper.framework"', + 'com.apple.product-type.library.static': '"archive.ar"', + 'com.apple.product-type.bundle.unit-test': '"wrapper.cfbundle"', + 'com.apple.product-type.application.watchapp': '"wrapper.application"', + 'com.apple.product-type.application.watchapp2': '"wrapper.application"', + 'com.apple.product-type.watchkit-extension': '"wrapper.app-extension"', + 'com.apple.product-type.watchkit2-extension': '"wrapper.app-extension"' + }; - FILETYPE_BY_PRODUCTTYPE = { - 'com.apple.product-type.application': '"wrapper.application"', - 'com.apple.product-type.app-extension': '"wrapper.app-extension"', - 'com.apple.product-type.bundle': '"wrapper.plug-in"', - 'com.apple.product-type.tool': '"compiled.mach-o.dylib"', - 'com.apple.product-type.library.dynamic': '"compiled.mach-o.dylib"', - 'com.apple.product-type.framework': '"wrapper.framework"', - 'com.apple.product-type.library.static': '"archive.ar"', - 'com.apple.product-type.bundle.unit-test': '"wrapper.cfbundle"', - 'com.apple.product-type.application.watchapp': '"wrapper.application"', - 'com.apple.product-type.application.watchapp2': '"wrapper.application"', - 'com.apple.product-type.watchkit-extension': '"wrapper.app-extension"', - 'com.apple.product-type.watchkit2-extension': '"wrapper.app-extension"' - }; - - return FILETYPE_BY_PRODUCTTYPE[productType] + return FILETYPE_BY_PRODUCTTYPE[productType]; } -pbxProject.prototype.getFirstProject = function() { - +PBXProject.prototype.getFirstProject = function () { // Get pbxProject container - var pbxProjectContainer = this.pbxProjectSection(); + const pbxProjectContainer = this.pbxProjectSection(); // Get first pbxProject UUID - var firstProjectUuid = Object.keys(pbxProjectContainer)[0]; + const firstProjectUuid = Object.keys(pbxProjectContainer)[0]; // Get first pbxProject - var firstProject = pbxProjectContainer[firstProjectUuid]; + const firstProject = pbxProjectContainer[firstProjectUuid]; - return { + return { uuid: firstProjectUuid, - firstProject: firstProject - } -} + firstProject + }; +}; -pbxProject.prototype.getFirstTarget = function() { +PBXProject.prototype.getFirstTarget = function () { // Get first target's UUID - var firstTargetUuid = this.getFirstProject()['firstProject']['targets'][0].value; + const firstTargetUuid = this.getFirstProject().firstProject.targets[0].value; // Get first pbxNativeTarget - var firstTarget = this.pbxNativeTargetSection()[firstTargetUuid]; + const firstTarget = this.pbxNativeTargetSection()[firstTargetUuid]; return { uuid: firstTargetUuid, - firstTarget: firstTarget - } -} + firstTarget + }; +}; -pbxProject.prototype.getTarget = function(productType) { +PBXProject.prototype.getTarget = function (productType) { // Find target by product type - var targets = this.getFirstProject()['firstProject']['targets']; - var nativeTargets = this.pbxNativeTargetSection(); - for (var i = 0; i < targets.length; i++) { - var target = targets[i]; - var targetUuid = target.value; - if (nativeTargets[targetUuid]['productType'] === '"' + productType + '"') { + const targets = this.getFirstProject().firstProject.targets; + const nativeTargets = this.pbxNativeTargetSection(); + for (let i = 0; i < targets.length; i++) { + const target = targets[i]; + const targetUuid = target.value; + if (nativeTargets[targetUuid].productType === '"' + productType + '"') { // Get pbxNativeTarget - var nativeTarget = this.pbxNativeTargetSection()[targetUuid]; + const nativeTarget = this.pbxNativeTargetSection()[targetUuid]; return { uuid: targetUuid, target: nativeTarget @@ -1825,254 +1774,236 @@ pbxProject.prototype.getTarget = function(productType) { } return null; -} +}; -/*** NEW ***/ +/** * NEW ***/ -pbxProject.prototype.addToPbxGroupType = function (file, groupKey, groupType) { - var group = this.getPBXGroupByKeyAndType(groupKey, groupType); +PBXProject.prototype.addToPbxGroupType = function (file, groupKey, groupType) { + const group = this.getPBXGroupByKeyAndType(groupKey, groupType); if (group && group.children !== undefined) { if (typeof file === 'string') { - //Group Key - var childGroup = { - value:file, + // Group Key + const childGroup = { + value: file }; if (this.getPBXGroupByKey(file)) { childGroup.comment = this.getPBXGroupByKey(file).name; - } - else if (this.getPBXVariantGroupByKey(file)) { + } else if (this.getPBXVariantGroupByKey(file)) { childGroup.comment = this.getPBXVariantGroupByKey(file).name; } group.children.push(childGroup); - } - else { - //File Object + } else { + // File Object group.children.push(pbxGroupChild(file)); } } -} +}; -pbxProject.prototype.addToPbxVariantGroup = function (file, groupKey) { +PBXProject.prototype.addToPbxVariantGroup = function (file, groupKey) { this.addToPbxGroupType(file, groupKey, 'PBXVariantGroup'); -} +}; -pbxProject.prototype.addToPbxGroup = function (file, groupKey) { +PBXProject.prototype.addToPbxGroup = function (file, groupKey) { this.addToPbxGroupType(file, groupKey, 'PBXGroup'); -} - - +}; -pbxProject.prototype.pbxCreateGroupWithType = function(name, pathName, groupType) { - //Create object - var model = { +PBXProject.prototype.pbxCreateGroupWithType = function (name, pathName, groupType) { + // Create object + const model = { isa: '"' + groupType + '"', children: [], - name: name, + name, sourceTree: '""' }; if (pathName) model.path = pathName; - var key = this.generateUuid(); + const key = this.generateUuid(); - //Create comment - var commendId = key + '_comment'; + // Create comment + const commendId = key + '_comment'; - //add obj and commentObj to groups; - var groups = this.hash.project.objects[groupType]; + // add obj and commentObj to groups; + let groups = this.hash.project.objects[groupType]; if (!groups) { - groups = this.hash.project.objects[groupType] = new Object(); + groups = this.hash.project.objects[groupType] = {}; } groups[commendId] = name; groups[key] = model; return key; -} +}; -pbxProject.prototype.pbxCreateVariantGroup = function(name) { - return this.pbxCreateGroupWithType(name, undefined, 'PBXVariantGroup') -} +PBXProject.prototype.pbxCreateVariantGroup = function (name) { + return this.pbxCreateGroupWithType(name, undefined, 'PBXVariantGroup'); +}; -pbxProject.prototype.pbxCreateGroup = function(name, pathName) { +PBXProject.prototype.pbxCreateGroup = function (name, pathName) { return this.pbxCreateGroupWithType(name, pathName, 'PBXGroup'); -} - - +}; -pbxProject.prototype.removeFromPbxGroupAndType = function (file, groupKey, groupType) { - var group = this.getPBXGroupByKeyAndType(groupKey, groupType); +PBXProject.prototype.removeFromPbxGroupAndType = function (file, groupKey, groupType) { + const group = this.getPBXGroupByKeyAndType(groupKey, groupType); if (group) { - var groupChildren = group.children, i; - for(i in groupChildren) { - if(pbxGroupChild(file).value == groupChildren[i].value && - pbxGroupChild(file).comment == groupChildren[i].comment) { + const groupChildren = group.children; + for (const i in groupChildren) { + if (pbxGroupChild(file).value === groupChildren[i].value && + pbxGroupChild(file).comment === groupChildren[i].comment) { groupChildren.splice(i, 1); break; } } } -} +}; -pbxProject.prototype.removeFromPbxGroup = function (file, groupKey) { +PBXProject.prototype.removeFromPbxGroup = function (file, groupKey) { this.removeFromPbxGroupAndType(file, groupKey, 'PBXGroup'); -} +}; -pbxProject.prototype.removeFromPbxVariantGroup = function (file, groupKey) { +PBXProject.prototype.removeFromPbxVariantGroup = function (file, groupKey) { this.removeFromPbxGroupAndType(file, groupKey, 'PBXVariantGroup'); -} - - +}; -pbxProject.prototype.getPBXGroupByKeyAndType = function(key, groupType) { +PBXProject.prototype.getPBXGroupByKeyAndType = function (key, groupType) { return this.hash.project.objects[groupType][key]; }; -pbxProject.prototype.getPBXGroupByKey = function(key) { - return this.hash.project.objects['PBXGroup'][key]; +PBXProject.prototype.getPBXGroupByKey = function (key) { + return this.hash.project.objects.PBXGroup[key]; }; -pbxProject.prototype.getPBXVariantGroupByKey = function(key) { - return this.hash.project.objects['PBXVariantGroup'][key]; +PBXProject.prototype.getPBXVariantGroupByKey = function (key) { + return this.hash.project.objects.PBXVariantGroup[key]; }; +PBXProject.prototype.findPBXGroupKeyAndType = function (criteria, groupType) { + const groups = this.hash.project.objects[groupType]; + let target; - -pbxProject.prototype.findPBXGroupKeyAndType = function(criteria, groupType) { - var groups = this.hash.project.objects[groupType]; - var target; - - for (var key in groups) { + for (const key in groups) { // only look for comments if (COMMENT_KEY.test(key)) continue; - var group = groups[key]; + const group = groups[key]; if (criteria && criteria.path && criteria.name) { if (criteria.path === group.path && criteria.name === group.name) { target = key; - break + break; } - } - else if (criteria && criteria.path) { + } else if (criteria && criteria.path) { if (criteria.path === group.path) { target = key; - break + break; } - } - else if (criteria && criteria.name) { + } else if (criteria && criteria.name) { if (criteria.name === group.name) { target = key; - break + break; } } } return target; -} +}; -pbxProject.prototype.findPBXGroupKey = function(criteria) { +PBXProject.prototype.findPBXGroupKey = function (criteria) { return this.findPBXGroupKeyAndType(criteria, 'PBXGroup'); -} +}; -pbxProject.prototype.findPBXVariantGroupKey = function(criteria) { +PBXProject.prototype.findPBXVariantGroupKey = function (criteria) { return this.findPBXGroupKeyAndType(criteria, 'PBXVariantGroup'); -} +}; -pbxProject.prototype.addLocalizationVariantGroup = function(name) { - var groupKey = this.pbxCreateVariantGroup(name); +PBXProject.prototype.addLocalizationVariantGroup = function (name) { + const groupKey = this.pbxCreateVariantGroup(name); - var resourceGroupKey = this.findPBXGroupKey({name: 'Resources'}); + const resourceGroupKey = this.findPBXGroupKey({ name: 'Resources' }); this.addToPbxGroup(groupKey, resourceGroupKey); - var localizationVariantGroup = { + const localizationVariantGroup = { uuid: this.generateUuid(), fileRef: groupKey, basename: name - } - this.addToPbxBuildFileSection(localizationVariantGroup); // PBXBuildFile - this.addToPbxResourcesBuildPhase(localizationVariantGroup); //PBXResourcesBuildPhase + }; + this.addToPbxBuildFileSection(localizationVariantGroup); // PBXBuildFile + this.addToPbxResourcesBuildPhase(localizationVariantGroup); // PBXResourcesBuildPhase return localizationVariantGroup; }; -pbxProject.prototype.addKnownRegion = function (name) { - if (!this.pbxProjectSection()[this.getFirstProject()['uuid']]['knownRegions']) { - this.pbxProjectSection()[this.getFirstProject()['uuid']]['knownRegions'] = []; - } - if (!this.hasKnownRegion(name)) { - this.pbxProjectSection()[this.getFirstProject()['uuid']]['knownRegions'].push(name); - } -} +PBXProject.prototype.addKnownRegion = function (name) { + if (!this.pbxProjectSection()[this.getFirstProject().uuid].knownRegions) { + this.pbxProjectSection()[this.getFirstProject().uuid].knownRegions = []; + } + if (!this.hasKnownRegion(name)) { + this.pbxProjectSection()[this.getFirstProject().uuid].knownRegions.push(name); + } +}; -pbxProject.prototype.removeKnownRegion = function (name) { - var regions = this.pbxProjectSection()[this.getFirstProject()['uuid']]['knownRegions']; - if (regions) { - for (var i = 0; i < regions.length; i++) { - if (regions[i] === name) { - regions.splice(i, 1); - break; - } - } - this.pbxProjectSection()[this.getFirstProject()['uuid']]['knownRegions'] = regions; - } -} +PBXProject.prototype.removeKnownRegion = function (name) { + const regions = this.pbxProjectSection()[this.getFirstProject().uuid].knownRegions; + if (regions) { + for (let i = 0; i < regions.length; i++) { + if (regions[i] === name) { + regions.splice(i, 1); + break; + } + } + this.pbxProjectSection()[this.getFirstProject().uuid].knownRegions = regions; + } +}; -pbxProject.prototype.hasKnownRegion = function (name) { - var regions = this.pbxProjectSection()[this.getFirstProject()['uuid']]['knownRegions']; - if (regions) { - for (var i in regions) { - if (regions[i] === name) { - return true; - } +PBXProject.prototype.hasKnownRegion = function (name) { + const regions = this.pbxProjectSection()[this.getFirstProject().uuid].knownRegions; + if (regions) { + for (const i in regions) { + if (regions[i] === name) { + return true; + } + } } - } - return false; -} + return false; +}; -pbxProject.prototype.getPBXObject = function(name) { +PBXProject.prototype.getPBXObject = function (name) { return this.hash.project.objects[name]; -} - - +}; -pbxProject.prototype.addFile = function (path, group, opt) { - var file = new pbxFile(path, opt); +PBXProject.prototype.addFile = function (path, group, opt) { + const file = new PBXFile(path, opt); // null is better for early errors if (this.hasFile(file.path)) return null; file.fileRef = this.generateUuid(); - this.addToPbxFileReferenceSection(file); // PBXFileReference + this.addToPbxFileReferenceSection(file); // PBXFileReference if (this.getPBXGroupByKey(group)) { - this.addToPbxGroup(file, group); // PBXGroup - } - else if (this.getPBXVariantGroupByKey(group)) { - this.addToPbxVariantGroup(file, group); // PBXVariantGroup + this.addToPbxGroup(file, group); // PBXGroup + } else if (this.getPBXVariantGroupByKey(group)) { + this.addToPbxVariantGroup(file, group); // PBXVariantGroup } return file; -} +}; -pbxProject.prototype.removeFile = function (path, group, opt) { - var file = new pbxFile(path, opt); +PBXProject.prototype.removeFile = function (path, group, opt) { + const file = new PBXFile(path, opt); - this.removeFromPbxFileReferenceSection(file); // PBXFileReference + this.removeFromPbxFileReferenceSection(file); // PBXFileReference if (this.getPBXGroupByKey(group)) { - this.removeFromPbxGroup(file, group); // PBXGroup - } - else if (this.getPBXVariantGroupByKey(group)) { - this.removeFromPbxVariantGroup(file, group); // PBXVariantGroup + this.removeFromPbxGroup(file, group); // PBXGroup + } else if (this.getPBXVariantGroupByKey(group)) { + this.removeFromPbxVariantGroup(file, group); // PBXVariantGroup } return file; -} - - +}; -pbxProject.prototype.getBuildProperty = function(prop, build, targetName) { - var target; - let validConfigs = []; +PBXProject.prototype.getBuildProperty = function (prop, build, targetName) { + let target; + const validConfigs = []; if (targetName) { const target = this.pbxTargetByName(targetName); @@ -2093,13 +2024,13 @@ pbxProject.prototype.getBuildProperty = function(prop, build, targetName) { } } } - - var configs = this.pbxXCBuildConfigurationSection(); - for (var configName in configs) { + + const configs = this.pbxXCBuildConfigurationSection(); + for (const configName in configs) { if (!COMMENT_KEY.test(configName)) { if (targetName && !validConfigs.includes(configName)) continue; - var config = configs[configName]; - if ( (build && config.name === build) || (build === undefined) ) { + const config = configs[configName]; + if ((build && config.name === build) || (build === undefined)) { if (config.buildSettings[prop] !== undefined) { target = config.buildSettings[prop]; } @@ -2107,23 +2038,23 @@ pbxProject.prototype.getBuildProperty = function(prop, build, targetName) { } } return target; -} +}; -pbxProject.prototype.getBuildConfigByName = function(name) { - var target = {}; - var configs = this.pbxXCBuildConfigurationSection(); - for (var configName in configs) { +PBXProject.prototype.getBuildConfigByName = function (name) { + const target = {}; + const configs = this.pbxXCBuildConfigurationSection(); + for (const configName in configs) { if (!COMMENT_KEY.test(configName)) { - var config = configs[configName]; - if (config.name === name) { + const config = configs[configName]; + if (config.name === name) { target[configName] = config; } } } return target; -} +}; -pbxProject.prototype.addDataModelDocument = function(filePath, group, opt) { +PBXProject.prototype.addDataModelDocument = function (filePath, group, opt) { if (!group) { group = 'Resources'; } @@ -2131,7 +2062,7 @@ pbxProject.prototype.addDataModelDocument = function(filePath, group, opt) { group = this.findPBXGroupKey({ name: group }); } - var file = new pbxFile(filePath, opt); + const file = new PBXFile(filePath, opt); if (!file || this.hasFile(file.path)) return null; @@ -2147,18 +2078,18 @@ pbxProject.prototype.addDataModelDocument = function(filePath, group, opt) { this.addToPbxSourcesBuildPhase(file); file.models = []; - var currentVersionName; - var modelFiles = fs.readdirSync(file.path); - for (var index in modelFiles) { - var modelFileName = modelFiles[index]; - var modelFilePath = path.join(filePath, modelFileName); + let currentVersionName; + const modelFiles = fs.readdirSync(file.path); + for (const index in modelFiles) { + const modelFileName = modelFiles[index]; + const modelFilePath = path.join(filePath, modelFileName); - if (modelFileName == '.xccurrentversion') { + if (modelFileName === '.xccurrentversion') { currentVersionName = plist.readFileSync(modelFilePath)._XCCurrentVersionName; continue; } - var modelFile = new pbxFile(modelFilePath); + const modelFile = new PBXFile(modelFilePath); modelFile.fileRef = this.generateUuid(); this.addToPbxFileReferenceSection(modelFile); @@ -2177,27 +2108,27 @@ pbxProject.prototype.addDataModelDocument = function(filePath, group, opt) { this.addToXcVersionGroupSection(file); return file; -} +}; -pbxProject.prototype.addTargetAttribute = function(prop, value, target) { - var attributes = this.getFirstProject()['firstProject']['attributes']; - if (attributes['TargetAttributes'] === undefined) { - attributes['TargetAttributes'] = {}; +PBXProject.prototype.addTargetAttribute = function (prop, value, target) { + const attributes = this.getFirstProject().firstProject.attributes; + if (attributes.TargetAttributes === undefined) { + attributes.TargetAttributes = {}; } target = target || this.getFirstTarget(); - if (attributes['TargetAttributes'][target.uuid] === undefined) { - attributes['TargetAttributes'][target.uuid] = {}; + if (attributes.TargetAttributes[target.uuid] === undefined) { + attributes.TargetAttributes[target.uuid] = {}; } - attributes['TargetAttributes'][target.uuid][prop] = value; -} + attributes.TargetAttributes[target.uuid][prop] = value; +}; -pbxProject.prototype.removeTargetAttribute = function(prop, target) { - var attributes = this.getFirstProject()['firstProject']['attributes']; +PBXProject.prototype.removeTargetAttribute = function (prop, target) { + const attributes = this.getFirstProject().firstProject.attributes; target = target || this.getFirstTarget(); - if (attributes['TargetAttributes'] && - attributes['TargetAttributes'][target.uuid]) { - delete attributes['TargetAttributes'][target.uuid][prop]; + if (attributes.TargetAttributes && + attributes.TargetAttributes[target.uuid]) { + delete attributes.TargetAttributes[target.uuid][prop]; } -} +}; -module.exports = pbxProject; +module.exports = PBXProject; diff --git a/lib/pbxWriter.js b/lib/pbxWriter.js index 165413e..b1cd9f5 100644 --- a/lib/pbxWriter.js +++ b/lib/pbxWriter.js @@ -17,97 +17,91 @@ under the License. */ -var pbxProj = require('./pbxProject'), - util = require('util'), - f = util.format, - INDENT = '\t', - COMMENT_KEY = /_comment$/, - QUOTED = /^"(.*)"$/, - EventEmitter = require('events').EventEmitter +const util = require('util'); +const f = util.format; +const INDENT = '\t'; +const COMMENT_KEY = /_comment$/; +const EventEmitter = require('events').EventEmitter; // indentation -function i(x) { - if (x <=0) - return ''; - else - return INDENT + i(x-1); +function i (x) { + if (x <= 0) { return ''; } else { return INDENT + i(x - 1); } } -function comment(key, parent) { - var text = parent[key + '_comment']; +function comment (key, parent) { + const text = parent[key + '_comment']; - if (text) - return text; - else - return null; + if (text) { return text; } else { return null; } } // copied from underscore -function isObject(obj) { - return obj === Object(obj) +function isObject (obj) { + return obj === Object(obj); } -function isArray(obj) { - return Array.isArray(obj) +function isArray (obj) { + return Array.isArray(obj); } -function pbxWriter(contents, options) { +function pbxWriter (contents, options) { if (!options) { - options = {} + options = {}; } if (options.omitEmptyValues === undefined) { - options.omitEmptyValues = false + options.omitEmptyValues = false; } this.contents = contents; this.sync = false; this.indentLevel = 0; - this.omitEmptyValues = options.omitEmptyValues + this.omitEmptyValues = options.omitEmptyValues; } util.inherits(pbxWriter, EventEmitter); pbxWriter.prototype.write = function (str) { - var fmt = f.apply(null, arguments); + const fmt = f.apply(null, arguments); if (this.sync) { - this.buffer += f("%s%s", i(this.indentLevel), fmt); + this.buffer += f('%s%s', i(this.indentLevel), fmt); } else { // do stream write } -} +}; pbxWriter.prototype.writeFlush = function (str) { - var oldIndent = this.indentLevel; + const oldIndent = this.indentLevel; this.indentLevel = 0; - this.write.apply(this, arguments) + this.write.apply(this, arguments); this.indentLevel = oldIndent; -} +}; pbxWriter.prototype.writeSync = function () { this.sync = true; - this.buffer = ""; + this.buffer = ''; this.writeHeadComment(); this.writeProject(); return this.buffer; -} +}; pbxWriter.prototype.writeHeadComment = function () { if (this.contents.headComment) { - this.write("// %s\n", this.contents.headComment) + this.write('// %s\n', this.contents.headComment); } -} +}; pbxWriter.prototype.writeProject = function () { - var proj = this.contents.project, - key, cmt, obj; + const proj = this.contents.project; + let key; + let cmt; + let obj; - this.write("{\n") + this.write('{\n'); if (proj) { this.indentLevel++; @@ -120,36 +114,36 @@ pbxWriter.prototype.writeProject = function () { obj = proj[key]; if (isArray(obj)) { - this.writeArray(obj, key) + this.writeArray(obj, key); } else if (isObject(obj)) { - this.write("%s = {\n", key); + this.write('%s = {\n', key); this.indentLevel++; if (key === 'objects') { - this.writeObjectsSections(obj) + this.writeObjectsSections(obj); } else { - this.writeObject(obj) + this.writeObject(obj); } this.indentLevel--; - this.write("};\n"); + this.write('};\n'); } else if (this.omitEmptyValues && (obj === undefined || obj === null)) { continue; } else if (cmt) { - this.write("%s = %s /* %s */;\n", key, obj, cmt) + this.write('%s = %s /* %s */;\n', key, obj, cmt); } else { - this.write("%s = %s;\n", key, obj) + this.write('%s = %s;\n', key, obj); } } this.indentLevel--; } - this.write("}\n") -} + this.write('}\n'); +}; pbxWriter.prototype.writeObject = function (object) { - var key, obj, cmt; + let key, obj, cmt; for (key in object) { if (COMMENT_KEY.test(key)) continue; @@ -158,32 +152,32 @@ pbxWriter.prototype.writeObject = function (object) { obj = object[key]; if (isArray(obj)) { - this.writeArray(obj, key) + this.writeArray(obj, key); } else if (isObject(obj)) { - this.write("%s = {\n", key); + this.write('%s = {\n', key); this.indentLevel++; - this.writeObject(obj) + this.writeObject(obj); this.indentLevel--; - this.write("};\n"); + this.write('};\n'); } else { if (this.omitEmptyValues && (obj === undefined || obj === null)) { continue; } else if (cmt) { - this.write("%s = %s /* %s */;\n", key, obj, cmt) + this.write('%s = %s /* %s */;\n', key, obj, cmt); } else { - this.write("%s = %s;\n", key, obj) + this.write('%s = %s;\n', key, obj); } } } -} +}; pbxWriter.prototype.writeObjectsSections = function (objects) { - var key, obj; + let key, obj; for (key in objects) { - this.writeFlush("\n") + this.writeFlush('\n'); obj = objects[key]; @@ -195,16 +189,16 @@ pbxWriter.prototype.writeObjectsSections = function (objects) { this.writeSectionComment(key, false); } } -} +}; pbxWriter.prototype.writeArray = function (arr, name) { - var i, entry; + let i, entry; - this.write("%s = (\n", name); + this.write('%s = (\n', name); this.indentLevel++; - for (i=0; i < arr.length; i++) { - entry = arr[i] + for (i = 0; i < arr.length; i++) { + entry = arr[i]; if (entry.value && entry.comment) { this.write('%s /* %s */,\n', entry.value, entry.comment); @@ -222,57 +216,57 @@ pbxWriter.prototype.writeArray = function (arr, name) { } this.indentLevel--; - this.write(");\n"); -} + this.write(');\n'); +}; pbxWriter.prototype.writeSectionComment = function (name, begin) { if (begin) { - this.writeFlush("/* Begin %s section */\n", name) + this.writeFlush('/* Begin %s section */\n', name); } else { // end - this.writeFlush("/* End %s section */\n", name) + this.writeFlush('/* End %s section */\n', name); } -} +}; pbxWriter.prototype.writeSection = function (section) { - var key, obj, cmt; + let key, obj, cmt; // section should only contain objects for (key in section) { if (COMMENT_KEY.test(key)) continue; cmt = comment(key, section); - obj = section[key] + obj = section[key]; - if (obj.isa == 'PBXBuildFile' || obj.isa == 'PBXFileReference') { + if (obj.isa === 'PBXBuildFile' || obj.isa === 'PBXFileReference') { this.writeInlineObject(key, cmt, obj); } else { if (cmt) { - this.write("%s /* %s */ = {\n", key, cmt); + this.write('%s /* %s */ = {\n', key, cmt); } else { - this.write("%s = {\n", key); + this.write('%s = {\n', key); } - this.indentLevel++ + this.indentLevel++; - this.writeObject(obj) + this.writeObject(obj); - this.indentLevel-- - this.write("};\n"); + this.indentLevel--; + this.write('};\n'); } } -} +}; pbxWriter.prototype.writeInlineObject = function (n, d, r) { - var output = []; - var self = this + const output = []; + const self = this; - var inlineObjectHelper = function (name, desc, ref) { - var key, cmt, obj; + const inlineObjectHelper = function (name, desc, ref) { + let key, cmt, obj; if (desc) { - output.push(f("%s /* %s */ = {", name, desc)); + output.push(f('%s /* %s */ = {', name, desc)); } else { - output.push(f("%s = {", name)); + output.push(f('%s = {', name)); } for (key in ref) { @@ -282,30 +276,30 @@ pbxWriter.prototype.writeInlineObject = function (n, d, r) { obj = ref[key]; if (isArray(obj)) { - output.push(f("%s = (", key)); + output.push(f('%s = (', key)); - for (var i=0; i < obj.length; i++) { - output.push(f("%s, ", obj[i])) + for (let i = 0; i < obj.length; i++) { + output.push(f('%s, ', obj[i])); } - output.push("); "); + output.push('); '); } else if (isObject(obj)) { - inlineObjectHelper(key, cmt, obj) + inlineObjectHelper(key, cmt, obj); } else if (self.omitEmptyValues && (obj === undefined || obj === null)) { continue; } else if (cmt) { - output.push(f("%s = %s /* %s */; ", key, obj, cmt)) + output.push(f('%s = %s /* %s */; ', key, obj, cmt)); } else { - output.push(f("%s = %s; ", key, obj)) + output.push(f('%s = %s; ', key, obj)); } } - output.push("}; "); - } + output.push('}; '); + }; inlineObjectHelper(n, d, r); - this.write("%s\n", output.join('').trim()); -} + this.write('%s\n', output.join('').trim()); +}; module.exports = pbxWriter; diff --git a/package-lock.json b/package-lock.json index fd62f91..ba7c7f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,419 +13,329 @@ "uuid": "^7.0.3" }, "devDependencies": { + "@cordova/eslint-config": "^6.0.1", "pegjs": "^0.10.0" }, "engines": { "node": ">=10.0.0" } }, - "node_modules/@ampproject/remapping": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", - "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", - "dev": true, - "dependencies": { - "@jridgewell/gen-mapping": "^0.1.0", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "node_modules/@cordova/eslint-config": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@cordova/eslint-config/-/eslint-config-6.0.1.tgz", + "integrity": "sha512-+PEHLeSGE53E85cPTZFveaO9cCaZvC13q443TkMLFJneeMePaXuM8alUZo7LrTRGVCj1sM/pMTIeaEqEEfPxuQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" + "eslint": "^9.31.0", + "eslint-plugin-import": "^2.32.0", + "eslint-plugin-n": "^17.21.0", + "eslint-plugin-promise": "^7.2.1", + "globals": "^16.3.0" }, "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/compat-data": { - "version": "7.18.8", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.18.8.tgz", - "integrity": "sha512-HSmX4WZPPK3FUxYp7g2T6EyO8j96HlZJlxmKPSh6KAcqwyDrfx7hKjXpAW/0FhFfTJsR0Yt4lAjLI2coMptIHQ==", - "dev": true, - "engines": { - "node": ">=6.9.0" + "node": ">=20.9.0" } }, - "node_modules/@babel/core": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.18.9.tgz", - "integrity": "sha512-1LIb1eL8APMy91/IMW+31ckrfBM4yCoLaVzoDhZUKSM4cu1L1nIidyxkCgzPAgrC5WEz36IPEr/eSeSF9pIn+g==", + "node_modules/@cordova/eslint-config/node_modules/globals": { + "version": "16.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.5.0.tgz", + "integrity": "sha512-c/c15i26VrJ4IRt5Z89DnIzCGDn9EcebibhAOjw5ibqEHsE1wLUgkPn9RDmNcUKyU87GeaL633nyJ+pplFR2ZQ==", "dev": true, - "dependencies": { - "@ampproject/remapping": "^2.1.0", - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.18.9", - "@babel/helper-compilation-targets": "^7.18.9", - "@babel/helper-module-transforms": "^7.18.9", - "@babel/helpers": "^7.18.9", - "@babel/parser": "^7.18.9", - "@babel/template": "^7.18.6", - "@babel/traverse": "^7.18.9", - "@babel/types": "^7.18.9", - "convert-source-map": "^1.7.0", - "debug": "^4.1.0", - "gensync": "^1.0.0-beta.2", - "json5": "^2.2.1", - "semver": "^6.3.0" - }, + "license": "MIT", "engines": { - "node": ">=6.9.0" + "node": ">=18" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/babel" - } - }, - "node_modules/@babel/generator": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", - "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", - "dev": true, - "dependencies": { - "@babel/types": "^7.23.0", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", - "jsesc": "^2.5.1" - }, - "engines": { - "node": ">=6.9.0" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", "dev": true, + "license": "MIT", "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@babel/helper-compilation-targets": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.9.tgz", - "integrity": "sha512-tzLCyVmqUiFlcFoAPLA/gL9TeYrF61VLNtb+hvkuVaB5SUjW7jcfrglBIX1vUIoT7CLP3bBlIMeyEsIl2eFQNg==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.18.8", - "@babel/helper-validator-option": "^7.18.6", - "browserslist": "^4.20.2", - "semver": "^6.3.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "engines": { - "node": ">=6.9.0" + "funding": { + "url": "https://opencollective.com/eslint" }, "peerDependencies": { - "@babel/core": "^7.0.0" + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, - "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", - "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, + "license": "Apache-2.0", "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-function-name": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", - "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", - "dev": true, - "dependencies": { - "@babel/template": "^7.22.15", - "@babel/types": "^7.23.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "engines": { - "node": ">=6.9.0" + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/@babel/helper-hoist-variables": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", - "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "dev": true, - "dependencies": { - "@babel/types": "^7.22.5" - }, + "license": "MIT", "engines": { - "node": ">=6.9.0" + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, - "node_modules/@babel/helper-module-imports": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", - "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", + "node_modules/@eslint/config-array": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz", + "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@babel/types": "^7.18.6" + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.5" }, "engines": { - "node": ">=6.9.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@babel/helper-module-transforms": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.18.9.tgz", - "integrity": "sha512-KYNqY0ICwfv19b31XzvmI/mfcylOzbLtowkw+mfvGPAQ3kfCnMLYbED3YecL5tPd8nAYFQFAd6JHp2LxZk/J1g==", + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-simple-access": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.18.6", - "@babel/template": "^7.18.6", - "@babel/traverse": "^7.18.9", - "@babel/types": "^7.18.9" + "@eslint/core": "^0.17.0" }, "engines": { - "node": ">=6.9.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@babel/helper-simple-access": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.18.6.tgz", - "integrity": "sha512-iNpIgTgyAvDQpDj76POqg+YEt8fPxx3yaNBg3S30dxNKm2SWfYhD0TGrK/Eu9wHpUW63VQU894TsTg+GLbUa1g==", + "node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@babel/types": "^7.18.6" + "@types/json-schema": "^7.0.15" }, "engines": { - "node": ">=6.9.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@babel/helper-split-export-declaration": { - "version": "7.22.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", - "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "node_modules/@eslint/eslintrc": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz", + "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/types": "^7.22.5" + "ajv": "^6.14.0", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.1", + "minimatch": "^3.1.5", + "strip-json-comments": "^3.1.1" }, "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", - "dev": true, - "engines": { - "node": ">=6.9.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, - "engines": { - "node": ">=6.9.0" - } + "license": "Python-2.0" }, - "node_modules/@babel/helper-validator-option": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", - "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helpers": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.18.9.tgz", - "integrity": "sha512-Jf5a+rbrLoR4eNdUmnFu8cN5eNJT6qdTdOg5IHIzq87WwyRw9PwguLFOWYgktN/60IP4fgDUawJvs7PjQIzELQ==", - "dev": true, - "dependencies": { - "@babel/template": "^7.18.6", - "@babel/traverse": "^7.18.9", - "@babel/types": "^7.18.9" + "node": ">=18" }, - "engines": { - "node": ">=6.9.0" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", - "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "argparse": "^2.0.1" }, - "engines": { - "node": ">=6.9.0" + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "node_modules/@eslint/js": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", + "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==", "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, + "license": "MIT", "engines": { - "node": ">=6.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" } }, - "node_modules/@babel/template": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", - "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", "dev": true, - "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" - }, + "license": "Apache-2.0", "engines": { - "node": ">=6.9.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@babel/traverse": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", - "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.0", - "@babel/types": "^7.23.0", - "debug": "^4.1.0", - "globals": "^11.1.0" + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" }, "engines": { - "node": ">=6.9.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@babel/types": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", - "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", "dev": true, - "dependencies": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.20", - "to-fast-properties": "^2.0.0" - }, + "license": "Apache-2.0", "engines": { - "node": ">=6.9.0" + "node": ">=18.18.0" } }, - "node_modules/@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "node_modules/@humanfs/node": { + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.4.0" }, "engines": { - "node": ">=8" + "node": ">=18.18.0" } }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, + "license": "Apache-2.0", "engines": { - "node": ">=8" + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", - "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.0.0", - "@jridgewell/sourcemap-codec": "^1.4.10" - }, + "license": "Apache-2.0", "engines": { - "node": ">=6.0.0" + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", "dev": true, - "engines": { - "node": ">=6.0.0" - } + "license": "MIT" }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", "dev": true, - "engines": { - "node": ">=6.0.0" - } + "license": "MIT" }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.20", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", - "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true, - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } + "license": "MIT" }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "dev": true, - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" + "license": "MIT", + "bin": { + "acorn": "bin/acorn" }, "engines": { - "node": ">=8" + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.14.0.tgz", + "integrity": "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw==", "dev": true, + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -437,99 +347,154 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "node_modules/array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/array-includes": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.9.tgz", + "integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==", "dev": true, + "license": "MIT", "dependencies": { - "color-convert": "^1.9.0" + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.24.0", + "es-object-atoms": "^1.1.1", + "get-intrinsic": "^1.3.0", + "is-string": "^1.1.1", + "math-intrinsics": "^1.1.0" }, "engines": { - "node": ">=4" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/append-transform": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", - "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "node_modules/array.prototype.findlastindex": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", + "integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==", "dev": true, + "license": "MIT", "dependencies": { - "default-require-extensions": "^3.0.0" + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-shim-unscopables": "^1.1.0" }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", - "dev": true - }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true + "node_modules/array.prototype.flat": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "node_modules/array.prototype.flatmap": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", + "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", "dev": true, + "license": "MIT", "dependencies": { - "sprintf-js": "~1.0.2" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", "dev": true, + "license": "MIT", "dependencies": { - "safer-buffer": "~2.1.0" + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/assert-plus": { + "node_modules/async-function": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", "dev": true, + "license": "MIT", "engines": { - "node": ">=0.8" + "node": ">= 0.4" } }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true - }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, "engines": { - "node": "*" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "dev": true - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -555,15 +520,6 @@ } ] }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", - "dev": true, - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, "node_modules/big-integer": { "version": "1.6.51", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", @@ -572,12 +528,6 @@ "node": ">=0.6" } }, - "node_modules/bind-obj-methods": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/bind-obj-methods/-/bind-obj-methods-2.0.2.tgz", - "integrity": "sha512-bUkRdEOppT1Xg/jG0+bp0JSjUD9U0r7skxb/42WeBUjfBpW6COQTIgQmKX5J2Z3aMXcORKgN2N+d7IQwTK3pag==", - "dev": true - }, "node_modules/bplist-creator": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz", @@ -598,319 +548,149 @@ } }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz", + "integrity": "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "node_modules/browser-process-hrtime": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", - "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", - "dev": true - }, - "node_modules/browserslist": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.2.tgz", - "integrity": "sha512-MonuOgAtUB46uP5CezYbRaYKBNt2LxP0yX+Pmj4LkcDFGkn9Cbpi83d9sCjwQDErXsIJSzY5oKGDbgOlF/LPAA==", + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - } - ], + "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001366", - "electron-to-chromium": "^1.4.188", - "node-releases": "^2.0.6", - "update-browserslist-db": "^1.0.4" - }, - "bin": { - "browserslist": "cli.js" + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" }, "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "node_modules/caching-transform": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", - "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dev": true, + "license": "MIT", "dependencies": { - "hasha": "^5.0.0", - "make-dir": "^3.0.0", - "package-hash": "^4.0.0", - "write-file-atomic": "^3.0.0" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" }, "engines": { - "node": ">=8" + "node": ">= 0.4" } }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/caniuse-lite": { - "version": "1.0.30001367", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001367.tgz", - "integrity": "sha512-XDgbeOHfifWV3GEES2B8rtsrADx4Jf+juKX2SICJcaUhjYBO3bR96kvEIHa15VU6ohtOhBZuPGGYGbXMRn0NCw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - } - ] - }, - "node_modules/capture-stack-trace": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", - "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==", + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, - "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" }, "engines": { - "node": ">=4" + "node": ">= 8" } }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/clean-yaml-object": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", - "integrity": "sha512-3yONmlN9CSAkzNwnRCiJQ7Q2xK5mWuEfL3PuTZcAUzhObbXsfsnMptJzXwz93nc5zn9V9TwCVMmV7w4xsm43dw==", + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" } }, - "node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", "dev": true, + "license": "MIT", "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, "engines": { - "node": ">=8" - } - }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", - "dev": true, - "bin": { - "color-support": "bin.js" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/convert-source-map": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", - "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.1" - } - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true, - "optional": true - }, - "node_modules/coveralls": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.1.1.tgz", - "integrity": "sha512-+dxnG2NHncSD1NrqbSM3dn/lE57O6Qf/koe9+I7c+wzkqRmEvcp0kgJdxKInzYzkICKkFMZsX3Vct3++tsF9ww==", - "dev": true, - "dependencies": { - "js-yaml": "^3.13.1", - "lcov-parse": "^1.0.0", - "log-driver": "^1.2.7", - "minimist": "^1.2.5", - "request": "^2.88.2" - }, - "bin": { - "coveralls": "bin/coveralls.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/cp-file": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-6.2.0.tgz", - "integrity": "sha512-fmvV4caBnofhPe8kOcitBwSn2f39QLjnAnGq3gO9dfd75mUytzKNZB1hde6QHunW2Rt+OwuBOMc3i1tNElbszA==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "make-dir": "^2.0.0", - "nested-error-stacks": "^2.0.0", - "pify": "^4.0.1", - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/cp-file/node_modules/make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", - "dev": true, - "dependencies": { - "pify": "^4.0.1", - "semver": "^5.6.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/cp-file/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0" + "node": ">= 0.4" }, - "engines": { - "node": ">=0.10" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/debug": { @@ -930,1805 +710,1723 @@ } } }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true, - "engines": { - "node": ">=0.10.0" - } + "license": "MIT" }, - "node_modules/default-require-extensions": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", - "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", "dev": true, + "license": "MIT", "dependencies": { - "strip-bom": "^4.0.0" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" }, "engines": { - "node": ">=8" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/diff": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", - "integrity": "sha512-VzVc42hMZbYU9Sx/ltb7KYuQ6pqAw+cbFWVy4XKdkuEL2CFaRLGEnISPs7YdzaUGpi+CpIqvRmu7hPQ4T7EQ5w==", - "dev": true, - "engines": { - "node": ">=0.3.1" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/domain-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", - "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, "engines": { - "node": ">=0.4", - "npm": ">=1.2" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, + "license": "Apache-2.0", "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/ejs": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.7.4.tgz", - "integrity": "sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==", - "dev": true, - "hasInstallScript": true, + "esutils": "^2.0.2" + }, "engines": { "node": ">=0.10.0" } }, - "node_modules/electron-to-chromium": { - "version": "1.4.194", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.194.tgz", - "integrity": "sha512-ola5UH0xAP1oYY0FFUsPvwtucEzCQHucXnT7PQ1zjHJMccZhCDktEugI++JUR3YuIs7Ff7afz+OVEhVAIMhLAQ==", - "dev": true - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true - }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", "dev": true, + "license": "MIT", "dependencies": { - "is-arrayish": "^0.2.1" + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" } }, - "node_modules/es6-error": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, + "node_modules/enhanced-resolve": { + "version": "5.20.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.20.1.tgz", + "integrity": "sha512-Qohcme7V1inbAfvjItgw0EaxVX5q2rdVEZHRBrEQdRZTssLDGsL8Lwrznl8oQ/6kuTJONLaDcGjkNP247XEhcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/es-abstract": { + "version": "1.24.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.1.tgz", + "integrity": "sha512-zHXBLhP+QehSSbsS9Pt23Gg964240DPd6QCf8WpkqEXxQ7fhdZzYsocOr5u7apWonsS5EjZDmTF+/slGMyasvw==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.3.0", + "get-proto": "^1.0.1", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-negative-zero": "^2.0.3", + "is-regex": "^1.2.1", + "is-set": "^2.0.3", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.1", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.4", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.4", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "stop-iteration-iterator": "^1.1.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.19" + }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "dev": true, + "license": "MIT", "engines": { - "node": ">=0.8.0" + "node": ">= 0.4" } }, - "node_modules/esm": { - "version": "3.2.25", - "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", - "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", "dev": true, + "license": "MIT", "engines": { - "node": ">=6" + "node": ">= 0.4" } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" }, "engines": { - "node": ">=4" + "node": ">= 0.4" } }, - "node_modules/events-to-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/events-to-array/-/events-to-array-1.1.2.tgz", - "integrity": "sha512-inRWzRY7nG+aXZxBzEqYKB3HPgwflZRopAjDCHv0whhRx+MTUr1ei0ICZUypdyE0HRm4L2d5VEcIqLD6yl+BFA==", - "dev": true - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", - "dev": true, - "engines": [ - "node >=0.6.0" - ] - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-json-stable-stringify": { + "node_modules/es-set-tostringtag": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/find-cache-dir": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", "dev": true, + "license": "MIT", "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + "node": ">= 0.4" } }, - "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/es-shim-unscopables": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", "dev": true, + "license": "MIT", "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "hasown": "^2.0.2" }, "engines": { - "node": ">=8" + "node": ">= 0.4" } }, - "node_modules/foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "node_modules/es-to-primitive": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", "dev": true, + "license": "MIT", "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" }, "engines": { - "node": ">=8.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", - "dev": true, + "node_modules/eslint": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.4.tgz", + "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.2", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.5", + "@eslint/js": "9.39.4", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.5", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, "engines": { - "node": "*" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } } }, - "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "node_modules/eslint-compat-utils": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/eslint-compat-utils/-/eslint-compat-utils-0.5.1.tgz", + "integrity": "sha512-3z3vFexKIEnjHE3zCMRo6fn/e44U7T1khUjg+Hp0ZQMCigh28rALD0nPFBcGZuiLC5rLZa2ubQHDRln09JfU2Q==", "dev": true, + "license": "MIT", "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" + "semver": "^7.5.4" }, "engines": { - "node": ">= 0.12" - } - }, - "node_modules/fromentries": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", - "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/fs-exists-cached": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-exists-cached/-/fs-exists-cached-1.0.0.tgz", - "integrity": "sha512-kSxoARUDn4F2RPXX48UXnaFKwVU7Ivd/6qpzZL29MCDmr9sTvybv4gFCp+qaI4fM9m0z9fgz/yJvi56GAz+BZg==", - "dev": true - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "node_modules/function-loop": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/function-loop/-/function-loop-1.0.2.tgz", - "integrity": "sha512-Iw4MzMfS3udk/rqxTiDDCllhGwlOrsr50zViTOO/W6lS/9y6B1J0BD2VZzrnWUYBJsl3aeqjgR5v7bWWhZSYbA==", - "dev": true - }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, - "engines": { - "node": ">=6.9.0" + "node": ">=12" + }, + "peerDependencies": { + "eslint": ">=6.0.0" } }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "node_modules/eslint-compat-utils/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, "engines": { - "node": "6.* || 8.* || >= 10.*" + "node": ">=10" } }, - "node_modules/get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "node_modules/eslint-import-resolver-node": { + "version": "0.3.10", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.10.tgz", + "integrity": "sha512-tRrKqFyCaKict5hOd244sL6EQFNycnMQnBe+j8uqGNXYzsImGbGUU4ibtoaBmv5FLwJwcFJNeg1GeVjQfbMrDQ==", "dev": true, - "engines": { - "node": ">=8.0.0" + "license": "MIT", + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.16.1", + "resolve": "^2.0.0-next.6" } }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { - "assert-plus": "^1.0.0" + "ms": "^2.1.1" } }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "node_modules/eslint-import-resolver-node/node_modules/resolve": { + "version": "2.0.0-next.6", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.6.tgz", + "integrity": "sha512-3JmVl5hMGtJ3kMmB3zi3DL25KfkCEyy3Tw7Gmw7z5w8M9WlwoPFnIvwChzu1+cF3iaK3sp18hhPz8ANeimdJfA==", "dev": true, + "license": "MIT", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "es-errors": "^1.3.0", + "is-core-module": "^2.16.1", + "node-exports-info": "^1.6.0", + "object-keys": "^1.1.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" }, "engines": { - "node": "*" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true - }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", - "dev": true, - "engines": { - "node": ">=4" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", + "node_modules/eslint-module-utils": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz", + "integrity": "sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==", "dev": true, + "license": "MIT", "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" + "debug": "^3.2.7" }, "engines": { - "node": ">=6" - } - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" + "node": ">=4" }, - "engines": { - "node": ">= 0.4.0" + "peerDependenciesMeta": { + "eslint": { + "optional": true + } } }, - "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, - "engines": { - "node": ">=4" + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" } }, - "node_modules/hasha": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", - "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", + "node_modules/eslint-plugin-es-x": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es-x/-/eslint-plugin-es-x-7.8.0.tgz", + "integrity": "sha512-7Ds8+wAAoV3T+LAKeu39Y5BzXCrGKrcISfgKEqTS4BDN8SFEDQd0S43jiQ8vIa3wUKD07qitZdfzlenSi8/0qQ==", "dev": true, + "funding": [ + "https://github.com/sponsors/ota-meshi", + "https://opencollective.com/eslint" + ], + "license": "MIT", "dependencies": { - "is-stream": "^2.0.0", - "type-fest": "^0.8.0" + "@eslint-community/eslint-utils": "^4.1.2", + "@eslint-community/regexpp": "^4.11.0", + "eslint-compat-utils": "^0.5.1" }, "engines": { - "node": ">=8" + "node": "^14.18.0 || >=16.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", - "dev": true - }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true - }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", - "dev": true, - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" + "peerDependencies": { + "eslint": ">=8" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.32.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.32.0.tgz", + "integrity": "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.9", + "array.prototype.findlastindex": "^1.2.6", + "array.prototype.flat": "^1.3.3", + "array.prototype.flatmap": "^1.3.3", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.12.1", + "hasown": "^2.0.2", + "is-core-module": "^2.16.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.1", + "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.9", + "tsconfig-paths": "^3.15.0" }, "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true, - "engines": { - "node": ">=8" + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, + "license": "MIT", "dependencies": { - "once": "^1.3.0", - "wrappy": "1" + "ms": "^2.1.1" } }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true - }, - "node_modules/is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "node_modules/eslint-plugin-n": { + "version": "17.24.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-17.24.0.tgz", + "integrity": "sha512-/gC7/KAYmfNnPNOb3eu8vw+TdVnV0zhdQwexsw6FLXbhzroVj20vRn2qL8lDWDGnAQ2J8DhdfvXxX9EoxvERvw==", "dev": true, + "license": "MIT", "dependencies": { - "has": "^1.0.3" + "@eslint-community/eslint-utils": "^4.5.0", + "enhanced-resolve": "^5.17.1", + "eslint-plugin-es-x": "^7.8.0", + "get-tsconfig": "^4.8.1", + "globals": "^15.11.0", + "globrex": "^0.1.2", + "ignore": "^5.3.2", + "semver": "^7.6.3", + "ts-declaration-location": "^1.0.6" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, "engines": { - "node": ">=8" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": ">=8.23.0" } }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "node_modules/eslint-plugin-n/node_modules/globals": { + "version": "15.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", "dev": true, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true - }, - "node_modules/is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "node_modules/eslint-plugin-n/node_modules/semver": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz", + "integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==", "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true, - "optional": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", - "dev": true - }, - "node_modules/istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-hook": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", - "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", - "dev": true, - "dependencies": { - "append-transform": "^2.0.0" + "license": "ISC", + "bin": { + "semver": "bin/semver.js" }, "engines": { - "node": ">=8" + "node": ">=10" } }, - "node_modules/istanbul-lib-instrument": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "node_modules/eslint-plugin-n/node_modules/ts-declaration-location": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/ts-declaration-location/-/ts-declaration-location-1.0.7.tgz", + "integrity": "sha512-EDyGAwH1gO0Ausm9gV6T2nUvBgXT5kGoCMJPllOaooZ+4VvJiKBdZE7wK18N1deEowhcUptS+5GXZK8U/fvpwA==", "dev": true, + "funding": [ + { + "type": "ko-fi", + "url": "https://ko-fi.com/rebeccastevens" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/ts-declaration-location" + } + ], + "license": "BSD-3-Clause", "dependencies": { - "@babel/core": "^7.7.5", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" + "picomatch": "^4.0.2" }, - "engines": { - "node": ">=8" + "peerDependencies": { + "typescript": ">=4.0.0" } }, - "node_modules/istanbul-lib-processinfo": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", - "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", + "node_modules/eslint-plugin-n/node_modules/typescript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.2.tgz", + "integrity": "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==", "dev": true, - "dependencies": { - "archy": "^1.0.0", - "cross-spawn": "^7.0.3", - "istanbul-lib-coverage": "^3.2.0", - "p-map": "^3.0.0", - "rimraf": "^3.0.0", - "uuid": "^8.3.2" + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" }, "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-processinfo/node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" + "node": ">=14.17" } }, - "node_modules/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "node_modules/eslint-plugin-promise": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-7.2.1.tgz", + "integrity": "sha512-SWKjd+EuvWkYaS+uN2csvj0KoP43YTu7+phKQ5v+xw6+A0gutVX2yqCeCkC3uLCJFiPfR2dD8Es5L7yUsmvEaA==", "dev": true, + "license": "ISC", "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" + "@eslint-community/eslint-utils": "^4.4.0" }, "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-report/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" } }, - "node_modules/istanbul-lib-report/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "has-flag": "^4.0.0" + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" }, "engines": { - "node": ">=8" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, - "dependencies": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" - }, + "license": "Apache-2.0", "engines": { - "node": ">=10" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/istanbul-reports": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", - "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "license": "MIT", "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" + "color-convert": "^2.0.1" }, "engines": { "node": ">=8" - } - }, - "node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, - "node_modules/js-yaml": { - "version": "3.14.2", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.2.tgz", - "integrity": "sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg==", - "dev": true, - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", - "dev": true - }, - "node_modules/jsesc": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "bin": { - "jsesc": "bin/jsesc" + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=4" - } - }, - "node_modules/json-parse-better-errors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true - }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", - "dev": true - }, - "node_modules/json5": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.1.tgz", - "integrity": "sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==", - "dev": true, - "bin": { - "json5": "lib/cli.js" + "node": ">=10" }, - "engines": { - "node": ">=6" + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "license": "MIT", "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" + "color-name": "~1.1.4" }, "engines": { - "node": ">=0.6.0" + "node": ">=7.0.0" } }, - "node_modules/lcov-parse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz", - "integrity": "sha512-aprLII/vPzuQvYZnDRU78Fns9I2Ag3gi4Ipga/hxnVMCZC8DnR2nI7XBqrPoywGfxqIx/DgarGvDJZAD3YBTgQ==", + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, - "bin": { - "lcov-parse": "bin/cli.js" - } + "license": "MIT" }, - "node_modules/load-json-file": { + "node_modules/eslint/node_modules/escape-string-regexp": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^4.0.0", - "pify": "^3.0.0", - "strip-bom": "^3.0.0" - }, + "license": "MIT", "engines": { - "node": ">=4" - } - }, - "node_modules/load-json-file/node_modules/pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/load-json-file/node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, - "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/locate-path": { + "node_modules/eslint/node_modules/find-up": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, + "license": "MIT", "dependencies": { - "p-locate": "^4.1.0" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", - "dev": true - }, - "node_modules/log-driver": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", - "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">=0.8.6" + "node": ">=8" } }, - "node_modules/lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, + "license": "MIT", "dependencies": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lru-cache/node_modules/yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", - "dev": true - }, - "node_modules/make-dir": { + "node_modules/eslint/node_modules/p-limit": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, + "license": "MIT", "dependencies": { - "semver": "^6.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "node_modules/merge-source-map": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", - "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "license": "MIT", "dependencies": { - "source-map": "^0.6.1" + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, "engines": { - "node": ">= 0.6" + "node": ">=8" } }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "mime-db": "1.52.0" + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" }, "engines": { - "node": ">= 0.6" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/minimatch": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", - "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "brace-expansion": "^1.1.7" + "estraverse": "^5.1.0" }, "engines": { - "node": "*" + "node": ">=0.10" } }, - "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true - }, - "node_modules/minipass": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" } }, - "node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, - "dependencies": { - "minimist": "^1.2.6" - }, - "bin": { - "mkdirp": "bin/cmd.js" + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" } }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, - "node_modules/nested-error-stacks": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz", - "integrity": "sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==", + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, - "node_modules/node-preload": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", - "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, + "license": "MIT", "dependencies": { - "process-on-spawn": "^1.0.0" + "flat-cache": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=16.0.0" } }, - "node_modules/node-releases": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.6.tgz", - "integrity": "sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==", - "dev": true - }, - "node_modules/nodeunit": { - "version": "0.11.3", - "resolved": "https://registry.npmjs.org/nodeunit/-/nodeunit-0.11.3.tgz", - "integrity": "sha512-gDNxrDWpx07BxYNO/jn1UrGI1vNhDQZrIFphbHMcTCDc5mrrqQBWfQMXPHJ5WSgbFwD1D6bv4HOsqtTrPG03AA==", - "deprecated": "you are strongly encouraged to use other testing options", + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, + "license": "MIT", "dependencies": { - "ejs": "^2.5.2", - "tap": "^12.0.1" + "flatted": "^3.2.9", + "keyv": "^4.5.4" }, - "bin": { - "nodeunit": "bin/nodeunit" + "engines": { + "node": ">=16" } }, - "node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "node_modules/flatted": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", "dev": true, - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } + "license": "ISC" }, - "node_modules/normalize-package-data/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "node_modules/for-each": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.5.tgz", + "integrity": "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==", "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/nyc": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", - "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", - "dev": true, - "dependencies": { - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "caching-transform": "^4.0.0", - "convert-source-map": "^1.7.0", - "decamelize": "^1.2.0", - "find-cache-dir": "^3.2.0", - "find-up": "^4.1.0", - "foreground-child": "^2.0.0", - "get-package-type": "^0.1.0", - "glob": "^7.1.6", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-hook": "^3.0.0", - "istanbul-lib-instrument": "^4.0.0", - "istanbul-lib-processinfo": "^2.0.2", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.0.2", - "make-dir": "^3.0.0", - "node-preload": "^0.2.1", - "p-map": "^3.0.0", - "process-on-spawn": "^1.0.0", - "resolve-from": "^5.0.0", - "rimraf": "^3.0.0", - "signal-exit": "^3.0.2", - "spawn-wrap": "^2.0.0", - "test-exclude": "^6.0.0", - "yargs": "^15.0.2" - }, - "bin": { - "nyc": "bin/nyc.js" + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7" }, "engines": { - "node": ">=8.9" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, - "engines": { - "node": "*" + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "node_modules/function.prototype.name": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", "dev": true, + "license": "MIT", "dependencies": { - "wrappy": "1" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/opener": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", - "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", "dev": true, - "bin": { - "opener": "bin/opener-bin.js" + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==", + "node_modules/generator-function": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", + "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", "dev": true, + "license": "MIT", "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/own-or": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/own-or/-/own-or-1.0.0.tgz", - "integrity": "sha512-NfZr5+Tdf6MB8UI9GLvKRs4cXY8/yB0w3xtt84xFdWy8hkGjn+JFc60VhzS/hFRfbyxFcGYMTjnF4Me+RbbqrA==", - "dev": true - }, - "node_modules/own-or-env": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/own-or-env/-/own-or-env-1.0.2.tgz", - "integrity": "sha512-NQ7v0fliWtK7Lkb+WdFqe6ky9XAzYmlkXthQrBbzlYbmFKoAYbDDcwmOm6q8kOuwSRXW8bdL5ORksploUJmWgw==", - "dev": true, - "dependencies": { - "own-or": "^1.0.0" + "node": ">= 0.4" } }, - "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dev": true, + "license": "MIT", "dependencies": { - "p-try": "^2.0.0" + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { - "node": ">=6" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", "dev": true, + "license": "MIT", "dependencies": { - "p-limit": "^2.2.0" + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" }, "engines": { - "node": ">=8" + "node": ">= 0.4" } }, - "node_modules/p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "node_modules/get-symbol-description": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", "dev": true, + "license": "MIT", "dependencies": { - "aggregate-error": "^3.0.0" + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" }, "engines": { - "node": ">=8" - } - }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, - "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/package-hash": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", - "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "node_modules/get-tsconfig": { + "version": "4.13.7", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.7.tgz", + "integrity": "sha512-7tN6rFgBlMgpBML5j8typ92BKFi2sFQvIdpAqLA2beia5avZDrMs0FLZiM5etShWq5irVyGcGMEA1jcDaK7A/Q==", "dev": true, + "license": "MIT", "dependencies": { - "graceful-fs": "^4.1.15", - "hasha": "^5.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" + "resolve-pkg-maps": "^1.0.0" }, - "engines": { - "node": ">=8" + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, - "node_modules/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, + "license": "ISC", "dependencies": { - "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" + "is-glob": "^4.0.3" }, "engines": { - "node": ">=4" + "node": ">=10.13.0" } }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "node_modules/globrex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", + "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", "dev": true, - "engines": { - "node": ">=0.10.0" - } + "license": "MIT" }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "dev": true, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", "dev": true }, - "node_modules/path-type": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "node_modules/has-bigints": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", + "integrity": "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==", "dev": true, - "dependencies": { - "pify": "^3.0.0" - }, + "license": "MIT", "engines": { - "node": ">=4" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/path-type/node_modules/pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dev": true, - "engines": { - "node": ">=4" + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/pegjs": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz", - "integrity": "sha512-qI5+oFNEGi3L5HAxDwN2LA4Gg7irF70Zs25edhjld9QemOgp0CbvMtbFcMvFtEo1OityPrcCzkQFB8JP/hxgow==", + "node_modules/has-proto": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", "dev": true, - "bin": { - "pegjs": "bin/pegjs" + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" }, "engines": { - "node": ">=0.10" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", - "dev": true - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - }, - "node_modules/pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, + "license": "MIT", "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, + "license": "MIT", "dependencies": { - "find-up": "^4.0.0" + "has-symbols": "^1.0.3" }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/plist": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.6.tgz", - "integrity": "sha512-WiIVYyrp8TD4w8yCvyeIr+lkmrGRd5u0VbRnU+tP/aRLxP/YadJUYOMZJ/6hIa3oUyVCsycXvtNRgd5XBJIbiA==", + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", "dependencies": { - "base64-js": "^1.5.1", - "xmlbuilder": "^15.1.1" + "function-bind": "^1.1.2" }, "engines": { - "node": ">=6" + "node": ">= 0.4" } }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", "dev": true, - "optional": true + "license": "MIT", + "engines": { + "node": ">= 4" + } }, - "node_modules/process-on-spawn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", - "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "dev": true, + "license": "MIT", "dependencies": { - "fromentries": "^1.2.0" + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", - "dev": true - }, - "node_modules/psl": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, + "license": "MIT", "engines": { - "node": ">=6" + "node": ">=4" } }, - "node_modules/qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "engines": { - "node": ">=0.6" + "node": ">=0.8.19" } }, - "node_modules/read-pkg": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "node_modules/internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", "dev": true, + "license": "MIT", "dependencies": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" }, "engines": { - "node": ">=4" + "node": ">= 0.4" } }, - "node_modules/read-pkg-up": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", - "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "node_modules/is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", "dev": true, + "license": "MIT", "dependencies": { - "find-up": "^3.0.0", - "read-pkg": "^3.0.0" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/read-pkg-up/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", "dev": true, + "license": "MIT", "dependencies": { - "locate-path": "^3.0.0" + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/read-pkg-up/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "node_modules/is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", "dev": true, + "license": "MIT", "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "has-bigints": "^1.0.2" }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/read-pkg-up/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "node_modules/is-boolean-object": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", "dev": true, + "license": "MIT", "dependencies": { - "p-limit": "^2.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/read-pkg-up/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", "dev": true, + "license": "MIT", "engines": { - "node": ">=4" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", "dev": true, - "optional": true, + "license": "MIT", "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/release-zalgo": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==", + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", "dev": true, + "license": "MIT", "dependencies": { - "es6-error": "^4.0.1" + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" }, "engines": { - "node": ">=4" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "dev": true, - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/request/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "node_modules/is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", "dev": true, - "bin": { - "uuid": "bin/uuid" + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/require-directory": { + "node_modules/is-extglob": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true - }, - "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", "dev": true, + "license": "MIT", "dependencies": { - "is-core-module": "^2.9.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" + "call-bound": "^1.0.3" }, - "bin": { - "resolve": "bin/resolve" + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "node_modules/is-generator-function": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", + "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.4", + "generator-function": "^2.0.0", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, + "license": "MIT", "dependencies": { - "glob": "^7.1.3" + "is-extglob": "^2.1.1" }, - "bin": { - "rimraf": "bin.js" + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", "dev": true, - "bin": { - "semver": "bin/semver.js" + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", - "dev": true - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "node_modules/is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", "dev": true, + "license": "MIT", "dependencies": { - "shebang-regex": "^3.0.0" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true - }, - "node_modules/simple-plist": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.1.tgz", - "integrity": "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw==", + "license": "MIT", "dependencies": { - "bplist-creator": "0.1.0", - "bplist-parser": "0.3.1", - "plist": "^3.0.5" + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", "dev": true, + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", "dev": true, + "license": "MIT", "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/spawn-wrap": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", - "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "node_modules/is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", "dev": true, + "license": "MIT", "dependencies": { - "foreground-child": "^2.0.0", - "is-windows": "^1.0.2", - "make-dir": "^3.0.0", - "rimraf": "^3.0.0", - "signal-exit": "^3.0.2", - "which": "^2.0.1" + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/spdx-correct": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "node_modules/is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", "dev": true, + "license": "MIT", "dependencies": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true - }, - "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", "dev": true, + "license": "MIT", "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/spdx-license-ids": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", - "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", - "dev": true - }, - "node_modules/sprintf-js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "node_modules/sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", + "node_modules/is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", "dev": true, + "license": "MIT", "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" + "call-bound": "^1.0.3" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/stack-utils": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.5.tgz", - "integrity": "sha512-KZiTzuV3CnSnSvgMRrARVCj+Ht7rMbauGDK0LdVFRGyenwdylpajAp4Q0i6SX8rEmbTpMMf6ryq2gb8pPq2WgQ==", + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", "dev": true, + "license": "MIT", "dependencies": { - "escape-string-regexp": "^2.0.0" + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/stack-utils/node_modules/escape-string-regexp": { + "node_modules/isexe": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", "dev": true, - "engines": { - "node": ">=8" - } + "license": "MIT" }, - "node_modules/stream-buffers": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz", - "integrity": "sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==", - "engines": { - "node": ">= 0.10.0" - } + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dev": true, - "optional": true, + "license": "MIT", "dependencies": { - "safe-buffer": "~5.1.0" + "json-buffer": "3.0.1" } }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, + "license": "MIT", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" }, "engines": { - "node": ">=8" + "node": ">= 0.8.0" } }, - "node_modules/string-width/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true, - "engines": { - "node": ">=8" - } + "license": "MIT" }, - "node_modules/string-width/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">= 0.4" } }, - "node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "dev": true, "dependencies": { - "ansi-regex": "^2.0.0" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=0.10.0" + "node": "*" } }, - "node_modules/strip-bom": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true, - "engines": { - "node": ">=8" - } + "license": "MIT" }, - "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/node-exports-info": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/node-exports-info/-/node-exports-info-1.6.0.tgz", + "integrity": "sha512-pyFS63ptit/P5WqUkt+UUfe+4oevH+bFeIiPPdfb0pFeYEu/1ELnJu5l+5EcTKYL5M7zaAa7S8ddywgXypqKCw==", "dev": true, + "license": "MIT", "dependencies": { - "has-flag": "^3.0.0" + "array.prototype.flatmap": "^1.3.3", + "es-errors": "^1.3.0", + "object.entries": "^1.1.9", + "semver": "^6.3.1" }, "engines": { - "node": ">=4" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "dev": true, + "license": "MIT", "engines": { "node": ">= 0.4" }, @@ -2736,814 +2434,798 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap": { - "version": "12.7.0", - "resolved": "https://registry.npmjs.org/tap/-/tap-12.7.0.tgz", - "integrity": "sha512-SjglJmRv0pqrQQ7d5ZBEY8ZOqv3nYDBXEX51oyycOH7piuhn82JKT/yDNewwmOsodTD/RZL9MccA96EjDgK+Eg==", - "dev": true, - "dependencies": { - "bind-obj-methods": "^2.0.0", - "browser-process-hrtime": "^1.0.0", - "capture-stack-trace": "^1.0.0", - "clean-yaml-object": "^0.1.0", - "color-support": "^1.1.0", - "coveralls": "^3.0.2", - "domain-browser": "^1.2.0", - "esm": "^3.2.5", - "foreground-child": "^1.3.3", - "fs-exists-cached": "^1.0.0", - "function-loop": "^1.0.1", - "glob": "^7.1.3", - "isexe": "^2.0.0", - "js-yaml": "^3.13.1", - "minipass": "^2.3.5", - "mkdirp": "^0.5.1", - "nyc": "^14.0.0", - "opener": "^1.5.1", - "os-homedir": "^1.0.2", - "own-or": "^1.0.0", - "own-or-env": "^1.0.1", - "rimraf": "^2.6.3", - "signal-exit": "^3.0.0", - "source-map-support": "^0.5.10", - "stack-utils": "^1.0.2", - "tap-mocha-reporter": "^3.0.9", - "tap-parser": "^7.0.0", - "tmatch": "^4.0.0", - "trivial-deferred": "^1.0.1", - "ts-node": "^8.0.2", - "tsame": "^2.0.1", - "typescript": "^3.3.3", - "write-file-atomic": "^2.4.2", - "yapool": "^1.0.0" - }, - "bin": { - "tap": "bin/run.js" - }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "license": "MIT", "engines": { - "node": ">=4" + "node": ">= 0.4" } }, - "node_modules/tap-mocha-reporter": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/tap-mocha-reporter/-/tap-mocha-reporter-3.0.9.tgz", - "integrity": "sha512-VO07vhC9EG27EZdOe7bWBj1ldbK+DL9TnRadOgdQmiQOVZjFpUEQuuqO7+rNSO2kfmkq5hWeluYXDWNG/ytXTQ==", + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", "dev": true, + "license": "MIT", "dependencies": { - "color-support": "^1.1.0", - "debug": "^2.1.3", - "diff": "^1.3.2", - "escape-string-regexp": "^1.0.3", - "glob": "^7.0.5", - "js-yaml": "^3.3.1", - "tap-parser": "^5.1.0", - "unicode-length": "^1.0.0" + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" }, - "bin": { - "tap-mocha-reporter": "index.js" + "engines": { + "node": ">= 0.4" }, - "optionalDependencies": { - "readable-stream": "^2.1.5" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap-mocha-reporter/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "node_modules/object.entries": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.9.tgz", + "integrity": "sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw==", "dev": true, + "license": "MIT", "dependencies": { - "ms": "2.0.0" + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" } }, - "node_modules/tap-mocha-reporter/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/tap-mocha-reporter/node_modules/tap-parser": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-5.4.0.tgz", - "integrity": "sha512-BIsIaGqv7uTQgTW1KLTMNPSEQf4zDDPgYOBRdgOfuB+JFOLRBfEu6cLa/KvMvmqggu1FKXDfitjLwsq4827RvA==", + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", "dev": true, + "license": "MIT", "dependencies": { - "events-to-array": "^1.0.1", - "js-yaml": "^3.2.7" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" }, - "bin": { - "tap-parser": "bin/cmd.js" + "engines": { + "node": ">= 0.4" }, - "optionalDependencies": { - "readable-stream": "^2" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap-parser": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-7.0.0.tgz", - "integrity": "sha512-05G8/LrzqOOFvZhhAk32wsGiPZ1lfUrl+iV7+OkKgfofZxiceZWMHkKmow71YsyVQ8IvGBP2EjcIjE5gL4l5lA==", + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", "dev": true, + "license": "MIT", "dependencies": { - "events-to-array": "^1.0.1", - "js-yaml": "^3.2.7", - "minipass": "^2.2.0" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" }, - "bin": { - "tap-parser": "bin/cmd.js" + "engines": { + "node": ">= 0.4" } }, - "node_modules/tap/node_modules/ansi-regex": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", - "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "node_modules/object.values": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap/node_modules/append-transform": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", - "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, + "license": "MIT", "dependencies": { - "default-require-extensions": "^2.0.0" + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" }, "engines": { - "node": ">=4" + "node": ">= 0.8.0" } }, - "node_modules/tap/node_modules/caching-transform": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-3.0.2.tgz", - "integrity": "sha512-Mtgcv3lh3U0zRii/6qVgQODdPA4G3zhG+jtbCWj39RXuUFTMzH0vcdMtaJS1jPowd+It2Pqr6y3NJMQqOqCE2w==", + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", "dev": true, + "license": "MIT", "dependencies": { - "hasha": "^3.0.0", - "make-dir": "^2.0.0", - "package-hash": "^3.0.0", - "write-file-atomic": "^2.4.2" + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap/node_modules/cliui": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, + "license": "MIT", "dependencies": { - "string-width": "^3.1.0", - "strip-ansi": "^5.2.0", - "wrap-ansi": "^5.1.0" + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" } }, - "node_modules/tap/node_modules/cross-spawn": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", - "integrity": "sha512-yAXz/pA1tD8Gtg2S98Ekf/sewp3Lcp3YoFKJ4Hkp5h5yLWnKVTDU0kwjKJ8NDCYcfTLfyGkzTikst+jWypT1iA==", + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, - "dependencies": { - "lru-cache": "^4.0.1", - "which": "^1.2.9" + "engines": { + "node": ">=8" } }, - "node_modules/tap/node_modules/default-require-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", - "integrity": "sha512-B0n2zDIXpzLzKeoEozorDSa1cHc1t0NjmxP0zuAxbizNU2MBqYJJKYXrrFdKuQliojXynrxgd7l4ahfg/+aA5g==", + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, - "dependencies": { - "strip-bom": "^3.0.0" - }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/tap/node_modules/emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, - "node_modules/tap/node_modules/find-cache-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", - "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "node_modules/pegjs": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/pegjs/-/pegjs-0.10.0.tgz", + "integrity": "sha512-qI5+oFNEGi3L5HAxDwN2LA4Gg7irF70Zs25edhjld9QemOgp0CbvMtbFcMvFtEo1OityPrcCzkQFB8JP/hxgow==", "dev": true, - "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^2.0.0", - "pkg-dir": "^3.0.0" + "bin": { + "pegjs": "bin/pegjs" }, "engines": { - "node": ">=6" + "node": ">=0.10" } }, - "node_modules/tap/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, - "dependencies": { - "locate-path": "^3.0.0" - }, + "license": "MIT", "engines": { - "node": ">=6" - } - }, - "node_modules/tap/node_modules/foreground-child": { - "version": "1.5.6", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", - "integrity": "sha512-3TOY+4TKV0Ml83PXJQY+JFQaHNV38lzQDIzzXYg1kWdBLenGgoZhAs0CKgzI31vi2pWEpQMq/Yi4bpKwCPkw7g==", - "dev": true, - "dependencies": { - "cross-spawn": "^4", - "signal-exit": "^3.0.0" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/tap/node_modules/hasha": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-3.0.0.tgz", - "integrity": "sha512-w0Kz8lJFBoyaurBiNrIvxPqr/gJ6fOfSkpAPOepN3oECqGJag37xPbOv57izi/KP8auHgNYxn5fXtAb+1LsJ6w==", - "dev": true, + "node_modules/plist": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.6.tgz", + "integrity": "sha512-WiIVYyrp8TD4w8yCvyeIr+lkmrGRd5u0VbRnU+tP/aRLxP/YadJUYOMZJ/6hIa3oUyVCsycXvtNRgd5XBJIbiA==", "dependencies": { - "is-stream": "^1.0.1" + "base64-js": "^1.5.1", + "xmlbuilder": "^15.1.1" }, "engines": { - "node": ">=4" + "node": ">=6" } }, - "node_modules/tap/node_modules/is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", "dev": true, + "license": "MIT", "engines": { - "node": ">=4" + "node": ">= 0.4" } }, - "node_modules/tap/node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">= 0.8.0" } }, - "node_modules/tap/node_modules/istanbul-lib-coverage": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", - "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true, "engines": { "node": ">=6" } }, - "node_modules/tap/node_modules/istanbul-lib-hook": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.7.tgz", - "integrity": "sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA==", + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", "dev": true, + "license": "MIT", "dependencies": { - "append-transform": "^1.0.0" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap/node_modules/istanbul-lib-instrument": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", - "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/generator": "^7.4.0", - "@babel/parser": "^7.4.3", - "@babel/template": "^7.4.0", - "@babel/traverse": "^7.4.3", - "@babel/types": "^7.4.0", - "istanbul-lib-coverage": "^2.0.5", - "semver": "^6.0.0" + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap/node_modules/istanbul-lib-report": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", - "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", "dev": true, - "dependencies": { - "istanbul-lib-coverage": "^2.0.5", - "make-dir": "^2.1.0", - "supports-color": "^6.1.0" - }, - "engines": { - "node": ">=6" + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } }, - "node_modules/tap/node_modules/istanbul-lib-source-maps": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", - "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", + "node_modules/safe-array-concat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", "dev": true, + "license": "MIT", "dependencies": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.5", - "make-dir": "^2.1.0", - "rimraf": "^2.6.3", - "source-map": "^0.6.1" + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" }, "engines": { - "node": ">=6" + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap/node_modules/istanbul-reports": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.7.tgz", - "integrity": "sha512-uu1F/L1o5Y6LzPVSVZXNOoD/KXpJue9aeLRd0sM9uMXfZvzomB0WxVamWb5ue8kA2vVWEmW7EG+A5n3f1kqHKg==", + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", "dev": true, + "license": "MIT", "dependencies": { - "html-escaper": "^2.0.0" + "es-errors": "^1.3.0", + "isarray": "^2.0.5" }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "node_modules/safe-push-apply/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", "dev": true, + "license": "MIT", "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap/node_modules/make-dir": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", - "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", "dev": true, + "license": "MIT", "dependencies": { - "pify": "^4.0.1", - "semver": "^5.6.0" + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" }, "engines": { - "node": ">=6" + "node": ">= 0.4" } }, - "node_modules/tap/node_modules/make-dir/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/tap/node_modules/nyc": { - "version": "14.1.1", - "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.1.1.tgz", - "integrity": "sha512-OI0vm6ZGUnoGZv/tLdZ2esSVzDwUC88SNs+6JoSOMVxA+gKMB8Tk7jBwgemLx4O40lhhvZCVw1C+OYLOBOPXWw==", - "dev": true, - "dependencies": { - "archy": "^1.0.0", - "caching-transform": "^3.0.2", - "convert-source-map": "^1.6.0", - "cp-file": "^6.2.0", - "find-cache-dir": "^2.1.0", - "find-up": "^3.0.0", - "foreground-child": "^1.5.6", - "glob": "^7.1.3", - "istanbul-lib-coverage": "^2.0.5", - "istanbul-lib-hook": "^2.0.7", - "istanbul-lib-instrument": "^3.3.0", - "istanbul-lib-report": "^2.0.8", - "istanbul-lib-source-maps": "^3.0.6", - "istanbul-reports": "^2.2.4", - "js-yaml": "^3.13.1", - "make-dir": "^2.1.0", - "merge-source-map": "^1.1.0", - "resolve-from": "^4.0.0", - "rimraf": "^2.6.3", - "signal-exit": "^3.0.2", - "spawn-wrap": "^1.4.2", - "test-exclude": "^5.2.3", - "uuid": "^3.3.2", - "yargs": "^13.2.2", - "yargs-parser": "^13.0.0" - }, - "bin": { - "nyc": "bin/nyc.js" + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" }, "engines": { - "node": ">=6" + "node": ">= 0.4" } }, - "node_modules/tap/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", "dev": true, + "license": "MIT", "dependencies": { - "p-limit": "^2.0.0" + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" }, "engines": { - "node": ">=6" + "node": ">= 0.4" } }, - "node_modules/tap/node_modules/package-hash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-3.0.0.tgz", - "integrity": "sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA==", + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "dependencies": { - "graceful-fs": "^4.1.15", - "hasha": "^3.0.0", - "lodash.flattendeep": "^4.4.0", - "release-zalgo": "^1.0.0" + "shebang-regex": "^3.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/tap/node_modules/path-exists": { + "node_modules/shebang-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/tap/node_modules/pkg-dir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "dev": true, + "license": "MIT", "dependencies": { - "find-up": "^3.0.0" + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap/node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, "engines": { - "node": ">=4" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap/node_modules/rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", "dev": true, + "license": "MIT", "dependencies": { - "glob": "^7.1.3" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" }, - "bin": { - "rimraf": "bin.js" + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap/node_modules/spawn-wrap": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.3.tgz", - "integrity": "sha512-IgB8md0QW/+tWqcavuFgKYR/qIRvJkRLPJDFaoXtLLUaVcCDK0+HeFTkmQHj3eprcYhc+gOl0aEA1w7qZlYezw==", + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "dev": true, + "license": "MIT", "dependencies": { - "foreground-child": "^1.5.6", - "mkdirp": "^0.5.0", - "os-homedir": "^1.0.1", - "rimraf": "^2.6.2", - "signal-exit": "^3.0.2", - "which": "^1.3.0" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap/node_modules/string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, + "node_modules/simple-plist": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.1.tgz", + "integrity": "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw==", "dependencies": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - }, - "engines": { - "node": ">=6" + "bplist-creator": "0.1.0", + "bplist-parser": "0.3.1", + "plist": "^3.0.5" } }, - "node_modules/tap/node_modules/strip-ansi": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "node_modules/stop-iteration-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-regex": "^4.1.0" + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" }, "engines": { - "node": ">=6" + "node": ">= 0.4" } }, - "node_modules/tap/node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, + "node_modules/stream-buffers": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz", + "integrity": "sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==", "engines": { - "node": ">=4" + "node": ">= 0.10.0" } }, - "node_modules/tap/node_modules/supports-color": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "node_modules/string.prototype.trim": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", "dev": true, + "license": "MIT", "dependencies": { - "has-flag": "^3.0.0" + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap/node_modules/test-exclude": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", - "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", + "node_modules/string.prototype.trimend": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", "dev": true, + "license": "MIT", "dependencies": { - "glob": "^7.1.3", - "minimatch": "^3.0.4", - "read-pkg-up": "^4.0.0", - "require-main-filename": "^2.0.0" + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, "engines": { - "node": ">=6" - } - }, - "node_modules/tap/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "dev": true, - "bin": { - "uuid": "bin/uuid" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", "dev": true, + "license": "MIT", "dependencies": { - "isexe": "^2.0.0" + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" }, - "bin": { - "which": "bin/which" + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap/node_modules/wrap-ansi": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, - "dependencies": { - "ansi-styles": "^3.2.0", - "string-width": "^3.0.0", - "strip-ansi": "^5.0.0" - }, + "license": "MIT", "engines": { - "node": ">=6" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/tap/node_modules/write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, - "dependencies": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tap/node_modules/yargs": { - "version": "13.3.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", - "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "node_modules/tapable": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.2.tgz", + "integrity": "sha512-1MOpMXuhGzGL5TTCZFItxCc0AARf1EZFQkGqMm7ERKj8+Hgr5oLvJOVFcC+lRmR8hCe2S3jC4T5D7Vg/d7/fhA==", "dev": true, - "dependencies": { - "cliui": "^5.0.0", - "find-up": "^3.0.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^3.0.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^13.1.2" + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" } }, - "node_modules/tap/node_modules/yargs-parser": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", - "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "dev": true, + "license": "MIT", "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" } }, - "node_modules/test-exclude": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "dev": true, + "license": "MIT", "dependencies": { - "@istanbuljs/schema": "^0.1.2", - "glob": "^7.1.4", - "minimatch": "^3.0.4" + "minimist": "^1.2.0" }, - "engines": { - "node": ">=8" + "bin": { + "json5": "lib/cli.js" } }, - "node_modules/tmatch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/tmatch/-/tmatch-4.0.0.tgz", - "integrity": "sha512-Ynn2Gsp+oCvYScQXeV+cCs7citRDilq0qDXA6tuvFwDgiYyyaq7D5vKUlAPezzZR5NDobc/QMeN6e5guOYmvxg==", - "dev": true - }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, + "license": "MIT", "engines": { "node": ">=4" } }, - "node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, + "license": "MIT", "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" + "prelude-ls": "^1.2.1" }, "engines": { - "node": ">=0.8" + "node": ">= 0.8.0" } }, - "node_modules/trivial-deferred": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trivial-deferred/-/trivial-deferred-1.0.1.tgz", - "integrity": "sha512-dagAKX7vaesNNAwOc9Np9C2mJ+7YopF4lk+jE2JML9ta4kZ91Y6UruJNH65bLRYoUROD8EY+Pmi44qQWwXR7sw==", - "dev": true - }, - "node_modules/ts-node": { - "version": "8.10.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", - "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", "dev": true, + "license": "MIT", "dependencies": { - "arg": "^4.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "source-map-support": "^0.5.17", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "engines": { - "node": ">=6.0.0" + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" }, - "peerDependencies": { - "typescript": ">=2.7" - } - }, - "node_modules/ts-node/node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, "engines": { - "node": ">=0.3.1" + "node": ">= 0.4" } }, - "node_modules/tsame": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/tsame/-/tsame-2.0.1.tgz", - "integrity": "sha512-jxyxgKVKa4Bh5dPcO42TJL22lIvfd9LOVJwdovKOnJa4TLLrHxquK+DlGm4rkGmrcur+GRx+x4oW00O2pY/fFw==", - "dev": true - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "node_modules/typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", "dev": true, + "license": "MIT", "dependencies": { - "safe-buffer": "^5.0.1" + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" }, "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", - "dev": true - }, - "node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, - "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "node_modules/typed-array-byte-offset": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", "dev": true, + "license": "MIT", "dependencies": { - "is-typedarray": "^1.0.0" - } - }, - "node_modules/typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" }, "engines": { - "node": ">=4.2.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/unicode-length": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/unicode-length/-/unicode-length-1.0.3.tgz", - "integrity": "sha512-rZKNhIqioUp7H49afr26tivLDCvUSqOXwmwEEnsCwnPX67S1CYbOL45Y5IP3K/XHN73/lg21HlrB8SNlYXKQTg==", + "node_modules/typed-array-length": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", "dev": true, + "license": "MIT", "dependencies": { - "punycode": "^1.3.2", - "strip-ansi": "^3.0.1" + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/unicode-length/node_modules/punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==", - "dev": true - }, - "node_modules/update-browserslist-db": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.5.tgz", - "integrity": "sha512-dteFFpCyvuDdr9S/ff1ISkKt/9YZxKjI9WlRR99c180GaztJtRa/fn18FdxGVKVsnPY7/a/FDN68mcvUmP4U7Q==", + "node_modules/unbox-primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - } - ], + "license": "MIT", "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" }, - "bin": { - "browserslist-lint": "cli.js" + "engines": { + "node": ">= 0.4" }, - "peerDependencies": { - "browserslist": ">= 4.21.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/uri-js": { @@ -3555,13 +3237,6 @@ "punycode": "^2.1.0" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true, - "optional": true - }, "node_modules/uuid": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", @@ -3570,36 +3245,6 @@ "uuid": "dist/bin/uuid" } }, - "node_modules/validate-npm-package-license": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, - "dependencies": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", - "dev": true, - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "node_modules/verror/node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -3615,96 +3260,110 @@ "node": ">= 8" } }, - "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", - "dev": true - }, - "node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" }, "engines": { - "node": ">=8" - } - }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", "dev": true, + "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" }, "engines": { - "node": ">=8" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/wrap-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/which-builtin-type/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", "dev": true, + "license": "MIT", "dependencies": { - "color-name": "~1.1.4" + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" }, "engines": { - "node": ">=7.0.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/wrap-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/which-typed-array": { + "version": "1.1.20", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.20.tgz", + "integrity": "sha512-LYfpUkmqwl0h9A2HL09Mms427Q1RZWuOHsukfVcKRq9q95iQxdw0ix1JQrqbcDR9PH1QDwf5Qo8OZb5lksZ8Xg==", "dev": true, + "license": "MIT", "dependencies": { - "ansi-regex": "^5.0.1" + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, - "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" + "license": "MIT", + "engines": { + "node": ">=0.10.0" } }, "node_modules/xmlbuilder": { @@ -3715,66 +3374,17 @@ "node": ">=8.0" } }, - "node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - }, - "node_modules/yapool": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/yapool/-/yapool-1.0.0.tgz", - "integrity": "sha512-RONBZndo8Lo8pKPfORRxr2DIk2NZKIml654o4kaIu7RXVxQCKsAN6AqrcoZsI3h+2H5YO2mD/04Wy4LbAgd+Pg==", - "dev": true - }, - "node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, - "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, + "license": "MIT", "engines": { - "node": ">=8" - } - }, - "node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "node": ">=10" }, - "engines": { - "node": ">=6" - } - }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, - "engines": { - "node": ">=6" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } } } diff --git a/package.json b/package.json index dd3a153..66b7370 100644 --- a/package.json +++ b/package.json @@ -14,10 +14,13 @@ "uuid": "^7.0.3" }, "devDependencies": { + "@cordova/eslint-config": "^6.0.1", "pegjs": "^0.10.0" }, "scripts": { "pegjs": "node_modules/.bin/pegjs lib/parser/pbxproj.pegjs", + "lint": "eslint .", + "lint:fix": "npm run lint -- --fix", "test": "node --test --experimental-test-coverage --test-reporter=spec --test-reporter=lcov --test-reporter-destination=stdout --test-reporter-destination=lcov.info" }, "license": "Apache-2.0" diff --git a/test/BuildSettings.js b/test/BuildSettings.js index 0761038..17e2617 100644 --- a/test/BuildSettings.js +++ b/test/BuildSettings.js @@ -19,41 +19,40 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } - -var PRODUCT_NAME = '"KitchenSinktablet"'; +const PRODUCT_NAME = '"KitchenSinktablet"'; describe('addAndRemoveToFromBuildSettings', () => { beforeEach(() => { proj.hash = cleanHash(); }); it('add should add the build setting to each configuration section', () => { - var buildSetting = 'some/buildSetting'; - var value = 'some/buildSetting'; + const buildSetting = 'some/buildSetting'; + const value = 'some/buildSetting'; proj.addToBuildSettings(buildSetting, value); - var config = proj.pbxXCBuildConfigurationSection(); - for (var ref in config) { - if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue; + const config = proj.pbxXCBuildConfigurationSection(); + for (const ref in config) { + if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME !== PRODUCT_NAME) continue; assert.ok(config[ref].buildSettings[buildSetting] === value); } }); it('remove should remove from the build settings in each configuration section', () => { - var buildSetting = 'some/buildSetting'; + const buildSetting = 'some/buildSetting'; proj.addToBuildSettings(buildSetting, 'some/buildSetting'); proj.removeFromBuildSettings(buildSetting); - var config = proj.pbxXCBuildConfigurationSection(); - for (var ref in config) { - if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue; - assert.ok(!config[ref].buildSettings.hasOwnProperty(buildSetting)); + const config = proj.pbxXCBuildConfigurationSection(); + for (const ref in config) { + if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME !== PRODUCT_NAME) continue; + const buildSettings = config[ref].buildSettings; + assert.ok(!Object.prototype.hasOwnProperty.call(buildSettings, buildSetting)); } }); }); diff --git a/test/FrameworkSearchPaths.js b/test/FrameworkSearchPaths.js index e557e2e..402531e 100644 --- a/test/FrameworkSearchPaths.js +++ b/test/FrameworkSearchPaths.js @@ -19,23 +19,22 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const proj = new PBXProject('.'); -var pbxFile = { - path:'some/path/include', - dirname: 'some/path', - customFramework: true -} -function cleanHash() { +const pbxFile = { + path: 'some/path/include', + dirname: 'some/path', + customFramework: true +}; + +function cleanHash () { return JSON.parse(fullProjectStr); } - -var PRODUCT_NAME = '"KitchenSinktablet"'; +const PRODUCT_NAME = '"KitchenSinktablet"'; describe('addAndRemoveToFromFrameworkSearchPaths', () => { beforeEach(() => { @@ -44,22 +43,22 @@ describe('addAndRemoveToFromFrameworkSearchPaths', () => { it('add should add the path to each configuration section', () => { proj.addToFrameworkSearchPaths(pbxFile); - var config = proj.pbxXCBuildConfigurationSection(); - for (var ref in config) { - if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue; - var lib = config[ref].buildSettings.FRAMEWORK_SEARCH_PATHS; + const config = proj.pbxXCBuildConfigurationSection(); + for (const ref in config) { + if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME !== PRODUCT_NAME) continue; + const lib = config[ref].buildSettings.FRAMEWORK_SEARCH_PATHS; assert.ok(lib[1].indexOf('some/path') > -1); } }); it('remove should remove from the path to each configuration section', () => { proj.addToFrameworkSearchPaths(pbxFile); proj.removeFromFrameworkSearchPaths(pbxFile); - var config = proj.pbxXCBuildConfigurationSection(); - for (var ref in config) { - if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue; - var lib = config[ref].buildSettings.FRAMEWORK_SEARCH_PATHS; + const config = proj.pbxXCBuildConfigurationSection(); + for (const ref in config) { + if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME !== PRODUCT_NAME) continue; + const lib = config[ref].buildSettings.FRAMEWORK_SEARCH_PATHS; assert.ok(lib.length === 1); - assert.ok(lib[0].indexOf('some/path') == -1); + assert.ok(lib[0].indexOf('some/path') === -1); } }); }); diff --git a/test/HeaderSearchPaths.js b/test/HeaderSearchPaths.js index f514865..0ebacea 100644 --- a/test/HeaderSearchPaths.js +++ b/test/HeaderSearchPaths.js @@ -19,18 +19,16 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } - -var PRODUCT_NAME = '"KitchenSinktablet"'; +const PRODUCT_NAME = '"KitchenSinktablet"'; describe('addAndRemoveToFromHeaderSearchPaths', () => { beforeEach(() => { @@ -39,39 +37,39 @@ describe('addAndRemoveToFromHeaderSearchPaths', () => { it('add should add the path to each configuration section', () => { proj.addToHeaderSearchPaths({ - path:'some/path/include' + path: 'some/path/include' }); - var config = proj.pbxXCBuildConfigurationSection(); - for (var ref in config) { - if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue; - var lib = config[ref].buildSettings.HEADER_SEARCH_PATHS; + const config = proj.pbxXCBuildConfigurationSection(); + for (const ref in config) { + if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME !== PRODUCT_NAME) continue; + const lib = config[ref].buildSettings.HEADER_SEARCH_PATHS; assert.ok(lib[1].indexOf('$(SRCROOT)/KitchenSinktablet/some/path') > -1); } }); it('add should not mangle string arguments and add to each config section', () => { - var includePath = '../../some/path'; + const includePath = '../../some/path'; proj.addToHeaderSearchPaths(includePath); - var config = proj.pbxXCBuildConfigurationSection(); - for (var ref in config) { - if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue; - var lib = config[ref].buildSettings.HEADER_SEARCH_PATHS; + const config = proj.pbxXCBuildConfigurationSection(); + for (const ref in config) { + if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME !== PRODUCT_NAME) continue; + const lib = config[ref].buildSettings.HEADER_SEARCH_PATHS; assert.ok(lib[1].indexOf(includePath) > -1); } }); it('remove should remove from the path to each configuration section', () => { - var libPath = 'some/path/include'; + const libPath = 'some/path/include'; proj.addToHeaderSearchPaths({ - path:libPath + path: libPath }); proj.removeFromHeaderSearchPaths({ - path:libPath + path: libPath }); - var config = proj.pbxXCBuildConfigurationSection(); - for (var ref in config) { - if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue; - var lib = config[ref].buildSettings.HEADER_SEARCH_PATHS; + const config = proj.pbxXCBuildConfigurationSection(); + for (const ref in config) { + if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME !== PRODUCT_NAME) continue; + const lib = config[ref].buildSettings.HEADER_SEARCH_PATHS; assert.ok(lib.length === 1); - assert.ok(lib[0].indexOf('$(SRCROOT)/KitchenSinktablet/some/path/include') == -1); + assert.ok(lib[0].indexOf('$(SRCROOT)/KitchenSinktablet/some/path/include') === -1); } }); }); diff --git a/test/LibrarySearchPaths.js b/test/LibrarySearchPaths.js index 299a62f..1668191 100644 --- a/test/LibrarySearchPaths.js +++ b/test/LibrarySearchPaths.js @@ -19,18 +19,16 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } - -var PRODUCT_NAME = '"KitchenSinktablet"'; +const PRODUCT_NAME = '"KitchenSinktablet"'; describe('addAndRemoveToFromLibrarySearchPaths', () => { beforeEach(() => { @@ -39,39 +37,39 @@ describe('addAndRemoveToFromLibrarySearchPaths', () => { it('add should add the path to each configuration section', () => { proj.addToLibrarySearchPaths({ - path:'some/path/poop.a' + path: 'some/path/poop.a' }); - var config = proj.pbxXCBuildConfigurationSection(); - for (var ref in config) { - if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue; - var lib = config[ref].buildSettings.LIBRARY_SEARCH_PATHS; + const config = proj.pbxXCBuildConfigurationSection(); + for (const ref in config) { + if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME !== PRODUCT_NAME) continue; + const lib = config[ref].buildSettings.LIBRARY_SEARCH_PATHS; assert.ok(lib[1].indexOf('$(SRCROOT)/KitchenSinktablet/some/path') > -1); } }); it('add should not mangle string arguments and add to each config section', () => { - var libPath = '../../some/path'; + const libPath = '../../some/path'; proj.addToLibrarySearchPaths(libPath); - var config = proj.pbxXCBuildConfigurationSection(); - for (var ref in config) { - if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue; - var lib = config[ref].buildSettings.LIBRARY_SEARCH_PATHS; + const config = proj.pbxXCBuildConfigurationSection(); + for (const ref in config) { + if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME !== PRODUCT_NAME) continue; + const lib = config[ref].buildSettings.LIBRARY_SEARCH_PATHS; assert.ok(lib[1].indexOf(libPath) > -1); } }); it('remove should remove from the path to each configuration section', () => { - var libPath = 'some/path/poop.a'; + const libPath = 'some/path/poop.a'; proj.addToLibrarySearchPaths({ - path:libPath + path: libPath }); proj.removeFromLibrarySearchPaths({ - path:libPath + path: libPath }); - var config = proj.pbxXCBuildConfigurationSection(); - for (var ref in config) { - if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue; - var lib = config[ref].buildSettings.LIBRARY_SEARCH_PATHS; + const config = proj.pbxXCBuildConfigurationSection(); + for (const ref in config) { + if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME !== PRODUCT_NAME) continue; + const lib = config[ref].buildSettings.LIBRARY_SEARCH_PATHS; assert.ok(lib.length === 1); - assert.ok(lib[0].indexOf('$(SRCROOT)/KitchenSinktablet/some/path') == -1); + assert.ok(lib[0].indexOf('$(SRCROOT)/KitchenSinktablet/some/path') === -1); } }); }); diff --git a/test/OtherLinkerFlags.js b/test/OtherLinkerFlags.js index 04edb3c..f9693c2 100644 --- a/test/OtherLinkerFlags.js +++ b/test/OtherLinkerFlags.js @@ -19,18 +19,16 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } - -var PRODUCT_NAME = '"KitchenSinktablet"'; +const PRODUCT_NAME = '"KitchenSinktablet"'; describe('addAndRemoveToFromOtherLinkerFlags', () => { beforeEach(() => { @@ -38,25 +36,25 @@ describe('addAndRemoveToFromOtherLinkerFlags', () => { }); it('add should add the flag to each configuration section', () => { - var flag = 'some/flag'; + const flag = 'some/flag'; proj.addToOtherLinkerFlags(flag); - var config = proj.pbxXCBuildConfigurationSection(); - for (var ref in config) { - if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue; - var lib = config[ref].buildSettings.OTHER_LDFLAGS; + const config = proj.pbxXCBuildConfigurationSection(); + for (const ref in config) { + if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME !== PRODUCT_NAME) continue; + const lib = config[ref].buildSettings.OTHER_LDFLAGS; assert.ok(lib[1].indexOf(flag) > -1); } }); it('remove should remove from the path to each configuration section', () => { - var flag = 'some/flag'; + const flag = 'some/flag'; proj.addToOtherLinkerFlags(flag); proj.removeFromOtherLinkerFlags(flag); - var config = proj.pbxXCBuildConfigurationSection(); - for (var ref in config) { - if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue; - var lib = config[ref].buildSettings.OTHER_LDFLAGS; + const config = proj.pbxXCBuildConfigurationSection(); + for (const ref in config) { + if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME !== PRODUCT_NAME) continue; + const lib = config[ref].buildSettings.OTHER_LDFLAGS; assert.ok(lib.length === 1); - assert.ok(lib[0].indexOf(flag) == -1); + assert.ok(lib[0].indexOf(flag) === -1); } }); }); diff --git a/test/addBuildPhase.js b/test/addBuildPhase.js index 574a6af..2a99f69 100644 --- a/test/addBuildPhase.js +++ b/test/addBuildPhase.js @@ -20,12 +20,12 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } @@ -35,26 +35,26 @@ describe('addBuildPhase', () => { }); it('should return a pbxBuildPhase', () => { - var buildPhase = proj.addBuildPhase(['file.m'], 'PBXSourcesBuildPhase', 'My build phase'); + const buildPhase = proj.addBuildPhase(['file.m'], 'PBXSourcesBuildPhase', 'My build phase'); assert.ok(typeof buildPhase === 'object'); }); it('should set a uuid on the pbxBuildPhase', () => { - var buildPhase = proj.addBuildPhase(['file.m'], 'PBXSourcesBuildPhase', 'My build phase'); + const buildPhase = proj.addBuildPhase(['file.m'], 'PBXSourcesBuildPhase', 'My build phase'); assert.ok(buildPhase.uuid); }); it('should add all files to build phase', () => { - var buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase; - for (var index = 0; index < buildPhase.files.length; index++) { - var file = buildPhase.files[index]; + const buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase; + for (let index = 0; index < buildPhase.files.length; index++) { + const file = buildPhase.files[index]; assert.ok(file.value); } }); it('should add the PBXBuildPhase object correctly', () => { - var buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase, - buildPhaseInPbx = proj.buildPhaseObject('PBXResourcesBuildPhase', 'My build phase'); + const buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase; + const buildPhaseInPbx = proj.buildPhaseObject('PBXResourcesBuildPhase', 'My build phase'); assert.equal(buildPhaseInPbx, buildPhase); assert.equal(buildPhaseInPbx.isa, 'PBXResourcesBuildPhase'); @@ -63,57 +63,56 @@ describe('addBuildPhase', () => { }); it('should add each of the files to PBXBuildFile section', () => { - var buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase, - buildFileSection = proj.pbxBuildFileSection(); + const buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase; + const buildFileSection = proj.pbxBuildFileSection(); - for (var index = 0; index < buildPhase.files.length; index++) { - var file = buildPhase.files[index]; + for (let index = 0; index < buildPhase.files.length; index++) { + const file = buildPhase.files[index]; assert.ok(buildFileSection[file.value]); } }); it('should add each of the files to PBXFileReference section', () => { - var buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase, - fileRefSection = proj.pbxFileReferenceSection(), - buildFileSection = proj.pbxBuildFileSection(), - fileRefs = []; + const buildPhase = proj.addBuildPhase(['file.m', 'assets.bundle'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase; + const fileRefSection = proj.pbxFileReferenceSection(); + const buildFileSection = proj.pbxBuildFileSection(); - for (var index = 0; index < buildPhase.files.length; index++) { - var file = buildPhase.files[index], - fileRef = buildFileSection[file.value].fileRef; + for (let index = 0; index < buildPhase.files.length; index++) { + const file = buildPhase.files[index]; + const fileRef = buildFileSection[file.value].fileRef; assert.ok(fileRefSection[fileRef]); } }); it('should not add files to PBXFileReference section if already added', () => { - var fileRefSection = proj.pbxFileReferenceSection(), - initialFileReferenceSectionItemsCount = Object.keys(fileRefSection), - buildPhase = proj.addBuildPhase(['AppDelegate.m', 'main.m'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase, - afterAdditionBuildFileSectionItemsCount = Object.keys(fileRefSection); + const fileRefSection = proj.pbxFileReferenceSection(); + const initialFileReferenceSectionItemsCount = Object.keys(fileRefSection); + proj.addBuildPhase(['AppDelegate.m', 'main.m'], 'PBXResourcesBuildPhase', 'My build phase'); + const afterAdditionBuildFileSectionItemsCount = Object.keys(fileRefSection); assert.deepEqual(initialFileReferenceSectionItemsCount, afterAdditionBuildFileSectionItemsCount); }); it('should not add files to PBXBuildFile section if already added', () => { - var buildFileSection = proj.pbxBuildFileSection(), - initialBuildFileSectionItemsCount = Object.keys(buildFileSection), - buildPhase = proj.addBuildPhase(['AppDelegate.m', 'main.m'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase, - afterAdditionBuildFileSectionItemsCount = Object.keys(buildFileSection); + const buildFileSection = proj.pbxBuildFileSection(); + const initialBuildFileSectionItemsCount = Object.keys(buildFileSection); + proj.addBuildPhase(['AppDelegate.m', 'main.m'], 'PBXResourcesBuildPhase', 'My build phase'); + const afterAdditionBuildFileSectionItemsCount = Object.keys(buildFileSection); assert.deepEqual(initialBuildFileSectionItemsCount, afterAdditionBuildFileSectionItemsCount); }); it('should add only missing files to PBXFileReference section', () => { - var fileRefSection = proj.pbxFileReferenceSection(), - buildFileSection = proj.pbxBuildFileSection(), - initialFileReferenceSectionItemsCount = Object.keys(fileRefSection), - buildPhase = proj.addBuildPhase(['file.m', 'AppDelegate.m'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase, - afterAdditionBuildFileSectionItemsCount = Object.keys(fileRefSection); + const fileRefSection = proj.pbxFileReferenceSection(); + const buildFileSection = proj.pbxBuildFileSection(); + const initialFileReferenceSectionItemsCount = Object.keys(fileRefSection); + const buildPhase = proj.addBuildPhase(['file.m', 'AppDelegate.m'], 'PBXResourcesBuildPhase', 'My build phase').buildPhase; + const afterAdditionBuildFileSectionItemsCount = Object.keys(fileRefSection); - for (var index = 0; index < buildPhase.files.length; index++) { - var file = buildPhase.files[index], - fileRef = buildFileSection[file.value].fileRef; + for (let index = 0; index < buildPhase.files.length; index++) { + const file = buildPhase.files[index]; + const fileRef = buildFileSection[file.value].fileRef; assert.ok(fileRefSection[fileRef]); } @@ -121,74 +120,74 @@ describe('addBuildPhase', () => { assert.deepEqual(initialFileReferenceSectionItemsCount.length, afterAdditionBuildFileSectionItemsCount.length - 2); }); - it(`should set target to Wrapper given 'application' as target`, () => { - var buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'application').buildPhase; + it('should set target to Wrapper given \'application\' as target', () => { + const buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'application').buildPhase; assert.equal(buildPhase.dstSubfolderSpec, 1); }); - it(`should set target to Plugins given 'app_extension' as target`, () => { - var buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'app_extension').buildPhase; + it('should set target to Plugins given \'app_extension\' as target', () => { + const buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'app_extension').buildPhase; assert.equal(buildPhase.dstSubfolderSpec, 13); }); - it(`should set target to Wapper given 'bundle' as target`, () => { - var buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'bundle').buildPhase; + it('should set target to Wapper given \'bundle\' as target', () => { + const buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'bundle').buildPhase; assert.equal(buildPhase.dstSubfolderSpec, 1); }); - it(`should set target to Wapper given 'command_line_tool' as target`, () => { - var buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'command_line_tool').buildPhase; + it('should set target to Wapper given \'command_line_tool\' as target', () => { + const buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'command_line_tool').buildPhase; assert.equal(buildPhase.dstSubfolderSpec, 1); }); - it(`should set target to Products Directory given 'dynamic_library' as target`, () => { - var buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'dynamic_library').buildPhase; + it('should set target to Products Directory given \'dynamic_library\' as target', () => { + const buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'dynamic_library').buildPhase; assert.equal(buildPhase.dstSubfolderSpec, 16); }); - it(`should set target to Shared Framework given 'framework' as target`, () => { - var buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'framework').buildPhase; + it('should set target to Shared Framework given \'framework\' as target', () => { + const buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'framework').buildPhase; assert.equal(buildPhase.dstSubfolderSpec, 11); }); - it(`should set target to Frameworks given 'frameworks' as target`, () => { - var buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'frameworks').buildPhase; + it('should set target to Frameworks given \'frameworks\' as target', () => { + const buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'frameworks').buildPhase; assert.equal(buildPhase.dstSubfolderSpec, 10); }); - it(`should set target to Products Directory given 'static_library' as target`, () => { - var buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'static_library').buildPhase; + it('should set target to Products Directory given \'static_library\' as target', () => { + const buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'static_library').buildPhase; assert.equal(buildPhase.dstSubfolderSpec, 16); }); - it(`should set target to Wrapper given 'unit_test_bundle' as target`, () => { - var buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'unit_test_bundle').buildPhase; + it('should set target to Wrapper given \'unit_test_bundle\' as target', () => { + const buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'unit_test_bundle').buildPhase; assert.equal(buildPhase.dstSubfolderSpec, 1); }); - it(`should set target to Wrapper given 'watch_app' as target`, () => { - var buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'watch_app').buildPhase; + it('should set target to Wrapper given \'watch_app\' as target', () => { + const buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'watch_app').buildPhase; assert.equal(buildPhase.dstSubfolderSpec, 1); }); - it(`should set target to Products Directory given 'watch2_app' as target`, () => { - var buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'watch2_app').buildPhase; + it('should set target to Products Directory given \'watch2_app\' as target', () => { + const buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'watch2_app').buildPhase; assert.equal(buildPhase.dstSubfolderSpec, 16); }); - it(`should set target to Plugins given 'watch_extension' as target`, () => { - var buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'watch_extension').buildPhase; + it('should set target to Plugins given \'watch_extension\' as target', () => { + const buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'watch_extension').buildPhase; assert.equal(buildPhase.dstSubfolderSpec, 13); }); - it(`should set target to Plugins given 'watch2_extension' as target`, () => { - var buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'watch2_extension').buildPhase; + it('should set target to Plugins given \'watch2_extension\' as target', () => { + const buildPhase = proj.addBuildPhase(['file.m'], 'PBXCopyFilesBuildPhase', 'Copy Files', proj.getFirstTarget().uuid, 'watch2_extension').buildPhase; assert.equal(buildPhase.dstSubfolderSpec, 13); }); it('should add a script build phase to echo "hello world!"', () => { - var options = {shellPath: '/bin/sh', shellScript: 'echo "hello world!"'}; - var buildPhase = proj.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Run a script', proj.getFirstTarget().uuid, options).buildPhase; + const options = { shellPath: '/bin/sh', shellScript: 'echo "hello world!"' }; + const buildPhase = proj.addBuildPhase([], 'PBXShellScriptBuildPhase', 'Run a script', proj.getFirstTarget().uuid, options).buildPhase; assert.equal(buildPhase.shellPath, '/bin/sh'); assert.equal(buildPhase.shellScript, '"echo \\"hello world!\\""'); }); diff --git a/test/addFramework.js b/test/addFramework.js index 67d8ae8..c5495cd 100644 --- a/test/addFramework.js +++ b/test/addFramework.js @@ -20,21 +20,21 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } -function nonComments(obj) { - var keys = Object.keys(obj), - newObj = {}, i = 0; +function nonComments (obj) { + const keys = Object.keys(obj); + const newObj = {}; - for (i; i < keys.length; i++) { + for (let i = 0; i < keys.length; i++) { if (!/_comment$/.test(keys[i])) { newObj[keys[i]] = obj[keys[i]]; } @@ -43,16 +43,17 @@ function nonComments(obj) { return newObj; } -function frameworkSearchPaths(proj) { - var configs = nonComments(proj.pbxXCBuildConfigurationSection()), - allPaths = [], - ids = Object.keys(configs), i, buildSettings; +function frameworkSearchPaths (proj) { + const configs = nonComments(proj.pbxXCBuildConfigurationSection()); + const allPaths = []; + const ids = Object.keys(configs); + let buildSettings; - for (i = 0; i< ids.length; i++) { + for (let i = 0; i < ids.length; i++) { buildSettings = configs[ids[i]].buildSettings; - if (buildSettings['FRAMEWORK_SEARCH_PATHS']) { - allPaths.push(buildSettings['FRAMEWORK_SEARCH_PATHS']); + if (buildSettings.FRAMEWORK_SEARCH_PATHS) { + allPaths.push(buildSettings.FRAMEWORK_SEARCH_PATHS); } } @@ -65,102 +66,97 @@ describe('addFramework', () => { }); it('should return a pbxFile', () => { - var newFile = proj.addFramework('libsqlite3.dylib'); - assert.equal(newFile.constructor, pbxFile); + const newFile = proj.addFramework('libsqlite3.dylib'); + assert.equal(newFile.constructor, PBXFile); }); it('should set a fileRef on the pbxFile', () => { - var newFile = proj.addFramework('libsqlite3.dylib'); + const newFile = proj.addFramework('libsqlite3.dylib'); assert.ok(newFile.fileRef); }); it('should populate the PBXFileReference section with 2 fields', () => { - var newFile = proj.addFramework('libsqlite3.dylib'), - fileRefSection = proj.pbxFileReferenceSection(), - frsLength = Object.keys(fileRefSection).length; + const newFile = proj.addFramework('libsqlite3.dylib'); + const fileRefSection = proj.pbxFileReferenceSection(); + const frsLength = Object.keys(fileRefSection).length; assert.equal(68, frsLength); assert.ok(fileRefSection[newFile.fileRef]); assert.ok(fileRefSection[newFile.fileRef + '_comment']); - ; }); it('should populate the PBXFileReference comment correctly', () => { - var newFile = proj.addFramework('libsqlite3.dylib'), - fileRefSection = proj.pbxFileReferenceSection(), - commentKey = newFile.fileRef + '_comment'; + const newFile = proj.addFramework('libsqlite3.dylib'); + const fileRefSection = proj.pbxFileReferenceSection(); + const commentKey = newFile.fileRef + '_comment'; assert.equal(fileRefSection[commentKey], 'libsqlite3.dylib'); }); it('should add the PBXFileReference object correctly', () => { - var newFile = proj.addFramework('libsqlite3.dylib'), - fileRefSection = proj.pbxFileReferenceSection(), - fileRefEntry = fileRefSection[newFile.fileRef]; + const newFile = proj.addFramework('libsqlite3.dylib'); + const fileRefSection = proj.pbxFileReferenceSection(); + const fileRefEntry = fileRefSection[newFile.fileRef]; assert.equal(fileRefEntry.isa, 'PBXFileReference'); assert.equal(fileRefEntry.lastKnownFileType, 'compiled.mach-o.dylib'); assert.equal(fileRefEntry.name, '"libsqlite3.dylib"'); assert.equal(fileRefEntry.path, '"usr/lib/libsqlite3.dylib"'); assert.equal(fileRefEntry.sourceTree, 'SDKROOT'); - ; }); it('should populate the PBXBuildFile section with 2 fields', () => { - var newFile = proj.addFramework('libsqlite3.dylib'), - buildFileSection = proj.pbxBuildFileSection(), - bfsLength = Object.keys(buildFileSection).length; + const newFile = proj.addFramework('libsqlite3.dylib'); + const buildFileSection = proj.pbxBuildFileSection(); + const bfsLength = Object.keys(buildFileSection).length; assert.equal(60, bfsLength); assert.ok(buildFileSection[newFile.uuid]); assert.ok(buildFileSection[newFile.uuid + '_comment']); - ; }); it('should add the PBXBuildFile comment correctly', () => { - var newFile = proj.addFramework('libsqlite3.dylib'), - commentKey = newFile.uuid + '_comment', - buildFileSection = proj.pbxBuildFileSection(); + const newFile = proj.addFramework('libsqlite3.dylib'); + const commentKey = newFile.uuid + '_comment'; + const buildFileSection = proj.pbxBuildFileSection(); assert.equal(buildFileSection[commentKey], 'libsqlite3.dylib in Frameworks'); }); it('should add the PBXBuildFile object correctly', () => { - var newFile = proj.addFramework('libsqlite3.dylib'), - buildFileSection = proj.pbxBuildFileSection(), - buildFileEntry = buildFileSection[newFile.uuid]; + const newFile = proj.addFramework('libsqlite3.dylib'); + const buildFileSection = proj.pbxBuildFileSection(); + const buildFileEntry = buildFileSection[newFile.uuid]; assert.equal(buildFileEntry.isa, 'PBXBuildFile'); assert.equal(buildFileEntry.fileRef, newFile.fileRef); assert.equal(buildFileEntry.fileRef_comment, 'libsqlite3.dylib'); assert.equal(buildFileEntry.settings, undefined); - ; }); it('should add the PBXBuildFile object correctly /w weak linked frameworks', () => { - var newFile = proj.addFramework('libsqlite3.dylib', { weak: true }), - buildFileSection = proj.pbxBuildFileSection(), - buildFileEntry = buildFileSection[newFile.uuid]; + const newFile = proj.addFramework('libsqlite3.dylib', { weak: true }); + const buildFileSection = proj.pbxBuildFileSection(); + const buildFileEntry = buildFileSection[newFile.uuid]; assert.equal(buildFileEntry.isa, 'PBXBuildFile'); assert.equal(buildFileEntry.fileRef, newFile.fileRef); assert.equal(buildFileEntry.fileRef_comment, 'libsqlite3.dylib'); - assert.deepEqual(buildFileEntry.settings, { ATTRIBUTES: [ 'Weak' ] }); - ; + assert.deepEqual(buildFileEntry.settings, { ATTRIBUTES: ['Weak'] }); }); it('should add to the Frameworks PBXGroup', () => { - var newLength = proj.pbxGroupByName('Frameworks').children.length + 1; + const newLength = proj.pbxGroupByName('Frameworks').children.length + 1; proj.addFramework('libsqlite3.dylib'); - var frameworks = proj.pbxGroupByName('Frameworks'); + const frameworks = proj.pbxGroupByName('Frameworks'); assert.equal(frameworks.children.length, newLength); }); it('should have the right values for the PBXGroup entry', () => { - var newFile = proj.addFramework('libsqlite3.dylib'), - frameworks = proj.pbxGroupByName('Frameworks').children, - framework = frameworks[frameworks.length - 1]; + const newFile = proj.addFramework('libsqlite3.dylib'); + const frameworks = proj.pbxGroupByName('Frameworks').children; + const framework = frameworks[frameworks.length - 1]; assert.equal(framework.comment, 'libsqlite3.dylib'); assert.equal(framework.value, newFile.fileRef); @@ -168,21 +164,21 @@ describe('addFramework', () => { it('should add to the PBXFrameworksBuildPhase', () => { proj.addFramework('libsqlite3.dylib'); - var frameworks = proj.pbxFrameworksBuildPhaseObj(); + const frameworks = proj.pbxFrameworksBuildPhaseObj(); assert.equal(frameworks.files.length, 16); }); it('should not add to the PBXFrameworksBuildPhase', () => { - proj.addFramework('Private.framework', {link: false}); - var frameworks = proj.pbxFrameworksBuildPhaseObj(); + proj.addFramework('Private.framework', { link: false }); + const frameworks = proj.pbxFrameworksBuildPhaseObj(); assert.equal(frameworks.files.length, 15); }); it('should have the right values for the Sources entry', () => { - var newFile = proj.addFramework('libsqlite3.dylib'), - frameworks = proj.pbxFrameworksBuildPhaseObj(), - framework = frameworks.files[15]; + const newFile = proj.addFramework('libsqlite3.dylib'); + const frameworks = proj.pbxFrameworksBuildPhaseObj(); + const framework = frameworks.files[15]; assert.equal(framework.comment, 'libsqlite3.dylib in Frameworks'); assert.equal(framework.value, newFile.uuid); @@ -194,7 +190,7 @@ describe('addFramework', () => { }); it('should pbxFile correctly for custom frameworks', () => { - var newFile = proj.addFramework('/path/to/Custom.framework', {customFramework: true}); + const newFile = proj.addFramework('/path/to/Custom.framework', { customFramework: true }); assert.ok(newFile.customFramework); assert.ok(!newFile.fileEncoding); @@ -205,42 +201,41 @@ describe('addFramework', () => { // XXX framework has to be copied over to PROJECT root. That is what XCode does when you drag&drop assert.equal(newFile.path, '/path/to/Custom.framework'); - // should add path to framework search path - var frameworkPaths = frameworkSearchPaths(proj); - expectedPath = '"\\"/path/to\\""'; + const frameworkPaths = frameworkSearchPaths(proj); + const expectedPath = '"\\"/path/to\\""'; - for (i = 0; i < frameworkPaths.length; i++) { - var current = frameworkPaths[i]; + for (let i = 0; i < frameworkPaths.length; i++) { + const current = frameworkPaths[i]; assert.ok(current.indexOf('"$(inherited)"') >= 0); assert.ok(current.indexOf(expectedPath) >= 0); - }; + } }); it('should add to the Embed Frameworks PBXCopyFilesBuildPhase', () => { - proj.addFramework('/path/to/SomeEmbeddableCustom.framework', {customFramework: true, embed: true}); - var frameworks = proj.pbxEmbedFrameworksBuildPhaseObj(); - var buildPhaseInPbx = proj.pbxEmbedFrameworksBuildPhaseObj(); + proj.addFramework('/path/to/SomeEmbeddableCustom.framework', { customFramework: true, embed: true }); + const frameworks = proj.pbxEmbedFrameworksBuildPhaseObj(); + const buildPhaseInPbx = proj.pbxEmbedFrameworksBuildPhaseObj(); assert.equal(buildPhaseInPbx.dstSubfolderSpec, 10); assert.equal(frameworks.files.length, 1); }); it('should not add to the Embed Frameworks PBXCopyFilesBuildPhase by default', () => { - proj.addFramework('/path/to/Custom.framework', {customFramework: true}); - var frameworks = proj.pbxEmbedFrameworksBuildPhaseObj(); + proj.addFramework('/path/to/Custom.framework', { customFramework: true }); + const frameworks = proj.pbxEmbedFrameworksBuildPhaseObj(); assert.equal(frameworks.files.length, 0); }); it('should add the PBXBuildFile object correctly /w signable frameworks', () => { - var newFile = proj.addFramework('/path/to/SomeSignable.framework', { customFramework: true, embed: true, sign: true }), - buildFileSection = proj.pbxBuildFileSection(), - buildFileEntry = buildFileSection[newFile.uuid]; + const newFile = proj.addFramework('/path/to/SomeSignable.framework', { customFramework: true, embed: true, sign: true }); + const buildFileSection = proj.pbxBuildFileSection(); + const buildFileEntry = buildFileSection[newFile.uuid]; assert.equal(newFile.group, 'Embed Frameworks'); assert.equal(buildFileEntry.isa, 'PBXBuildFile'); assert.equal(buildFileEntry.fileRef, newFile.fileRef); assert.equal(buildFileEntry.fileRef_comment, 'SomeSignable.framework'); - assert.deepEqual(buildFileEntry.settings, { ATTRIBUTES: [ 'CodeSignOnCopy' ] }); + assert.deepEqual(buildFileEntry.settings, { ATTRIBUTES: ['CodeSignOnCopy'] }); }); }); diff --git a/test/addHeaderFile.js b/test/addHeaderFile.js index 0f846a0..190287d 100644 --- a/test/addHeaderFile.js +++ b/test/addHeaderFile.js @@ -20,13 +20,13 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } @@ -36,19 +36,19 @@ describe('addHeaderFile', () => { }); it('should return a pbxFile', () => { - var newFile = proj.addHeaderFile('file.h'); - assert.equal(newFile.constructor, pbxFile); + const newFile = proj.addHeaderFile('file.h'); + assert.equal(newFile.constructor, PBXFile); }); it('should set a fileRef on the pbxFile', () => { - var newFile = proj.addHeaderFile('file.h'); + const newFile = proj.addHeaderFile('file.h'); assert.ok(newFile.fileRef); }); it('should populate the PBXFileReference section with 2 fields', () => { - var newFile = proj.addHeaderFile('file.h'), - fileRefSection = proj.pbxFileReferenceSection(), - frsLength = Object.keys(fileRefSection).length; + const newFile = proj.addHeaderFile('file.h'); + const fileRefSection = proj.pbxFileReferenceSection(); + const frsLength = Object.keys(fileRefSection).length; assert.equal(68, frsLength); assert.ok(fileRefSection[newFile.fileRef]); @@ -56,17 +56,17 @@ describe('addHeaderFile', () => { }); it('should populate the PBXFileReference comment correctly', () => { - var newFile = proj.addHeaderFile('file.h'), - fileRefSection = proj.pbxFileReferenceSection(), - commentKey = newFile.fileRef + '_comment'; + const newFile = proj.addHeaderFile('file.h'); + const fileRefSection = proj.pbxFileReferenceSection(); + const commentKey = newFile.fileRef + '_comment'; assert.equal(fileRefSection[commentKey], 'file.h'); }); it('should add the PBXFileReference object correctly', () => { - var newFile = proj.addHeaderFile('Plugins/file.h'), - fileRefSection = proj.pbxFileReferenceSection(), - fileRefEntry = fileRefSection[newFile.fileRef]; + const newFile = proj.addHeaderFile('Plugins/file.h'); + const fileRefSection = proj.pbxFileReferenceSection(); + const fileRefEntry = fileRefSection[newFile.fileRef]; assert.equal(fileRefEntry.isa, 'PBXFileReference'); assert.equal(fileRefEntry.fileEncoding, 4); @@ -77,16 +77,17 @@ describe('addHeaderFile', () => { }); it('should add to the Plugins PBXGroup group', () => { - proj.addHeaderFile('Plugins/file.h'), - plugins = proj.pbxGroupByName('Plugins'); + proj.addHeaderFile('Plugins/file.h'); + + const plugins = proj.pbxGroupByName('Plugins'); assert.equal(plugins.children.length, 1); }); it('should have the right values for the PBXGroup entry', () => { - var newFile = proj.addHeaderFile('Plugins/file.h'), - plugins = proj.pbxGroupByName('Plugins'), - pluginObj = plugins.children[0]; + const newFile = proj.addHeaderFile('Plugins/file.h'); + const plugins = proj.pbxGroupByName('Plugins'); + const pluginObj = plugins.children[0]; assert.equal(pluginObj.comment, 'file.h'); assert.equal(pluginObj.value, newFile.fileRef); @@ -100,9 +101,9 @@ describe('addHeaderFile', () => { it('addHeaderFile duplicate entries: should not add another entry anywhere', () => { proj.addHeaderFile('Plugins/file.h'); - var fileRefSection = proj.pbxFileReferenceSection(), - frsLength = Object.keys(fileRefSection).length, - plugins = proj.pbxGroupByName('Plugins'); + const fileRefSection = proj.pbxFileReferenceSection(); + const frsLength = Object.keys(fileRefSection).length; + const plugins = proj.pbxGroupByName('Plugins'); proj.addHeaderFile('Plugins/file.h'); diff --git a/test/addRemovePbxGroup.js b/test/addRemovePbxGroup.js index 52f1181..e91abbf 100644 --- a/test/addRemovePbxGroup.js +++ b/test/addRemovePbxGroup.js @@ -20,12 +20,12 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } @@ -35,26 +35,26 @@ describe('addRemovePbxGroup', () => { }); it('should return a pbxGroup', () => { - var pbxGroup = proj.addPbxGroup(['file.m'], 'MyGroup', 'Application', 'Application', '""'); + const pbxGroup = proj.addPbxGroup(['file.m'], 'MyGroup', 'Application', 'Application', '""'); assert.ok(typeof pbxGroup === 'object'); }); it('should set a uuid on the pbxGroup', () => { - var pbxGroup = proj.addPbxGroup(['file.m'], 'MyGroup', 'Application', 'Application', '""'); + const pbxGroup = proj.addPbxGroup(['file.m'], 'MyGroup', 'Application', 'Application', '""'); assert.ok(pbxGroup.uuid); }); it('should add all files to pbxGroup', () => { - var pbxGroup = proj.addPbxGroup(['file.m'], 'MyGroup', 'Application', 'Application', '""'); - for (var index = 0; index < pbxGroup.pbxGroup.children.length; index++) { - var file = pbxGroup.pbxGroup.children[index]; + const pbxGroup = proj.addPbxGroup(['file.m'], 'MyGroup', 'Application', 'Application', '""'); + for (let index = 0; index < pbxGroup.pbxGroup.children.length; index++) { + const file = pbxGroup.pbxGroup.children[index]; assert.ok(file.value); } }); it('should add the PBXGroup object correctly', () => { - var pbxGroup = proj.addPbxGroup(['file.m'], 'MyGroup', 'Application', '""'); - var pbxGroupInPbx = proj.pbxGroupByName('MyGroup'); + const pbxGroup = proj.addPbxGroup(['file.m'], 'MyGroup', 'Application', '""'); + const pbxGroupInPbx = proj.pbxGroupByName('MyGroup'); assert.equal(pbxGroupInPbx.children, pbxGroup.pbxGroup.children); assert.equal(pbxGroupInPbx.isa, 'PBXGroup'); @@ -65,109 +65,109 @@ describe('addRemovePbxGroup', () => { it('should add sourceTree if no other specified', () => { proj.addPbxGroup(['file.m'], 'MyGroup', 'Application'); - var pbxGroupInPbx = proj.pbxGroupByName('MyGroup'); + const pbxGroupInPbx = proj.pbxGroupByName('MyGroup'); assert.equal(pbxGroupInPbx.sourceTree, '""'); }); it('should add each of the files to PBXBuildFile section', () => { - var buildFileSection = proj.pbxBuildFileSection(); - for (var key in buildFileSection) { + const buildFileSection = proj.pbxBuildFileSection(); + for (const key in buildFileSection) { assert.notEqual(buildFileSection[key].fileRef_comment, 'file.m'); assert.notEqual(buildFileSection[key].fileRef_comment, 'assets.bundle'); } - var initialBuildFileSectionItemsCount = Object.keys(buildFileSection), - pbxGroup = proj.addPbxGroup(['file.m', 'assets.bundle'], 'MyGroup', 'Application', '""'), - afterAdditionBuildFileSectionItemsCount = Object.keys(buildFileSection); + const initialBuildFileSectionItemsCount = Object.keys(buildFileSection); + proj.addPbxGroup(['file.m', 'assets.bundle'], 'MyGroup', 'Application', '""'); + const afterAdditionBuildFileSectionItemsCount = Object.keys(buildFileSection); assert.equal(initialBuildFileSectionItemsCount.length, afterAdditionBuildFileSectionItemsCount.length - 4); }); it('should not add any of the files to PBXBuildFile section if already added', () => { - var buildFileSection = proj.pbxBuildFileSection(), - initialBuildFileSectionItemsCount = Object.keys(buildFileSection), - pbxGroup = proj.addPbxGroup(['AppDelegate.m', 'AppDelegate.h'], 'MyGroup', 'Application', '""'), - afterAdditionBuildFileSectionItemsCount = Object.keys(buildFileSection); + const buildFileSection = proj.pbxBuildFileSection(); + const initialBuildFileSectionItemsCount = Object.keys(buildFileSection); + proj.addPbxGroup(['AppDelegate.m', 'AppDelegate.h'], 'MyGroup', 'Application', '""'); + const afterAdditionBuildFileSectionItemsCount = Object.keys(buildFileSection); assert.deepEqual(initialBuildFileSectionItemsCount, afterAdditionBuildFileSectionItemsCount); }); it('should not add any of the files to PBXBuildFile section when they contain special symbols and are already added', () => { - var buildFileSection = proj.pbxBuildFileSection(), - initialBuildFileSectionItemsCount = Object.keys(buildFileSection), - pbxGroup = proj.addPbxGroup(['KitchenSinktablet.app'], 'MyGroup', 'Application', '""'), - afterAdditionBuildFileSectionItemsCount = Object.keys(buildFileSection); + const buildFileSection = proj.pbxBuildFileSection(); + const initialBuildFileSectionItemsCount = Object.keys(buildFileSection); + proj.addPbxGroup(['KitchenSinktablet.app'], 'MyGroup', 'Application', '""'); + const afterAdditionBuildFileSectionItemsCount = Object.keys(buildFileSection); assert.deepEqual(initialBuildFileSectionItemsCount, afterAdditionBuildFileSectionItemsCount); }); it('should add all files which are not added and not add files already added to PBXBuildFile section', () => { - var buildFileSection = proj.pbxBuildFileSection(); - for (var key in buildFileSection) { + const buildFileSection = proj.pbxBuildFileSection(); + for (const key in buildFileSection) { assert.notEqual(buildFileSection[key].fileRef_comment, 'file.m'); assert.notEqual(buildFileSection[key].fileRef_comment, 'assets.bundle'); } - var initialBuildFileSectionItemsCount = Object.keys(buildFileSection), - pbxGroup = proj.addPbxGroup(['AppDelegate.m', 'AppDelegate.h', 'file.m', 'assets.bundle'], 'MyGroup', 'Application', '""'), - afterAdditionBuildFileSectionItemsCount = Object.keys(buildFileSection); + const initialBuildFileSectionItemsCount = Object.keys(buildFileSection); + proj.addPbxGroup(['AppDelegate.m', 'AppDelegate.h', 'file.m', 'assets.bundle'], 'MyGroup', 'Application', '""'); + const afterAdditionBuildFileSectionItemsCount = Object.keys(buildFileSection); assert.equal(initialBuildFileSectionItemsCount.length, afterAdditionBuildFileSectionItemsCount.length - 4); }); it('should add each of the files to PBXFileReference section', () => { - var fileReference = proj.pbxFileReferenceSection(); - for (var key in fileReference) { + const fileReference = proj.pbxFileReferenceSection(); + for (const key in fileReference) { assert.notEqual(fileReference[key].fileRef_comment, 'file.m'); assert.notEqual(fileReference[key].fileRef_comment, 'assets.bundle'); } - var pbxGroup = proj.addPbxGroup(['file.m', 'assets.bundle'], 'MyGroup', 'Application', '""'); - for (var index = 0; index < pbxGroup.pbxGroup.children.length; index++) { - var file = pbxGroup.pbxGroup.children[index]; + const pbxGroup = proj.addPbxGroup(['file.m', 'assets.bundle'], 'MyGroup', 'Application', '""'); + for (let index = 0; index < pbxGroup.pbxGroup.children.length; index++) { + const file = pbxGroup.pbxGroup.children[index]; assert.ok(fileReference[file.value]); } }); it('should not add any of the files to PBXFileReference section if already added', () => { - var fileReference = proj.pbxFileReferenceSection(), - initialBuildFileSectionItemsCount = Object.keys(fileReference), - pbxGroup = proj.addPbxGroup(['AppDelegate.m', 'AppDelegate.h'], 'MyGroup', 'Application', '""'), - afterAdditionBuildFileSectionItemsCount = Object.keys(fileReference); + const fileReference = proj.pbxFileReferenceSection(); + const initialBuildFileSectionItemsCount = Object.keys(fileReference); + proj.addPbxGroup(['AppDelegate.m', 'AppDelegate.h'], 'MyGroup', 'Application', '""'); + const afterAdditionBuildFileSectionItemsCount = Object.keys(fileReference); assert.deepEqual(initialBuildFileSectionItemsCount, afterAdditionBuildFileSectionItemsCount); }); it('should not add any of the files to PBXFileReference section when they contain special symbols and are already added', () => { - var fileReference = proj.pbxFileReferenceSection(), - initialBuildFileSectionItemsCount = Object.keys(fileReference), - pbxGroup = proj.addPbxGroup(['KitchenSinktablet.app'], 'MyGroup', 'Application', '""'), - afterAdditionBuildFileSectionItemsCount = Object.keys(fileReference); + const fileReference = proj.pbxFileReferenceSection(); + const initialBuildFileSectionItemsCount = Object.keys(fileReference); + proj.addPbxGroup(['KitchenSinktablet.app'], 'MyGroup', 'Application', '""'); + const afterAdditionBuildFileSectionItemsCount = Object.keys(fileReference); assert.deepEqual(initialBuildFileSectionItemsCount, afterAdditionBuildFileSectionItemsCount); }); it('should add all files which are not added and not add files already added to PBXFileReference section', () => { - var fileReference = proj.pbxFileReferenceSection(); - for (var key in fileReference) { + const fileReference = proj.pbxFileReferenceSection(); + for (const key in fileReference) { assert.notEqual(fileReference[key].fileRef_comment, 'file.m'); assert.notEqual(fileReference[key].fileRef_comment, 'assets.bundle'); } - var initialBuildFileSectionItemsCount = Object.keys(fileReference), - pbxGroup = proj.addPbxGroup(['AppDelegate.m', 'AppDelegate.h', 'file.m', 'assets.bundle'], 'MyGroup', 'Application', '""'), - afterAdditionBuildFileSectionItemsCount = Object.keys(fileReference); + const initialBuildFileSectionItemsCount = Object.keys(fileReference); + proj.addPbxGroup(['AppDelegate.m', 'AppDelegate.h', 'file.m', 'assets.bundle'], 'MyGroup', 'Application', '""'); + const afterAdditionBuildFileSectionItemsCount = Object.keys(fileReference); assert.equal(initialBuildFileSectionItemsCount.length, afterAdditionBuildFileSectionItemsCount.length - 4); }); it('should remove a pbxGroup', () => { - var groupName = 'MyGroup'; + const groupName = 'MyGroup'; proj.addPbxGroup(['file.m'], groupName, 'Application', 'Application', '""'); proj.removePbxGroup(groupName); - var pbxGroupInPbx = proj.pbxGroupByName(groupName); + const pbxGroupInPbx = proj.pbxGroupByName(groupName); console.log(pbxGroupInPbx); assert.ok(!pbxGroupInPbx); diff --git a/test/addResourceFile.js b/test/addResourceFile.js index 405cccf..bd2d13f 100644 --- a/test/addResourceFile.js +++ b/test/addResourceFile.js @@ -22,11 +22,11 @@ const assert = require('node:assert'); const fullProject = require('./fixtures/full-project'); const fullProjectStr = JSON.stringify(fullProject); -const pbx = require('../lib/pbxProject'); -const pbxFile = require('../lib/pbxFile'); -const proj = new pbx('.'); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } @@ -37,7 +37,7 @@ describe('addResourceFile', () => { it('should return a pbxFile', () => { const newFile = proj.addResourceFile('assets.bundle'); - assert.equal(newFile.constructor, pbxFile); + assert.equal(newFile.constructor, PBXFile); }); it('should set a uuid on the pbxFile', () => { @@ -155,7 +155,6 @@ describe('addResourceFile', () => { // { plugin: true } // describe('when added with { plugin: true }', () => { - it('should add the PBXFileReference with the "Plugins" path', () => { delete proj.pbxGroupByName('Plugins').path; @@ -232,7 +231,6 @@ describe('addResourceFile', () => { // { variantGroup: true } // describe('when added with { variantGroup: true }', () => { - it('should not add to the PBXResourcesBuildPhase and PBXBuildFile', () => { const newFile = proj.addResourceFile( 'en.lproj/Localization.strings', @@ -251,7 +249,6 @@ describe('addResourceFile', () => { // duplicate entries // describe('duplicate entries', () => { - it('should return false', () => { proj.addResourceFile('Plugins/assets.bundle'); assert.ok(!proj.addResourceFile('Plugins/assets.bundle')); diff --git a/test/addSourceFile.js b/test/addSourceFile.js index 29c912d..362ef30 100644 --- a/test/addSourceFile.js +++ b/test/addSourceFile.js @@ -19,147 +19,147 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } describe('addSourceFile', () => { - beforeEach(() => { - proj.hash = cleanHash(); - }); - - it('should return a pbxFile', () => { - const newFile = proj.addSourceFile('file.m'); - assert.strictEqual(newFile.constructor, pbxFile); - }); - - it('should set a uuid on the pbxFile', () => { - const newFile = proj.addSourceFile('file.m'); - assert.ok(newFile.uuid); - }); - - it('should set a fileRef on the pbxFile', () => { - const newFile = proj.addSourceFile('file.m'); - assert.ok(newFile.fileRef); - }); - - it('should populate the PBXBuildFile section with 2 fields', () => { - const newFile = proj.addSourceFile('file.m'); - const buildFileSection = proj.pbxBuildFileSection(); - const bfsLength = Object.keys(buildFileSection).length; - - assert.strictEqual(bfsLength, 60); - assert.ok(buildFileSection[newFile.uuid]); - assert.ok(buildFileSection[newFile.uuid + '_comment']); - }); - - it('should add the PBXBuildFile comment correctly', () => { - const newFile = proj.addSourceFile('file.m'); - const commentKey = newFile.uuid + '_comment'; - const buildFileSection = proj.pbxBuildFileSection(); - - assert.strictEqual(buildFileSection[commentKey], 'file.m in Sources'); - }); - - it('should add the PBXBuildFile object correctly', () => { - const newFile = proj.addSourceFile('file.m'); - const buildFileSection = proj.pbxBuildFileSection(); - const buildFileEntry = buildFileSection[newFile.uuid]; - - assert.strictEqual(buildFileEntry.isa, 'PBXBuildFile'); - assert.strictEqual(buildFileEntry.fileRef, newFile.fileRef); - assert.strictEqual(buildFileEntry.fileRef_comment, 'file.m'); - }); - - it('should populate the PBXFileReference section with 2 fields', () => { - const newFile = proj.addSourceFile('file.m'); - const fileRefSection = proj.pbxFileReferenceSection(); - const frsLength = Object.keys(fileRefSection).length; - - assert.strictEqual(frsLength, 68); - assert.ok(fileRefSection[newFile.fileRef]); - assert.ok(fileRefSection[newFile.fileRef + '_comment']); - }); - - it('should populate the PBXFileReference comment correctly', () => { - const newFile = proj.addSourceFile('file.m'); - const fileRefSection = proj.pbxFileReferenceSection(); - const commentKey = newFile.fileRef + '_comment'; - - assert.strictEqual(fileRefSection[commentKey], 'file.m'); - }); - - it('should add the PBXFileReference object correctly', () => { - const newFile = proj.addSourceFile('Plugins/file.m'); - const fileRefSection = proj.pbxFileReferenceSection(); - const fileRefEntry = fileRefSection[newFile.fileRef]; - - assert.strictEqual(fileRefEntry.isa, 'PBXFileReference'); - assert.strictEqual(fileRefEntry.fileEncoding, 4); - assert.strictEqual(fileRefEntry.lastKnownFileType, 'sourcecode.c.objc'); - assert.strictEqual(fileRefEntry.name, '"file.m"'); - assert.strictEqual(fileRefEntry.path, '"file.m"'); - assert.strictEqual(fileRefEntry.sourceTree, '""'); - }); - - it('should add to the Plugins PBXGroup group', () => { - proj.addSourceFile('Plugins/file.m'); - - const plugins = proj.pbxGroupByName('Plugins'); - assert.strictEqual(plugins.children.length, 1); - }); - - it('should have the right values for the PBXGroup entry', () => { - const newFile = proj.addSourceFile('Plugins/file.m'); - const plugins = proj.pbxGroupByName('Plugins'); - const pluginObj = plugins.children[0]; - - assert.strictEqual(pluginObj.comment, 'file.m'); - assert.strictEqual(pluginObj.value, newFile.fileRef); - }); - - it('should add to the PBXSourcesBuildPhase', () => { - proj.addSourceFile('Plugins/file.m'); - - const sources = proj.pbxSourcesBuildPhaseObj(); - assert.strictEqual(sources.files.length, 3); - }); - - it('should have the right values for the Sources entry', () => { - const newFile = proj.addSourceFile('Plugins/file.m'); - const sources = proj.pbxSourcesBuildPhaseObj(); - const sourceObj = sources.files[2]; - - assert.strictEqual(sourceObj.comment, 'file.m in Sources'); - assert.strictEqual(sourceObj.value, newFile.uuid); - }); - - it('duplicate entries should return false', () => { - proj.addSourceFile('Plugins/file.m'); - assert.ok(!proj.addSourceFile('Plugins/file.m')); - }); - - it('duplicate entries should not add another entry anywhere', () => { - proj.addSourceFile('Plugins/file.m'); - const buildFileSection = proj.pbxBuildFileSection(); - const bfsLength = Object.keys(buildFileSection).length; - const fileRefSection = proj.pbxFileReferenceSection(); - const frsLength = Object.keys(fileRefSection).length; - const plugins = proj.pbxGroupByName('Plugins'); - const sources = proj.pbxSourcesBuildPhaseObj(); - - // duplicate! - proj.addSourceFile('Plugins/file.m'); - - assert.strictEqual(bfsLength, 60); - assert.strictEqual(frsLength, 68); - assert.strictEqual(plugins.children.length, 1); - assert.strictEqual(sources.files.length, 3); - }); + beforeEach(() => { + proj.hash = cleanHash(); + }); + + it('should return a pbxFile', () => { + const newFile = proj.addSourceFile('file.m'); + assert.strictEqual(newFile.constructor, PBXFile); + }); + + it('should set a uuid on the pbxFile', () => { + const newFile = proj.addSourceFile('file.m'); + assert.ok(newFile.uuid); + }); + + it('should set a fileRef on the pbxFile', () => { + const newFile = proj.addSourceFile('file.m'); + assert.ok(newFile.fileRef); + }); + + it('should populate the PBXBuildFile section with 2 fields', () => { + const newFile = proj.addSourceFile('file.m'); + const buildFileSection = proj.pbxBuildFileSection(); + const bfsLength = Object.keys(buildFileSection).length; + + assert.strictEqual(bfsLength, 60); + assert.ok(buildFileSection[newFile.uuid]); + assert.ok(buildFileSection[newFile.uuid + '_comment']); + }); + + it('should add the PBXBuildFile comment correctly', () => { + const newFile = proj.addSourceFile('file.m'); + const commentKey = newFile.uuid + '_comment'; + const buildFileSection = proj.pbxBuildFileSection(); + + assert.strictEqual(buildFileSection[commentKey], 'file.m in Sources'); + }); + + it('should add the PBXBuildFile object correctly', () => { + const newFile = proj.addSourceFile('file.m'); + const buildFileSection = proj.pbxBuildFileSection(); + const buildFileEntry = buildFileSection[newFile.uuid]; + + assert.strictEqual(buildFileEntry.isa, 'PBXBuildFile'); + assert.strictEqual(buildFileEntry.fileRef, newFile.fileRef); + assert.strictEqual(buildFileEntry.fileRef_comment, 'file.m'); + }); + + it('should populate the PBXFileReference section with 2 fields', () => { + const newFile = proj.addSourceFile('file.m'); + const fileRefSection = proj.pbxFileReferenceSection(); + const frsLength = Object.keys(fileRefSection).length; + + assert.strictEqual(frsLength, 68); + assert.ok(fileRefSection[newFile.fileRef]); + assert.ok(fileRefSection[newFile.fileRef + '_comment']); + }); + + it('should populate the PBXFileReference comment correctly', () => { + const newFile = proj.addSourceFile('file.m'); + const fileRefSection = proj.pbxFileReferenceSection(); + const commentKey = newFile.fileRef + '_comment'; + + assert.strictEqual(fileRefSection[commentKey], 'file.m'); + }); + + it('should add the PBXFileReference object correctly', () => { + const newFile = proj.addSourceFile('Plugins/file.m'); + const fileRefSection = proj.pbxFileReferenceSection(); + const fileRefEntry = fileRefSection[newFile.fileRef]; + + assert.strictEqual(fileRefEntry.isa, 'PBXFileReference'); + assert.strictEqual(fileRefEntry.fileEncoding, 4); + assert.strictEqual(fileRefEntry.lastKnownFileType, 'sourcecode.c.objc'); + assert.strictEqual(fileRefEntry.name, '"file.m"'); + assert.strictEqual(fileRefEntry.path, '"file.m"'); + assert.strictEqual(fileRefEntry.sourceTree, '""'); + }); + + it('should add to the Plugins PBXGroup group', () => { + proj.addSourceFile('Plugins/file.m'); + + const plugins = proj.pbxGroupByName('Plugins'); + assert.strictEqual(plugins.children.length, 1); + }); + + it('should have the right values for the PBXGroup entry', () => { + const newFile = proj.addSourceFile('Plugins/file.m'); + const plugins = proj.pbxGroupByName('Plugins'); + const pluginObj = plugins.children[0]; + + assert.strictEqual(pluginObj.comment, 'file.m'); + assert.strictEqual(pluginObj.value, newFile.fileRef); + }); + + it('should add to the PBXSourcesBuildPhase', () => { + proj.addSourceFile('Plugins/file.m'); + + const sources = proj.pbxSourcesBuildPhaseObj(); + assert.strictEqual(sources.files.length, 3); + }); + + it('should have the right values for the Sources entry', () => { + const newFile = proj.addSourceFile('Plugins/file.m'); + const sources = proj.pbxSourcesBuildPhaseObj(); + const sourceObj = sources.files[2]; + + assert.strictEqual(sourceObj.comment, 'file.m in Sources'); + assert.strictEqual(sourceObj.value, newFile.uuid); + }); + + it('duplicate entries should return false', () => { + proj.addSourceFile('Plugins/file.m'); + assert.ok(!proj.addSourceFile('Plugins/file.m')); + }); + + it('duplicate entries should not add another entry anywhere', () => { + proj.addSourceFile('Plugins/file.m'); + const buildFileSection = proj.pbxBuildFileSection(); + const bfsLength = Object.keys(buildFileSection).length; + const fileRefSection = proj.pbxFileReferenceSection(); + const frsLength = Object.keys(fileRefSection).length; + const plugins = proj.pbxGroupByName('Plugins'); + const sources = proj.pbxSourcesBuildPhaseObj(); + + // duplicate! + proj.addSourceFile('Plugins/file.m'); + + assert.strictEqual(bfsLength, 60); + assert.strictEqual(frsLength, 68); + assert.strictEqual(plugins.children.length, 1); + assert.strictEqual(sources.files.length, 3); + }); }); diff --git a/test/addStaticLibrary.js b/test/addStaticLibrary.js index e3b4c4a..825d634 100644 --- a/test/addStaticLibrary.js +++ b/test/addStaticLibrary.js @@ -19,19 +19,20 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } -function nonComments(obj) { - var keys = Object.keys(obj), - newObj = {}, i = 0; +function nonComments (obj) { + const keys = Object.keys(obj); + const newObj = {}; + let i = 0; for (i; i < keys.length; i++) { if (!/_comment$/.test(keys[i])) { @@ -42,16 +43,18 @@ function nonComments(obj) { return newObj; } -function librarySearchPaths(proj) { - var configs = nonComments(proj.pbxXCBuildConfigurationSection()), - allPaths = [], - ids = Object.keys(configs), i, buildSettings; +function librarySearchPaths (proj) { + const configs = nonComments(proj.pbxXCBuildConfigurationSection()); + const allPaths = []; + const ids = Object.keys(configs); + let i; + let buildSettings; - for (i = 0; i< ids.length; i++) { + for (i = 0; i < ids.length; i++) { buildSettings = configs[ids[i]].buildSettings; - if (buildSettings['LIBRARY_SEARCH_PATHS']) { - allPaths.push(buildSettings['LIBRARY_SEARCH_PATHS']); + if (buildSettings.LIBRARY_SEARCH_PATHS) { + allPaths.push(buildSettings.LIBRARY_SEARCH_PATHS); } } @@ -64,21 +67,21 @@ beforeEach(() => { describe('addStaticLibrary', () => { it('should return a pbxFile', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); + const newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); - assert.equal(newFile.constructor, pbxFile); + assert.equal(newFile.constructor, PBXFile); }); it('should set a fileRef on the pbxFile', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); + const newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); assert.ok(newFile.fileRef); }); it('should populate the PBXBuildFile section with 2 fields', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); - buildFileSection = proj.pbxBuildFileSection(), - bfsLength = Object.keys(buildFileSection).length; + const newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); + const buildFileSection = proj.pbxBuildFileSection(); + const bfsLength = Object.keys(buildFileSection).length; assert.equal(60, bfsLength); assert.ok(buildFileSection[newFile.uuid]); @@ -86,10 +89,9 @@ describe('addStaticLibrary', () => { }); it('should populate the PBXBuildFile section with 2 fields as plugin', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a', - { plugin: true }); - buildFileSection = proj.pbxBuildFileSection(), - bfsLength = Object.keys(buildFileSection).length; + const newFile = proj.addStaticLibrary('libGoogleAnalytics.a', { plugin: true }); + const buildFileSection = proj.pbxBuildFileSection(); + const bfsLength = Object.keys(buildFileSection).length; assert.equal(60, bfsLength); assert.ok(buildFileSection[newFile.uuid]); @@ -97,17 +99,17 @@ describe('addStaticLibrary', () => { }); it('should add the PBXBuildFile comment correctly', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); - commentKey = newFile.uuid + '_comment', - buildFileSection = proj.pbxBuildFileSection(); + const newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); + const commentKey = newFile.uuid + '_comment'; + const buildFileSection = proj.pbxBuildFileSection(); assert.equal(buildFileSection[commentKey], 'libGoogleAnalytics.a in Frameworks'); }); it('should add the PBXBuildFile object correctly', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); - buildFileSection = proj.pbxBuildFileSection(), - buildFileEntry = buildFileSection[newFile.uuid]; + const newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); + const buildFileSection = proj.pbxBuildFileSection(); + const buildFileEntry = buildFileSection[newFile.uuid]; assert.equal(buildFileEntry.isa, 'PBXBuildFile'); assert.equal(buildFileEntry.fileRef, newFile.fileRef); @@ -115,9 +117,9 @@ describe('addStaticLibrary', () => { }); it('should populate the PBXFileReference section with 2 fields', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); - fileRefSection = proj.pbxFileReferenceSection(), - frsLength = Object.keys(fileRefSection).length; + const newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); + const fileRefSection = proj.pbxFileReferenceSection(); + const frsLength = Object.keys(fileRefSection).length; assert.equal(68, frsLength); assert.ok(fileRefSection[newFile.fileRef]); @@ -125,17 +127,17 @@ describe('addStaticLibrary', () => { }); it('should populate the PBXFileReference comment correctly', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); - fileRefSection = proj.pbxFileReferenceSection(), - commentKey = newFile.fileRef + '_comment'; + const newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); + const fileRefSection = proj.pbxFileReferenceSection(); + const commentKey = newFile.fileRef + '_comment'; assert.equal(fileRefSection[commentKey], 'libGoogleAnalytics.a'); }); it('should add the PBXFileReference object correctly', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a'), - fileRefSection = proj.pbxFileReferenceSection(), - fileRefEntry = fileRefSection[newFile.fileRef]; + const newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); + const fileRefSection = proj.pbxFileReferenceSection(); + const fileRefEntry = fileRefSection[newFile.fileRef]; assert.equal(fileRefEntry.isa, 'PBXFileReference'); assert.equal(fileRefEntry.lastKnownFileType, 'archive.ar'); @@ -145,118 +147,113 @@ describe('addStaticLibrary', () => { }); it('should add to the PBXFrameworksBuildPhase', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a'), - frameworks = proj.pbxFrameworksBuildPhaseObj(); + proj.addStaticLibrary('libGoogleAnalytics.a'); + const frameworks = proj.pbxFrameworksBuildPhaseObj(); assert.equal(frameworks.files.length, 16); }); it('should have the right values for the Sources entry', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a'), - frameworks = proj.pbxFrameworksBuildPhaseObj(), - framework = frameworks.files[15]; + const newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); + const frameworks = proj.pbxFrameworksBuildPhaseObj(); + const framework = frameworks.files[15]; assert.equal(framework.comment, 'libGoogleAnalytics.a in Frameworks'); assert.equal(framework.value, newFile.uuid); }); it('should set LIBRARY_SEARCH_PATHS for appropriate build configurations', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a'), - configs = nonComments(proj.pbxXCBuildConfigurationSection()), - ids = Object.keys(configs), i, buildSettings; + proj.addStaticLibrary('libGoogleAnalytics.a'); + const configs = nonComments(proj.pbxXCBuildConfigurationSection()); + const ids = Object.keys(configs); + let i; + let buildSettings; - for (i = 0; i< ids.length; i++) { + for (i = 0; i < ids.length; i++) { buildSettings = configs[ids[i]].buildSettings; - if (buildSettings['PRODUCT_NAME'] == '"KitchenSinktablet"') { - assert.ok(buildSettings['LIBRARY_SEARCH_PATHS']); + if (buildSettings.PRODUCT_NAME === '"KitchenSinktablet"') { + assert.ok(buildSettings.LIBRARY_SEARCH_PATHS); } } - }); it('should ensure LIBRARY_SEARCH_PATHS inherits defaults correctly', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a'), - libraryPaths = librarySearchPaths(proj), - expectedPath = '"\\"$(SRCROOT)/KitchenSinktablet\\""', - i, current; + proj.addStaticLibrary('libGoogleAnalytics.a'); + const libraryPaths = librarySearchPaths(proj); + let i; + let current; for (i = 0; i < libraryPaths.length; i++) { current = libraryPaths[i]; assert.ok(current.indexOf('"$(inherited)"') >= 0); } - }); it('should ensure the new library is in LIBRARY_SEARCH_PATHS', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a'), - libraryPaths = librarySearchPaths(proj), - expectedPath = '"\\"$(SRCROOT)/KitchenSinktablet\\""', - i, current; + proj.addStaticLibrary('libGoogleAnalytics.a'); + const libraryPaths = librarySearchPaths(proj); + const expectedPath = '"\\"$(SRCROOT)/KitchenSinktablet\\""'; + let i; + let current; for (i = 0; i < libraryPaths.length; i++) { current = libraryPaths[i]; assert.ok(current.indexOf(expectedPath) >= 0); } - }); it('should add to the Plugins group, optionally', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a', - { plugin: true }), - plugins = proj.pbxGroupByName('Plugins'); + proj.addStaticLibrary('libGoogleAnalytics.a', { plugin: true }); + const plugins = proj.pbxGroupByName('Plugins'); assert.equal(plugins.children.length, 1); }); + describe('should add the right LIBRARY_SEARCH_PATHS entry for plugins', () => { it('with group set', () => { - plugins = proj.pbxGroupByName('Plugins'); + const plugins = proj.pbxGroupByName('Plugins'); plugins.path = '"Test200/Plugins"'; - var newFile = proj.addStaticLibrary('Plugins/libGoogleAnalytics.a', - { plugin: true }), - libraryPaths = librarySearchPaths(proj), - expectedPath = '"\\"$(SRCROOT)/Test200/Plugins\\""', - i, current; + proj.addStaticLibrary('Plugins/libGoogleAnalytics.a', { plugin: true }); + const libraryPaths = librarySearchPaths(proj); + const expectedPath = '"\\"$(SRCROOT)/Test200/Plugins\\""'; + let current; - for (i = 0; i < libraryPaths.length; i++) { + for (let i = 0; i < libraryPaths.length; i++) { current = libraryPaths[i]; assert.ok(current.indexOf(expectedPath) >= 0, - expectedPath + ' not found in ' + current); + expectedPath + ' not found in ' + current); } - }); it('without group set', () => { - plugins = proj.pbxGroupByName('Plugins'); + const plugins = proj.pbxGroupByName('Plugins'); delete plugins.path; - var newFile = proj.addStaticLibrary('Plugins/libGoogleAnalytics.a', - { plugin: true }), - libraryPaths = librarySearchPaths(proj), - expectedPath = '"\\"$(SRCROOT)/KitchenSinktablet/Plugins\\""', - i, current; + proj.addStaticLibrary('Plugins/libGoogleAnalytics.a', { plugin: true }); + const libraryPaths = librarySearchPaths(proj); + const expectedPath = '"\\"$(SRCROOT)/KitchenSinktablet/Plugins\\""'; + let current; - for (i = 0; i < libraryPaths.length; i++) { + for (let i = 0; i < libraryPaths.length; i++) { current = libraryPaths[i]; assert.ok(current.indexOf(expectedPath) >= 0, - expectedPath + ' not found in ' + current); + expectedPath + ' not found in ' + current); } }); }); describe('duplicate entries', () => { it('should return false', () => { - var newFile = proj.addStaticLibrary('libGoogleAnalytics.a'); + proj.addStaticLibrary('libGoogleAnalytics.a'); assert.ok(!proj.addStaticLibrary('libGoogleAnalytics.a')); }); it('should return false (plugin entries)', () => { - var newFile = proj.addStaticLibrary('Plugins/libGoogleAnalytics.a', - { plugin: true }); + proj.addStaticLibrary('Plugins/libGoogleAnalytics.a', { plugin: true }); - assert.ok(!proj.addStaticLibrary('Plugins/libGoogleAnalytics.a', - { plugin: true })); + assert.ok(!proj.addStaticLibrary('Plugins/libGoogleAnalytics.a', { plugin: true })); }); }); }); diff --git a/test/addTarget.js b/test/addTarget.js index 62e94e7..87fe642 100644 --- a/test/addTarget.js +++ b/test/addTarget.js @@ -19,21 +19,20 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } -var TARGET_NAME = 'TestExtension', - TARGET_TYPE = 'app_extension', - TARGET_SUBFOLDER_NAME = 'TestExtensionFiles', - TARGET_BUNDLE_ID ="com.cordova.test.appextension"; - +const TARGET_NAME = 'TestExtension'; +const TARGET_TYPE = 'app_extension'; +const TARGET_SUBFOLDER_NAME = 'TestExtensionFiles'; +const TARGET_BUNDLE_ID = 'com.cordova.test.appextension'; describe('addTarget', () => { beforeEach(() => { @@ -41,49 +40,45 @@ describe('addTarget', () => { }); it('should throw when target name is missing', () => { - assert.throws(function() { + assert.throws(function () { proj.addTarget(null, TARGET_TYPE); }); - }); it('should throw when provided blank or empty target name', () => { - assert.throws(function() { + assert.throws(function () { proj.addTarget('', TARGET_TYPE); }, function (error) { return (error instanceof Error) && /Target name missing/i.test(error); }); - assert.throws(function() { + assert.throws(function () { proj.addTarget(' ', TARGET_TYPE); }, function (error) { return (error instanceof Error) && /Target name missing/i.test(error); }); - }); it('should throw when target type missing', () => { - assert.throws(function() { + assert.throws(function () { proj.addTarget(TARGET_NAME, null); }, function (error) { return (error instanceof Error) && /Target type missing/i.test(error); }); - }); it('should throw when invalid target type', () => { - assert.throws(function() { + assert.throws(function () { proj.addTarget(TARGET_NAME, 'invalid_target_type'); }, function (error) { return (error instanceof Error) && /Target type invalid/i.test(error); }); - }); it('should create a new target', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -95,13 +90,12 @@ describe('addTarget', () => { assert.ok(target.pbxNativeTarget.buildPhases); assert.ok(target.pbxNativeTarget.buildRules); assert.ok(target.pbxNativeTarget.dependencies); - }); it('should create a new target with bundleid', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME, TARGET_BUNDLE_ID); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME, TARGET_BUNDLE_ID); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -113,85 +107,81 @@ describe('addTarget', () => { assert.ok(target.pbxNativeTarget.buildPhases); assert.ok(target.pbxNativeTarget.buildRules); assert.ok(target.pbxNativeTarget.dependencies); - }); it('should add debug and release configurations to build configuration list', () => { - var pbxXCBuildConfigurationSection = proj.pbxXCBuildConfigurationSection(), - pbxXCConfigurationList = proj.pbxXCConfigurationList(), - target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); + const pbxXCBuildConfigurationSection = proj.pbxXCBuildConfigurationSection(); + const pbxXCConfigurationList = proj.pbxXCConfigurationList(); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); assert.ok(target.pbxNativeTarget.buildConfigurationList); assert.ok(pbxXCConfigurationList[target.pbxNativeTarget.buildConfigurationList]); - var buildConfigurations = pbxXCConfigurationList[target.pbxNativeTarget.buildConfigurationList].buildConfigurations; + const buildConfigurations = pbxXCConfigurationList[target.pbxNativeTarget.buildConfigurationList].buildConfigurations; assert.ok(buildConfigurations); assert.equal(buildConfigurations.length, 2); buildConfigurations.forEach((config, index) => { - var configUuid = config.value; + const configUuid = config.value; assert.ok(configUuid); - var pbxConfig = pbxXCBuildConfigurationSection[configUuid]; + const pbxConfig = pbxXCBuildConfigurationSection[configUuid]; assert.ok(pbxConfig); assert.equal(pbxConfig.name, index === 0 ? 'Debug' : 'Release'); assert.equal(pbxConfig.isa, 'XCBuildConfiguration'); assert.ok(pbxConfig.buildSettings); if (index === 0) { - var debugConfig = pbxConfig.buildSettings['GCC_PREPROCESSOR_DEFINITIONS']; + const debugConfig = pbxConfig.buildSettings.GCC_PREPROCESSOR_DEFINITIONS; assert.ok(debugConfig); assert.equal(debugConfig.length, 2); assert.equal(debugConfig[0], '"DEBUG=1"'); assert.equal(debugConfig[1], '"$(inherited)"'); } - assert.equal(pbxConfig.buildSettings['INFOPLIST_FILE'], '"' + TARGET_SUBFOLDER_NAME + '/' + TARGET_SUBFOLDER_NAME + '-Info.plist"'); - assert.equal(pbxConfig.buildSettings['LD_RUNPATH_SEARCH_PATHS'], '"$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"'); - assert.equal(pbxConfig.buildSettings['PRODUCT_NAME'], '"' + TARGET_NAME + '"'); - assert.equal(pbxConfig.buildSettings['SKIP_INSTALL'], 'YES'); + assert.equal(pbxConfig.buildSettings.INFOPLIST_FILE, '"' + TARGET_SUBFOLDER_NAME + '/' + TARGET_SUBFOLDER_NAME + '-Info.plist"'); + assert.equal(pbxConfig.buildSettings.LD_RUNPATH_SEARCH_PATHS, '"$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"'); + assert.equal(pbxConfig.buildSettings.PRODUCT_NAME, '"' + TARGET_NAME + '"'); + assert.equal(pbxConfig.buildSettings.SKIP_INSTALL, 'YES'); }); - }); it('should add to build configuration list with default configuration name', () => { - var pbxXCConfigurationList = proj.pbxXCConfigurationList(), - target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); + const pbxXCConfigurationList = proj.pbxXCConfigurationList(); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); assert.ok(target.pbxNativeTarget.buildConfigurationList); assert.ok(pbxXCConfigurationList[target.pbxNativeTarget.buildConfigurationList]); assert.equal(pbxXCConfigurationList[target.pbxNativeTarget.buildConfigurationList].defaultConfigurationName, 'Release'); - }); it('should add to build configuration list with comment', () => { - var pbxXCConfigurationList = proj.pbxXCConfigurationList(), - target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); + const pbxXCConfigurationList = proj.pbxXCConfigurationList(); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); - var buildCommentKey = target.pbxNativeTarget.buildConfigurationList + '_comment'; + const buildCommentKey = target.pbxNativeTarget.buildConfigurationList + '_comment'; assert.ok(pbxXCConfigurationList[buildCommentKey]); assert.equal(pbxXCConfigurationList[buildCommentKey], 'Build configuration list for PBXNativeTarget "' + TARGET_NAME + '"'); - }); it('should create a new target and add source, framework, resource and header files and the corresponding build phases', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME), - options = { 'target' : target.uuid }; + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); + const options = { target: target.uuid }; - var sourceFile = proj.addSourceFile('Plugins/file.m', options), - sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid), - resourceFile = proj.addResourceFile('assets.bundle', options), - resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid), - frameworkFile = proj.addFramework('libsqlite3.dylib', options), - frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid), - headerFile = proj.addHeaderFile('file.h', options); + const sourceFile = proj.addSourceFile('Plugins/file.m', options); + const sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid); + const resourceFile = proj.addResourceFile('assets.bundle', options); + const resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid); + const frameworkFile = proj.addFramework('libsqlite3.dylib', options); + const frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid); + const headerFile = proj.addHeaderFile('file.h', options); assert.ok(sourcePhase); assert.ok(resourcePhase); assert.ok(frameworkPhase); - assert.equal(sourceFile.constructor, pbxFile); - assert.equal(resourceFile.constructor, pbxFile); - assert.equal(frameworkFile.constructor, pbxFile); - assert.equal(headerFile.constructor, pbxFile); + assert.equal(sourceFile.constructor, PBXFile); + assert.equal(resourceFile.constructor, PBXFile); + assert.equal(frameworkFile.constructor, PBXFile); + assert.equal(headerFile.constructor, PBXFile); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -203,211 +193,194 @@ describe('addTarget', () => { assert.ok(target.pbxNativeTarget.buildPhases); assert.ok(target.pbxNativeTarget.buildRules); assert.ok(target.pbxNativeTarget.dependencies); - }); it('should create target with correct pbxNativeTarget name', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); - var quotedTargetName = '"' + TARGET_NAME + '"'; + const quotedTargetName = '"' + TARGET_NAME + '"'; assert.equal(target.pbxNativeTarget.name, quotedTargetName); assert.equal(target.pbxNativeTarget.productName, quotedTargetName); - }); it('should add build phase for extension target', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE); assert.ok(target.uuid); - var phases = proj.pbxCopyfilesBuildPhaseObj(target.uuid); + const phases = proj.pbxCopyfilesBuildPhaseObj(target.uuid); assert.ok(phases); assert.ok(phases.files); assert.equal(phases.files.length, 1); - }); it('should not add build phase for non-extension target', () => { - var target = proj.addTarget(TARGET_NAME, 'application'); + const target = proj.addTarget(TARGET_NAME, 'application'); assert.ok(target.uuid); - var phases = proj.pbxCopyfilesBuildPhaseObj(target.uuid); + const phases = proj.pbxCopyfilesBuildPhaseObj(target.uuid); assert.ok(!phases); - }); it('should add target as a target dependency to the main target', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE); assert.ok(target); assert.ok(target.uuid); - var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency']; + const pbxTargetDependencySection = proj.hash.project.objects.PBXTargetDependency; - var targetDependencyUuid = Object.keys(pbxTargetDependencySection).find( (key) => pbxTargetDependencySection[key].target === target.uuid); + const targetDependencyUuid = Object.keys(pbxTargetDependencySection).find((key) => pbxTargetDependencySection[key].target === target.uuid); assert.ok(targetDependencyUuid); - var firstTarget = proj.getFirstTarget(); + const firstTarget = proj.getFirstTarget(); assert.ok(firstTarget); assert.ok(firstTarget.firstTarget); assert.ok(firstTarget.firstTarget.dependencies); - var firstTargetMatchingDependency = firstTarget.firstTarget.dependencies.find( (elem) => elem.value === targetDependencyUuid); + const firstTargetMatchingDependency = firstTarget.firstTarget.dependencies.find((elem) => elem.value === targetDependencyUuid); assert.ok(firstTargetMatchingDependency); - }); it('should have "wrapper.application" filetype for application product', () => { - var target = proj.addTarget(TARGET_NAME, 'application'); + const target = proj.addTarget(TARGET_NAME, 'application'); assert.ok(target); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.productReference); - var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + const productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; assert.ok(productFile); assert.ok(productFile.explicitFileType); assert.equal(productFile.explicitFileType, '"wrapper.application"'); - }); it('should have "wrapper.app-extension" filetype for app_extension product', () => { - var target = proj.addTarget(TARGET_NAME, 'app_extension'); + const target = proj.addTarget(TARGET_NAME, 'app_extension'); assert.ok(target); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.productReference); - var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + const productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; assert.ok(productFile); assert.ok(productFile.explicitFileType); assert.equal(productFile.explicitFileType, '"wrapper.app-extension"'); - }); it('should have "wrapper.plug-in" filetype for bundle product', () => { - var target = proj.addTarget(TARGET_NAME, 'bundle'); + const target = proj.addTarget(TARGET_NAME, 'bundle'); assert.ok(target); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.productReference); - var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + const productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; assert.ok(productFile); assert.ok(productFile.explicitFileType); assert.equal(productFile.explicitFileType, '"wrapper.plug-in"'); - }); it('should have "compiled.mach-o.dylib" filetype for command_line_tool product', () => { - var target = proj.addTarget(TARGET_NAME, 'command_line_tool'); + const target = proj.addTarget(TARGET_NAME, 'command_line_tool'); assert.ok(target); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.productReference); - var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + const productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; assert.ok(productFile); assert.ok(productFile.explicitFileType); assert.equal(productFile.explicitFileType, '"compiled.mach-o.dylib"'); - }); it('should have "compiled.mach-o.dylib" filetype for dynamic_library product', () => { - var target = proj.addTarget(TARGET_NAME, 'dynamic_library'); + const target = proj.addTarget(TARGET_NAME, 'dynamic_library'); assert.ok(target); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.productReference); - var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + const productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; assert.ok(productFile); assert.ok(productFile.explicitFileType); assert.equal(productFile.explicitFileType, '"compiled.mach-o.dylib"'); - }); it('should have "wrapper.framework" filetype for framework product', () => { - var target = proj.addTarget(TARGET_NAME, 'framework'); + const target = proj.addTarget(TARGET_NAME, 'framework'); assert.ok(target); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.productReference); - var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + const productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; assert.ok(productFile); assert.ok(productFile.explicitFileType); assert.equal(productFile.explicitFileType, '"wrapper.framework"'); - }); it('should have "archive.ar" filetype for static_library product', () => { - var target = proj.addTarget(TARGET_NAME, 'static_library'); + const target = proj.addTarget(TARGET_NAME, 'static_library'); assert.ok(target); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.productReference); - var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + const productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; assert.ok(productFile); assert.ok(productFile.explicitFileType); assert.equal(productFile.explicitFileType, '"archive.ar"'); - }); it('should have "wrapper.cfbundle" filetype for unit_test_bundle product', () => { - var target = proj.addTarget(TARGET_NAME, 'unit_test_bundle'); + const target = proj.addTarget(TARGET_NAME, 'unit_test_bundle'); assert.ok(target); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.productReference); - var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + const productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; assert.ok(productFile); assert.ok(productFile.explicitFileType); assert.equal(productFile.explicitFileType, '"wrapper.cfbundle"'); - }); it('should have "wrapper.application" filetype for watch_app product', () => { - var target = proj.addTarget(TARGET_NAME, 'watch_app'); + const target = proj.addTarget(TARGET_NAME, 'watch_app'); assert.ok(target); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.productReference); - var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + const productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; assert.ok(productFile); assert.ok(productFile.explicitFileType); assert.equal(productFile.explicitFileType, '"wrapper.application"'); - }); it('should have "wrapper.application" filetype for watch2_app product', () => { - var target = proj.addTarget(TARGET_NAME, 'watch2_app'); + const target = proj.addTarget(TARGET_NAME, 'watch2_app'); assert.ok(target); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.productReference); - var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + const productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; assert.ok(productFile); assert.ok(productFile.explicitFileType); assert.equal(productFile.explicitFileType, '"wrapper.application"'); - }); it('should have "wrapper.app-extension" filetype for watch_extension product', () => { - var target = proj.addTarget(TARGET_NAME, 'watch_extension'); + const target = proj.addTarget(TARGET_NAME, 'watch_extension'); assert.ok(target); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.productReference); - var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + const productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; assert.ok(productFile); assert.ok(productFile.explicitFileType); assert.equal(productFile.explicitFileType, '"wrapper.app-extension"'); - }); it('should have "wrapper.app-extension" filetype for watch2_extension product', () => { - var target = proj.addTarget(TARGET_NAME, 'watch2_extension'); + const target = proj.addTarget(TARGET_NAME, 'watch2_extension'); assert.ok(target); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.productReference); - var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + const productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; assert.ok(productFile); assert.ok(productFile.explicitFileType); assert.equal(productFile.explicitFileType, '"wrapper.app-extension"'); - }); }); diff --git a/test/addTargetDependency.js b/test/addTargetDependency.js index c8d77f7..d872e73 100644 --- a/test/addTargetDependency.js +++ b/test/addTargetDependency.js @@ -19,28 +19,27 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } - describe('addTargetDependency', () => { beforeEach(() => { proj.hash = cleanHash(); }); it('should return undefined when no target specified', () => { - var buildPhase = proj.addTargetDependency(); + const buildPhase = proj.addTargetDependency(); assert.ok(typeof buildPhase === 'undefined'); }); it('should throw when target not found in nativeTargetsSection', () => { - assert.throws(function() { + assert.throws(function () { proj.addTargetDependency('invalidTarget'); }, function (error) { return (error instanceof Error) && /Invalid target/i.test(error); @@ -48,7 +47,7 @@ describe('addTargetDependency', () => { }); it('should throw when any dependency target not found in nativeTargetsSection', () => { - assert.throws(function() { + assert.throws(function () { proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['invalidTarget']); }, function (error) { return (error instanceof Error) && /Invalid target/i.test(error); @@ -56,184 +55,176 @@ describe('addTargetDependency', () => { }); it('should return the pbxTarget', () => { - var target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54']); + const target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54']); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.target); }); it('should add targetDependencies to target', () => { - var targetInPbxProj = proj.pbxNativeTargetSection()['1D6058900D05DD3D006BFB55']; + const targetInPbxProj = proj.pbxNativeTargetSection()['1D6058900D05DD3D006BFB55']; assert.deepEqual(targetInPbxProj.dependencies, []); - var target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; - assert.deepEqual(targetInPbxProj.dependencies, target.dependencies) + const target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; + assert.deepEqual(targetInPbxProj.dependencies, target.dependencies); }); it('should not modify native target dependencies if PBXTargetDependency object does not exist', () => { - delete proj.hash.project.objects['PBXTargetDependency']; + delete proj.hash.project.objects.PBXTargetDependency; - var numDependenciesBefore = proj.pbxNativeTargetSection()['1D6058900D05DD3D006BFB54'].dependencies.length; + const numDependenciesBefore = proj.pbxNativeTargetSection()['1D6058900D05DD3D006BFB54'].dependencies.length; proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54']); - var numDependenciesAfter = proj.pbxNativeTargetSection()['1D6058900D05DD3D006BFB54'].dependencies.length; + const numDependenciesAfter = proj.pbxNativeTargetSection()['1D6058900D05DD3D006BFB54'].dependencies.length; assert.equal(numDependenciesBefore, numDependenciesAfter); - }); it('should not modify native target dependencies if PBXContainerItemProxy object does not exist', () => { - delete proj.hash.project.objects['PBXContainerItemProxy']; + delete proj.hash.project.objects.PBXContainerItemProxy; - var numDependenciesBefore = proj.pbxNativeTargetSection()['1D6058900D05DD3D006BFB54'].dependencies.length; + const numDependenciesBefore = proj.pbxNativeTargetSection()['1D6058900D05DD3D006BFB54'].dependencies.length; proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54']); - var numDependenciesAfter = proj.pbxNativeTargetSection()['1D6058900D05DD3D006BFB54'].dependencies.length; + const numDependenciesAfter = proj.pbxNativeTargetSection()['1D6058900D05DD3D006BFB54'].dependencies.length; assert.equal(numDependenciesBefore, numDependenciesAfter); - }); it('should create a PBXTargetDependency for each dependency target', () => { - var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'], - target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; + const pbxTargetDependencySection = proj.hash.project.objects.PBXTargetDependency; + const target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; - for (var index = 0; index < target.dependencies.length; index++) { - var dependency = target.dependencies[index].value; + for (let index = 0; index < target.dependencies.length; index++) { + const dependency = target.dependencies[index].value; assert.ok(pbxTargetDependencySection[dependency]); } - }); it('should set right comment for each target dependency', () => { - var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'], - target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; + const pbxTargetDependencySection = proj.hash.project.objects.PBXTargetDependency; + const target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; - for (var index = 0; index < target.dependencies.length; index++) { - var dependencyCommentKey = target.dependencies[index].value + '_comment'; + for (let index = 0; index < target.dependencies.length; index++) { + const dependencyCommentKey = target.dependencies[index].value + '_comment'; assert.equal(pbxTargetDependencySection[dependencyCommentKey], 'PBXTargetDependency'); } - }); it('should set right comment for each dependency target', () => { - var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'], - target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; + const pbxTargetDependencySection = proj.hash.project.objects.PBXTargetDependency; + const target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; - for (var index = 0; index < target.dependencies.length; index++) { - var dependencyTargetUuid = target.dependencies[index].value; - var targetDependencyUuid = pbxTargetDependencySection[dependencyTargetUuid].target; + for (let index = 0; index < target.dependencies.length; index++) { + const dependencyTargetUuid = target.dependencies[index].value; + const targetDependencyUuid = pbxTargetDependencySection[dependencyTargetUuid].target; if (pbxTargetDependencySection[dependencyTargetUuid].target) { - var targetCommentKey = targetDependencyUuid + '_comment'; + const targetCommentKey = targetDependencyUuid + '_comment'; assert.equal(pbxTargetDependencySection[dependencyTargetUuid].target_comment, proj.pbxNativeTargetSection()[targetCommentKey]); } } - }); it('should create a PBXContainerItemProxy for each PBXTargetDependency', () => { - var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'], - pbxContainerItemProxySection = proj.hash.project.objects['PBXContainerItemProxy'], - target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; + const pbxTargetDependencySection = proj.hash.project.objects.PBXTargetDependency; + const pbxContainerItemProxySection = proj.hash.project.objects.PBXContainerItemProxy; + const target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; - for (var index = 0; index < target.dependencies.length; index++) { - var dependency = target.dependencies[index].value, - targetProxy = pbxTargetDependencySection[dependency]['targetProxy']; + for (let index = 0; index < target.dependencies.length; index++) { + const dependency = target.dependencies[index].value; + const targetProxy = pbxTargetDependencySection[dependency].targetProxy; assert.ok(pbxContainerItemProxySection[targetProxy]); } - }); it('should set right comment for each container item proxy', () => { - var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'], - pbxContainerItemProxySection = proj.hash.project.objects['PBXContainerItemProxy'], - target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; + const pbxTargetDependencySection = proj.hash.project.objects.PBXTargetDependency; + const pbxContainerItemProxySection = proj.hash.project.objects.PBXContainerItemProxy; + const target = proj.addTargetDependency('1D6058900D05DD3D006BFB54', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; - for (var index = 0; index < target.dependencies.length; index++) { - var dependencyTargetUuid = target.dependencies[index].value; + for (let index = 0; index < target.dependencies.length; index++) { + const dependencyTargetUuid = target.dependencies[index].value; - var proxyUuid = pbxTargetDependencySection[dependencyTargetUuid].targetProxy; + const proxyUuid = pbxTargetDependencySection[dependencyTargetUuid].targetProxy; if (proxyUuid) { assert.ok(pbxTargetDependencySection[dependencyTargetUuid].targetProxy_comment, 'PBXContainerItemProxy'); assert.ok(pbxContainerItemProxySection[proxyUuid]); - var proxyCommentKey = proxyUuid + '_comment'; + const proxyCommentKey = proxyUuid + '_comment'; assert.ok(pbxContainerItemProxySection[proxyCommentKey]); } } - }); it('should set each PBXContainerItemProxy`s remoteGlobalIDString correctly', () => { - var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'], - pbxContainerItemProxySection = proj.hash.project.objects['PBXContainerItemProxy'], - target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target, - remoteGlobalIDStrings = []; + const pbxTargetDependencySection = proj.hash.project.objects.PBXTargetDependency; + const pbxContainerItemProxySection = proj.hash.project.objects.PBXContainerItemProxy; + const target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; + const remoteGlobalIDStrings = []; - for (var index = 0; index < target.dependencies.length; index++) { - var dependency = target.dependencies[index].value, - targetProxy = pbxTargetDependencySection[dependency]['targetProxy']; + for (let index = 0; index < target.dependencies.length; index++) { + const dependency = target.dependencies[index].value; + const targetProxy = pbxTargetDependencySection[dependency].targetProxy; - remoteGlobalIDStrings.push(pbxContainerItemProxySection[targetProxy]['remoteGlobalIDString']); + remoteGlobalIDStrings.push(pbxContainerItemProxySection[targetProxy].remoteGlobalIDString); } assert.deepEqual(remoteGlobalIDStrings, ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']); }); it('should set each PBXContainerItemProxy`s remoteInfo correctly', () => { - var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'], - pbxContainerItemProxySection = proj.hash.project.objects['PBXContainerItemProxy'], - target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target, - remoteInfoArray = []; + const pbxTargetDependencySection = proj.hash.project.objects.PBXTargetDependency; + const pbxContainerItemProxySection = proj.hash.project.objects.PBXContainerItemProxy; + const target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; + const remoteInfoArray = []; - for (var index = 0; index < target.dependencies.length; index++) { - var dependency = target.dependencies[index].value, - targetProxy = pbxTargetDependencySection[dependency]['targetProxy']; + for (let index = 0; index < target.dependencies.length; index++) { + const dependency = target.dependencies[index].value; + const targetProxy = pbxTargetDependencySection[dependency].targetProxy; - remoteInfoArray.push(pbxContainerItemProxySection[targetProxy]['remoteInfo']); + remoteInfoArray.push(pbxContainerItemProxySection[targetProxy].remoteInfo); } assert.deepEqual(remoteInfoArray, ['"KitchenSinktablet"', '"TestApp"']); }); it('should set each PBXContainerItemProxy`s containerPortal correctly', () => { - var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'], - pbxContainerItemProxySection = proj.hash.project.objects['PBXContainerItemProxy'], - target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; + const pbxTargetDependencySection = proj.hash.project.objects.PBXTargetDependency; + const pbxContainerItemProxySection = proj.hash.project.objects.PBXContainerItemProxy; + const target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; - for (var index = 0; index < target.dependencies.length; index++) { - var dependency = target.dependencies[index].value, - targetProxy = pbxTargetDependencySection[dependency]['targetProxy']; + for (let index = 0; index < target.dependencies.length; index++) { + const dependency = target.dependencies[index].value; + const targetProxy = pbxTargetDependencySection[dependency].targetProxy; - assert.equal(pbxContainerItemProxySection[targetProxy]['containerPortal'], proj.hash.project['rootObject']); + assert.equal(pbxContainerItemProxySection[targetProxy].containerPortal, proj.hash.project.rootObject); } - }); it('should set each PBXContainerItemProxy`s containerPortal_comment correctly', () => { - var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'], - pbxContainerItemProxySection = proj.hash.project.objects['PBXContainerItemProxy'], - target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; + const pbxTargetDependencySection = proj.hash.project.objects.PBXTargetDependency; + const pbxContainerItemProxySection = proj.hash.project.objects.PBXContainerItemProxy; + const target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; - for (var index = 0; index < target.dependencies.length; index++) { - var dependency = target.dependencies[index].value, - targetProxy = pbxTargetDependencySection[dependency]['targetProxy']; + for (let index = 0; index < target.dependencies.length; index++) { + const dependency = target.dependencies[index].value; + const targetProxy = pbxTargetDependencySection[dependency].targetProxy; - assert.equal(pbxContainerItemProxySection[targetProxy]['containerPortal_comment'], proj.hash.project['rootObject_comment']); + assert.equal(pbxContainerItemProxySection[targetProxy].containerPortal_comment, proj.hash.project.rootObject_comment); } }); it('should set each PBXContainerItemProxy`s proxyType correctly', () => { - var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'], - pbxContainerItemProxySection = proj.hash.project.objects['PBXContainerItemProxy'], - target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; + const pbxTargetDependencySection = proj.hash.project.objects.PBXTargetDependency; + const pbxContainerItemProxySection = proj.hash.project.objects.PBXContainerItemProxy; + const target = proj.addTargetDependency('1D6058900D05DD3D006BFB55', ['1D6058900D05DD3D006BFB54', '1D6058900D05DD3D006BFB55']).target; - for (var index = 0; index < target.dependencies.length; index++) { - var dependency = target.dependencies[index].value, - targetProxy = pbxTargetDependencySection[dependency]['targetProxy']; + for (let index = 0; index < target.dependencies.length; index++) { + const dependency = target.dependencies[index].value; + const targetProxy = pbxTargetDependencySection[dependency].targetProxy; - assert.equal(pbxContainerItemProxySection[targetProxy]['proxyType'], 1); + assert.equal(pbxContainerItemProxySection[targetProxy].proxyType, 1); } }); }); diff --git a/test/addToPbxFileReferenceSection.js b/test/addToPbxFileReferenceSection.js index eb38ee4..cfb1a8d 100644 --- a/test/addToPbxFileReferenceSection.js +++ b/test/addToPbxFileReferenceSection.js @@ -20,24 +20,23 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var jsonProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(jsonProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - myProj = new pbx('.'); +const jsonProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(jsonProject); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const myProj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } - describe('addToPbxFileReferenceSection function', () => { beforeEach(() => { myProj.hash = cleanHash(); }); it('should add file and comment to fileReferenceSection', () => { - var file = new pbxFile('file.m'); + const file = new PBXFile('file.m'); file.fileRef = myProj.generateUuid(); myProj.addToPbxFileReferenceSection(file); @@ -48,13 +47,13 @@ describe('addToPbxFileReferenceSection function', () => { assert.equal(myProj.pbxFileReferenceSection()[file.fileRef].path, '"file.m"'); assert.equal(myProj.pbxFileReferenceSection()[file.fileRef].sourceTree, '""'); assert.equal(myProj.pbxFileReferenceSection()[file.fileRef].fileEncoding, 4); - assert.equal(myProj.pbxFileReferenceSection()[file.fileRef + "_comment"], 'file.m'); + assert.equal(myProj.pbxFileReferenceSection()[file.fileRef + '_comment'], 'file.m'); }); it('should add file with preset explicitFileType to fileReferenceSection correctly', () => { - var appexFile = { fileRef: myProj.generateUuid(), isa: 'PBXFileReference', explicitFileType: '"wrapper.app-extension"', path: "WatchKit Extension.appex"}; + const appexFile = { fileRef: myProj.generateUuid(), isa: 'PBXFileReference', explicitFileType: '"wrapper.app-extension"', path: 'WatchKit Extension.appex' }; - myProj.addToPbxFileReferenceSection(appexFile) + myProj.addToPbxFileReferenceSection(appexFile); assert.equal(myProj.pbxFileReferenceSection()[appexFile.fileRef].isa, 'PBXFileReference'); assert.equal(myProj.pbxFileReferenceSection()[appexFile.fileRef].explicitFileType, '"wrapper.app-extension"'); @@ -62,9 +61,9 @@ describe('addToPbxFileReferenceSection function', () => { }); it('should add file with preset includeInIndex to fileReferenceSection correctly', () => { - var appexFile = { fileRef: myProj.generateUuid(), isa: 'PBXFileReference', includeInIndex: 0, path: "WatchKit Extension.appex"}; + const appexFile = { fileRef: myProj.generateUuid(), isa: 'PBXFileReference', includeInIndex: 0, path: 'WatchKit Extension.appex' }; - myProj.addToPbxFileReferenceSection(appexFile) + myProj.addToPbxFileReferenceSection(appexFile); assert.equal(myProj.pbxFileReferenceSection()[appexFile.fileRef].isa, 'PBXFileReference'); assert.equal(myProj.pbxFileReferenceSection()[appexFile.fileRef].includeInIndex, 0); @@ -72,9 +71,9 @@ describe('addToPbxFileReferenceSection function', () => { }); it('should add file with preset sourceTree to fileReferenceSection correctly', () => { - var appexFile = { fileRef: myProj.generateUuid(), isa: 'PBXFileReference', sourceTree: 'BUILT_PRODUCTS_DIR', path: "WatchKit Extension.appex"}; + const appexFile = { fileRef: myProj.generateUuid(), isa: 'PBXFileReference', sourceTree: 'BUILT_PRODUCTS_DIR', path: 'WatchKit Extension.appex' }; - myProj.addToPbxFileReferenceSection(appexFile) + myProj.addToPbxFileReferenceSection(appexFile); assert.equal(myProj.pbxFileReferenceSection()[appexFile.fileRef].isa, 'PBXFileReference'); assert.equal(myProj.pbxFileReferenceSection()[appexFile.fileRef].sourceTree, 'BUILT_PRODUCTS_DIR'); diff --git a/test/addWatch2App.js b/test/addWatch2App.js index c083cf0..2d10a4a 100644 --- a/test/addWatch2App.js +++ b/test/addWatch2App.js @@ -19,29 +19,28 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } -var TARGET_NAME = 'TestWatchApp', - TARGET_TYPE = 'watch2_app', - TARGET_SUBFOLDER_NAME = 'TestWatchAppFiles'; - +const TARGET_NAME = 'TestWatchApp'; +const TARGET_TYPE = 'watch2_app'; +const TARGET_SUBFOLDER_NAME = 'TestWatchAppFiles'; describe('addWatchApp', () => { beforeEach(() => { proj.hash = cleanHash(); }); it('should create a new watch2 app target with the correct product type', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -55,13 +54,12 @@ describe('addWatchApp', () => { assert.ok(target.pbxNativeTarget.dependencies); assert.equal(target.pbxNativeTarget.productType, '"com.apple.product-type.application.watchapp2"'); - }); it('should create a new watch2 app target with the correct product type, without needing a subfolder name', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -75,31 +73,30 @@ describe('addWatchApp', () => { assert.ok(target.pbxNativeTarget.dependencies); assert.equal(target.pbxNativeTarget.productType, '"com.apple.product-type.application.watchapp2"'); - }); it('should create a new watch2 app target and add source, framework, resource and header files and the corresponding build phases', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME), - options = { 'target' : target.uuid }; + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); + const options = { target: target.uuid }; - var sourceFile = proj.addSourceFile('Plugins/file.m', options), - sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid), - resourceFile = proj.addResourceFile('assets.bundle', options), - resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid), - frameworkFile = proj.addFramework('libsqlite3.dylib', options), - frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid), - headerFile = proj.addHeaderFile('file.h', options); + const sourceFile = proj.addSourceFile('Plugins/file.m', options); + const sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid); + const resourceFile = proj.addResourceFile('assets.bundle', options); + const resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid); + const frameworkFile = proj.addFramework('libsqlite3.dylib', options); + const frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid); + const headerFile = proj.addHeaderFile('file.h', options); assert.ok(sourcePhase); assert.ok(resourcePhase); assert.ok(frameworkPhase); - assert.equal(sourceFile.constructor, pbxFile); - assert.equal(resourceFile.constructor, pbxFile); - assert.equal(frameworkFile.constructor, pbxFile); - assert.equal(headerFile.constructor, pbxFile); + assert.equal(sourceFile.constructor, PBXFile); + assert.equal(resourceFile.constructor, PBXFile); + assert.equal(frameworkFile.constructor, PBXFile); + assert.equal(headerFile.constructor, PBXFile); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -111,13 +108,12 @@ describe('addWatchApp', () => { assert.ok(target.pbxNativeTarget.buildPhases); assert.ok(target.pbxNativeTarget.buildRules); assert.ok(target.pbxNativeTarget.dependencies); - }); it('should create a new watch2 app target and add watch build phase', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -132,7 +128,7 @@ describe('addWatchApp', () => { assert.equal(target.pbxNativeTarget.productType, '"com.apple.product-type.application.watchapp2"'); - var buildPhase = proj.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed Watch Content', target.uuid); + const buildPhase = proj.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed Watch Content', target.uuid); assert.ok(buildPhase); assert.ok(buildPhase.files); @@ -140,28 +136,26 @@ describe('addWatchApp', () => { assert.ok(buildPhase.dstPath); assert.equal(buildPhase.dstPath, '"$(CONTENTS_FOLDER_PATH)/Watch"'); assert.equal(buildPhase.dstSubfolderSpec, 16); - }); it('should create a new watch2 app with appropriate target extension', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE); - var buildPhase = proj.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed Watch Content', target.uuid); + const buildPhase = proj.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed Watch Content', target.uuid); - var buildPhaseFile = buildPhase.files[0]; + const buildPhaseFile = buildPhase.files[0]; assert.ok(buildPhaseFile.value); - var buildPhaseFileSection = proj.pbxBuildFileSection()[buildPhaseFile.value]; + const buildPhaseFileSection = proj.pbxBuildFileSection()[buildPhaseFile.value]; assert.ok(buildPhaseFileSection); assert.ok(buildPhaseFileSection.fileRef); - var buildPhaseFileRef = proj.pbxFileReferenceSection()[buildPhaseFileSection.fileRef]; + const buildPhaseFileRef = proj.pbxFileReferenceSection()[buildPhaseFileSection.fileRef]; assert.ok(buildPhaseFileRef); assert.ok(buildPhaseFileRef.name); assert.ok(buildPhaseFileRef.path); - var quotedTargetPath = "\"" + TARGET_NAME + ".app\""; + const quotedTargetPath = '"' + TARGET_NAME + '.app"'; assert.equal(buildPhaseFileRef.name, quotedTargetPath); assert.equal(buildPhaseFileRef.path, quotedTargetPath); - }); }); diff --git a/test/addWatch2Extension.js b/test/addWatch2Extension.js index ed826df..c157fbd 100644 --- a/test/addWatch2Extension.js +++ b/test/addWatch2Extension.js @@ -19,29 +19,28 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } -var TARGET_NAME = 'TestWatchExtension', - TARGET_TYPE = 'watch2_extension', - TARGET_SUBFOLDER_NAME = 'TestWatchExtensionFiles'; - +const TARGET_NAME = 'TestWatchExtension'; +const TARGET_TYPE = 'watch2_extension'; +const TARGET_SUBFOLDER_NAME = 'TestWatchExtensionFiles'; describe('addWatchExtension', () => { beforeEach(() => { proj.hash = cleanHash(); }); it('should create a new watch2 extension target with the correct product type', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -54,31 +53,30 @@ describe('addWatchExtension', () => { assert.ok(target.pbxNativeTarget.buildRules); assert.ok(target.pbxNativeTarget.dependencies); assert.equal(target.pbxNativeTarget.productType, '"com.apple.product-type.watchkit2-extension"'); - }); it('should create a new watch2 extension target and add source, framework, resource and header files and the corresponding build phases', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME), - options = { 'target' : target.uuid }; + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); + const options = { target: target.uuid }; - var sourceFile = proj.addSourceFile('Plugins/file.m', options), - sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid), - resourceFile = proj.addResourceFile('assets.bundle', options), - resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid), - frameworkFile = proj.addFramework('libsqlite3.dylib', options), - frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid), - headerFile = proj.addHeaderFile('file.h', options); + const sourceFile = proj.addSourceFile('Plugins/file.m', options); + const sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid); + const resourceFile = proj.addResourceFile('assets.bundle', options); + const resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid); + const frameworkFile = proj.addFramework('libsqlite3.dylib', options); + const frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid); + const headerFile = proj.addHeaderFile('file.h', options); assert.ok(sourcePhase); assert.ok(resourcePhase); assert.ok(frameworkPhase); - assert.equal(sourceFile.constructor, pbxFile); - assert.equal(resourceFile.constructor, pbxFile); - assert.equal(frameworkFile.constructor, pbxFile); - assert.equal(headerFile.constructor, pbxFile); + assert.equal(sourceFile.constructor, PBXFile); + assert.equal(resourceFile.constructor, PBXFile); + assert.equal(frameworkFile.constructor, PBXFile); + assert.equal(headerFile.constructor, PBXFile); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -90,13 +88,12 @@ describe('addWatchExtension', () => { assert.ok(target.pbxNativeTarget.buildPhases); assert.ok(target.pbxNativeTarget.buildRules); assert.ok(target.pbxNativeTarget.dependencies); - }); it('should not create a new watch2 extension build phase if no watch2 app exists', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -109,30 +106,28 @@ describe('addWatchExtension', () => { assert.ok(target.pbxNativeTarget.buildRules); assert.ok(target.pbxNativeTarget.dependencies); - var buildPhase = proj.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed App Extensions', target.uuid); + const buildPhase = proj.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed App Extensions', target.uuid); assert.ok(!buildPhase); - }); it('should create a new watch2 extension build phase if watch2 app exists', () => { proj.addTarget('TestWatchApp', 'watch2_app'); - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE); - var buildPhase = proj.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed App Extensions', target.uuid); + const buildPhase = proj.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed App Extensions', target.uuid); assert.ok(buildPhase); assert.ok(buildPhase.files); assert.equal(buildPhase.files.length, 1); assert.ok(buildPhase.dstPath); assert.equal(buildPhase.dstSubfolderSpec, 13); - }); it('should create a new watch2 extension and add to existing watch2 app build phase and dependency', () => { - var watchApp = proj.addTarget('TestWatchApp', 'watch2_app'); + const watchApp = proj.addTarget('TestWatchApp', 'watch2_app'); - var nativeTargets = proj.pbxNativeTargetSection(); + const nativeTargets = proj.pbxNativeTargetSection(); assert.equal(nativeTargets[watchApp.uuid].buildPhases.length, 0); assert.equal(nativeTargets[watchApp.uuid].dependencies.length, 0); @@ -141,49 +136,46 @@ describe('addWatchExtension', () => { assert.equal(nativeTargets[watchApp.uuid].buildPhases.length, 1); assert.equal(nativeTargets[watchApp.uuid].dependencies.length, 1); - }); it('should not modify watch2 target unless adding watch2 extension', () => { - var watchApp = proj.addTarget('TestWatchApp', 'watch2_app'); + const watchApp = proj.addTarget('TestWatchApp', 'watch2_app'); - var nativeTargets = proj.pbxNativeTargetSection(); + const nativeTargets = proj.pbxNativeTargetSection(); assert.equal(nativeTargets[watchApp.uuid].buildPhases.length, 0); assert.equal(nativeTargets[watchApp.uuid].dependencies.length, 0); - proj.addTarget(TARGET_NAME, "app_extension"); + proj.addTarget(TARGET_NAME, 'app_extension'); assert.equal(nativeTargets[watchApp.uuid].buildPhases.length, 0); assert.equal(nativeTargets[watchApp.uuid].dependencies.length, 0); - proj.addTarget(TARGET_NAME, "watch_extension"); + proj.addTarget(TARGET_NAME, 'watch_extension'); assert.equal(nativeTargets[watchApp.uuid].buildPhases.length, 0); assert.equal(nativeTargets[watchApp.uuid].dependencies.length, 0); - }); it('should create a new watch2 extension with appropriate target extension', () => { proj.addTarget('TestWatchApp', 'watch2_app'); - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE); - var buildPhase = proj.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed App Extensions', target.uuid); + const buildPhase = proj.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed App Extensions', target.uuid); - var buildPhaseFile = buildPhase.files[0]; + const buildPhaseFile = buildPhase.files[0]; assert.ok(buildPhaseFile.value); - var buildPhaseFileSection = proj.pbxBuildFileSection()[buildPhaseFile.value]; + const buildPhaseFileSection = proj.pbxBuildFileSection()[buildPhaseFile.value]; assert.ok(buildPhaseFileSection); assert.ok(buildPhaseFileSection.fileRef); - var buildPhaseFileRef = proj.pbxFileReferenceSection()[buildPhaseFileSection.fileRef]; + const buildPhaseFileRef = proj.pbxFileReferenceSection()[buildPhaseFileSection.fileRef]; assert.ok(buildPhaseFileRef); assert.ok(buildPhaseFileRef.name); assert.ok(buildPhaseFileRef.path); - var quotedTargetPath = "\"" + TARGET_NAME + ".appex\""; + const quotedTargetPath = '"' + TARGET_NAME + '.appex"'; assert.equal(buildPhaseFileRef.name, quotedTargetPath); assert.equal(buildPhaseFileRef.path, quotedTargetPath); - }); }); diff --git a/test/addWatchApp.js b/test/addWatchApp.js index 8646618..21389d3 100644 --- a/test/addWatchApp.js +++ b/test/addWatchApp.js @@ -19,29 +19,28 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } -var TARGET_NAME = 'TestWatchApp', - TARGET_TYPE = 'watch_app', - TARGET_SUBFOLDER_NAME = 'TestWatchAppFiles'; - +const TARGET_NAME = 'TestWatchApp'; +const TARGET_TYPE = 'watch_app'; +const TARGET_SUBFOLDER_NAME = 'TestWatchAppFiles'; describe('addWatchApp', () => { beforeEach(() => { proj.hash = cleanHash(); }); it('should create a new watch app target with the correct product type', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -55,13 +54,12 @@ describe('addWatchApp', () => { assert.ok(target.pbxNativeTarget.dependencies); assert.equal(target.pbxNativeTarget.productType, '"com.apple.product-type.application.watchapp"'); - }); it('should create a new watch app target with the correct product type, without needing a subfolder name', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -75,31 +73,30 @@ describe('addWatchApp', () => { assert.ok(target.pbxNativeTarget.dependencies); assert.equal(target.pbxNativeTarget.productType, '"com.apple.product-type.application.watchapp"'); - }); it('should create a new watch app target and add source, framework, resource and header files and the corresponding build phases', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME), - options = { 'target' : target.uuid }; + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); + const options = { target: target.uuid }; - var sourceFile = proj.addSourceFile('Plugins/file.m', options), - sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid), - resourceFile = proj.addResourceFile('assets.bundle', options), - resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid), - frameworkFile = proj.addFramework('libsqlite3.dylib', options), - frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid), - headerFile = proj.addHeaderFile('file.h', options); + const sourceFile = proj.addSourceFile('Plugins/file.m', options); + const sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid); + const resourceFile = proj.addResourceFile('assets.bundle', options); + const resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid); + const frameworkFile = proj.addFramework('libsqlite3.dylib', options); + const frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid); + const headerFile = proj.addHeaderFile('file.h', options); assert.ok(sourcePhase); assert.ok(resourcePhase); assert.ok(frameworkPhase); - assert.equal(sourceFile.constructor, pbxFile); - assert.equal(resourceFile.constructor, pbxFile); - assert.equal(frameworkFile.constructor, pbxFile); - assert.equal(headerFile.constructor, pbxFile); + assert.equal(sourceFile.constructor, PBXFile); + assert.equal(resourceFile.constructor, PBXFile); + assert.equal(frameworkFile.constructor, PBXFile); + assert.equal(headerFile.constructor, PBXFile); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -111,6 +108,5 @@ describe('addWatchApp', () => { assert.ok(target.pbxNativeTarget.buildPhases); assert.ok(target.pbxNativeTarget.buildRules); assert.ok(target.pbxNativeTarget.dependencies); - }); }); diff --git a/test/addWatchExtension.js b/test/addWatchExtension.js index c9c141d..09a296c 100644 --- a/test/addWatchExtension.js +++ b/test/addWatchExtension.js @@ -19,29 +19,28 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } -var TARGET_NAME = 'TestWatchExtension', - TARGET_TYPE = 'watch_extension', - TARGET_SUBFOLDER_NAME = 'TestWatchExtensionFiles'; - +const TARGET_NAME = 'TestWatchExtension'; +const TARGET_TYPE = 'watch_extension'; +const TARGET_SUBFOLDER_NAME = 'TestWatchExtensionFiles'; describe('addWatchExtension', () => { beforeEach(() => { proj.hash = cleanHash(); }); it('should create a new watch extension target', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -53,31 +52,30 @@ describe('addWatchExtension', () => { assert.ok(target.pbxNativeTarget.buildPhases); assert.ok(target.pbxNativeTarget.buildRules); assert.ok(target.pbxNativeTarget.dependencies); - }); it('should create a new watch extension target and add source, framework, resource and header files and the corresponding build phases', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME), - options = { 'target' : target.uuid }; + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE, TARGET_SUBFOLDER_NAME); + const options = { target: target.uuid }; - var sourceFile = proj.addSourceFile('Plugins/file.m', options), - sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid), - resourceFile = proj.addResourceFile('assets.bundle', options), - resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid), - frameworkFile = proj.addFramework('libsqlite3.dylib', options), - frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid), - headerFile = proj.addHeaderFile('file.h', options); + const sourceFile = proj.addSourceFile('Plugins/file.m', options); + const sourcePhase = proj.addBuildPhase([], 'PBXSourcesBuildPhase', 'Sources', target.uuid); + const resourceFile = proj.addResourceFile('assets.bundle', options); + const resourcePhase = proj.addBuildPhase([], 'PBXResourcesBuildPhase', 'Resources', target.uuid); + const frameworkFile = proj.addFramework('libsqlite3.dylib', options); + const frameworkPhase = proj.addBuildPhase([], 'PBXFrameworkBuildPhase', 'Frameworks', target.uuid); + const headerFile = proj.addHeaderFile('file.h', options); assert.ok(sourcePhase); assert.ok(resourcePhase); assert.ok(frameworkPhase); - assert.equal(sourceFile.constructor, pbxFile); - assert.equal(resourceFile.constructor, pbxFile); - assert.equal(frameworkFile.constructor, pbxFile); - assert.equal(headerFile.constructor, pbxFile); + assert.equal(sourceFile.constructor, PBXFile); + assert.equal(resourceFile.constructor, PBXFile); + assert.equal(frameworkFile.constructor, PBXFile); + assert.equal(headerFile.constructor, PBXFile); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -89,13 +87,12 @@ describe('addWatchExtension', () => { assert.ok(target.pbxNativeTarget.buildPhases); assert.ok(target.pbxNativeTarget.buildRules); assert.ok(target.pbxNativeTarget.dependencies); - }); it('should not create a new watch extension build phase if no watch app exists', () => { - var target = proj.addTarget(TARGET_NAME, TARGET_TYPE); + const target = proj.addTarget(TARGET_NAME, TARGET_TYPE); - assert.ok(typeof target == 'object'); + assert.ok(typeof target === 'object'); assert.ok(target.uuid); assert.ok(target.pbxNativeTarget); assert.ok(target.pbxNativeTarget.isa); @@ -108,9 +105,8 @@ describe('addWatchExtension', () => { assert.ok(target.pbxNativeTarget.buildRules); assert.ok(target.pbxNativeTarget.dependencies); - var buildPhase = proj.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed App Extensions', target.uuid); + const buildPhase = proj.buildPhaseObject('PBXCopyFilesBuildPhase', 'Embed App Extensions', target.uuid); assert.ok(!buildPhase); - }); }); diff --git a/test/addXCConfigurationList.js b/test/addXCConfigurationList.js index 7a2d3c1..f19f429 100644 --- a/test/addXCConfigurationList.js +++ b/test/addXCConfigurationList.js @@ -19,99 +19,97 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - proj = new pbx('.'), - debugConfiguration = { - isa: 'XCBuildConfiguration', - buildSettings: { - GCC_PREPROCESSOR_DEFINITIONS: [ - '"DEBUG=1"', - '"$(inherited)"', - ], - INFOPLIST_FILE: "Info.Plist", - LD_RUNPATH_SEARCH_PATHS: '"$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"', - PRODUCT_NAME: '"${TARGET_NAME}"', - SKIP_INSTALL: 'YES' - }, - name: 'Debug' +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const proj = new PBXProject('.'); +const debugConfiguration = { + isa: 'XCBuildConfiguration', + buildSettings: { + GCC_PREPROCESSOR_DEFINITIONS: [ + '"DEBUG=1"', + '"$(inherited)"' + ], + INFOPLIST_FILE: 'Info.Plist', + LD_RUNPATH_SEARCH_PATHS: '"$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"', + PRODUCT_NAME: '"${TARGET_NAME}"', // eslint-disable-line no-template-curly-in-string + SKIP_INSTALL: 'YES' }, - releaseConfiguration = { - isa: 'XCBuildConfiguration', - buildSettings: { - INFOPLIST_FILE: "Info.Plist", - LD_RUNPATH_SEARCH_PATHS: '"$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"', - PRODUCT_NAME: '"${TARGET_NAME}"', - SKIP_INSTALL: 'YES' - }, - name: 'Release' - }; - -function cleanHash() { + name: 'Debug' +}; +const releaseConfiguration = { + isa: 'XCBuildConfiguration', + buildSettings: { + INFOPLIST_FILE: 'Info.Plist', + LD_RUNPATH_SEARCH_PATHS: '"$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"', + PRODUCT_NAME: '"${TARGET_NAME}"', // eslint-disable-line no-template-curly-in-string + SKIP_INSTALL: 'YES' + }, + name: 'Release' +}; + +function cleanHash () { return JSON.parse(fullProjectStr); } - describe('addXCConfigurationList', () => { beforeEach(() => { proj.hash = cleanHash(); }); it('should return an XCConfigurationList', () => { - var myProj = new pbx('test/parser/projects/full.pbxproj').parseSync(), - xcConfigurationList = myProj.addXCConfigurationList([debugConfiguration, releaseConfiguration], 'Release', 'XCConfigurationList Comment'); + const myProj = new PBXProject('test/parser/projects/full.pbxproj').parseSync(); + const xcConfigurationList = myProj.addXCConfigurationList([debugConfiguration, releaseConfiguration], 'Release', 'XCConfigurationList Comment'); assert.ok(typeof xcConfigurationList === 'object'); }); it('should set a uuid on the XCConfigurationList', () => { - var myProj = new pbx('test/parser/projects/full.pbxproj').parseSync(), - xcConfigurationList = myProj.addXCConfigurationList([debugConfiguration, releaseConfiguration], 'Release', 'XCConfigurationList Comment'); + const myProj = new PBXProject('test/parser/projects/full.pbxproj').parseSync(); + const xcConfigurationList = myProj.addXCConfigurationList([debugConfiguration, releaseConfiguration], 'Release', 'XCConfigurationList Comment'); assert.ok(xcConfigurationList.uuid); }); it('should add configurations to pbxBuildConfigurationSection', () => { - var myProj = new pbx('test/parser/projects/full.pbxproj').parseSync(), - pbxBuildConfigurationSection = myProj.pbxXCBuildConfigurationSection(), - xcConfigurationList = myProj.addXCConfigurationList([debugConfiguration, releaseConfiguration], 'Release', 'XCConfigurationList Comment'), - xcConfigurationListConfigurations = xcConfigurationList.xcConfigurationList.buildConfigurations; + const myProj = new PBXProject('test/parser/projects/full.pbxproj').parseSync(); + const pbxBuildConfigurationSection = myProj.pbxXCBuildConfigurationSection(); + const xcConfigurationList = myProj.addXCConfigurationList([debugConfiguration, releaseConfiguration], 'Release', 'XCConfigurationList Comment'); + const xcConfigurationListConfigurations = xcConfigurationList.xcConfigurationList.buildConfigurations; - for (var index = 0; index < xcConfigurationListConfigurations.length; index++) { - var configuration = xcConfigurationListConfigurations[index]; + for (let index = 0; index < xcConfigurationListConfigurations.length; index++) { + const configuration = xcConfigurationListConfigurations[index]; assert.ok(pbxBuildConfigurationSection[configuration.value]); } - }); it('should add XCConfigurationList to pbxXCConfigurationListSection', () => { - var myProj = new pbx('test/parser/projects/full.pbxproj').parseSync(), - pbxXCConfigurationListSection = myProj.pbxXCConfigurationList(); - xcConfigurationList = myProj.addXCConfigurationList([debugConfiguration, releaseConfiguration], 'Release', 'XCConfigurationList Comment'); + const myProj = new PBXProject('test/parser/projects/full.pbxproj').parseSync(); + const pbxXCConfigurationListSection = myProj.pbxXCConfigurationList(); + const xcConfigurationList = myProj.addXCConfigurationList([debugConfiguration, releaseConfiguration], 'Release', 'XCConfigurationList Comment'); assert.ok(pbxXCConfigurationListSection[xcConfigurationList.uuid]); }); it('should add XCConfigurationList object correctly', () => { - var myProj = new pbx('test/parser/projects/full.pbxproj').parseSync(), - pbxXCConfigurationListSection = myProj.pbxXCConfigurationList(); - xcConfigurationList = myProj.addXCConfigurationList([debugConfiguration, releaseConfiguration], 'Release', 'XCConfigurationList Comment'), - xcConfigurationListInPbx = pbxXCConfigurationListSection[xcConfigurationList.uuid]; + const myProj = new PBXProject('test/parser/projects/full.pbxproj').parseSync(); + const pbxXCConfigurationListSection = myProj.pbxXCConfigurationList(); + const xcConfigurationList = myProj.addXCConfigurationList([debugConfiguration, releaseConfiguration], 'Release', 'XCConfigurationList Comment'); + const xcConfigurationListInPbx = pbxXCConfigurationListSection[xcConfigurationList.uuid]; assert.deepEqual(xcConfigurationListInPbx, xcConfigurationList.xcConfigurationList); }); it('should add correct configurations to XCConfigurationList and to pbxBuildConfigurationSection', () => { - var myProj = new pbx('test/parser/projects/full.pbxproj').parseSync(), - pbxXCConfigurationListSection = myProj.pbxXCConfigurationList(); - pbxBuildConfigurationSection = myProj.pbxXCBuildConfigurationSection(), - xcConfigurationList = myProj.addXCConfigurationList([debugConfiguration, releaseConfiguration], 'Release', 'XCConfigurationList Comment'), - xcConfigurationListConfigurations = xcConfigurationList.xcConfigurationList.buildConfigurations, - expectedConfigurations = [], - xcConfigurationListInPbx = pbxXCConfigurationListSection[xcConfigurationList.uuid]; - - for (var index = 0; index < xcConfigurationListConfigurations.length; index++) { - var configuration = xcConfigurationListConfigurations[index]; + const myProj = new PBXProject('test/parser/projects/full.pbxproj').parseSync(); + const pbxXCConfigurationListSection = myProj.pbxXCConfigurationList(); + const pbxBuildConfigurationSection = myProj.pbxXCBuildConfigurationSection(); + const xcConfigurationList = myProj.addXCConfigurationList([debugConfiguration, releaseConfiguration], 'Release', 'XCConfigurationList Comment'); + const xcConfigurationListConfigurations = xcConfigurationList.xcConfigurationList.buildConfigurations; + const expectedConfigurations = []; + const xcConfigurationListInPbx = pbxXCConfigurationListSection[xcConfigurationList.uuid]; + + for (let index = 0; index < xcConfigurationListConfigurations.length; index++) { + const configuration = xcConfigurationListConfigurations[index]; expectedConfigurations.push(pbxBuildConfigurationSection[configuration.value]); } @@ -120,15 +118,14 @@ describe('addXCConfigurationList', () => { }); it('should set comments for pbxBuildConfigurations', () => { - var myProj = new pbx('test/parser/projects/full.pbxproj').parseSync(), - pbxBuildConfigurationSection = myProj.pbxXCBuildConfigurationSection(), - xcConfigurationList = myProj.addXCConfigurationList([debugConfiguration, releaseConfiguration], 'Release', 'XCConfigurationList Comment'), - xcConfigurationListConfigurations = xcConfigurationList.xcConfigurationList.buildConfigurations; + const myProj = new PBXProject('test/parser/projects/full.pbxproj').parseSync(); + const pbxBuildConfigurationSection = myProj.pbxXCBuildConfigurationSection(); + const xcConfigurationList = myProj.addXCConfigurationList([debugConfiguration, releaseConfiguration], 'Release', 'XCConfigurationList Comment'); + const xcConfigurationListConfigurations = xcConfigurationList.xcConfigurationList.buildConfigurations; - for (var index = 0; index < xcConfigurationListConfigurations.length; index++) { - var configuration = xcConfigurationListConfigurations[index]; + for (let index = 0; index < xcConfigurationListConfigurations.length; index++) { + const configuration = xcConfigurationListConfigurations[index]; assert.ok(pbxBuildConfigurationSection[configuration.value + '_comment']); } - }); }); diff --git a/test/dataModelDocument.js b/test/dataModelDocument.js index 9cf890a..b627c3c 100644 --- a/test/dataModelDocument.js +++ b/test/dataModelDocument.js @@ -20,91 +20,87 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var jsonProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(jsonProject), - path = require('path'), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'), - singleDataModelFilePath = __dirname + '/fixtures/single-data-model.xcdatamodeld', - multipleDataModelFilePath = __dirname + '/fixtures/multiple-data-model.xcdatamodeld'; - -function cleanHash() { +const jsonProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(jsonProject); +const path = require('node:path'); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); +const singleDataModelFilePath = path.join(__dirname, '/fixtures/single-data-model.xcdatamodeld'); +const multipleDataModelFilePath = path.join(__dirname, '/fixtures/multiple-data-model.xcdatamodeld'); + +function cleanHash () { return JSON.parse(fullProjectStr); } - describe('dataModelDocument', () => { beforeEach(() => { proj.hash = cleanHash(); }); it('should return a pbxFile', () => { - var newFile = proj.addDataModelDocument(singleDataModelFilePath); + const newFile = proj.addDataModelDocument(singleDataModelFilePath); - assert.equal(newFile.constructor, pbxFile); + assert.equal(newFile.constructor, PBXFile); }); it('should set a uuid on the pbxFile', () => { - var newFile = proj.addDataModelDocument(singleDataModelFilePath); + const newFile = proj.addDataModelDocument(singleDataModelFilePath); assert.ok(newFile.uuid); }); it('should set a fileRef on the pbxFile', () => { - var newFile = proj.addDataModelDocument(singleDataModelFilePath); + const newFile = proj.addDataModelDocument(singleDataModelFilePath); assert.ok(newFile.fileRef); }); it('should set an optional target on the pbxFile', () => { - var newFile = proj.addDataModelDocument(singleDataModelFilePath, undefined, { target: target }), - target = proj.findTargetKey('TestApp'); + const target = proj.findTargetKey('TestApp'); + const newFile = proj.addDataModelDocument(singleDataModelFilePath, undefined, { target }); assert.equal(newFile.target, target); }); it('should populate the PBXBuildFile section with 2 fields', () => { - var newFile = proj.addDataModelDocument(singleDataModelFilePath), - buildFileSection = proj.pbxBuildFileSection(), - bfsLength = Object.keys(buildFileSection).length; + const newFile = proj.addDataModelDocument(singleDataModelFilePath); + const buildFileSection = proj.pbxBuildFileSection(); + const bfsLength = Object.keys(buildFileSection).length; assert.equal(59 + 1, bfsLength); assert.ok(buildFileSection[newFile.uuid]); assert.ok(buildFileSection[newFile.uuid + '_comment']); - }); it('should populate the PBXFileReference section with 2 fields for single model document', () => { - var newFile = proj.addDataModelDocument(singleDataModelFilePath), - fileRefSection = proj.pbxFileReferenceSection(), - frsLength = Object.keys(fileRefSection).length; + const newFile = proj.addDataModelDocument(singleDataModelFilePath); + const fileRefSection = proj.pbxFileReferenceSection(); + const frsLength = Object.keys(fileRefSection).length; assert.equal(66 + 2, frsLength); assert.ok(fileRefSection[newFile.models[0].fileRef]); assert.ok(fileRefSection[newFile.models[0].fileRef + '_comment']); - }); it('should populate the PBXFileReference section with 2 fields for each model of a model document', () => { - var newFile = proj.addDataModelDocument(multipleDataModelFilePath), - fileRefSection = proj.pbxFileReferenceSection(), - frsLength = Object.keys(fileRefSection).length; + const newFile = proj.addDataModelDocument(multipleDataModelFilePath); + const fileRefSection = proj.pbxFileReferenceSection(); + const frsLength = Object.keys(fileRefSection).length; assert.equal(66 + 2 * 2, frsLength); assert.ok(fileRefSection[newFile.models[0].fileRef]); assert.ok(fileRefSection[newFile.models[0].fileRef + '_comment']); assert.ok(fileRefSection[newFile.models[1].fileRef]); assert.ok(fileRefSection[newFile.models[1].fileRef + '_comment']); - }); it('should add to resources group by default', () => { - var newFile = proj.addDataModelDocument(singleDataModelFilePath); - groupChildren = proj.pbxGroupByName('Resources').children, - found = false; + proj.addDataModelDocument(singleDataModelFilePath); + const groupChildren = proj.pbxGroupByName('Resources').children; + let found = false; - for (var index in groupChildren) { + for (const index in groupChildren) { if (groupChildren[index].comment === 'single-data-model.xcdatamodeld') { found = true; break; @@ -114,12 +110,12 @@ describe('dataModelDocument', () => { }); it('should add to group specified by key', () => { - var group = 'Frameworks', - newFile = proj.addDataModelDocument(singleDataModelFilePath, proj.findPBXGroupKey({ name: group })); - groupChildren = proj.pbxGroupByName(group).children; + const group = 'Frameworks'; + proj.addDataModelDocument(singleDataModelFilePath, proj.findPBXGroupKey({ name: group })); + const groupChildren = proj.pbxGroupByName(group).children; - var found = false; - for (var index in groupChildren) { + let found = false; + for (const index in groupChildren) { if (groupChildren[index].comment === path.basename(singleDataModelFilePath)) { found = true; break; @@ -129,12 +125,12 @@ describe('dataModelDocument', () => { }); it('should add to group specified by name', () => { - var group = 'Frameworks', - newFile = proj.addDataModelDocument(singleDataModelFilePath, group); - groupChildren = proj.pbxGroupByName(group).children; + const group = 'Frameworks'; + proj.addDataModelDocument(singleDataModelFilePath, group); + const groupChildren = proj.pbxGroupByName(group).children; - var found = false; - for (var index in groupChildren) { + let found = false; + for (const index in groupChildren) { if (groupChildren[index].comment === path.basename(singleDataModelFilePath)) { found = true; break; @@ -144,31 +140,31 @@ describe('dataModelDocument', () => { }); it('should add to the PBXSourcesBuildPhase', () => { - var newFile = proj.addDataModelDocument(singleDataModelFilePath), - sources = proj.pbxSourcesBuildPhaseObj(); + proj.addDataModelDocument(singleDataModelFilePath); + const sources = proj.pbxSourcesBuildPhaseObj(); assert.equal(sources.files.length, 2 + 1); }); it('should create a XCVersionGroup section', () => { - var newFile = proj.addDataModelDocument(singleDataModelFilePath), - xcVersionGroupSection = proj.xcVersionGroupSection(); + const newFile = proj.addDataModelDocument(singleDataModelFilePath); + const xcVersionGroupSection = proj.xcVersionGroupSection(); assert.ok(xcVersionGroupSection[newFile.fileRef]); }); it('should populate the XCVersionGroup comment correctly', () => { - var newFile = proj.addDataModelDocument(singleDataModelFilePath), - xcVersionGroupSection = proj.xcVersionGroupSection(), - commentKey = newFile.fileRef + '_comment'; + const newFile = proj.addDataModelDocument(singleDataModelFilePath); + const xcVersionGroupSection = proj.xcVersionGroupSection(); + const commentKey = newFile.fileRef + '_comment'; assert.equal(xcVersionGroupSection[commentKey], path.basename(singleDataModelFilePath)); }); it('should add the XCVersionGroup object correctly', () => { - var newFile = proj.addDataModelDocument(singleDataModelFilePath), - xcVersionGroupSection = proj.xcVersionGroupSection(), - xcVersionGroupEntry = xcVersionGroupSection[newFile.fileRef]; + const newFile = proj.addDataModelDocument(singleDataModelFilePath); + const xcVersionGroupSection = proj.xcVersionGroupSection(); + const xcVersionGroupEntry = xcVersionGroupSection[newFile.fileRef]; assert.equal(xcVersionGroupEntry.isa, 'XCVersionGroup'); assert.equal(xcVersionGroupEntry.children[0], newFile.models[0].fileRef); @@ -178,6 +174,5 @@ describe('dataModelDocument', () => { assert.equal(xcVersionGroupEntry.path, singleDataModelFilePath.replace(/\\/g, '/')); assert.equal(xcVersionGroupEntry.sourceTree, '""'); assert.equal(xcVersionGroupEntry.versionGroupType, 'wrapper.xcdatamodel'); - }); }); diff --git a/test/group.js b/test/group.js index 13b37e1..ae4a85c 100644 --- a/test/group.js +++ b/test/group.js @@ -20,15 +20,14 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - project, - projectHash; +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +let project; -var findChildInGroup = function(obj, target) { - var found = false; +const findChildInGroup = function (obj, target) { + let found = false; - for (var i = 0, j = obj.children.length; i < j; i++) { + for (let i = 0, j = obj.children.length; i < j; i++) { if (obj.children[i].value === target) { found = true; break; @@ -36,12 +35,12 @@ var findChildInGroup = function(obj, target) { } return found; -} +}; -var findFileByUUID = function(obj, target) { - var found = false; +const findFileByUUID = function (obj, target) { + let found = false; - for (var k = 0, l = obj.files.length; k < l; k++) { + for (let k = 0, l = obj.files.length; k < l; k++) { if (obj.files[k].value === target) { found = true; break; @@ -49,12 +48,12 @@ var findFileByUUID = function(obj, target) { } return found; -} +}; -var findByFileRef = function(obj, target) { - var found = false; +const findByFileRef = function (obj, target) { + let found = false; - for (var property in obj) { + for (const property in obj) { if (!/comment/.test(property)) { if (obj[property].fileRef === target) { found = true; @@ -63,51 +62,50 @@ var findByFileRef = function(obj, target) { } } return found; -} +}; -var findByName = function(obj, target) { - var found = false; - for (var property in obj) { +const findByName = function (obj, target) { + let found = false; + for (const property in obj) { if (!/comment/.test(property)) { - var value = obj[property]; + const value = obj[property]; if (value.name === target) { found = true; } } } return found; -} +}; describe('group', () => { beforeEach(() => { - project = new pbx('test/parser/projects/group.pbxproj'); - projectHash = project.parseSync(); + project = new PBXProject('test/parser/projects/group.pbxproj'); + project.parseSync(); }); describe('getGroupByKey', () => { it('should return PBXGroup for Classes', () => { - var groupKey = project.findPBXGroupKey({name: 'Classes'}); - var group = project.getPBXGroupByKey(groupKey); + const groupKey = project.findPBXGroupKey({ name: 'Classes' }); + const group = project.getPBXGroupByKey(groupKey); assert.ok(group.name === 'Classes'); }); it('should return PBXGroup for Plugins', () => { - var groupKey = project.findPBXGroupKey({name: 'Plugins'}); - var group = project.getPBXGroupByKey(groupKey); + const groupKey = project.findPBXGroupKey({ name: 'Plugins' }); + const group = project.getPBXGroupByKey(groupKey); assert.ok(group.name === 'Plugins'); }); }); describe('createGroup', () => { it('should create a new Test Group', () => { - var found = false; - var groups = project.getPBXObject('PBXGroup'); + let found = false; + let groups = project.getPBXObject('PBXGroup'); - var found = findByName(groups, 'Test'); + found = findByName(groups, 'Test'); assert.ok(found === false); - - var group = project.findPBXGroupKey({name:'Test'}); + let group = project.findPBXGroupKey({ name: 'Test' }); assert.ok(group === undefined); project.pbxCreateGroup('Test', 'Test'); @@ -116,58 +114,56 @@ describe('group', () => { found = findByName(groups, 'Test'); assert.ok(found === true); - group = project.findPBXGroupKey({name:'Test'}); + group = project.findPBXGroupKey({ name: 'Test' }); assert.ok(typeof group === 'string'); }); }); describe('findGroupKey', () => { it('should return a valid group key', () => { - var keyByName = project.findPBXGroupKey({ name: 'Classes'}); - var keyByPath = project.findPBXGroupKey({ path: 'icons'}); - var keyByPathName = project.findPBXGroupKey({ path: '"HelloCordova/Plugins"', name: 'Plugins'}); - var nonExistingKey = project.findPBXGroupKey({ name: 'Foo'}); + const keyByName = project.findPBXGroupKey({ name: 'Classes' }); + const keyByPath = project.findPBXGroupKey({ path: 'icons' }); + const keyByPathName = project.findPBXGroupKey({ path: '"HelloCordova/Plugins"', name: 'Plugins' }); + const nonExistingKey = project.findPBXGroupKey({ name: 'Foo' }); assert.ok(keyByName === '080E96DDFE201D6D7F000001'); assert.ok(keyByPath === '308D052D1370CCF300D202BF'); assert.ok(keyByPathName === '307C750510C5A3420062BCA9'); assert.ok(nonExistingKey === undefined); - }); }); describe('addGroupToGroup', () => { it('should create a new test group then add group to Classes group', () => { - var testKey = project.pbxCreateGroup('Test', 'Test'); - var classesKey = project.findPBXGroupKey({name: 'Classes'}); + const testKey = project.pbxCreateGroup('Test', 'Test'); + const classesKey = project.findPBXGroupKey({ name: 'Classes' }); project.addToPbxGroup(testKey, classesKey); - var classesGroup = project.getPBXGroupByKey(classesKey); - var foundTestGroup = false; - for (var i = 0, j = classesGroup.children.length; i < j; i++) { - var child = classesGroup.children[i]; + const classesGroup = project.getPBXGroupByKey(classesKey); + let foundTestGroup = false; + for (let i = 0, j = classesGroup.children.length; i < j; i++) { + const child = classesGroup.children[i]; if (child.value === testKey && child.comment === 'Test') { foundTestGroup = true; } } assert.ok(foundTestGroup); - }); }); describe('predefinedPbxGroups', () => { beforeEach(() => { - project = new pbx('test/parser/projects/empty-groups.pbxproj').parseSync(); + project = new PBXProject('test/parser/projects/empty-groups.pbxproj').parseSync(); - this.file = new pbxFile('some-file.m'); + this.file = new PBXFile('some-file.m'); this.file.fileRef = project.generateUuid(); project.addToPbxFileReferenceSection(this.file); }); it('should add a file to "Plugins" group', () => { project.addToPluginsPbxGroup(this.file); - var foundInGroup = findChildInGroup(project.pbxGroupByName('Plugins'), this.file.fileRef); + const foundInGroup = findChildInGroup(project.pbxGroupByName('Plugins'), this.file.fileRef); assert.ok(foundInGroup); }); @@ -175,14 +171,14 @@ describe('group', () => { project.addToPluginsPbxGroup(this.file); project.removeFromPluginsPbxGroup(this.file); - var foundInGroup = findChildInGroup(project.pbxGroupByName('Plugins'), this.file.fileRef); + const foundInGroup = findChildInGroup(project.pbxGroupByName('Plugins'), this.file.fileRef); assert.ok(!foundInGroup); }); it('should add a file to "Resources" group', () => { project.addToResourcesPbxGroup(this.file); - var foundInGroup = findChildInGroup(project.pbxGroupByName('Resources'), this.file.fileRef); + const foundInGroup = findChildInGroup(project.pbxGroupByName('Resources'), this.file.fileRef); assert.ok(foundInGroup); }); @@ -190,14 +186,14 @@ describe('group', () => { project.addToResourcesPbxGroup(this.file); project.removeFromResourcesPbxGroup(this.file); - var foundInGroup = findChildInGroup(project.pbxGroupByName('Resources'), this.file.fileRef); + const foundInGroup = findChildInGroup(project.pbxGroupByName('Resources'), this.file.fileRef); assert.ok(!foundInGroup); }); it('should add a file to "Frameworks" group', () => { project.addToFrameworksPbxGroup(this.file); - var foundInGroup = findChildInGroup(project.pbxGroupByName('Frameworks'), this.file.fileRef); + const foundInGroup = findChildInGroup(project.pbxGroupByName('Frameworks'), this.file.fileRef); assert.ok(foundInGroup); }); @@ -205,14 +201,14 @@ describe('group', () => { project.addToFrameworksPbxGroup(this.file); project.removeFromFrameworksPbxGroup(this.file); - var foundInGroup = findChildInGroup(project.pbxGroupByName('Frameworks'), this.file.fileRef); + const foundInGroup = findChildInGroup(project.pbxGroupByName('Frameworks'), this.file.fileRef); assert.ok(!foundInGroup); }); it('should add a file to "Products" group', () => { project.addToProductsPbxGroup(this.file); - var foundInGroup = findChildInGroup(project.pbxGroupByName('Products'), this.file.fileRef); + const foundInGroup = findChildInGroup(project.pbxGroupByName('Products'), this.file.fileRef); assert.ok(foundInGroup); }); @@ -220,143 +216,134 @@ describe('group', () => { project.addToProductsPbxGroup(this.file); project.removeFromProductsPbxGroup(this.file); - var foundInGroup = findChildInGroup(project.pbxGroupByName('Products'), this.file.fileRef); + const foundInGroup = findChildInGroup(project.pbxGroupByName('Products'), this.file.fileRef); assert.ok(!foundInGroup); }); }); describe('addSourceFileToGroup', () => { it('should create group + add source file', () => { - var testKey = project.pbxCreateGroup('Test', 'Test'); - var file = project.addSourceFile('Notifications.m', {}, testKey); + const testKey = project.pbxCreateGroup('Test', 'Test'); + const file = project.addSourceFile('Notifications.m', {}, testKey); - var foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey),file.fileRef ); + const foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey), file.fileRef); assert.ok(foundInGroup); - var foundInBuildFileSection = findByFileRef(project.pbxBuildFileSection(), file.fileRef); + const foundInBuildFileSection = findByFileRef(project.pbxBuildFileSection(), file.fileRef); assert.ok(foundInBuildFileSection); - var foundInBuildPhase = findFileByUUID(project.pbxSourcesBuildPhaseObj(), file.uuid); + const foundInBuildPhase = findFileByUUID(project.pbxSourcesBuildPhaseObj(), file.uuid); assert.ok(foundInBuildPhase); - }); }); describe('removeSourceFileFromGroup', () => { it('should create group + add source file then remove source file', () => { - var testKey = project.pbxCreateGroup('Test', 'Test'); - var file = project.addSourceFile('Notifications.m', {}, testKey); + const testKey = project.pbxCreateGroup('Test', 'Test'); + const file = project.addSourceFile('Notifications.m', {}, testKey); - var foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey),file.fileRef ); + let foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey), file.fileRef); assert.ok(foundInGroup); - var foundInBuildFileSection = findByFileRef(project.pbxBuildFileSection(), file.fileRef); + let foundInBuildFileSection = findByFileRef(project.pbxBuildFileSection(), file.fileRef); assert.ok(foundInBuildFileSection); - var foundInBuildPhase = findFileByUUID(project.pbxSourcesBuildPhaseObj(), file.uuid); + let foundInBuildPhase = findFileByUUID(project.pbxSourcesBuildPhaseObj(), file.uuid); assert.ok(foundInBuildPhase); project.removeSourceFile('Notifications.m', {}, testKey); - var foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey),file.fileRef ); + foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey), file.fileRef); assert.ok(!foundInGroup); - var foundInBuildFileSection = findByFileRef(project.pbxBuildFileSection(), file.fileRef); + foundInBuildFileSection = findByFileRef(project.pbxBuildFileSection(), file.fileRef); assert.ok(!foundInBuildFileSection); - var foundInBuildPhase = findFileByUUID(project.pbxSourcesBuildPhaseObj(), file.uuid); + foundInBuildPhase = findFileByUUID(project.pbxSourcesBuildPhaseObj(), file.uuid); assert.ok(!foundInBuildPhase); - }); }); describe('addHeaderFileToGroup', () => { it('should create group + add header file', () => { - var testKey = project.pbxCreateGroup('Test', 'Test'); - var file = project.addHeaderFile('Notifications.h', {}, testKey); + const testKey = project.pbxCreateGroup('Test', 'Test'); + const file = project.addHeaderFile('Notifications.h', {}, testKey); - var foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey),file.fileRef ); + const foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey), file.fileRef); assert.ok(foundInGroup); - }); }); describe('removeHeaderFileFromGroup', () => { it('should create group + add source file then remove header file', () => { - var testKey = project.pbxCreateGroup('Test', 'Test'); - var file = project.addHeaderFile('Notifications.h', {}, testKey); + const testKey = project.pbxCreateGroup('Test', 'Test'); + const file = project.addHeaderFile('Notifications.h', {}, testKey); - var foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey),file.fileRef ); + let foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey), file.fileRef); assert.ok(foundInGroup); project.removeHeaderFile('Notifications.h', {}, testKey); - var foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey),file.fileRef ); + foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey), file.fileRef); assert.ok(!foundInGroup); - }); }); describe('addResourceFileToGroup', () => { it('should add resource file (PNG) to the splash group', () => { + const testKey = project.findPBXGroupKey({ path: 'splash' }); + const file = project.addResourceFile('DefaultTest-667h.png', {}, testKey); - var testKey = project.findPBXGroupKey({path:'splash'}); - var file = project.addResourceFile('DefaultTest-667h.png', {}, testKey); - - var foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey),file.fileRef ); + const foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey), file.fileRef); assert.ok(foundInGroup); - }); }); describe('removeResourceFileFromGroup', () => { it('should add resource file (PNG) then remove resource file from splash group', () => { - var testKey = project.findPBXGroupKey({path:'splash'}); - var file = project.addResourceFile('DefaultTest-667h.png', {}, testKey); + const testKey = project.findPBXGroupKey({ path: 'splash' }); + const file = project.addResourceFile('DefaultTest-667h.png', {}, testKey); - var foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey),file.fileRef ); + let foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey), file.fileRef); assert.ok(foundInGroup); project.removeResourceFile('DefaultTest-667h.png', {}, testKey); - var foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey),file.fileRef ); + foundInGroup = findChildInGroup(project.getPBXGroupByKey(testKey), file.fileRef); assert.ok(!foundInGroup); - }); }); describe('retrieveBuildPropertyForBuild', () => { it('should retrieve valid build property ', () => { - var releaseTargetedDeviceFamily = project.getBuildProperty('TARGETED_DEVICE_FAMILY', 'Release'); - var debugTargetedDeviceFamily = project.getBuildProperty('TARGETED_DEVICE_FAMILY', 'Debug'); - var nonExistingProperty = project.getBuildProperty('FOO', 'Debug'); - var nonExistingBuild = project.getBuildProperty('TARGETED_DEVICE_FAMILY', 'Foo'); + const releaseTargetedDeviceFamily = project.getBuildProperty('TARGETED_DEVICE_FAMILY', 'Release'); + const debugTargetedDeviceFamily = project.getBuildProperty('TARGETED_DEVICE_FAMILY', 'Debug'); + const nonExistingProperty = project.getBuildProperty('FOO', 'Debug'); + const nonExistingBuild = project.getBuildProperty('TARGETED_DEVICE_FAMILY', 'Foo'); assert.equal(releaseTargetedDeviceFamily, '"1,2"'); - assert.equal(debugTargetedDeviceFamily,'"1"'); + assert.equal(debugTargetedDeviceFamily, '"1"'); assert.equal(nonExistingProperty, undefined); assert.equal(nonExistingBuild, undefined); - }); }); describe('retrieveBuildConfigByName', () => { it('should retrieve valid build config', () => { - var releaseBuildConfig = project.getBuildConfigByName('Release'); - for (var property in releaseBuildConfig) { - var value = releaseBuildConfig[property]; + const releaseBuildConfig = project.getBuildConfigByName('Release'); + for (const property in releaseBuildConfig) { + const value = releaseBuildConfig[property]; assert.ok(value.name === 'Release'); } - var debugBuildConfig = project.getBuildConfigByName('Debug'); - for (var property in debugBuildConfig) { - var value = debugBuildConfig[property]; + const debugBuildConfig = project.getBuildConfigByName('Debug'); + for (const property in debugBuildConfig) { + const value = debugBuildConfig[property]; assert.ok(value.name === 'Debug'); } - var nonExistingBuildConfig = project.getBuildConfigByName('Foo'); + const nonExistingBuildConfig = project.getBuildConfigByName('Foo'); assert.deepEqual(nonExistingBuildConfig, {}); - }); }); @@ -382,23 +369,23 @@ describe('group', () => { describe('validateHasFile', () => { it('should return true for has file MainViewController.m', () => { - var result = project.hasFile('MainViewController.m'); - assert.ok(result.path == "MainViewController.m"); + const result = project.hasFile('MainViewController.m'); + assert.ok(result.path === 'MainViewController.m'); }); }); describe('testWritingPBXProject', () => { it('should successfully write to PBXProject TargetAttributes', () => { - var pbxProjectObj = project.getPBXObject('PBXProject'); - var pbxProject; - for (var property in pbxProjectObj) { + const pbxProjectObj = project.getPBXObject('PBXProject'); + let pbxProject; + for (const property in pbxProjectObj) { if (!/comment/.test(property)) { pbxProject = pbxProjectObj[property]; } } - var target; - for (var i = 0, j = pbxProject.targets.length; i < j; i++ ) { + let target; + for (let i = 0, j = pbxProject.targets.length; i < j; i++) { target = pbxProject.targets[i].value; } @@ -406,13 +393,13 @@ describe('group', () => { pbxProject.attributes.TargetAttributes[target] = { DevelopmentTeam: 'N6X4RJZZ5D', SystemCapabilities: { - "com.apple.BackgroundModes": { - enabled : 0 + 'com.apple.BackgroundModes': { + enabled: 0 }, - "com.apple.DataProtection" : { - enabled : 0 + 'com.apple.DataProtection': { + enabled: 0 }, - "com.apple.Keychain" : { + 'com.apple.Keychain': { enabled: 1 } } @@ -423,32 +410,29 @@ describe('group', () => { it('should add target attribute to PBXProject TargetAttributes', () => { project.addTargetAttribute('ProvisioningStyle', 'Manual'); - var output = project.writeSync(); + const output = project.writeSync(); assert.equal(output.match(/ProvisioningStyle\s*=\s*Manual/g).length, 1); - }); it('should change target attribute at PBXProject TargetAttributes', () => { project.addTargetAttribute('ProvisioningStyle', 'Manual'); - var output = project.writeSync(); + let output = project.writeSync(); assert.equal(output.match(/ProvisioningStyle\s*=\s*Manual/g).length, 1); project.addTargetAttribute('ProvisioningStyle', 'Automatic'); output = project.writeSync(); assert.equal(output.match(/ProvisioningStyle\s*=\s*Manual/g), null); assert.equal(output.match(/ProvisioningStyle\s*=\s*Automatic/g).length, 1); - }); it('should remove target attribute from PBXProject TargetAttributes', () => { project.addTargetAttribute('ProvisioningStyle', 'Manual'); - var output = project.writeSync(); + let output = project.writeSync(); assert.equal(output.match(/ProvisioningStyle\s*=\s*Manual/g).length, 1); project.removeTargetAttribute('ProvisioningStyle'); output = project.writeSync(); assert.equal(output.match(/ProvisioningStyle\s*=\s*Manual/g), null); - }); }); }); diff --git a/test/knownRegions.js b/test/knownRegions.js index e1ccc14..105f04e 100644 --- a/test/knownRegions.js +++ b/test/knownRegions.js @@ -19,12 +19,12 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - project = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const project = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } @@ -34,58 +34,58 @@ describe('knownRegions', () => { }); describe('addKnownRegion', () => { - it('should add new region to existing knownRegions', () => { - var knownRegions = project.pbxProjectSection()[project.getFirstProject()['uuid']]['knownRegions']; - assert.equal(knownRegions.indexOf('Spanish'), -1); - - project.addKnownRegion('Spanish') - knownRegions = project.pbxProjectSection()[project.getFirstProject()['uuid']]['knownRegions']; - assert.notEqual(knownRegions.indexOf('Spanish'), -1); - }); - - it('should not add region if it already exists in knownRegions', () => { - var numberOfRegions = project.pbxProjectSection()[project.getFirstProject()['uuid']]['knownRegions'].length; - - project.addKnownRegion('German'); - var newNumberOfRegions = project.pbxProjectSection()[project.getFirstProject()['uuid']]['knownRegions'].length; - assert.equal(numberOfRegions, newNumberOfRegions); - }); - - it('should create knownRegions array if it does not exist', () => { - delete project.pbxProjectSection()[project.getFirstProject()['uuid']]['knownRegions']; - assert.ok(!project.pbxProjectSection()[project.getFirstProject()['uuid']]['knownRegions']); - - project.addKnownRegion('German') - assert.ok(project.pbxProjectSection()[project.getFirstProject()['uuid']]['knownRegions']); - }); + it('should add new region to existing knownRegions', () => { + let knownRegions = project.pbxProjectSection()[project.getFirstProject().uuid].knownRegions; + assert.equal(knownRegions.indexOf('Spanish'), -1); + + project.addKnownRegion('Spanish'); + knownRegions = project.pbxProjectSection()[project.getFirstProject().uuid].knownRegions; + assert.notEqual(knownRegions.indexOf('Spanish'), -1); + }); + + it('should not add region if it already exists in knownRegions', () => { + const numberOfRegions = project.pbxProjectSection()[project.getFirstProject().uuid].knownRegions.length; + + project.addKnownRegion('German'); + const newNumberOfRegions = project.pbxProjectSection()[project.getFirstProject().uuid].knownRegions.length; + assert.equal(numberOfRegions, newNumberOfRegions); + }); + + it('should create knownRegions array if it does not exist', () => { + delete project.pbxProjectSection()[project.getFirstProject().uuid].knownRegions; + assert.ok(!project.pbxProjectSection()[project.getFirstProject().uuid].knownRegions); + + project.addKnownRegion('German'); + assert.ok(project.pbxProjectSection()[project.getFirstProject().uuid].knownRegions); + }); }); describe('removeKnownRegion', () => { - it('should remove named region from knownRegions', () => { - var knownRegions = project.pbxProjectSection()[project.getFirstProject()['uuid']]['knownRegions']; - assert.notEqual(knownRegions.indexOf('German'), -1); - - project.removeKnownRegion('German'); - knownRegions = project.pbxProjectSection()[project.getFirstProject()['uuid']]['knownRegions']; - assert.equal(knownRegions.indexOf('German'), -1); - }); - - it('should do nothing if named region does not exist in knownRegions', () => { - var numberOfRegions = project.pbxProjectSection()[project.getFirstProject()['uuid']]['knownRegions'].length; - - project.removeKnownRegion('Korean'); - var newNumberOfRegions = project.pbxProjectSection()[project.getFirstProject()['uuid']]['knownRegions'].length; - assert.equal(numberOfRegions, newNumberOfRegions); - }); + it('should remove named region from knownRegions', () => { + let knownRegions = project.pbxProjectSection()[project.getFirstProject().uuid].knownRegions; + assert.notEqual(knownRegions.indexOf('German'), -1); + + project.removeKnownRegion('German'); + knownRegions = project.pbxProjectSection()[project.getFirstProject().uuid].knownRegions; + assert.equal(knownRegions.indexOf('German'), -1); + }); + + it('should do nothing if named region does not exist in knownRegions', () => { + const numberOfRegions = project.pbxProjectSection()[project.getFirstProject().uuid].knownRegions.length; + + project.removeKnownRegion('Korean'); + const newNumberOfRegions = project.pbxProjectSection()[project.getFirstProject().uuid].knownRegions.length; + assert.equal(numberOfRegions, newNumberOfRegions); + }); }); describe('hasKnownRegion', () => { - it('should return true if named region exists in knownRegions', () => { - assert.ok(project.hasKnownRegion('German')); - }); + it('should return true if named region exists in knownRegions', () => { + assert.ok(project.hasKnownRegion('German')); + }); - it('should return false if named region does not exist in knownRegions', () => { - assert.ok(!project.hasKnownRegion('Ducth')); - }); + it('should return false if named region does not exist in knownRegions', () => { + assert.ok(!project.hasKnownRegion('Ducth')); + }); }); }); diff --git a/test/multipleTargets.js b/test/multipleTargets.js index ce72f65..d1eab55 100644 --- a/test/multipleTargets.js +++ b/test/multipleTargets.js @@ -20,151 +20,133 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/multiple-targets'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/multiple-targets'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } - describe('addFilesToTarget', () => { beforeEach(() => { proj.hash = cleanHash(); }); it('should add the file to a proper target', () => { + const target = '1D6058900D05DD3D006BFB54'; + const filename = 'file.m'; - var target = "1D6058900D05DD3D006BFB54"; - var filename = "file.m"; - - var opt = { target : target }; - var newFile = proj.addSourceFile(filename,opt); - - assert.equal(newFile.constructor, pbxFile); + const opt = { target }; + const newFile = proj.addSourceFile(filename, opt); - var sources = proj.pbxSourcesBuildPhaseObj(target); - assert.equal(sources.files[5].comment, filename+" in Sources"); + assert.equal(newFile.constructor, PBXFile); + const sources = proj.pbxSourcesBuildPhaseObj(target); + assert.equal(sources.files[5].comment, filename + ' in Sources'); }); it('should remove the file from the proper target', () => { + const target = '1D6058900D05DD3D006BFB54'; + const filename = 'file.m'; - var target = "1D6058900D05DD3D006BFB54"; - var filename = "file.m"; - - var opt = { target : target }; - var newFile = proj.addSourceFile(filename,opt); - - assert.equal(newFile.constructor, pbxFile); + const opt = { target }; + const newFile = proj.addSourceFile(filename, opt); - var sources = proj.pbxSourcesBuildPhaseObj(target); - assert.equal(sources.files[5].comment, filename+" in Sources"); - var l = sources.files.length; + assert.equal(newFile.constructor, PBXFile); - proj.removeSourceFile(filename,opt); - var sources = proj.pbxSourcesBuildPhaseObj(target); - assert.equal(sources.files.length,l-1); + let sources = proj.pbxSourcesBuildPhaseObj(target); + assert.equal(sources.files[5].comment, filename + ' in Sources'); + const l = sources.files.length; + proj.removeSourceFile(filename, opt); + sources = proj.pbxSourcesBuildPhaseObj(target); + assert.equal(sources.files.length, l - 1); }); it('should fail when specifying an invalid target', () => { + const target = 'XXXXX'; + const filename = 'file.m'; - var target = "XXXXX"; - var filename = "file.m"; - - var opt = { target : target }; - assert.throws(function(){ - proj.addSourceFile(filename,opt); + const opt = { target }; + assert.throws(function () { + proj.addSourceFile(filename, opt); }); - - }); - it('should add the library to a proper target', () => { - - var target = "1D6058900D05DD3D006BFB54"; - var filename = "library.lib"; + it('should add the library to a proper target', () => { + const target = '1D6058900D05DD3D006BFB54'; + const filename = 'library.lib'; - var opt = { target : target }; - var newFile = proj.addStaticLibrary(filename,opt); + const opt = { target }; + const newFile = proj.addStaticLibrary(filename, opt); - assert.equal(newFile.constructor, pbxFile); - - var libraries = proj.pbxFrameworksBuildPhaseObj(target); - assert.equal(libraries.files[4].comment, filename+" in Resources"); + assert.equal(newFile.constructor, PBXFile); + const libraries = proj.pbxFrameworksBuildPhaseObj(target); + assert.equal(libraries.files[4].comment, filename + ' in Resources'); }); it('should remove the library to a proper target', () => { + const target = '1D6058900D05DD3D006BFB54'; + const filename = 'library.lib'; - var target = "1D6058900D05DD3D006BFB54"; - var filename = "library.lib"; - - var opt = { target : target }; - var newFile = proj.addStaticLibrary(filename,opt); + const opt = { target }; + const newFile = proj.addStaticLibrary(filename, opt); - assert.equal(newFile.constructor, pbxFile); + assert.equal(newFile.constructor, PBXFile); - var libraries = proj.pbxFrameworksBuildPhaseObj(target); - assert.equal(libraries.files[4].comment, filename+" in Resources"); - var l = libraries.files.length; + let libraries = proj.pbxFrameworksBuildPhaseObj(target); + assert.equal(libraries.files[4].comment, filename + ' in Resources'); + const l = libraries.files.length; - proj.removeFramework(filename,opt); - var libraries = proj.pbxFrameworksBuildPhaseObj(target); - assert.equal(libraries.files.length,l-1); + proj.removeFramework(filename, opt); + libraries = proj.pbxFrameworksBuildPhaseObj(target); + assert.equal(libraries.files.length, l - 1); }); - it('should add the framework to a proper target', () => { - - var target = "1D6058900D05DD3D006BFB54"; - var filename = "delta.framework"; + it('should add the framework to a proper target', () => { + const target = '1D6058900D05DD3D006BFB54'; + const filename = 'delta.framework'; - var opt = { target : target }; - var newFile = proj.addFramework(filename,opt); + const opt = { target }; + const newFile = proj.addFramework(filename, opt); - assert.equal(newFile.constructor, pbxFile); - - var frameworks = proj.pbxFrameworksBuildPhaseObj(target); - assert.equal(frameworks.files[4].comment, filename+" in Frameworks"); + assert.equal(newFile.constructor, PBXFile); + const frameworks = proj.pbxFrameworksBuildPhaseObj(target); + assert.equal(frameworks.files[4].comment, filename + ' in Frameworks'); }); it('should add a ressource fileto a proper target', () => { + const target = '1D6058900D05DD3D006BFB54'; + const filename = 'delta.png'; - var target = "1D6058900D05DD3D006BFB54"; - var filename = "delta.png"; - - var opt = { target : target }; - var newFile = proj.addResourceFile(filename,opt); + const opt = { target }; + const newFile = proj.addResourceFile(filename, opt); - assert.equal(newFile.constructor, pbxFile); - - var resources = proj.pbxResourcesBuildPhaseObj(target); - assert.equal(resources.files[26].comment, filename+" in Resources"); + assert.equal(newFile.constructor, PBXFile); + const resources = proj.pbxResourcesBuildPhaseObj(target); + assert.equal(resources.files[26].comment, filename + ' in Resources'); }); - it('should remove a ressource file from a proper target', () => { - - var target = "1D6058900D05DD3D006BFB54"; - var filename = "delta.png"; + it('should remove a ressource file from a proper target', () => { + const target = '1D6058900D05DD3D006BFB54'; + const filename = 'delta.png'; - var opt = { target : target }; - var newFile = proj.addResourceFile(filename,opt); + const opt = { target }; + const newFile = proj.addResourceFile(filename, opt); - assert.equal(newFile.constructor, pbxFile); + assert.equal(newFile.constructor, PBXFile); - var resources = proj.pbxResourcesBuildPhaseObj(target); - assert.equal(resources.files[26].comment, filename+" in Resources"); + let resources = proj.pbxResourcesBuildPhaseObj(target); + assert.equal(resources.files[26].comment, filename + ' in Resources'); - var l = resources.files.length; - - proj.removeResourceFile(filename,opt); - var resources = proj.pbxResourcesBuildPhaseObj(target); - assert.equal(resources.files.length,l-1); + const l = resources.files.length; + proj.removeResourceFile(filename, opt); + resources = proj.pbxResourcesBuildPhaseObj(target); + assert.equal(resources.files.length, l - 1); }); }); - diff --git a/test/parser/build-config.js b/test/parser/build-config.js index 295fd69..609b706 100644 --- a/test/parser/build-config.js +++ b/test/parser/build-config.js @@ -20,14 +20,13 @@ const { describe, it } = require('node:test'); const assert = require('node:assert'); -var PEG = require('pegjs'), - fs = require('fs'), - pbx = fs.readFileSync('test/parser/projects/build-config.pbxproj', 'utf-8'), - grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'), - parser = PEG.generate(grammar), - rawProj = parser.parse(pbx), - util = require('util'), - project = rawProj.project; +const PEG = require('pegjs'); +const fs = require('fs'); +const pbx = fs.readFileSync('test/parser/projects/build-config.pbxproj', 'utf-8'); +const grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'); +const parser = PEG.generate(grammar); +const rawProj = parser.parse(pbx); +const project = rawProj.project; describe('parser/build-config', () => { it('should parse the build config section', () => { @@ -35,17 +34,17 @@ describe('parser/build-config', () => { }); it('should read a decimal value correctly', () => { - const xcbConfig = project.objects['XCBuildConfiguration']; + const xcbConfig = project.objects.XCBuildConfiguration; const debugSettings = xcbConfig['1D6058950D05DD3E006BFB54'].buildSettings; - assert.strictEqual(debugSettings['IPHONEOS_DEPLOYMENT_TARGET'], '3.0'); + assert.strictEqual(debugSettings.IPHONEOS_DEPLOYMENT_TARGET, '3.0'); }); it('should read an escaped value correctly', () => { - const xcbConfig = project.objects['XCBuildConfiguration']; - const debugSettings = xcbConfig['C01FCF4F08A954540054247B'].buildSettings; + const xcbConfig = project.objects.XCBuildConfiguration; + const debugSettings = xcbConfig.C01FCF4F08A954540054247B.buildSettings; const expt = '"\\"$(PHONEGAPLIB)/Classes/JSON\\" \\"$(PHONEGAPLIB)/Classes\\""'; - assert.strictEqual(debugSettings['USER_HEADER_SEARCH_PATHS'], expt); + assert.strictEqual(debugSettings.USER_HEADER_SEARCH_PATHS, expt); }); }); diff --git a/test/parser/comments.js b/test/parser/comments.js index cba7e6c..6322e76 100644 --- a/test/parser/comments.js +++ b/test/parser/comments.js @@ -19,11 +19,11 @@ const { describe, it } = require('node:test'); -var PEG = require('pegjs'), - fs = require('fs'), - pbx = fs.readFileSync('test/parser/projects/comments.pbxproj', 'utf-8'), - grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'), - parser = PEG.generate(grammar); +const PEG = require('pegjs'); +const fs = require('fs'); +const pbx = fs.readFileSync('test/parser/projects/comments.pbxproj', 'utf-8'); +const grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'); +const parser = PEG.generate(grammar); // Cordova 1.8 has the Apache headers as comments in the pbxproj file // I DON'T KNOW WHY diff --git a/test/parser/dotsInNames.js b/test/parser/dotsInNames.js index f6d163d..df8a0ce 100644 --- a/test/parser/dotsInNames.js +++ b/test/parser/dotsInNames.js @@ -20,13 +20,13 @@ const { describe, it } = require('node:test'); const assert = require('node:assert'); -var PEG = require('pegjs'), - fs = require('fs'), - pbx = fs.readFileSync('test/parser/projects/dots-in-names.pbxproj', 'utf-8'), - grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'), - parser = PEG.generate(grammar), - rawProj = parser.parse(pbx), - project = rawProj.project; +const PEG = require('pegjs'); +const fs = require('fs'); +const pbx = fs.readFileSync('test/parser/projects/dots-in-names.pbxproj', 'utf-8'); +const grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'); +const parser = PEG.generate(grammar); +const rawProj = parser.parse(pbx); +const project = rawProj.project; describe('parser/dotsInNames', () => { it('should parse com.apple.BackgroundModes', () => { diff --git a/test/parser/file-references.js b/test/parser/file-references.js index b123b84..66ecb9a 100644 --- a/test/parser/file-references.js +++ b/test/parser/file-references.js @@ -20,16 +20,16 @@ const { describe, it } = require('node:test'); const assert = require('assert'); -var PEG = require('pegjs'), - fs = require('fs'), - pbx = fs.readFileSync('test/parser/projects/file-references.pbxproj', 'utf-8'), - grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'), - parser = PEG.generate(grammar), - rawProj = parser.parse(pbx), - project = rawProj.project; +const PEG = require('pegjs'); +const fs = require('fs'); +const pbx = fs.readFileSync('test/parser/projects/file-references.pbxproj', 'utf-8'); +const grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'); +const parser = PEG.generate(grammar); +const rawProj = parser.parse(pbx); +const project = rawProj.project; describe('parser/file-references', () => { it('should have a PBXFileReference section', () => { - assert.ok(project.objects['PBXFileReference']); + assert.ok(project.objects.PBXFileReference); }); }); diff --git a/test/parser/hash.js b/test/parser/hash.js index 21f5aa2..bbb3d0b 100644 --- a/test/parser/hash.js +++ b/test/parser/hash.js @@ -20,13 +20,13 @@ const { describe, it } = require('node:test'); const assert = require('assert'); -var PEG = require('pegjs'), - fs = require('fs'), - pbx = fs.readFileSync('test/parser/projects/hash.pbxproj', 'utf-8'), - grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'), - parser = PEG.generate(grammar), - rawProj = parser.parse(pbx), - project = rawProj.project; +const PEG = require('pegjs'); +const fs = require('fs'); +const pbx = fs.readFileSync('test/parser/projects/hash.pbxproj', 'utf-8'); +const grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'); +const parser = PEG.generate(grammar); +const rawProj = parser.parse(pbx); +const project = rawProj.project; describe('parser/hash', () => { it('should have the top-line comment in place', () => { @@ -45,7 +45,7 @@ describe('parser/hash', () => { it('should split out properties and comments', () => { assert.strictEqual(project.rootObject, '29B97313FDCFA39411CA2CEA'); - assert.strictEqual(project['rootObject_comment'], 'Project object'); + assert.strictEqual(project.rootObject_comment, 'Project object'); }); it('should parse non-commented hash things', () => { diff --git a/test/parser/header-search.js b/test/parser/header-search.js index c57d0cc..d0a87c0 100644 --- a/test/parser/header-search.js +++ b/test/parser/header-search.js @@ -20,18 +20,18 @@ const { describe, it } = require('node:test'); const assert = require('assert'); -var PEG = require('pegjs'), - fs = require('fs'), - pbx = fs.readFileSync('test/parser/projects/header-search.pbxproj', 'utf-8'), - grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'), - parser = PEG.generate(grammar), - rawProj = parser.parse(pbx), - project = rawProj.project; +const PEG = require('pegjs'); +const fs = require('fs'); +const pbx = fs.readFileSync('test/parser/projects/header-search.pbxproj', 'utf-8'); +const grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'); +const parser = PEG.generate(grammar); +const rawProj = parser.parse(pbx); +const project = rawProj.project; describe('parser/header-search', () => { it('should read a decimal value correctly', () => { - const debug = project.objects['XCBuildConfiguration']['C01FCF4F08A954540054247B']; - const hsPaths = debug.buildSettings['HEADER_SEARCH_PATHS']; + const debug = project.objects.XCBuildConfiguration.C01FCF4F08A954540054247B; + const hsPaths = debug.buildSettings.HEADER_SEARCH_PATHS; const expected = '"\\"$(TARGET_BUILD_DIR)/usr/local/lib/include\\""'; assert.strictEqual(hsPaths[0], expected); diff --git a/test/parser/section-entries.js b/test/parser/section-entries.js index 6817a83..8c8c4f4 100644 --- a/test/parser/section-entries.js +++ b/test/parser/section-entries.js @@ -20,27 +20,27 @@ const { describe, it } = require('node:test'); const assert = require('assert'); -var PEG = require('pegjs'), - fs = require('fs'), - pbx = fs.readFileSync('test/parser/projects/section-entries.pbxproj', 'utf-8'), - grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'), - parser = PEG.generate(grammar), - rawProj = parser.parse(pbx), - project = rawProj.project; +const PEG = require('pegjs'); +const fs = require('fs'); +const pbx = fs.readFileSync('test/parser/projects/section-entries.pbxproj', 'utf-8'); +const grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'); +const parser = PEG.generate(grammar); +const rawProj = parser.parse(pbx); +const project = rawProj.project; describe('parser/section-entries', () => { it('should have a PBXVariantGroup section', () => { - assert.ok(project.objects['PBXVariantGroup']); + assert.ok(project.objects.PBXVariantGroup); }); it('should have two children for PBXVariantGroup', () => { - const variantGroup = project.objects['PBXVariantGroup']; + const variantGroup = project.objects.PBXVariantGroup; assert.ok(variantGroup['1F766FDF13BBADB100FB74C0']); assert.ok(variantGroup['1F766FDC13BBADB100FB74C0']); }); it('should store quote-surround values correctly', () => { - const localizable = project.objects['PBXVariantGroup']['1F766FDF13BBADB100FB74C0']; + const localizable = project.objects.PBXVariantGroup['1F766FDF13BBADB100FB74C0']; assert.strictEqual(localizable.sourceTree, '""'); }); }); diff --git a/test/parser/section-split.js b/test/parser/section-split.js index 8577322..84fd465 100644 --- a/test/parser/section-split.js +++ b/test/parser/section-split.js @@ -20,35 +20,34 @@ const { describe, it } = require('node:test'); const assert = require('assert'); -var PEG = require('pegjs'), - fs = require('fs'), - pbx = fs.readFileSync('test/parser/projects/section-split.pbxproj', 'utf-8'), - grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'), - parser = PEG.generate(grammar), - rawProj = parser.parse(pbx), - project = rawProj.project; +const PEG = require('pegjs'); +const fs = require('fs'); +const pbx = fs.readFileSync('test/parser/projects/section-split.pbxproj', 'utf-8'); +const grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'); +const parser = PEG.generate(grammar); +const rawProj = parser.parse(pbx); +const project = rawProj.project; describe('parser/section-split', () => { it('should have a PBXTargetDependency section', () => { - assert.ok(project.objects['PBXTargetDependency']); + assert.ok(project.objects.PBXTargetDependency); }); it('should have the right child of PBXTargetDependency section', () => { - assert.ok(project.objects['PBXTargetDependency']['301BF551109A68C00062928A']); + assert.ok(project.objects.PBXTargetDependency['301BF551109A68C00062928A']); }); it('should have the right properties on the dependency', () => { - const dependency = project.objects['PBXTargetDependency']['301BF551109A68C00062928A']; + const dependency = project.objects.PBXTargetDependency['301BF551109A68C00062928A']; assert.strictEqual(dependency.isa, 'PBXTargetDependency'); assert.strictEqual(dependency.name, 'PhoneGapLib'); assert.strictEqual(dependency.targetProxy, '301BF550109A68C00062928A'); - assert.strictEqual(dependency['targetProxy_comment'], 'PBXContainerItemProxy'); + assert.strictEqual(dependency.targetProxy_comment, 'PBXContainerItemProxy'); }); it('should merge two PBXTargetDependency sections', () => { - assert.ok(project.objects['PBXTargetDependency']['301BF551109A68C00062928A']); - assert.ok(project.objects['PBXTargetDependency']['45FDD1944D304A9F96DF3AC6']); + assert.ok(project.objects.PBXTargetDependency['301BF551109A68C00062928A']); + assert.ok(project.objects.PBXTargetDependency['45FDD1944D304A9F96DF3AC6']); }); }); - diff --git a/test/parser/section.js b/test/parser/section.js index e4bd7da..ee0a6bb 100644 --- a/test/parser/section.js +++ b/test/parser/section.js @@ -20,29 +20,29 @@ const { describe, it } = require('node:test'); const assert = require('assert'); -var PEG = require('pegjs'), - fs = require('fs'), - pbx = fs.readFileSync('test/parser/projects/section.pbxproj', 'utf-8'), - grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'), - parser = PEG.generate(grammar), - rawProj = parser.parse(pbx), - project = rawProj.project; +const PEG = require('pegjs'); +const fs = require('fs'); +const pbx = fs.readFileSync('test/parser/projects/section.pbxproj', 'utf-8'); +const grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'); +const parser = PEG.generate(grammar); +const rawProj = parser.parse(pbx); +const project = rawProj.project; describe('parser/section', () => { it('should have a PBXTargetDependency section', () => { - assert.ok(project.objects['PBXTargetDependency']); + assert.ok(project.objects.PBXTargetDependency); }); it('should have the right child of PBXTargetDependency section', () => { - assert.ok(project.objects['PBXTargetDependency']['301BF551109A68C00062928A']); + assert.ok(project.objects.PBXTargetDependency['301BF551109A68C00062928A']); }); it('should have the right properties on the dependency', () => { - const dependency = project.objects['PBXTargetDependency']['301BF551109A68C00062928A']; + const dependency = project.objects.PBXTargetDependency['301BF551109A68C00062928A']; assert.strictEqual(dependency.isa, 'PBXTargetDependency'); assert.strictEqual(dependency.name, 'PhoneGapLib'); assert.strictEqual(dependency.targetProxy, '301BF550109A68C00062928A'); - assert.strictEqual(dependency['targetProxy_comment'], 'PBXContainerItemProxy'); + assert.strictEqual(dependency.targetProxy_comment, 'PBXContainerItemProxy'); }); }); diff --git a/test/parser/two-sections.js b/test/parser/two-sections.js index 2312b56..c99288c 100644 --- a/test/parser/two-sections.js +++ b/test/parser/two-sections.js @@ -20,13 +20,13 @@ const { describe, it } = require('node:test'); const assert = require('assert'); -var PEG = require('pegjs'), - fs = require('fs'), - pbx = fs.readFileSync('test/parser/projects/two-sections.pbxproj', 'utf-8'), - grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'), - parser = PEG.generate(grammar), - rawProj = parser.parse(pbx), - project = rawProj.project; +const PEG = require('pegjs'); +const fs = require('fs'); +const pbx = fs.readFileSync('test/parser/projects/two-sections.pbxproj', 'utf-8'); +const grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'); +const parser = PEG.generate(grammar); +const rawProj = parser.parse(pbx); +const project = rawProj.project; describe('parser/two-sections', () => { it('should parse a project with two sections', () => { @@ -34,7 +34,7 @@ describe('parser/two-sections', () => { }); it('should have both sections on the project object', () => { - assert.ok(project.objects['PBXTargetDependency']); - assert.ok(project.objects['PBXSourcesBuildPhase']); + assert.ok(project.objects.PBXTargetDependency); + assert.ok(project.objects.PBXSourcesBuildPhase); }); }); diff --git a/test/parser/with_array.js b/test/parser/with_array.js index 096e407..4861e71 100644 --- a/test/parser/with_array.js +++ b/test/parser/with_array.js @@ -20,13 +20,13 @@ const { describe, it } = require('node:test'); const assert = require('assert'); -var PEG = require('pegjs'), - fs = require('fs'), - pbx = fs.readFileSync('test/parser/projects/with_array.pbxproj', 'utf-8'), - grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'), - parser = PEG.generate(grammar), - rawProj = parser.parse(pbx), - project = rawProj.project; +const PEG = require('pegjs'); +const fs = require('fs'); +const pbx = fs.readFileSync('test/parser/projects/with_array.pbxproj', 'utf-8'); +const grammar = fs.readFileSync('lib/parser/pbxproj.pegjs', 'utf-8'); +const parser = PEG.generate(grammar); +const rawProj = parser.parse(pbx); +const project = rawProj.project; describe('parser/with_array', () => { it('should parse arrays with commented entries', () => { diff --git a/test/pbxFile.js b/test/pbxFile.js index 224612d..8c053d6 100644 --- a/test/pbxFile.js +++ b/test/pbxFile.js @@ -20,73 +20,73 @@ const { describe, it } = require('node:test'); const assert = require('node:assert'); -var pbxFile = require('../lib/pbxFile'); +const PBXFile = require('../lib/pbxFile'); -describe('pbxFile', () =>{ +describe('PBXFile', () => { describe('lastKnownFileType', () => { it('should detect that a .m path means sourcecode.c.objc', () => { - var sourceFile = new pbxFile('Plugins/ChildBrowser.m'); + const sourceFile = new PBXFile('Plugins/ChildBrowser.m'); assert.equal('sourcecode.c.objc', sourceFile.lastKnownFileType); }); it('should detect that a .h path means sourceFile.c.h', () => { - var sourceFile = new pbxFile('Plugins/ChildBrowser.h'); + const sourceFile = new PBXFile('Plugins/ChildBrowser.h'); assert.equal('sourcecode.c.h', sourceFile.lastKnownFileType); }); it('should detect that a .bundle path means "wrapper.plug-in"', () => { - var sourceFile = new pbxFile('Plugins/ChildBrowser.bundle'); + const sourceFile = new PBXFile('Plugins/ChildBrowser.bundle'); assert.equal('wrapper.plug-in', sourceFile.lastKnownFileType); }); it('should detect that a .xib path means file.xib', () => { - var sourceFile = new pbxFile('Plugins/ChildBrowser.xib'); + const sourceFile = new PBXFile('Plugins/ChildBrowser.xib'); assert.equal('file.xib', sourceFile.lastKnownFileType); }); it('should detect that a .dylib path means "compiled.mach-o.dylib"', () => { - var sourceFile = new pbxFile('libsqlite3.dylib'); + const sourceFile = new PBXFile('libsqlite3.dylib'); assert.equal('compiled.mach-o.dylib', sourceFile.lastKnownFileType); }); it('should detect that a .tbd path means sourcecode.text-based-dylib-definition', () => { - var sourceFile = new pbxFile('libsqlite3.tbd'); + const sourceFile = new PBXFile('libsqlite3.tbd'); assert.equal('sourcecode.text-based-dylib-definition', sourceFile.lastKnownFileType); }); it('should detect that a .framework path means wrapper.framework', () => { - var sourceFile = new pbxFile('MessageUI.framework'); + const sourceFile = new PBXFile('MessageUI.framework'); assert.equal('wrapper.framework', sourceFile.lastKnownFileType); }); it('should detect that a .a path means archive.ar', () => { - var sourceFile = new pbxFile('libGoogleAnalytics.a'); + const sourceFile = new PBXFile('libGoogleAnalytics.a'); assert.equal('archive.ar', sourceFile.lastKnownFileType); }); it('should detect that a .xcdatamodel path means wrapper.xcdatamodel', () => { - var sourceFile = new pbxFile('dataModel.xcdatamodel'); + const sourceFile = new PBXFile('dataModel.xcdatamodel'); assert.equal('wrapper.xcdatamodel', sourceFile.lastKnownFileType); }); it('should allow lastKnownFileType to be overridden', () => { - var sourceFile = new pbxFile('Plugins/ChildBrowser.m', - { lastKnownFileType: 'somestupidtype' }); + const sourceFile = new PBXFile('Plugins/ChildBrowser.m', + { lastKnownFileType: 'somestupidtype' }); assert.equal('somestupidtype', sourceFile.lastKnownFileType); }); it('should set lastKnownFileType to unknown if undetectable', () => { - var sourceFile = new pbxFile('Plugins/ChildBrowser.guh'); + const sourceFile = new PBXFile('Plugins/ChildBrowser.guh'); assert.equal('unknown', sourceFile.lastKnownFileType); }); @@ -94,45 +94,45 @@ describe('pbxFile', () =>{ describe('group', () => { it('should be Sources for source files', () => { - var sourceFile = new pbxFile('Plugins/ChildBrowser.m'); + const sourceFile = new PBXFile('Plugins/ChildBrowser.m'); assert.equal('Sources', sourceFile.group); }); it('should be Sources for data model document files', () => { - var dataModelFile = new pbxFile('dataModel.xcdatamodeld'); + const dataModelFile = new PBXFile('dataModel.xcdatamodeld'); assert.equal('Sources', dataModelFile.group); }); it('should be Frameworks for dylibs', () => { - var framework = new pbxFile('libsqlite3.dylib'); + const framework = new PBXFile('libsqlite3.dylib'); assert.equal('Frameworks', framework.group); }); it('should be Frameworks for tbds', () => { - var framework = new pbxFile('libsqlite3.tbd'); + const framework = new PBXFile('libsqlite3.tbd'); assert.equal('Frameworks', framework.group); }); it('should be Frameworks for frameworks', () => { - var framework = new pbxFile('MessageUI.framework'); + const framework = new PBXFile('MessageUI.framework'); assert.equal('Frameworks', framework.group); }); it('should be Resources for all other files', () => { - var headerFile = new pbxFile('Plugins/ChildBrowser.h'), - xibFile = new pbxFile('Plugins/ChildBrowser.xib'); + const headerFile = new PBXFile('Plugins/ChildBrowser.h'); + const xibFile = new PBXFile('Plugins/ChildBrowser.xib'); assert.equal('Resources', headerFile.group); assert.equal('Resources', xibFile.group); }); it('should be Frameworks for archives', () => { - var archive = new pbxFile('libGoogleAnalytics.a'); + const archive = new PBXFile('libGoogleAnalytics.a'); assert.equal('Frameworks', archive.group); }); @@ -140,7 +140,7 @@ describe('pbxFile', () =>{ describe('basename', () => { it('should be as expected', () => { - var sourceFile = new pbxFile('Plugins/ChildBrowser.m'); + const sourceFile = new PBXFile('Plugins/ChildBrowser.m'); assert.equal('ChildBrowser.m', sourceFile.basename); }); @@ -148,38 +148,38 @@ describe('pbxFile', () =>{ describe('sourceTree', () => { it('should be SDKROOT for dylibs', () => { - var sourceFile = new pbxFile('libsqlite3.dylib'); + const sourceFile = new PBXFile('libsqlite3.dylib'); assert.equal('SDKROOT', sourceFile.sourceTree); }); it('should be SDKROOT for tbds', () => { - var sourceFile = new pbxFile('libsqlite3.tbd'); + const sourceFile = new PBXFile('libsqlite3.tbd'); assert.equal('SDKROOT', sourceFile.sourceTree); }); it('should be SDKROOT for frameworks', () => { - var sourceFile = new pbxFile('MessageUI.framework'); + const sourceFile = new PBXFile('MessageUI.framework'); assert.equal('SDKROOT', sourceFile.sourceTree); }); it('should default to "" otherwise', () => { - var sourceFile = new pbxFile('Plugins/ChildBrowser.m'); + const sourceFile = new PBXFile('Plugins/ChildBrowser.m'); assert.equal('""', sourceFile.sourceTree); }); it('should be overridable either way', () => { - var sourceFile = new pbxFile('Plugins/ChildBrowser.m', - { sourceTree: 'SOMETHING'}); + const sourceFile = new PBXFile('Plugins/ChildBrowser.m', + { sourceTree: 'SOMETHING' }); assert.equal('SOMETHING', sourceFile.sourceTree); }); it('should be "" for archives', () => { - var archive = new pbxFile('libGoogleAnalytics.a'); + const archive = new PBXFile('libGoogleAnalytics.a'); assert.equal('""', archive.sourceTree); }); @@ -187,42 +187,41 @@ describe('pbxFile', () =>{ describe('path', () => { it('should be "usr/lib" for dylibs (relative to SDKROOT)', () => { - var sourceFile = new pbxFile('libsqlite3.dylib'); + const sourceFile = new PBXFile('libsqlite3.dylib'); assert.equal('usr/lib/libsqlite3.dylib', sourceFile.path); }); it('should be "usr/lib" for tbds (relative to SDKROOT)', () => { - var sourceFile = new pbxFile('libsqlite3.tbd'); + const sourceFile = new PBXFile('libsqlite3.tbd'); assert.equal('usr/lib/libsqlite3.tbd', sourceFile.path); }); it('should be "System/Library/Frameworks" for frameworks', () => { - var sourceFile = new pbxFile('MessageUI.framework'); + const sourceFile = new PBXFile('MessageUI.framework'); assert.equal('System/Library/Frameworks/MessageUI.framework', sourceFile.path); }); - it('should default to the first argument otherwise', () => { - var sourceFile = new pbxFile('Plugins/ChildBrowser.m'); + const sourceFile = new PBXFile('Plugins/ChildBrowser.m'); assert.equal('Plugins/ChildBrowser.m', sourceFile.path); }); }); describe('settings', () => { - it('should not be defined by default', () => { - var sourceFile = new pbxFile('social.framework'); + it('should not be defined by default', () => { + const sourceFile = new PBXFile('social.framework'); - assert.equal(undefined, sourceFile.settings); + assert.equal(undefined, sourceFile.settings); }); it('should be undefined if weak is false or non-boolean', () => { - var sourceFile1 = new pbxFile('social.framework', + const sourceFile1 = new PBXFile('social.framework', { weak: false }); - var sourceFile2 = new pbxFile('social.framework', + const sourceFile2 = new PBXFile('social.framework', { weak: 'bad_value' }); assert.equal(undefined, sourceFile1.settings); @@ -230,36 +229,36 @@ describe('pbxFile', () =>{ }); it('should be {ATTRIBUTES:["Weak"]} if weak linking specified', () => { - var sourceFile = new pbxFile('social.framework', + const sourceFile = new PBXFile('social.framework', { weak: true }); - assert.deepEqual({ATTRIBUTES:["Weak"]}, sourceFile.settings); + assert.deepEqual({ ATTRIBUTES: ['Weak'] }, sourceFile.settings); }); it('should be {ATTRIBUTES:["CodeSignOnCopy"]} if sign specified', () => { - var sourceFile = new pbxFile('signable.framework', + const sourceFile = new PBXFile('signable.framework', { embed: true, sign: true }); - assert.deepEqual({ATTRIBUTES:["CodeSignOnCopy"]}, sourceFile.settings); + assert.deepEqual({ ATTRIBUTES: ['CodeSignOnCopy'] }, sourceFile.settings); }); it('should be {ATTRIBUTES:["Weak","CodeSignOnCopy"]} if both weak linking and sign specified', () => { - var sourceFile = new pbxFile('signableWeak.framework', + const sourceFile = new PBXFile('signableWeak.framework', { embed: true, weak: true, sign: true }); - assert.deepEqual({ATTRIBUTES:["Weak", "CodeSignOnCopy"]}, sourceFile.settings); + assert.deepEqual({ ATTRIBUTES: ['Weak', 'CodeSignOnCopy'] }, sourceFile.settings); }); it('should be {COMPILER_FLAGS:"blah"} if compiler flags specified', () => { - var sourceFile = new pbxFile('Plugins/BarcodeScanner.m', - { compilerFlags: "-std=c++11 -fno-objc-arc" }); + const sourceFile = new PBXFile('Plugins/BarcodeScanner.m', + { compilerFlags: '-std=c++11 -fno-objc-arc' }); - assert.deepEqual({COMPILER_FLAGS:'"-std=c++11 -fno-objc-arc"'}, sourceFile.settings); + assert.deepEqual({ COMPILER_FLAGS: '"-std=c++11 -fno-objc-arc"' }, sourceFile.settings); }); it('should be .appex if {explicitFileType:\'"wrapper.app-extension"\'} specified', () => { - var sourceFile = new pbxFile('AppExtension', - { explicitFileType: '"wrapper.app-extension"'}); + const sourceFile = new PBXFile('AppExtension', + { explicitFileType: '"wrapper.app-extension"' }); assert.equal('AppExtension.appex', sourceFile.basename); }); diff --git a/test/pbxItemByComment.js b/test/pbxItemByComment.js index 69da9a3..5438d1c 100644 --- a/test/pbxItemByComment.js +++ b/test/pbxItemByComment.js @@ -19,12 +19,12 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } @@ -34,35 +34,35 @@ describe('pbxItemByComment', () => { }); it('should return PBXTargetDependency', () => { - var pbxItem = proj.pbxItemByComment('PBXTargetDependency', 'PBXTargetDependency'); + const pbxItem = proj.pbxItemByComment('PBXTargetDependency', 'PBXTargetDependency'); assert.ok(pbxItem); assert.equal(pbxItem.isa, 'PBXTargetDependency'); }); it('should return PBXContainerItemProxy', () => { - var pbxItem = proj.pbxItemByComment('libPhoneGap.a', 'PBXReferenceProxy'); + const pbxItem = proj.pbxItemByComment('libPhoneGap.a', 'PBXReferenceProxy'); assert.ok(pbxItem); assert.equal(pbxItem.isa, 'PBXReferenceProxy'); }); it('should return PBXResourcesBuildPhase', () => { - var pbxItem = proj.pbxItemByComment('Resources', 'PBXResourcesBuildPhase'); + const pbxItem = proj.pbxItemByComment('Resources', 'PBXResourcesBuildPhase'); assert.ok(pbxItem); assert.equal(pbxItem.isa, 'PBXResourcesBuildPhase'); }); it('should return PBXShellScriptBuildPhase', () => { - var pbxItem = proj.pbxItemByComment('Touch www folder', 'PBXShellScriptBuildPhase'); + const pbxItem = proj.pbxItemByComment('Touch www folder', 'PBXShellScriptBuildPhase'); assert.ok(pbxItem); assert.equal(pbxItem.isa, 'PBXShellScriptBuildPhase'); }); it('should return null when PBXNativeTarget not found', () => { - var pbxItem = proj.pbxItemByComment('Invalid', 'PBXTargetDependency'); + const pbxItem = proj.pbxItemByComment('Invalid', 'PBXTargetDependency'); assert.equal(pbxItem, null); }); diff --git a/test/pbxProject.js b/test/pbxProject.js index 2b0cdc0..18f9495 100644 --- a/test/pbxProject.js +++ b/test/pbxProject.js @@ -20,142 +20,137 @@ const { describe, it, afterEach } = require('node:test'); const assert = require('node:assert'); -var pbx = require('../lib/pbxProject'), - buildConfig = require('./fixtures/buildFiles'), - jsonProject = require('./fixtures/full-project'), - fs = require('fs'), - project; +const PBXProject = require('../lib/pbxProject'); +const buildConfig = require('./fixtures/buildFiles'); +const jsonProject = require('./fixtures/full-project'); +const fs = require('fs'); -describe('pbxProject', () => { +describe('PBXProject', () => { describe('creation', () => { it('should create a pbxProject with the new operator', () => { - var myProj = new pbx('test/parser/projects/hash.pbxproj'); + const myProj = new PBXProject('test/parser/projects/hash.pbxproj'); - assert.ok(myProj instanceof pbx); + assert.ok(myProj instanceof PBXProject); }); it('should create a pbxProject without the new operator', () => { - var myProj = pbx('test/parser/projects/hash.pbxproj'); + const myProj = PBXProject('test/parser/projects/hash.pbxproj'); - assert.ok(myProj instanceof pbx); + assert.ok(myProj instanceof PBXProject); }); }); describe('parseSync function', () => { - it('should return the hash object', () => { - var myProj = new pbx('test/parser/projects/hash.pbxproj') - , projHash = myProj.parseSync(); - assert.ok(projHash);; - }); - it('should contain valid data in the returned objects hash', () => { - var myProj = new pbx('test/parser/projects/hash.pbxproj') - , projHash = myProj.parseSync(); + it('should return the hash object', () => { + const myProj = new PBXProject('test/parser/projects/hash.pbxproj'); + const projHash = myProj.parseSync(); + assert.ok(projHash); + }); + it('should contain valid data in the returned objects hash', () => { + const myProj = new PBXProject('test/parser/projects/hash.pbxproj'); + const projHash = myProj.parseSync(); assert.ok(projHash); assert.equal(projHash.hash.project.archiveVersion, 1); assert.equal(projHash.hash.project.objectVersion, 45); assert.equal(projHash.hash.project.nonObject, '29B97313FDCFA39411CA2CEF'); - ; - }); + }); }); describe('parse function', () => { it('should emit an "end" event', () => { - var myProj = new pbx('test/parser/projects/hash.pbxproj'); + const myProj = new PBXProject('test/parser/projects/hash.pbxproj'); - myProj.parse().on('end', function (err, projHash) {; - }) + myProj.parse().on('end', function () { + }); }); it('should take the end callback as a parameter', () => { - var myProj = new pbx('test/parser/projects/hash.pbxproj'); + const myProj = new PBXProject('test/parser/projects/hash.pbxproj'); - myProj.parse(function (err, projHash) {; - }) + myProj.parse(function () { + }); }); it('should allow evented error handling', () => { - var myProj = new pbx('NotARealPath.pbxproj'); + const myProj = new PBXProject('NotARealPath.pbxproj'); myProj.parse().on('error', function (err) { - assert.equal(typeof err, "object");; - }) + assert.equal(typeof err, 'object'); + }); }); it('should pass the hash object to the callback function', () => { - var myProj = new pbx('test/parser/projects/hash.pbxproj'); + const myProj = new PBXProject('test/parser/projects/hash.pbxproj'); - myProj.parse(function (err, projHash) { - assert.ok(projHash);; - }) + myProj.parse(function (_, projHash) { + assert.ok(projHash); + }); }); it('should handle projects with comments in the header', () => { - var myProj = new pbx('test/parser/projects/comments.pbxproj'); + const myProj = new PBXProject('test/parser/projects/comments.pbxproj'); - myProj.parse(function (err, projHash) { - assert.ok(projHash);; - }) + myProj.parse(function (_, projHash) { + assert.ok(projHash); + }); }); it('should attach the hash object to the pbx object', () => { - var myProj = new pbx('test/parser/projects/hash.pbxproj'); + const myProj = new PBXProject('test/parser/projects/hash.pbxproj'); - myProj.parse(function (err, projHash) { - assert.ok(myProj.hash);; - }) + myProj.parse(function () { + assert.ok(myProj.hash); + }); }); it('it should pass an error object back when the parsing fails', () => { - var myProj = new pbx('test/parser/projects/fail.pbxproj'); + const myProj = new PBXProject('test/parser/projects/fail.pbxproj'); - myProj.parse(function (err, projHash) { - assert.ok(err);; - }) + myProj.parse(function (err, _) { + assert.ok(err); + }); }); }); describe('allUuids function', () => { - it('should return the right amount of uuids', () => { - var project = new pbx('.'), - uuids; + it('should return the right amount of uuids', () => { + const project = new PBXProject('.'); - project.hash = buildConfig; - uuids = project.allUuids(); + project.hash = buildConfig; + const uuids = project.allUuids(); - assert.equal(uuids.length, 4);; - }); + assert.equal(uuids.length, 4); + }); }); describe('generateUuid function', () => { it('should return a 24 character string', () => { - var project = new pbx('.'), - newUUID; + const project = new PBXProject('.'); - project.hash = buildConfig; - newUUID = project.generateUuid(); + project.hash = buildConfig; + const newUUID = project.generateUuid(); - assert.equal(newUUID.length, 24);; + assert.equal(newUUID.length, 24); }); it('should be an uppercase hex string', () => { - var project = new pbx('.'), - uHex = /^[A-F0-9]{24}$/, - newUUID; + const project = new PBXProject('.'); + const uHex = /^[A-F0-9]{24}$/; - project.hash = buildConfig; - newUUID = project.generateUuid(); + project.hash = buildConfig; + const newUUID = project.generateUuid(); - assert.ok(uHex.test(newUUID));; + assert.ok(uHex.test(newUUID)); }); }); - var bcpbx = 'test/parser/projects/build-config.pbxproj'; - var original_pbx = fs.readFileSync(bcpbx, 'utf-8'); + const bcpbx = 'test/parser/projects/build-config.pbxproj'; + const original_pbx = fs.readFileSync(bcpbx, 'utf-8'); describe('updateProductName function', () => { afterEach(() => { fs.writeFileSync(bcpbx, original_pbx, 'utf-8'); }); it('should change the PRODUCT_NAME field in the .pbxproj file', () => { - var myProj = new pbx('test/parser/projects/build-config.pbxproj'); - myProj.parse(function(err, hash) { + const myProj = new PBXProject('test/parser/projects/build-config.pbxproj'); + myProj.parse(function () { myProj.updateProductName('furious anger'); - var newContents = myProj.writeSync(); - assert.ok(newContents.match(/PRODUCT_NAME\s*=\s*"furious anger"/));; + const newContents = myProj.writeSync(); + assert.ok(newContents.match(/PRODUCT_NAME\s*=\s*"furious anger"/)); }); }); }); @@ -165,32 +160,32 @@ describe('pbxProject', () => { fs.writeFileSync(bcpbx, original_pbx, 'utf-8'); }); it('should change build properties in the .pbxproj file', () => { - var myProj = new pbx('test/parser/projects/build-config.pbxproj'); - myProj.parse(function(err, hash) { + const myProj = new PBXProject('test/parser/projects/build-config.pbxproj'); + myProj.parse(function () { myProj.updateBuildProperty('TARGETED_DEVICE_FAMILY', '"arm"'); - var newContents = myProj.writeSync(); + let newContents = myProj.writeSync(); assert.ok(newContents.match(/TARGETED_DEVICE_FAMILY\s*=\s*"arm"/)); - myProj.updateBuildProperty('OTHER_LDFLAGS', ['T','E','S','T']); + myProj.updateBuildProperty('OTHER_LDFLAGS', ['T', 'E', 'S', 'T']); newContents = myProj.writeSync(); assert.ok(newContents.match(/OTHER_LDFLAGS\s*=\s*\(\s*T,\s*E,\s*S,\s*T,\s*\)/)); }); }); it('should change all targets in .pbxproj with multiple targets', () => { - var myProj = new pbx('test/parser/projects/multitarget.pbxproj'); - myProj.parse(function(err, hash) { + const myProj = new PBXProject('test/parser/projects/multitarget.pbxproj'); + myProj.parse(function () { myProj.updateBuildProperty('PRODUCT_BUNDLE_IDENTIFIER', 'comcompanytest'); - var newContents = myProj.writeSync(); + const newContents = myProj.writeSync(); // Should be 10 times = 5 targets, debug and release each - assert.ok(newContents.match(/PRODUCT_BUNDLE_IDENTIFIER\s*=\s*comcompanytest/g).length === 10);; + assert.ok(newContents.match(/PRODUCT_BUNDLE_IDENTIFIER\s*=\s*comcompanytest/g).length === 10); }); }); it('should change only one target in .pbxproj with multiple targets', () => { - var myProj = new pbx('test/parser/projects/multitarget.pbxproj'); - myProj.parse(function(err, hash) { + const myProj = new PBXProject('test/parser/projects/multitarget.pbxproj'); + myProj.parse(function () { myProj.updateBuildProperty('PRODUCT_BUNDLE_IDENTIFIER', 'comcompanytest', null, 'MultiTargetTest'); - var newContents = myProj.writeSync(); + const newContents = myProj.writeSync(); // should be 2 times = one target debug and release - assert.ok(newContents.match(/PRODUCT_BUNDLE_IDENTIFIER\s*=\s*comcompanytest/g).length === 2);; + assert.ok(newContents.match(/PRODUCT_BUNDLE_IDENTIFIER\s*=\s*comcompanytest/g).length === 2); }); }); }); @@ -200,19 +195,19 @@ describe('pbxProject', () => { fs.writeFileSync(bcpbx, original_pbx, 'utf-8'); }); it('should change all targets in .pbxproj with multiple targets', () => { - var myProj = new pbx('test/parser/projects/multitarget.pbxproj'); - myProj.parse(function(err, hash) { + const myProj = new PBXProject('test/parser/projects/multitarget.pbxproj'); + myProj.parse(function () { myProj.updateBuildProperty('PRODUCT_BUNDLE_IDENTIFIER', 'comcompanytest'); myProj.writeSync(); - assert.ok(myProj.getBuildProperty('PRODUCT_BUNDLE_IDENTIFIER') === 'comcompanytest');; + assert.ok(myProj.getBuildProperty('PRODUCT_BUNDLE_IDENTIFIER') === 'comcompanytest'); }); }); it('should change only one target in .pbxproj with multiple targets', () => { - var myProj = new pbx('test/parser/projects/multitarget.pbxproj'); - myProj.parse(function(err, hash) { + const myProj = new PBXProject('test/parser/projects/multitarget.pbxproj'); + myProj.parse(function () { myProj.updateBuildProperty('PRODUCT_BUNDLE_IDENTIFIER', 'comcompanytest', null, 'MultiTargetTest'); myProj.writeSync(); - assert.ok(myProj.getBuildProperty('PRODUCT_BUNDLE_IDENTIFIER', undefined, 'MultiTargetTest') === 'comcompanytest');; + assert.ok(myProj.getBuildProperty('PRODUCT_BUNDLE_IDENTIFIER', undefined, 'MultiTargetTest') === 'comcompanytest'); }); }); }); @@ -222,27 +217,27 @@ describe('pbxProject', () => { fs.writeFileSync(bcpbx, original_pbx, 'utf-8'); }); it('should add 4 build properties in the .pbxproj file', () => { - var myProj = new pbx('test/parser/projects/build-config.pbxproj'); - myProj.parse(function(err, hash) { + const myProj = new PBXProject('test/parser/projects/build-config.pbxproj'); + myProj.parse(function () { myProj.addBuildProperty('ENABLE_BITCODE', 'NO'); - var newContents = myProj.writeSync(); - assert.equal(newContents.match(/ENABLE_BITCODE\s*=\s*NO/g).length, 4);; + const newContents = myProj.writeSync(); + assert.equal(newContents.match(/ENABLE_BITCODE\s*=\s*NO/g).length, 4); }); }); it('should add 2 build properties in the .pbxproj file for specific build', () => { - var myProj = new pbx('test/parser/projects/build-config.pbxproj'); - myProj.parse(function(err, hash) { + const myProj = new PBXProject('test/parser/projects/build-config.pbxproj'); + myProj.parse(function () { myProj.addBuildProperty('ENABLE_BITCODE', 'NO', 'Release'); - var newContents = myProj.writeSync(); - assert.equal(newContents.match(/ENABLE_BITCODE\s*=\s*NO/g).length, 2);; + const newContents = myProj.writeSync(); + assert.equal(newContents.match(/ENABLE_BITCODE\s*=\s*NO/g).length, 2); }); }); it('should not add build properties in the .pbxproj file for nonexist build', () => { - var myProj = new pbx('test/parser/projects/build-config.pbxproj'); - myProj.parse(function(err, hash) { + const myProj = new PBXProject('test/parser/projects/build-config.pbxproj'); + myProj.parse(function () { myProj.addBuildProperty('ENABLE_BITCODE', 'NO', 'nonexist'); - var newContents = myProj.writeSync(); - assert.ok(!newContents.match(/ENABLE_BITCODE\s*=\s*NO/g));; + const newContents = myProj.writeSync(); + assert.ok(!newContents.match(/ENABLE_BITCODE\s*=\s*NO/g)); }); }); }); @@ -252,42 +247,42 @@ describe('pbxProject', () => { fs.writeFileSync(bcpbx, original_pbx, 'utf-8'); }); it('should remove all build properties in the .pbxproj file', () => { - var myProj = new pbx('test/parser/projects/build-config.pbxproj'); - myProj.parse(function(err, hash) { + const myProj = new PBXProject('test/parser/projects/build-config.pbxproj'); + myProj.parse(function () { myProj.removeBuildProperty('IPHONEOS_DEPLOYMENT_TARGET'); - var newContents = myProj.writeSync(); - assert.ok(!newContents.match(/IPHONEOS_DEPLOYMENT_TARGET/));; + const newContents = myProj.writeSync(); + assert.ok(!newContents.match(/IPHONEOS_DEPLOYMENT_TARGET/)); }); }); it('should remove specific build properties in the .pbxproj file', () => { - var myProj = new pbx('test/parser/projects/build-config.pbxproj'); - myProj.parse(function(err, hash) { + const myProj = new PBXProject('test/parser/projects/build-config.pbxproj'); + myProj.parse(function () { myProj.removeBuildProperty('IPHONEOS_DEPLOYMENT_TARGET', 'Debug'); - var newContents = myProj.writeSync(); - assert.equal(newContents.match(/IPHONEOS_DEPLOYMENT_TARGET/g).length, 2);; + const newContents = myProj.writeSync(); + assert.equal(newContents.match(/IPHONEOS_DEPLOYMENT_TARGET/g).length, 2); }); }); it('should not remove any build properties in the .pbxproj file', () => { - var myProj = new pbx('test/parser/projects/build-config.pbxproj'); - myProj.parse(function(err, hash) { + const myProj = new PBXProject('test/parser/projects/build-config.pbxproj'); + myProj.parse(function () { myProj.removeBuildProperty('IPHONEOS_DEPLOYMENT_TARGET', 'notexist'); - var newContents = myProj.writeSync(); - assert.equal(newContents.match(/IPHONEOS_DEPLOYMENT_TARGET/g).length, 4);; + const newContents = myProj.writeSync(); + assert.equal(newContents.match(/IPHONEOS_DEPLOYMENT_TARGET/g).length, 4); }); }); it('should fine with remove inexist build properties in the .pbxproj file', () => { - var myProj = new pbx('test/parser/projects/build-config.pbxproj'); - myProj.parse(function(err, hash) { + const myProj = new PBXProject('test/parser/projects/build-config.pbxproj'); + myProj.parse(function () { myProj.removeBuildProperty('ENABLE_BITCODE'); - var newContents = myProj.writeSync(); - assert.ok(!newContents.match(/ENABLE_BITCODE/));; + const newContents = myProj.writeSync(); + assert.ok(!newContents.match(/ENABLE_BITCODE/)); }); }); }); describe('productName field', () => { it('should return the product name', () => { - var newProj = new pbx('.'); + const newProj = new PBXProject('.'); newProj.hash = jsonProject; assert.equal(newProj.productName, 'KitchenSinktablet'); @@ -296,39 +291,39 @@ describe('pbxProject', () => { describe('addPluginFile function', () => { it('should strip the Plugin path prefix', () => { - var myProj = new pbx('test/parser/projects/full.pbxproj'); + const myProj = new PBXProject('test/parser/projects/full.pbxproj'); - myProj.parse(function (err, hash) { + myProj.parse(function () { assert.equal(myProj.addPluginFile('Plugins/testMac.m').path, 'testMac.m'); - assert.equal(myProj.addPluginFile('Plugins\\testWin.m').path, 'testWin.m');; + assert.equal(myProj.addPluginFile('Plugins\\testWin.m').path, 'testWin.m'); }); }); it('should add files to the .pbxproj file using the / path seperator', () => { - var myProj = new pbx('test/parser/projects/full.pbxproj'); + const myProj = new PBXProject('test/parser/projects/full.pbxproj'); - myProj.parse(function (err, hash) { - var file = myProj.addPluginFile('myPlugin\\newFile.m'); + myProj.parse(function () { + const file = myProj.addPluginFile('myPlugin\\newFile.m'); - assert.equal(myProj.pbxFileReferenceSection()[file.fileRef].path, '"myPlugin/newFile.m"');; + assert.equal(myProj.pbxFileReferenceSection()[file.fileRef].path, '"myPlugin/newFile.m"'); }); }); }); describe('hasFile', () => { it('should return true if the file is in the project', () => { - var newProj = new pbx('.'); + const newProj = new PBXProject('.'); newProj.hash = jsonProject; // sourceTree: '""' - assert.ok(newProj.hasFile('AppDelegate.m')) + assert.ok(newProj.hasFile('AppDelegate.m')); }); it('should return false if the file is not in the project', () => { - var newProj = new pbx('.'); + const newProj = new PBXProject('.'); newProj.hash = jsonProject; // sourceTree: '""' - assert.ok(!newProj.hasFile('NotTheAppDelegate.m')) + assert.ok(!newProj.hasFile('NotTheAppDelegate.m')); }); }); }); diff --git a/test/pbxTargetByName.js b/test/pbxTargetByName.js index 084117b..8672098 100644 --- a/test/pbxTargetByName.js +++ b/test/pbxTargetByName.js @@ -20,12 +20,12 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } @@ -35,14 +35,14 @@ describe('pbxTargetByName', () => { }); it('should return PBXNativeTarget', () => { - var pbxTarget = proj.pbxTargetByName('KitchenSinktablet'); + const pbxTarget = proj.pbxTargetByName('KitchenSinktablet'); assert.ok(pbxTarget); assert.equal(pbxTarget.isa, 'PBXNativeTarget'); }); it('should return null when PBXNativeTarget not found', () => { - var pbxTarget = proj.pbxTargetByName('Invalid'); + const pbxTarget = proj.pbxTargetByName('Invalid'); assert.equal(pbxTarget, null); }); diff --git a/test/pbxWriter.js b/test/pbxWriter.js index baec48c..25ea0cd 100644 --- a/test/pbxWriter.js +++ b/test/pbxWriter.js @@ -20,34 +20,33 @@ const { describe, it } = require('node:test'); const assert = require('node:assert'); -var pbx = require('../lib/pbxProject'), - fs = require('fs'), - myProj; +const PBXProject = require('../lib/pbxProject'); +const fs = require('fs'); -function testProjectContents(filename, expectedFilename) { - var myProj = new pbx(filename); +function testProjectContents (filename, expectedFilename) { + const myProj = new PBXProject(filename); - var content; + let content; if (expectedFilename) { content = fs.readFileSync(expectedFilename, 'utf-8'); } else { content = fs.readFileSync(filename, 'utf-8'); } // normalize tabs vs strings - content = content.replace(/ /g, '\t'); + content = content.replace(/ {4}/g, '\t'); - return new Promise(function(success, erro) { - myProj.parse(function (err, projHash) { - var written = myProj.writeSync(); + return new Promise(function (resolve) { + myProj.parse(function () { + const written = myProj.writeSync(); assert.equal(content, written); - success(); + resolve(); }); }); } // // for debugging failing tests // function testContentsInDepth(filename) { -// var myProj = new pbx(filename), +// var myProj = new PBXProject(filename), // content = fs.readFileSync(filename, 'utf-8'); // // normalize tabs vs strings @@ -112,33 +111,33 @@ describe('writeSync', () => { }); it('should not null and undefined with the "omitEmptyValues" option set to false test', () => { - var filename = 'test/parser/projects/with_omit_empty_values_disabled.pbxproj' - var expectedFilename = 'test/parser/projects/expected/with_omit_empty_values_disabled_expected.pbxproj' - var content = fs.readFileSync(expectedFilename, 'utf-8').replace(/ /g, '\t'); - var project = new pbx(filename); + const filename = 'test/parser/projects/with_omit_empty_values_disabled.pbxproj'; + const expectedFilename = 'test/parser/projects/expected/with_omit_empty_values_disabled_expected.pbxproj'; + let content = fs.readFileSync(expectedFilename, 'utf-8').replace(/ {4}/g, '\t'); + const project = new PBXProject(filename); project.parse(function (err) { if (err) { return assert.fail(err); } - const group = project.addPbxGroup([], 'CustomGroup', undefined) - var written = project.writeSync(); - content = content.replace('CUSTOM_GROUP_UUID_REPLACED_BY_TEST', group.uuid) + const group = project.addPbxGroup([], 'CustomGroup', undefined); + const written = project.writeSync(); + content = content.replace('CUSTOM_GROUP_UUID_REPLACED_BY_TEST', group.uuid); assert.equal(content, written); }); }); it('should drop null and undefined with the "omitEmptyValues" option set to true test', () => { - var filename = 'test/parser/projects/with_omit_empty_values_enabled.pbxproj' - var expectedFilename = 'test/parser/projects/expected/with_omit_empty_values_enabled_expected.pbxproj' - var content = fs.readFileSync(expectedFilename, 'utf-8').replace(/ /g, '\t'); - var project = new pbx(filename); + const filename = 'test/parser/projects/with_omit_empty_values_enabled.pbxproj'; + const expectedFilename = 'test/parser/projects/expected/with_omit_empty_values_enabled_expected.pbxproj'; + let content = fs.readFileSync(expectedFilename, 'utf-8').replace(/ {4}/g, '\t'); + const project = new PBXProject(filename); project.parse(function (err) { if (err) { return assert.fail(err); } - var group = project.addPbxGroup([], 'CustomGroup', undefined); - var written = project.writeSync({ omitEmptyValues: true }); - content = content.replace('CUSTOM_GROUP_UUID_REPLACED_BY_TEST', group.uuid) + const group = project.addPbxGroup([], 'CustomGroup', undefined); + const written = project.writeSync({ omitEmptyValues: true }); + content = content.replace('CUSTOM_GROUP_UUID_REPLACED_BY_TEST', group.uuid); assert.equal(content, written); }); }); diff --git a/test/removeFramework.js b/test/removeFramework.js index 1242265..0fd7f01 100644 --- a/test/removeFramework.js +++ b/test/removeFramework.js @@ -19,21 +19,21 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } -function nonComments(obj) { - var keys = Object.keys(obj), - newObj = {}, i = 0; +function nonComments (obj) { + const keys = Object.keys(obj); + const newObj = {}; - for (i; i < keys.length; i++) { + for (let i = 0; i < keys.length; i++) { if (!/_comment$/.test(keys[i])) { newObj[keys[i]] = obj[keys[i]]; } @@ -42,16 +42,17 @@ function nonComments(obj) { return newObj; } -function frameworkSearchPaths(proj) { - var configs = nonComments(proj.pbxXCBuildConfigurationSection()), - allPaths = [], - ids = Object.keys(configs), i, buildSettings; +function frameworkSearchPaths (proj) { + const configs = nonComments(proj.pbxXCBuildConfigurationSection()); + const allPaths = []; + const ids = Object.keys(configs); + let buildSettings; - for (i = 0; i< ids.length; i++) { + for (let i = 0; i < ids.length; i++) { buildSettings = configs[ids[i]].buildSettings; - if (buildSettings['FRAMEWORK_SEARCH_PATHS']) { - allPaths.push(buildSettings['FRAMEWORK_SEARCH_PATHS']); + if (buildSettings.FRAMEWORK_SEARCH_PATHS) { + allPaths.push(buildSettings.FRAMEWORK_SEARCH_PATHS); } } @@ -64,31 +65,31 @@ describe('removeFramework', () => { }); it('should return a pbxFile', () => { - var newFile = proj.addFramework('libsqlite3.dylib'); - assert.equal(newFile.constructor, pbxFile); + const newFile = proj.addFramework('libsqlite3.dylib'); + assert.equal(newFile.constructor, PBXFile); - var deletedFile = proj.removeFramework('libsqlite3.dylib'); - assert.equal(deletedFile.constructor, pbxFile); + const deletedFile = proj.removeFramework('libsqlite3.dylib'); + assert.equal(deletedFile.constructor, PBXFile); }); it('should set a fileRef on the pbxFile', () => { - var newFile = proj.addFramework('libsqlite3.dylib'); + const newFile = proj.addFramework('libsqlite3.dylib'); assert.ok(newFile.fileRef); - var deletedFile = proj.removeFramework('libsqlite3.dylib'); + const deletedFile = proj.removeFramework('libsqlite3.dylib'); assert.ok(deletedFile.fileRef); }); it('should remove 2 fields from the PBXFileReference section', () => { - var newFile = proj.addFramework('libsqlite3.dylib'), - fileRefSection = proj.pbxFileReferenceSection(), - frsLength = Object.keys(fileRefSection).length; + const newFile = proj.addFramework('libsqlite3.dylib'); + const fileRefSection = proj.pbxFileReferenceSection(); + let frsLength = Object.keys(fileRefSection).length; assert.equal(68, frsLength); assert.ok(fileRefSection[newFile.fileRef]); assert.ok(fileRefSection[newFile.fileRef + '_comment']); - var deletedFile = proj.removeFramework('libsqlite3.dylib'); + const deletedFile = proj.removeFramework('libsqlite3.dylib'); frsLength = Object.keys(fileRefSection).length; assert.equal(66, frsLength); @@ -97,15 +98,15 @@ describe('removeFramework', () => { }); it('should remove 2 fields from the PBXBuildFile section', () => { - var newFile = proj.addFramework('libsqlite3.dylib'), - buildFileSection = proj.pbxBuildFileSection(), - bfsLength = Object.keys(buildFileSection).length; + const newFile = proj.addFramework('libsqlite3.dylib'); + const buildFileSection = proj.pbxBuildFileSection(); + let bfsLength = Object.keys(buildFileSection).length; assert.equal(60, bfsLength); assert.ok(buildFileSection[newFile.uuid]); assert.ok(buildFileSection[newFile.uuid + '_comment']); - var deletedFile = proj.removeFramework('libsqlite3.dylib'); + const deletedFile = proj.removeFramework('libsqlite3.dylib'); bfsLength = Object.keys(buildFileSection).length; assert.equal(58, bfsLength); @@ -114,13 +115,13 @@ describe('removeFramework', () => { }); it('should remove from the Frameworks PBXGroup', () => { - var newLength = proj.pbxGroupByName('Frameworks').children.length + 1; + let newLength = proj.pbxGroupByName('Frameworks').children.length + 1; proj.addFramework('libsqlite3.dylib'); - var frameworks = proj.pbxGroupByName('Frameworks'); + const frameworks = proj.pbxGroupByName('Frameworks'); assert.equal(frameworks.children.length, newLength); - proj.removeFramework('libsqlite3.dylib'), + proj.removeFramework('libsqlite3.dylib'); newLength = newLength - 1; assert.equal(frameworks.children.length, newLength); @@ -129,7 +130,7 @@ describe('removeFramework', () => { it('should remove from the PBXFrameworksBuildPhase', () => { proj.addFramework('libsqlite3.dylib'); - var frameworks = proj.pbxFrameworksBuildPhaseObj(); + let frameworks = proj.pbxFrameworksBuildPhaseObj(); assert.equal(frameworks.files.length, 16); proj.removeFramework('libsqlite3.dylib'); @@ -141,7 +142,7 @@ describe('removeFramework', () => { it('should remove custom frameworks', () => { proj.addFramework('/path/to/Custom.framework', { customFramework: true }); - var frameworks = proj.pbxFrameworksBuildPhaseObj(); + let frameworks = proj.pbxFrameworksBuildPhaseObj(); assert.equal(frameworks.files.length, 16); proj.removeFramework('/path/to/Custom.framework', { customFramework: true }); @@ -149,42 +150,40 @@ describe('removeFramework', () => { frameworks = proj.pbxFrameworksBuildPhaseObj(); assert.equal(frameworks.files.length, 15); - var frameworkPaths = frameworkSearchPaths(proj), - expectedPath = '"/path/to"'; + const frameworkPaths = frameworkSearchPaths(proj); + const expectedPath = '"/path/to"'; - for (i = 0; i < frameworkPaths.length; i++) { - var current = frameworkPaths[i]; - assert.ok(current.indexOf(expectedPath) == -1); + for (let i = 0; i < frameworkPaths.length; i++) { + const current = frameworkPaths[i]; + assert.ok(current.indexOf(expectedPath) === -1); } - }); it('should remove embedded frameworks', () => { - proj.addFramework('/path/to/Custom.framework', { customFramework: true, embed:true, sign:true }); + proj.addFramework('/path/to/Custom.framework', { customFramework: true, embed: true, sign: true }); - var frameworks = proj.pbxFrameworksBuildPhaseObj(), - buildFileSection = proj.pbxBuildFileSection(), - bfsLength = Object.keys(buildFileSection).length; + let frameworks = proj.pbxFrameworksBuildPhaseObj(); + let buildFileSection = proj.pbxBuildFileSection(); + let bfsLength = Object.keys(buildFileSection).length; assert.equal(frameworks.files.length, 16); assert.equal(62, bfsLength); - proj.removeFramework('/path/to/Custom.framework', { customFramework: true, embed:true }); + proj.removeFramework('/path/to/Custom.framework', { customFramework: true, embed: true }); - frameworks = proj.pbxFrameworksBuildPhaseObj(), - buildFileSection = proj.pbxBuildFileSection(), - bfsLength = Object.keys(buildFileSection).length; + frameworks = proj.pbxFrameworksBuildPhaseObj(); + buildFileSection = proj.pbxBuildFileSection(); + bfsLength = Object.keys(buildFileSection).length; assert.equal(frameworks.files.length, 15); assert.equal(58, bfsLength); - var frameworkPaths = frameworkSearchPaths(proj); - expectedPath = '"/path/to"'; + const frameworkPaths = frameworkSearchPaths(proj); + const expectedPath = '"/path/to"'; - for (i = 0; i < frameworkPaths.length; i++) { - var current = frameworkPaths[i]; - assert.ok(current.indexOf(expectedPath) == -1); + for (let i = 0; i < frameworkPaths.length; i++) { + const current = frameworkPaths[i]; + assert.ok(current.indexOf(expectedPath) === -1); } - }); }); diff --git a/test/removeHeaderFile.js b/test/removeHeaderFile.js index 85fafc9..278b2c5 100644 --- a/test/removeHeaderFile.js +++ b/test/removeHeaderFile.js @@ -19,13 +19,13 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } @@ -35,37 +35,33 @@ describe('removeHeaderFile', () => { }); it('should return a pbxFile', () => { - var newFile = proj.addHeaderFile('file.h'); + const newFile = proj.addHeaderFile('file.h'); + assert.equal(newFile.constructor, PBXFile); - assert.equal(newFile.constructor, pbxFile); - - var deletedFile = proj.removeHeaderFile('file.h'); - - assert.equal(deletedFile.constructor, pbxFile); + const deletedFile = proj.removeHeaderFile('file.h'); + assert.equal(deletedFile.constructor, PBXFile); }); it('should set a fileRef on the pbxFile', () => { - var newFile = proj.addHeaderFile('file.h'); - + const newFile = proj.addHeaderFile('file.h'); assert.ok(newFile.fileRef); - var deletedFile = proj.removeHeaderFile('file.h'); - + const deletedFile = proj.removeHeaderFile('file.h'); assert.ok(deletedFile.fileRef); }); it('should remove 2 fields from the PBXFileReference section', () => { - var newFile = proj.addHeaderFile('file.h'), - fileRefSection = proj.pbxFileReferenceSection(), - frsLength = Object.keys(fileRefSection).length; + const newFile = proj.addHeaderFile('file.h'); + let fileRefSection = proj.pbxFileReferenceSection(); + let frsLength = Object.keys(fileRefSection).length; assert.equal(68, frsLength); assert.ok(fileRefSection[newFile.fileRef]); assert.ok(fileRefSection[newFile.fileRef + '_comment']); - var deletedFile = proj.removeHeaderFile('file.h'), - fileRefSection = proj.pbxFileReferenceSection(), - frsLength = Object.keys(fileRefSection).length; + const deletedFile = proj.removeHeaderFile('file.h'); + fileRefSection = proj.pbxFileReferenceSection(); + frsLength = Object.keys(fileRefSection).length; assert.equal(66, frsLength); assert.ok(!fileRefSection[deletedFile.fileRef]); @@ -73,22 +69,22 @@ describe('removeHeaderFile', () => { }); it('should remove comment from the PBXFileReference correctly', () => { - var newFile = proj.addHeaderFile('file.h'), - fileRefSection = proj.pbxFileReferenceSection(), - commentKey = newFile.fileRef + '_comment'; + const newFile = proj.addHeaderFile('file.h'); + let fileRefSection = proj.pbxFileReferenceSection(); + let commentKey = newFile.fileRef + '_comment'; assert.equal(fileRefSection[commentKey], 'file.h'); - var deletedFile = proj.removeHeaderFile('file.h'), - fileRefSection = proj.pbxFileReferenceSection(), - commentKey = deletedFile.fileRef + '_comment'; + const deletedFile = proj.removeHeaderFile('file.h'); + fileRefSection = proj.pbxFileReferenceSection(); + commentKey = deletedFile.fileRef + '_comment'; assert.ok(!fileRefSection[commentKey]); }); it('should remove the PBXFileReference object correctly', () => { - var newFile = proj.addHeaderFile('Plugins/file.h'), - fileRefSection = proj.pbxFileReferenceSection(), - fileRefEntry = fileRefSection[newFile.fileRef]; + const newFile = proj.addHeaderFile('Plugins/file.h'); + let fileRefSection = proj.pbxFileReferenceSection(); + let fileRefEntry = fileRefSection[newFile.fileRef]; assert.equal(fileRefEntry.isa, 'PBXFileReference'); assert.equal(fileRefEntry.fileEncoding, 4); @@ -97,21 +93,21 @@ describe('removeHeaderFile', () => { assert.equal(fileRefEntry.path, '"file.h"'); assert.equal(fileRefEntry.sourceTree, '""'); - var deletedFile = proj.removeHeaderFile('Plugins/file.h'), - fileRefSection = proj.pbxFileReferenceSection(), - fileRefEntry = fileRefSection[deletedFile.fileRef]; + const deletedFile = proj.removeHeaderFile('Plugins/file.h'); + fileRefSection = proj.pbxFileReferenceSection(); + fileRefEntry = fileRefSection[deletedFile.fileRef]; assert.ok(!fileRefEntry); }); it('should remove from the Plugins PBXGroup group', () => { - var newFile = proj.addHeaderFile('Plugins/file.h'), - plugins = proj.pbxGroupByName('Plugins'); + proj.addHeaderFile('Plugins/file.h'); + let plugins = proj.pbxGroupByName('Plugins'); assert.equal(plugins.children.length, 1); - var deletedFile = proj.removeHeaderFile('Plugins/file.h'), - plugins = proj.pbxGroupByName('Plugins'); + proj.removeHeaderFile('Plugins/file.h'); + plugins = proj.pbxGroupByName('Plugins'); assert.equal(plugins.children.length, 0); }); diff --git a/test/removeResourceFile.js b/test/removeResourceFile.js index a572ada..ecdc9db 100644 --- a/test/removeResourceFile.js +++ b/test/removeResourceFile.js @@ -19,13 +19,13 @@ const { describe, it, beforeEach, afterEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } @@ -35,47 +35,47 @@ describe('removeResourceFile', () => { }); it('should return a pbxFile', () => { - var newFile = proj.addResourceFile('assets.bundle'); + const newFile = proj.addResourceFile('assets.bundle'); - assert.equal(newFile.constructor, pbxFile); + assert.equal(newFile.constructor, PBXFile); - var deletedFile = proj.removeResourceFile('assets.bundle'); + const deletedFile = proj.removeResourceFile('assets.bundle'); - assert.equal(deletedFile.constructor, pbxFile); + assert.equal(deletedFile.constructor, PBXFile); }); it('should set a uuid on the pbxFile', () => { - var newFile = proj.addResourceFile('assets.bundle'); + const newFile = proj.addResourceFile('assets.bundle'); assert.ok(newFile.uuid); - var deletedFile = proj.removeResourceFile('assets.bundle'); + const deletedFile = proj.removeResourceFile('assets.bundle'); assert.ok(deletedFile.uuid); }); it('should set a fileRef on the pbxFile', () => { - var newFile = proj.addResourceFile('assets.bundle'); + const newFile = proj.addResourceFile('assets.bundle'); assert.ok(newFile.fileRef); - var deletedFile = proj.removeResourceFile('assets.bundle'); + const deletedFile = proj.removeResourceFile('assets.bundle'); assert.ok(deletedFile.fileRef); }); it('should remove 2 fields from the PBXBuildFile section', () => { - var newFile = proj.addResourceFile('assets.bundle'), - buildFileSection = proj.pbxBuildFileSection(), - bfsLength = Object.keys(buildFileSection).length; + const newFile = proj.addResourceFile('assets.bundle'); + let buildFileSection = proj.pbxBuildFileSection(); + let bfsLength = Object.keys(buildFileSection).length; assert.equal(60, bfsLength); assert.ok(buildFileSection[newFile.uuid]); assert.ok(buildFileSection[newFile.uuid + '_comment']); - var deletedFile = proj.removeResourceFile('assets.bundle'), - buildFileSection = proj.pbxBuildFileSection(), - bfsLength = Object.keys(buildFileSection).length; + const deletedFile = proj.removeResourceFile('assets.bundle'); + buildFileSection = proj.pbxBuildFileSection(); + bfsLength = Object.keys(buildFileSection).length; assert.equal(58, bfsLength); assert.ok(!buildFileSection[deletedFile.uuid]); @@ -83,47 +83,47 @@ describe('removeResourceFile', () => { }); it('should remove the PBXBuildFile comment correctly', () => { - var newFile = proj.addResourceFile('assets.bundle'), - commentKey = newFile.uuid + '_comment', - buildFileSection = proj.pbxBuildFileSection(); + const newFile = proj.addResourceFile('assets.bundle'); + let commentKey = newFile.uuid + '_comment'; + let buildFileSection = proj.pbxBuildFileSection(); assert.equal(buildFileSection[commentKey], 'assets.bundle in Resources'); - var deletedFile = proj.removeResourceFile('assets.bundle'), - commentKey = deletedFile.uuid + '_comment', - buildFileSection = proj.pbxBuildFileSection(); + const deletedFile = proj.removeResourceFile('assets.bundle'); + commentKey = deletedFile.uuid + '_comment'; + buildFileSection = proj.pbxBuildFileSection(); assert.ok(!buildFileSection[commentKey]); }); it('should remove the PBXBuildFile object correctly', () => { - var newFile = proj.addResourceFile('assets.bundle'), - buildFileSection = proj.pbxBuildFileSection(), - buildFileEntry = buildFileSection[newFile.uuid]; + const newFile = proj.addResourceFile('assets.bundle'); + let buildFileSection = proj.pbxBuildFileSection(); + let buildFileEntry = buildFileSection[newFile.uuid]; assert.equal(buildFileEntry.isa, 'PBXBuildFile'); assert.equal(buildFileEntry.fileRef, newFile.fileRef); assert.equal(buildFileEntry.fileRef_comment, 'assets.bundle'); - var deletedFile = proj.removeResourceFile('assets.bundle'), - buildFileSection = proj.pbxBuildFileSection(), - buildFileEntry = buildFileSection[deletedFile.uuid]; + const deletedFile = proj.removeResourceFile('assets.bundle'); + buildFileSection = proj.pbxBuildFileSection(); + buildFileEntry = buildFileSection[deletedFile.uuid]; assert.ok(!buildFileEntry); }); it('should remove 2 fields from the PBXFileReference section', () => { - var newFile = proj.addResourceFile('assets.bundle'), - fileRefSection = proj.pbxFileReferenceSection(), - frsLength = Object.keys(fileRefSection).length; + const newFile = proj.addResourceFile('assets.bundle'); + let fileRefSection = proj.pbxFileReferenceSection(); + let frsLength = Object.keys(fileRefSection).length; assert.equal(68, frsLength); assert.ok(fileRefSection[newFile.fileRef]); assert.ok(fileRefSection[newFile.fileRef + '_comment']); - var deletedFile = proj.removeResourceFile('assets.bundle'), - fileRefSection = proj.pbxFileReferenceSection(), - frsLength = Object.keys(fileRefSection).length; + const deletedFile = proj.removeResourceFile('assets.bundle'); + fileRefSection = proj.pbxFileReferenceSection(); + frsLength = Object.keys(fileRefSection).length; assert.equal(66, frsLength); assert.ok(!fileRefSection[deletedFile.fileRef]); @@ -131,15 +131,15 @@ describe('removeResourceFile', () => { }); it('should populate the PBXFileReference comment correctly', () => { - var newFile = proj.addResourceFile('assets.bundle'), - fileRefSection = proj.pbxFileReferenceSection(), - commentKey = newFile.fileRef + '_comment'; + const newFile = proj.addResourceFile('assets.bundle'); + let fileRefSection = proj.pbxFileReferenceSection(); + let commentKey = newFile.fileRef + '_comment'; assert.equal(fileRefSection[commentKey], 'assets.bundle'); - var deletedFile = proj.removeResourceFile('assets.bundle'), - fileRefSection = proj.pbxFileReferenceSection(), - commentKey = deletedFile.fileRef + '_comment'; + const deletedFile = proj.removeResourceFile('assets.bundle'); + fileRefSection = proj.pbxFileReferenceSection(); + commentKey = deletedFile.fileRef + '_comment'; assert.ok(!fileRefSection[commentKey]); }); @@ -147,9 +147,9 @@ describe('removeResourceFile', () => { it('should remove the PBXFileReference object correctly', () => { delete proj.pbxGroupByName('Resources').path; - var newFile = proj.addResourceFile('Resources/assets.bundle'), - fileRefSection = proj.pbxFileReferenceSection(), - fileRefEntry = fileRefSection[newFile.fileRef]; + const newFile = proj.addResourceFile('Resources/assets.bundle'); + let fileRefSection = proj.pbxFileReferenceSection(); + let fileRefEntry = fileRefSection[newFile.fileRef]; assert.equal(fileRefEntry.isa, 'PBXFileReference'); assert.equal(fileRefEntry.fileEncoding, undefined); @@ -158,33 +158,33 @@ describe('removeResourceFile', () => { assert.equal(fileRefEntry.path, '"Resources/assets.bundle"'); assert.equal(fileRefEntry.sourceTree, '""'); - var deletedFile = proj.removeResourceFile('Resources/assets.bundle'), - fileRefSection = proj.pbxFileReferenceSection(), - fileRefEntry = fileRefSection[deletedFile.fileRef]; + const deletedFile = proj.removeResourceFile('Resources/assets.bundle'); + fileRefSection = proj.pbxFileReferenceSection(); + fileRefEntry = fileRefSection[deletedFile.fileRef]; assert.ok(!fileRefEntry); }); it('should remove from the Resources PBXGroup group', () => { - var newFile = proj.addResourceFile('Resources/assets.bundle'), - resources = proj.pbxGroupByName('Resources'); + proj.addResourceFile('Resources/assets.bundle'); + let resources = proj.pbxGroupByName('Resources'); assert.equal(resources.children.length, 10); - var deletedFile = proj.removeResourceFile('Resources/assets.bundle'), - resources = proj.pbxGroupByName('Resources'); + proj.removeResourceFile('Resources/assets.bundle'); + resources = proj.pbxGroupByName('Resources'); assert.equal(resources.children.length, 9); }); it('should remove from the PBXSourcesBuildPhase', () => { - var newFile = proj.addResourceFile('Resources/assets.bundle'), - sources = proj.pbxResourcesBuildPhaseObj(); + proj.addResourceFile('Resources/assets.bundle'); + let sources = proj.pbxResourcesBuildPhaseObj(); assert.equal(sources.files.length, 13); - var deletedFile = proj.removeResourceFile('Resources/assets.bundle'), - sources = proj.pbxResourcesBuildPhaseObj(); + proj.removeResourceFile('Resources/assets.bundle'); + sources = proj.pbxResourcesBuildPhaseObj(); assert.equal(sources.files.length, 12); }); diff --git a/test/removeSourceFile.js b/test/removeSourceFile.js index 1e6d77f..08b0bf3 100644 --- a/test/removeSourceFile.js +++ b/test/removeSourceFile.js @@ -19,13 +19,13 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var fullProject = require('./fixtures/full-project'), - fullProjectStr = JSON.stringify(fullProject), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'); +const fullProject = require('./fixtures/full-project'); +const fullProjectStr = JSON.stringify(fullProject); +const PBXProject = require('../lib/pbxProject'); +const PBXFile = require('../lib/pbxFile'); +const proj = new PBXProject('.'); -function cleanHash() { +function cleanHash () { return JSON.parse(fullProjectStr); } @@ -34,130 +34,126 @@ describe('removeSourceFile', () => { proj.hash = cleanHash(); }); - it('should return a pbxFile', () => { proj.addSourceFile('file.m'); - var newFile = proj.removeSourceFile('file.m'); + const newFile = proj.removeSourceFile('file.m'); - assert.equal(newFile.constructor, pbxFile); + assert.equal(newFile.constructor, PBXFile); }); it('should set a uuid on the pbxFile', () => { proj.addSourceFile('file.m'); - var newFile = proj.removeSourceFile('file.m'); + const newFile = proj.removeSourceFile('file.m'); assert.ok(newFile.uuid); }); it('should set a fileRef on the pbxFile', () => { proj.addSourceFile('file.m'); - var newFile = proj.removeSourceFile('file.m'); + const newFile = proj.removeSourceFile('file.m'); assert.ok(newFile.fileRef); }); it('should remove 2 fields from the PBXBuildFile section', () => { proj.addSourceFile('file.m'); - var newFile = proj.removeSourceFile('file.m'), - buildFileSection = proj.pbxBuildFileSection(), - bfsLength = Object.keys(buildFileSection).length; + const newFile = proj.removeSourceFile('file.m'); + const buildFileSection = proj.pbxBuildFileSection(); + const bfsLength = Object.keys(buildFileSection).length; assert.equal(58, bfsLength); assert.ok(!buildFileSection[newFile.uuid]); assert.ok(!buildFileSection[newFile.uuid + '_comment']); - }); it('should remove comment from the PBXBuildFile correctly', () => { proj.addSourceFile('file.m'); - var newFile = proj.removeSourceFile('file.m'), - commentKey = newFile.uuid + '_comment', - buildFileSection = proj.pbxBuildFileSection(); + const newFile = proj.removeSourceFile('file.m'); + const commentKey = newFile.uuid + '_comment'; + const buildFileSection = proj.pbxBuildFileSection(); assert.notEqual(!buildFileSection[commentKey], 'file.m in Sources'); }); it('should remove the PBXBuildFile object correctly', () => { proj.addSourceFile('file.m'); - var newFile = proj.removeSourceFile('file.m'), - buildFileSection = proj.pbxBuildFileSection(), - buildFileEntry = buildFileSection[newFile.uuid]; + const newFile = proj.removeSourceFile('file.m'); + const buildFileSection = proj.pbxBuildFileSection(); + const buildFileEntry = buildFileSection[newFile.uuid]; assert.equal(buildFileEntry, undefined); - }); it('should remove 2 fields from the PBXFileReference section', () => { proj.addSourceFile('file.m'); - var newFile = proj.removeSourceFile('file.m'), - fileRefSection = proj.pbxFileReferenceSection(), - frsLength = Object.keys(fileRefSection).length; + const newFile = proj.removeSourceFile('file.m'); + const fileRefSection = proj.pbxFileReferenceSection(); + const frsLength = Object.keys(fileRefSection).length; assert.equal(66, frsLength); assert.ok(!fileRefSection[newFile.fileRef]); assert.ok(!fileRefSection[newFile.fileRef + '_comment']); - }); it('should remove the PBXFileReference comment correctly', () => { proj.addSourceFile('file.m'); - var newFile = proj.removeSourceFile('file.m'), - fileRefSection = proj.pbxFileReferenceSection(), - commentKey = newFile.fileRef + '_comment'; + const newFile = proj.removeSourceFile('file.m'); + const fileRefSection = proj.pbxFileReferenceSection(); + const commentKey = newFile.fileRef + '_comment'; assert.ok(!fileRefSection[commentKey]); }); it('should remove the PBXFileReference object correctly', () => { proj.addSourceFile('file.m'); - var newFile = proj.removeSourceFile('Plugins/file.m'), - fileRefSection = proj.pbxFileReferenceSection(), - fileRefEntry = fileRefSection[newFile.fileRef]; + const newFile = proj.removeSourceFile('Plugins/file.m'); + const fileRefSection = proj.pbxFileReferenceSection(); + const fileRefEntry = fileRefSection[newFile.fileRef]; assert.ok(!fileRefEntry); }); it('should remove from the Plugins PBXGroup group', () => { proj.addSourceFile('Plugins/file.m'); - var newFile = proj.removeSourceFile('Plugins/file.m'), - plugins = proj.pbxGroupByName('Plugins'); + proj.removeSourceFile('Plugins/file.m'); + const plugins = proj.pbxGroupByName('Plugins'); assert.equal(plugins.children.length, 0); }); it('should have the right values for the PBXGroup entry', () => { proj.addSourceFile('Plugins/file.m'); - var newFile = proj.removeSourceFile('Plugins/file.m'), - plugins = proj.pbxGroupByName('Plugins'), - pluginObj = plugins.children[0]; + proj.removeSourceFile('Plugins/file.m'); + const plugins = proj.pbxGroupByName('Plugins'); + const pluginObj = plugins.children[0]; assert.ok(!pluginObj); }); it('should remove from the PBXSourcesBuildPhase', () => { proj.addSourceFile('Plugins/file.m'); - var newFile = proj.removeSourceFile('Plugins/file.m'), - sources = proj.pbxSourcesBuildPhaseObj(); + proj.removeSourceFile('Plugins/file.m'); + const sources = proj.pbxSourcesBuildPhaseObj(); assert.equal(sources.files.length, 2); }); it('should have the right values for the Sources entry', () => { proj.addSourceFile('Plugins/file.m'); - var newFile = proj.removeSourceFile('Plugins/file.m'), - sources = proj.pbxSourcesBuildPhaseObj(), - sourceObj = sources.files[2]; + proj.removeSourceFile('Plugins/file.m'); + const sources = proj.pbxSourcesBuildPhaseObj(); + const sourceObj = sources.files[2]; assert.ok(!sourceObj); }); it('should remove file from PBXFileReference after modified by Xcode', () => { - var fileRef = proj.addSourceFile('Plugins/file.m').fileRef; + const fileRef = proj.addSourceFile('Plugins/file.m').fileRef; // Simulate Xcode's behaviour of stripping quotes around path and name // properties. - var entry = proj.pbxFileReferenceSection()[fileRef]; - entry.name = entry.name.replace(/^"(.*)"$/, "$1"); - entry.path = entry.path.replace(/^"(.*)"$/, "$1"); + const entry = proj.pbxFileReferenceSection()[fileRef]; + entry.name = entry.name.replace(/^"(.*)"$/, '$1'); + entry.path = entry.path.replace(/^"(.*)"$/, '$1'); - var newFile = proj.removeSourceFile('Plugins/file.m'); + const newFile = proj.removeSourceFile('Plugins/file.m'); assert.ok(newFile.uuid); assert.ok(!proj.pbxFileReferenceSection()[fileRef]); diff --git a/test/variantGroup.js b/test/variantGroup.js index 8c0e399..a2b2228 100644 --- a/test/variantGroup.js +++ b/test/variantGroup.js @@ -20,14 +20,13 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var pbx = require('../lib/pbxProject'), - project, - projectHash; +const PBXProject = require('../lib/pbxProject'); +let project; -var findChildInGroup = function(obj, target) { - var found = false; +const findChildInGroup = function (obj, target) { + let found = false; - for (var i = 0, j = obj.children.length; i < j; i++) { + for (let i = 0, j = obj.children.length; i < j; i++) { if (obj.children[i].value === target) { found = true; break; @@ -35,59 +34,31 @@ var findChildInGroup = function(obj, target) { } return found; -} +}; -var findFileByUUID = function(obj, target) { - var found = false; - - for (var k = 0, l = obj.files.length; k < l; k++) { - if (obj.files[k].value === target) { - found = true; - break; - } - } - - return found; -} - -var findByFileRef = function(obj, target) { - var found = false; - - for (var property in obj) { +const findByName = function (obj, target) { + let found = false; + for (const property in obj) { if (!/comment/.test(property)) { - if (obj[property].fileRef === target) { - found = true; - break; - } - } - } - return found; -} - -var findByName = function(obj, target) { - var found = false; - for (var property in obj) { - if (!/comment/.test(property)) { - var value = obj[property]; + const value = obj[property]; if (value.name === target) { found = true; } } } return found; -} - +}; describe('variantGroup', () => { beforeEach(() => { - project = new pbx('test/parser/projects/variantgroup.pbxproj'); - projectHash = project.parseSync(); + project = new PBXProject('test/parser/projects/variantgroup.pbxproj'); + project.parseSync(); }); describe('getVariantGroupByKey', () => { it('should return PBXVariantGroup for Localizable.strings', () => { - var groupKey = project.findPBXVariantGroupKey({name: 'Localizable.strings'}); - var group = project.getPBXVariantGroupByKey(groupKey); + const groupKey = project.findPBXVariantGroupKey({ name: 'Localizable.strings' }); + const group = project.getPBXVariantGroupByKey(groupKey); assert.ok(group.name === 'Localizable.strings'); }); }); @@ -96,13 +67,13 @@ describe('variantGroup', () => { it('should create a new Test Variant Group', () => { delete project.getPBXObject('PBXVariantGroup'); - var found = false; - var groups = project.getPBXObject('PBXVariantGroup'); + let found = false; + let groups = project.getPBXObject('PBXVariantGroup'); - var found = findByName(groups, 'Test'); + found = findByName(groups, 'Test'); assert.ok(found === false); - var group = project.findPBXVariantGroupKey({name:'Test'}); + let group = project.findPBXVariantGroupKey({ name: 'Test' }); assert.ok(group === undefined); project.pbxCreateVariantGroup('Test'); @@ -111,15 +82,15 @@ describe('variantGroup', () => { found = findByName(groups, 'Test'); assert.ok(found === true); - group = project.findPBXVariantGroupKey({name:'Test'}); + group = project.findPBXVariantGroupKey({ name: 'Test' }); assert.ok(typeof group === 'string'); }); }); describe('findVariantGroupKey', () => { it('should return a valid group key', () => { - var keyByName = project.findPBXVariantGroupKey({ name: 'Localizable.strings'}); - var nonExistingKey = project.findPBXVariantGroupKey({ name: 'Foo'}); + const keyByName = project.findPBXVariantGroupKey({ name: 'Localizable.strings' }); + const nonExistingKey = project.findPBXVariantGroupKey({ name: 'Foo' }); assert.ok(keyByName === '07E3BDBC1DF1DEA500E49912'); assert.ok(nonExistingKey === undefined); @@ -130,17 +101,17 @@ describe('variantGroup', () => { it('should create a new localisation variationgroup then add group to Resources group', () => { delete project.getPBXObject('PBXVariantGroup'); - var localizationVariantGp = project.addLocalizationVariantGroup('InfoPlist.strings'); + const localizationVariantGp = project.addLocalizationVariantGroup('InfoPlist.strings'); - var resourceGroupKey = project.findPBXGroupKey({name: 'Resources'}); - var resourceGroup = project.getPBXGroupByKey(resourceGroupKey); - var foundInResourcesGroup = findChildInGroup(resourceGroup, localizationVariantGp.fileRef ); + const resourceGroupKey = project.findPBXGroupKey({ name: 'Resources' }); + const resourceGroup = project.getPBXGroupByKey(resourceGroupKey); + const foundInResourcesGroup = findChildInGroup(resourceGroup, localizationVariantGp.fileRef); assert.ok(foundInResourcesGroup); - var foundInResourcesBuildPhase = false; - var sources = project.pbxResourcesBuildPhaseObj(); - for (var i = 0, j = sources.files.length; i < j; i++) { - var file = sources.files[i]; + let foundInResourcesBuildPhase = false; + const sources = project.pbxResourcesBuildPhaseObj(); + for (let i = 0, j = sources.files.length; i < j; i++) { + const file = sources.files[i]; if (file.value === localizationVariantGp.uuid) { foundInResourcesBuildPhase = true; } @@ -151,40 +122,39 @@ describe('variantGroup', () => { describe('addResourceFileToLocalisationGroup', () => { it('should add resource file to the TestVariantGroup group', () => { + const infoPlistVarGp = project.addLocalizationVariantGroup('InfoPlist.strings'); + const testKey = infoPlistVarGp.fileRef; + const file = project.addResourceFile('Resources/en.lproj/Localization.strings', { variantGroup: true }, testKey); - var infoPlistVarGp = project.addLocalizationVariantGroup('InfoPlist.strings'); - var testKey = infoPlistVarGp.fileRef; - var file = project.addResourceFile('Resources/en.lproj/Localization.strings', {variantGroup: true}, testKey); - - var foundInLocalisationVariantGroup = findChildInGroup(project.getPBXVariantGroupByKey(testKey), file.fileRef ); + const foundInLocalisationVariantGroup = findChildInGroup(project.getPBXVariantGroupByKey(testKey), file.fileRef); assert.ok(foundInLocalisationVariantGroup); - var foundInResourcesBuildPhase = false; - var sources = project.pbxResourcesBuildPhaseObj(); - for (var i = 0, j = sources.files.length; i < j; i++) { - var sourceFile = sources.files[i]; + let foundInResourcesBuildPhase = false; + const sources = project.pbxResourcesBuildPhaseObj(); + for (let i = 0, j = sources.files.length; i < j; i++) { + const sourceFile = sources.files[i]; if (sourceFile.value === file.fileRef) { foundInResourcesBuildPhase = true; } } assert.ok(!foundInResourcesBuildPhase); - var buildFileSection = project.pbxBuildFileSection(); + const buildFileSection = project.pbxBuildFileSection(); assert.ok(buildFileSection[file.uuid] === undefined); }); }); describe('removeResourceFileFromGroup', () => { it('should add resource file then remove resource file from Localizable.strings group', () => { - var testKey = project.findPBXVariantGroupKey({name:'Localizable.strings'}); - var file = project.addResourceFile('Resources/zh.lproj/Localization.strings', {}, testKey); + const testKey = project.findPBXVariantGroupKey({ name: 'Localizable.strings' }); + const file = project.addResourceFile('Resources/zh.lproj/Localization.strings', {}, testKey); - var foundInGroup = findChildInGroup(project.getPBXVariantGroupByKey(testKey),file.fileRef ); + let foundInGroup = findChildInGroup(project.getPBXVariantGroupByKey(testKey), file.fileRef); assert.ok(foundInGroup); project.removeResourceFile('Resources/zh.lproj/Localization.strings', {}, testKey); - var foundInGroup = findChildInGroup(project.getPBXVariantGroupByKey(testKey),file.fileRef ); + foundInGroup = findChildInGroup(project.getPBXVariantGroupByKey(testKey), file.fileRef); assert.ok(!foundInGroup); }); }); diff --git a/test/xcode5searchPaths.js b/test/xcode5searchPaths.js index 4858c48..20b417a 100644 --- a/test/xcode5searchPaths.js +++ b/test/xcode5searchPaths.js @@ -20,18 +20,17 @@ const { describe, it, beforeEach } = require('node:test'); const assert = require('node:assert'); -var xcode5proj = require('./fixtures/library-search-paths') - xcode5projStr = JSON.stringify(xcode5proj), - pbx = require('../lib/pbxProject'), - pbxFile = require('../lib/pbxFile'), - proj = new pbx('.'), - libPoop = { path: 'some/path/poop.a' }; - -function cleanHash() { +const xcode5proj = require('./fixtures/library-search-paths'); +const xcode5projStr = JSON.stringify(xcode5proj); +const PBXProject = require('../lib/pbxProject'); +const proj = new PBXProject('.'); +const libPoop = { path: 'some/path/poop.a' }; + +function cleanHash () { return JSON.parse(xcode5projStr); } -var PRODUCT_NAME = '"$(TARGET_NAME)"'; +const PRODUCT_NAME = '"$(TARGET_NAME)"'; describe('addAndRemoveToFromLibrarySearchPaths', () => { beforeEach(() => { @@ -39,20 +38,20 @@ describe('addAndRemoveToFromLibrarySearchPaths', () => { }); it('add should add the path to each configuration section', () => { - var expected = '"\\"$(SRCROOT)/$(TARGET_NAME)/some/path\\""', - config = proj.pbxXCBuildConfigurationSection(), - ref, lib, refSettings; + const expected = '"\\"$(SRCROOT)/$(TARGET_NAME)/some/path\\""'; + const config = proj.pbxXCBuildConfigurationSection(); + let ref; + let lib; + let refSettings; proj.addToLibrarySearchPaths(libPoop); for (ref in config) { - if (ref.indexOf('_comment') > -1) - continue; + if (ref.indexOf('_comment') > -1) { continue; } refSettings = config[ref].buildSettings; - if (refSettings.PRODUCT_NAME != PRODUCT_NAME) - continue; + if (refSettings.PRODUCT_NAME !== PRODUCT_NAME) { continue; } lib = refSettings.LIBRARY_SEARCH_PATHS; assert.equal(lib[1], expected); @@ -60,18 +59,19 @@ describe('addAndRemoveToFromLibrarySearchPaths', () => { }); it('remove should remove from the path to each configuration section', () => { - var config, ref, lib; + let ref; + let lib; proj.addToLibrarySearchPaths(libPoop); proj.removeFromLibrarySearchPaths(libPoop); - config = proj.pbxXCBuildConfigurationSection(); + const config = proj.pbxXCBuildConfigurationSection(); for (ref in config) { - if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME != PRODUCT_NAME) continue; + if (ref.indexOf('_comment') > -1 || config[ref].buildSettings.PRODUCT_NAME !== PRODUCT_NAME) continue; lib = config[ref].buildSettings.LIBRARY_SEARCH_PATHS; assert.ok(lib.length === 1); - assert.ok(lib[0].indexOf('$(SRCROOT)/KitchenSinktablet/some/path') == -1); + assert.ok(lib[0].indexOf('$(SRCROOT)/KitchenSinktablet/some/path') === -1); } }); });